diff --git a/dist/elmahio.js b/dist/elmahio.js index d10a081..e27e1d4 100644 --- a/dist/elmahio.js +++ b/dist/elmahio.js @@ -2055,7 +2055,7 @@ window.onunhandledrejection = function(event) { var errorLog = { 'message': event.reason && event.reason.message ? event.reason.message : undefined, - 'error': event.reason.message && event.reason.stack ? event.reason : undefined + 'error': event.reason && event.reason.message && event.reason.stack ? event.reason : undefined }; setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); diff --git a/dist/elmahio.js.map b/dist/elmahio.js.map index 2183ce6..cdf2ac4 100644 --- a/dist/elmahio.js.map +++ b/dist/elmahio.js.map @@ -1 +1 @@ -{"version":3,"names":[],"mappings":"","sources":["elmahio.js"],"sourcesContent":["/*!\n * elmah.io Javascript Logger - version 4.1.0\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n 'use strict';\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(,.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').replace(/^.*?\\s+/, '');\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\(.+\\)$)/);\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine\n // because this line doesn't have function name\n var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);\n var functionName = location && sanitizedLine || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function generateErrorObject(error) {\n return {\n error: error,\n type: error.name,\n message: error.message,\n inner: error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? generateErrorObject(error.cause) : []\n }\n }\n\n function getErrorTypeSource(error) {\n var object = generateErrorObject(error);\n var type = null;\n var source = null;\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n var stack = obj[key] ? ErrorStackParser.parse(obj[key]) : null;\n source = stack && stack.length > 0 ? stack[0].fileName : null;\n }\n }\n if (key === \"type\") {\n type = obj[key];\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n return { type: type, source: source };\n }\n\n function GenerateNewFrames(errorMessage, newFrames, cause, fileName) {\n var lastInnerFileName = null;\n\n newFrames.forEach(function(stackFrame, i) {\n if (stackFrame.functionName) {\n var fn = stackFrame.functionName + ' ';\n } else {\n var fn = '';\n }\n var stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n newFrames[i] = stackString;\n if (i === 0) {\n lastInnerFileName = stackFrame.fileName || null;\n }\n });\n \n if (!cause) {\n newFrames.unshift(errorMessage);\n } else {\n newFrames.unshift(\"\\nCaused by: \" + errorMessage);\n }\n\n if (fileName) {\n return {\n newFrames: newFrames,\n fileName: lastInnerFileName\n }\n }\n \n return newFrames;\n }\n\n function GPSPromise(stackframes) {\n if (stackframes) {\n var gps = new StackTraceGPS();\n\n return new Promise(function(resolve) {\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n });\n }\n\n return new Promise(function(resolve) {\n return resolve([]);\n });\n }\n\n function stackGPS(error, xhr, jsonData) {\n var object = generateErrorObject(error);\n var messagesArr = [];\n var promiseArr = [];\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n messagesArr.push(obj[key].toString().split(\"\\n\")[0]);\n promiseArr.push(GPSPromise(ErrorStackParser.parse(obj[key])));\n }\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n Promise.all(promiseArr).then((values) => {\n values.forEach(function(stackframe, index) {\n if (index === 0) {\n jsonData.detail = GenerateNewFrames(messagesArr[index], stackframe, false).join(\"\\n\");\n } else {\n jsonData.detail += GenerateNewFrames(messagesArr[index], stackframe, true).join(\"\\n\");\n }\n });\n }).then(function() {\n xhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n function guid() {\n var s4 = function() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1).toUpperCase();\n }\n return s4() + s4();\n }\n\n function inspectorObj (error, fullError) {\n var obj = {};\n obj.Id = guid();\n\n if (typeof error === \"object\" && error !== null) {\n var stack = error && objectLength(error.stack) !== 0 && typeof error === \"object\" ? ErrorStackParser.parse(error) : '';\n obj.Type = error.name || null;\n obj.Message = error.message || null;\n obj.StackTrace = objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n obj.Source = stack && stack.length > 0 ? stack[0].fileName : null;\n obj.Inners = error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? [inspectorObj(error.cause)] : [];\n\n if (error.cause && obj.Inners instanceof Array && obj.Inners.length === 0) {\n if (typeof error.cause === \"number\" || typeof error.cause === \"string\" || typeof error.cause === \"boolean\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause }];\n }\n if (typeof error.cause === \"bigint\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() + \"n\" }];\n }\n if (typeof error.cause === \"symbol\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() }];\n }\n if (typeof error.cause === \"object\") {\n if (!(Object.keys(obj).length === 0 && obj.constructor === Object)) {\n let objEntries = [];\n for (const [key, value] of Object.entries(error.cause)) {\n if (typeof value === \"number\" || typeof value === \"string\" || typeof value === \"boolean\") {\n objEntries.push({ key: key, value: value });\n }\n if (typeof value === \"bigint\") {\n objEntries.push({ key: key, value: value.toString() + \"n\" });\n }\n if (typeof value === \"symbol\") {\n objEntries.push({ key: key, value: value.toString() });\n }\n }\n obj.ExceptionSpecific = objEntries;\n }\n }\n }\n\n } else {\n obj.Type = typeof fullError.error || null;\n obj.Message = fullError.message || null;\n obj.StackTrace = stackString(fullError);\n obj.Source = fullError.source || null;\n obj.Inners = [];\n }\n\n return obj;\n }\n\n function inspectorGPS (error) {\n var inspectorObject = inspectorObj(error);\n var promiseArr = [];\n\n function iterateObj(obj, final) {\n Object.keys(obj).forEach(function(key){\n if (key === \"StackTrace\") {\n if (!final) {\n obj[key] = GPSPromise(obj[key]);\n promiseArr.push(obj[key]);\n } else {\n obj[key].then(result => {\n var generateNewFrames = GenerateNewFrames(obj.Type + ': ' + obj.Message, result, false, true);\n obj[key] = generateNewFrames.newFrames.join(\"\\n\");\n obj['Source'] = generateNewFrames.fileName || null;\n });\n }\n }\n if (key === \"Inners\" && obj[key].length !== 0) {\n iterateObj(obj[key][0], final);\n }\n });\n }\n\n iterateObj(inspectorObject, false);\n\n return new Promise(function(resolve, reject) {\n Promise.all(promiseArr).then(function(values) {\n iterateObj(inspectorObject, true);\n }).then(function() {\n resolve(inspectorObject);\n });\n });\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error.error && error.error.cause && typeof error.error.cause === \"object\" && error.error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error.error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error.error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error.error, xhr, jsonData);\n });\n\t } else {\n // Add inspector to jsonData\n if (jsonData.detail) {\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(inspectorObj(error.error, errorLog)) });\n }\n\n // send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error && error instanceof Error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && error instanceof Error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n // send message\n if(jsonData.errorObject && jsonData.errorObject instanceof Error) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n delete jsonData.errorObject;\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n };\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Log on window unhandled rejection\n window.onunhandledrejection = function (event) {\n var errorLog = {\n 'message': event.reason && event.reason.message ? event.reason.message : undefined,\n 'error': event.reason.message && event.reason.stack ? event.reason : undefined\n };\n\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.js"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["elmahio.js"],"sourcesContent":["/*!\n * elmah.io Javascript Logger - version 4.1.0\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n 'use strict';\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(,.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').replace(/^.*?\\s+/, '');\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\(.+\\)$)/);\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine\n // because this line doesn't have function name\n var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);\n var functionName = location && sanitizedLine || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function generateErrorObject(error) {\n return {\n error: error,\n type: error.name,\n message: error.message,\n inner: error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? generateErrorObject(error.cause) : []\n }\n }\n\n function getErrorTypeSource(error) {\n var object = generateErrorObject(error);\n var type = null;\n var source = null;\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n var stack = obj[key] ? ErrorStackParser.parse(obj[key]) : null;\n source = stack && stack.length > 0 ? stack[0].fileName : null;\n }\n }\n if (key === \"type\") {\n type = obj[key];\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n return { type: type, source: source };\n }\n\n function GenerateNewFrames(errorMessage, newFrames, cause, fileName) {\n var lastInnerFileName = null;\n\n newFrames.forEach(function(stackFrame, i) {\n if (stackFrame.functionName) {\n var fn = stackFrame.functionName + ' ';\n } else {\n var fn = '';\n }\n var stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n newFrames[i] = stackString;\n if (i === 0) {\n lastInnerFileName = stackFrame.fileName || null;\n }\n });\n \n if (!cause) {\n newFrames.unshift(errorMessage);\n } else {\n newFrames.unshift(\"\\nCaused by: \" + errorMessage);\n }\n\n if (fileName) {\n return {\n newFrames: newFrames,\n fileName: lastInnerFileName\n }\n }\n \n return newFrames;\n }\n\n function GPSPromise(stackframes) {\n if (stackframes) {\n var gps = new StackTraceGPS();\n\n return new Promise(function(resolve) {\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n });\n }\n\n return new Promise(function(resolve) {\n return resolve([]);\n });\n }\n\n function stackGPS(error, xhr, jsonData) {\n var object = generateErrorObject(error);\n var messagesArr = [];\n var promiseArr = [];\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n messagesArr.push(obj[key].toString().split(\"\\n\")[0]);\n promiseArr.push(GPSPromise(ErrorStackParser.parse(obj[key])));\n }\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n Promise.all(promiseArr).then((values) => {\n values.forEach(function(stackframe, index) {\n if (index === 0) {\n jsonData.detail = GenerateNewFrames(messagesArr[index], stackframe, false).join(\"\\n\");\n } else {\n jsonData.detail += GenerateNewFrames(messagesArr[index], stackframe, true).join(\"\\n\");\n }\n });\n }).then(function() {\n xhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n function guid() {\n var s4 = function() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1).toUpperCase();\n }\n return s4() + s4();\n }\n\n function inspectorObj (error, fullError) {\n var obj = {};\n obj.Id = guid();\n\n if (typeof error === \"object\" && error !== null) {\n var stack = error && objectLength(error.stack) !== 0 && typeof error === \"object\" ? ErrorStackParser.parse(error) : '';\n obj.Type = error.name || null;\n obj.Message = error.message || null;\n obj.StackTrace = objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n obj.Source = stack && stack.length > 0 ? stack[0].fileName : null;\n obj.Inners = error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? [inspectorObj(error.cause)] : [];\n\n if (error.cause && obj.Inners instanceof Array && obj.Inners.length === 0) {\n if (typeof error.cause === \"number\" || typeof error.cause === \"string\" || typeof error.cause === \"boolean\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause }];\n }\n if (typeof error.cause === \"bigint\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() + \"n\" }];\n }\n if (typeof error.cause === \"symbol\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() }];\n }\n if (typeof error.cause === \"object\") {\n if (!(Object.keys(obj).length === 0 && obj.constructor === Object)) {\n let objEntries = [];\n for (const [key, value] of Object.entries(error.cause)) {\n if (typeof value === \"number\" || typeof value === \"string\" || typeof value === \"boolean\") {\n objEntries.push({ key: key, value: value });\n }\n if (typeof value === \"bigint\") {\n objEntries.push({ key: key, value: value.toString() + \"n\" });\n }\n if (typeof value === \"symbol\") {\n objEntries.push({ key: key, value: value.toString() });\n }\n }\n obj.ExceptionSpecific = objEntries;\n }\n }\n }\n\n } else {\n obj.Type = typeof fullError.error || null;\n obj.Message = fullError.message || null;\n obj.StackTrace = stackString(fullError);\n obj.Source = fullError.source || null;\n obj.Inners = [];\n }\n\n return obj;\n }\n\n function inspectorGPS (error) {\n var inspectorObject = inspectorObj(error);\n var promiseArr = [];\n\n function iterateObj(obj, final) {\n Object.keys(obj).forEach(function(key){\n if (key === \"StackTrace\") {\n if (!final) {\n obj[key] = GPSPromise(obj[key]);\n promiseArr.push(obj[key]);\n } else {\n obj[key].then(result => {\n var generateNewFrames = GenerateNewFrames(obj.Type + ': ' + obj.Message, result, false, true);\n obj[key] = generateNewFrames.newFrames.join(\"\\n\");\n obj['Source'] = generateNewFrames.fileName || null;\n });\n }\n }\n if (key === \"Inners\" && obj[key].length !== 0) {\n iterateObj(obj[key][0], final);\n }\n });\n }\n\n iterateObj(inspectorObject, false);\n\n return new Promise(function(resolve, reject) {\n Promise.all(promiseArr).then(function(values) {\n iterateObj(inspectorObject, true);\n }).then(function() {\n resolve(inspectorObject);\n });\n });\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error.error && error.error.cause && typeof error.error.cause === \"object\" && error.error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error.error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error.error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error.error, xhr, jsonData);\n });\n\t } else {\n // Add inspector to jsonData\n if (jsonData.detail) {\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(inspectorObj(error.error, errorLog)) });\n }\n\n // send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error && error instanceof Error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && error instanceof Error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n // send message\n if(jsonData.errorObject && jsonData.errorObject instanceof Error) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n delete jsonData.errorObject;\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n };\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Log on window unhandled rejection\n window.onunhandledrejection = function (event) {\n var errorLog = {\n 'message': event.reason && event.reason.message ? event.reason.message : undefined,\n 'error': event.reason && event.reason.message && event.reason.stack ? event.reason : undefined\n };\n\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.js"} \ No newline at end of file diff --git a/dist/elmahio.min.js b/dist/elmahio.min.js index 82d1102..aea4490 100644 --- a/dist/elmahio.min.js +++ b/dist/elmahio.min.js @@ -2,5 +2,5 @@ * elmah.io Javascript Logger - version 4.1.0 * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io */ -!function(e,n){"function"==typeof define&&define.amd?define([],function(){return n(e)}):"object"==typeof exports?module.exports=n(e):e.Elmahio=n(e)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(e){"use strict";for(var n,t,r,o=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],i=["fileName","functionName","source"],a=r.concat(o,i,["args"]);function s(e){if(e instanceof Object)for(var t=0;t-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),t=n.match(/ (\(.+\)$)/);n=t?n.replace(t[0],""):n;var r=this.extractLocation(t?t[1]:n),i=t&&n||void 0,a=["eval",""].indexOf(r[0])>-1?void 0:r[0];return new o({functionName:i,fileName:a,lineNumber:r[1],columnNumber:r[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new o({functionName:e});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,t=e.match(n),r=t&&t[1]?t[1]:void 0,i=this.extractLocation(e.replace(n,""));return new o({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,t=e.message.split("\n"),r=[],i=2,a=t.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(n=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new o({functionName:a,args:s,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}),a=function(n,t){function r(e){return new Promise(function(n,t){var r=new XMLHttpRequest;r.open("get",e),r.onerror=t,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||"file://"===e.substr(0,7)&&r.responseText?n(r.responseText):t(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function o(n){if(void 0!==e&&e.atob)return e.atob(n);throw new Error("You must supply a polyfill for window.atob in this environment")}function i(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}return function e(a){if(!(this instanceof e))return new e(a);a=a||{},this.sourceCache=a.sourceCache||{},this.sourceMapConsumerCache=a.sourceMapConsumerCache||{},this.ajax=a.ajax||r,this._atob=a.atob||o,this._get=function(e){return new Promise(function(n,t){var r="data:"===e.substr(0,5);if(this.sourceCache[e])n(this.sourceCache[e]);else if(a.offline&&!r)t(new Error("Cannot make network requests in offline mode"));else if(r){var o=e.match(/^data:application\/json;([\w=:"-]+;)*base64,/);if(o){var i=o[0].length,s=e.substr(i),u=this._atob(s);this.sourceCache[e]=u,n(u)}else t(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(n,t)}}.bind(this))},this._getSourceMapConsumer=function(e,t){return new Promise(function(r,o){if(this.sourceMapConsumerCache[e])r(this.sourceMapConsumerCache[e]);else{var i=new Promise(function(r,o){return this._get(e).then(function(e){"string"==typeof e&&(e=function(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}(e.replace(/^\)\]\}'/,""))),void 0===e.sourceRoot&&(e.sourceRoot=t),r(new n.SourceMapConsumer(e))},o)}.bind(this));this.sourceMapConsumerCache[e]=i,r(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(n,t){this.getMappedLocation(e).then(function(e){function t(){n(e)}this.findFunctionName(e).then(n,t).catch(t)}.bind(this),t)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(n,r){i(e),this._get(e.fileName).then(function(r){var o=e.lineNumber,i=e.columnNumber,a=function(e,n){for(var t=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],r=e.split("\n"),o="",i=Math.min(n,20),a=0;a=0&&(s=s.substr(0,u)),s){o=s+o;for(var c=t.length,l=0;l=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var c=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==c;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,c.prototype=Object.create(u.prototype),c.prototype.consumer=u,c.fromSourceMap=function(e){var n=Object.create(c.prototype),t=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],p=n.__originalMappings=[],g=0,f=a.length;g1&&(t.source=m+i[1],m+=i[1],t.originalLine=f+i[2],f=t.originalLine,t.originalLine+=1,t.originalColumn=h+i[3],h=t.originalColumn,i.length>4&&(t.name=d+i[4],d+=i[4])),C.push(t),"number"==typeof t.originalLine&&_.push(t)}s(C,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,s(_,r.compareByOriginalPositions),this.__originalMappings=_},c.prototype._findMapping=function(e,n,t,r,i,a){if(e[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[t]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,n,i,a)},c.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[t];if(o.generatedLine===n.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=r.join(this.sourceRoot,i)));var a=r.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})},c.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=r.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var t;if(null!=this.sourceRoot&&(t=r.urlParse(this.sourceRoot))){var o=e.replace(/^file:\/\//,"");if("file"==t.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!t.path||"/"==t.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var n=r.getArg(e,"source");if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var t={source:n=this._sources.indexOf(n),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===t.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=c,p.prototype=Object.create(u.prototype),p.prototype.constructor=u,p.prototype._version=3,Object.defineProperty(p.prototype,"sources",{get:function(){for(var e=[],n=0;n=0;l--)"."===(a=u[l])?u.splice(l,1):".."===a?c++:c>0&&(""===a?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return""===(t=u.join("/"))&&(t=s?"/":"."),r?(r.path=t,i(r)):t}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){""===e&&(e="."),""===n&&(n=".");var t=o(n),s=o(e);if(s&&(e=s.path||"/"),t&&!t.scheme)return s&&(t.scheme=s.scheme),i(t);if(t||n.match(r))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u="/"===n.charAt(0)?n:a(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(t)},n.relative=function(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var t=0;0!==n.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return n;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function u(e){return e}function c(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function l(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return c(e)?"$"+e:e},n.fromSetString=s?u:function(e){return c(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,t){var r=e.source-n.source;return 0!==r?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)||t?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!=(r=e.generatedLine-n.generatedLine)?r:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,t){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)||t?r:0!=(r=e.source-n.source)?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!==(t=l(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:l(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,r,o){if(0===t.length)return-1;var i=function e(t,r,o,i,a,s){var u=Math.floor((r-t)/2)+t,c=a(o,i[u],!0);return 0===c?u:c>0?r-u>1?e(u,r,o,i,a,s):s==n.LEAST_UPPER_BOUND?r1?e(t,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:t<0?-1:t}(-1,t.length,e,t,r,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===r(t[i],t[i-1],!0);)--i;return i}},function(e,n,t){var r=t(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var t=new i,r=0,o=e.length;r=0&&e>>=5)>0&&(n|=32),o+=r.encode(n)}while(i>0);return o},n.decode=function(e,n,t){var o,i,a,s,u=e.length,c=0,l=0;do{if(n>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(n++))))throw new Error("Invalid base64 digit: "+e.charAt(n-1));o=!!(32&i),c+=(i&=31)<>1,1==(1&a)?-s:s),t.rest=n}},function(e,n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e ".length;e&&r++<5&&!("html"===(n=S(e))||r>1&&o+t.length*i+n.length>=80);)t.push(n),o+=n.length,e=e.parentNode;return t.reverse().join(" > ")}function S(e){var n,t,r,o,i,a=[];if(!e||!e.tagName)return"";if(a.push(e.tagName.toLowerCase()),e.id&&a.push("#"+e.id),(n=e.className)&&_(n))for(t=n.split(/\s+/),i=0;i0?a[0].fileName:null}"type"===o&&(t=n[o]),"inner"===o&&0!==n[o].length&&e(n[o])})}(n),{type:t,source:r}}function E(e,n,t,r){var o=null;return n.forEach(function(e,t){if(e.functionName)var r=e.functionName+" ";else r="";var i=" at "+r+"("+e.fileName+":"+e.lineNumber+":"+e.columnNumber+")";n[t]=i,0===t&&(o=e.fileName||null)}),t?n.unshift("\nCaused by: "+e):n.unshift(e),r?{newFrames:n,fileName:o}:n}function N(e){if(e){var n=new a;return new Promise(function(t){t(Promise.all(e.map(function(e){return new Promise(function(t){function r(){t(e)}n.pinpoint(e).then(t,r).catch(r)})})))})}return new Promise(function(e){return e([])})}function L(e,n,t){var r=m(e),o=[],a=[];!function e(n){Object.keys(n).forEach(function(t){"error"===t&&0!==y(n[t].stack)&&(o.push(n[t].toString().split("\n")[0]),a.push(N(i.parse(n[t])))),"inner"===t&&0!==n[t].length&&e(n[t])})}(r),Promise.all(a).then(e=>{e.forEach(function(e,n){0===n?t.detail=E(o[n],e,!1).join("\n"):t.detail+=E(o[n],e,!0).join("\n")})}).then(function(){n.send(JSON.stringify(t))})}function A(e){var n=typeof e.error;return n.charAt(0).toUpperCase()+n.slice(1)+": "+e.error+"\n at ("+e.source+":"+e.lineno+":"+e.colno+")"}function M(e,n){var t,r={};if(r.Id=(t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1).toUpperCase()})()+t(),"object"==typeof e&&null!==e){var o=e&&0!==y(e.stack)&&"object"==typeof e?i.parse(e):"";if(r.Type=e.name||null,r.Message=e.message||null,r.StackTrace=0!==y(e.stack)?i.parse(e):null,r.Source=o&&o.length>0?o[0].fileName:null,r.Inners=e.cause&&"object"==typeof e.cause&&e.cause instanceof Error?[M(e.cause)]:[],e.cause&&r.Inners instanceof Array&&0===r.Inners.length&&("number"!=typeof e.cause&&"string"!=typeof e.cause&&"boolean"!=typeof e.cause||(r.ExceptionSpecific=[{key:"cause",value:e.cause}]),"bigint"==typeof e.cause&&(r.ExceptionSpecific=[{key:"cause",value:e.cause.toString()+"n"}]),"symbol"==typeof e.cause&&(r.ExceptionSpecific=[{key:"cause",value:e.cause.toString()}]),"object"==typeof e.cause&&(0!==Object.keys(r).length||r.constructor!==Object))){let n=[];for(const[t,r]of Object.entries(e.cause))"number"!=typeof r&&"string"!=typeof r&&"boolean"!=typeof r||n.push({key:t,value:r}),"bigint"==typeof r&&n.push({key:t,value:r.toString()+"n"}),"symbol"==typeof r&&n.push({key:t,value:r.toString()});r.ExceptionSpecific=n}}else r.Type=typeof n.error||null,r.Message=n.message||null,r.StackTrace=A(n),r.Source=n.source||null,r.Inners=[];return r}function T(e){var n=M(e),t=[];function r(e,n){Object.keys(e).forEach(function(o){"StackTrace"===o&&(n?e[o].then(n=>{var t=E(e.Type+": "+e.Message,n,!1,!0);e[o]=t.newFrames.join("\n"),e.Source=t.fileName||null}):(e[o]=N(e[o]),t.push(e[o]))),"Inners"===o&&0!==e[o].length&&r(e[o][0],n)})}return r(n,!1),new Promise(function(e,o){Promise.all(t).then(function(e){r(n,!0)}).then(function(){e(n)})})}var k=function(e){var t=O({dateTime:(new Date).toISOString()},e),r=10;o.push(t),n.breadcrumbsNumber>=0&&"number"==typeof n.breadcrumbsNumber&&(n.breadcrumbsNumber>25?r=25:n.breadcrumbsNumber<=25&&(r=n.breadcrumbsNumber)),o.length>r&&o.shift()},x=function(e){var n;try{n=C(e.target)}catch(e){n=""}k({severity:"Information",action:"Click",message:n})},P=function(e){var n;try{n=C(e.target)}catch(e){n=""}k({severity:"Information",action:"Form submit",message:n})},j=function(n){var t=null;switch(n.type){case"load":t="Page loaded";break;case"DOMContentLoaded":t="DOMContentLoaded";break;case"pageshow":t="Page shown";break;case"pagehide":t="Page hidden";break;case"popstate":t="Navigated from: "+s+" to: "+e.location.href}k({severity:"Information",action:"Navigation",message:t})},R=function(e){var n=e.oldURL,t=e.newURL,r=null;r=n&&t?"from: '"+w(n)+"' to: '"+w(t)+"'":"to: '"+location.hash+"'",k({severity:"Information",action:"Navigation",message:"Hash changed "+r})},I=function(e,n,a,s){var c=e,f=n,h=s,m=1,d=b(),v=h.error&&0!==y(h.error.stack)&&"object"==typeof h.error?i.parse(h.error):"";if(!h||0!==h.colno||0!==h.lineno||v&&""!==v||!h.message||"Script error."!==h.message&&"Script error"!==h.message){if((null===c||null===f)&&2!==p)return console.log("Login api error");l.hasOwnProperty("apiKey")&&l.hasOwnProperty("logId")&&(c=l.apiKey,f=l.logId);var _=new XMLHttpRequest;_.open("POST","https://api.elmah.io/v3/messages/"+f+"?api_key="+c,!0),_.setRequestHeader("Content-type","application/json"),_.onload=function(e){4===_.readyState&&(201===_.status&&a("success",_.statusText),_.status>=400&&_.status<=499&&(a("error",_.statusText),r.emit("error",_.status,_.statusText)))},_.onerror=function(e){a("error",_.statusText),r.emit("error",_.status,_.statusText)};var C={detail:h.error?h.error.stack:null,title:h.message||"Unspecified error",source:v&&v.length>0?v[0].fileName:null,severity:"Error",type:h.error?h.error.name:null,queryString:JSON.parse(JSON.stringify(d))};if(h.error&&0===y(h.error.stack)&&void 0===C.detail){var w=typeof s.error,E=w.charAt(0).toUpperCase()+w.slice(1);C.detail=A(s),C.source=s.source,C.title="Uncaught "+E+": "+s.error}if(h.error&&h.error.cause&&"object"==typeof h.error.cause&&h.error.cause instanceof Error){var N=S(h.error);C.type=N.type,C.source=N.source}C=O(C,u()),o.length>0&&(C.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(C)&&(m=0),1===m&&(r.emit("message",C),h.error&&"object"==typeof h.error&&0!==y(h.error.stack)&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?T(h.error).then(e=>{C.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(e)}),L(h.error,_,C)}):(C.detail&&C.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(M(h.error,s))}),_.send(JSON.stringify(C))))}else t.debug&&console.log("%c ⯈ Error log: %c 🛈 Ignoring error from external script ",g.lightCSS,g.warningCSS)},D=function(e,n,a,s,c,g){var f=e,h=n,m=s,d=g,v=c,_=1,C=b();if((null===f||null===h)&&2!==p)return console.log("Login api error");l.hasOwnProperty("apiKey")&&l.hasOwnProperty("logId")&&(f=l.apiKey,h=l.logId);var w=new XMLHttpRequest;if(w.open("POST","https://api.elmah.io/v3/messages/"+h+"?api_key="+f,!0),w.setRequestHeader("Content-type","application/json"),w.onload=function(e){4===w.readyState&&(201===w.status&&a("success",w.statusText),w.status>=400&&w.status<=499&&(a("error",w.statusText),r.emit("error",w.status,w.statusText)))},w.onerror=function(e){a("error",w.statusText),r.emit("error",w.status,w.statusText)},"Log"!==m){var E=d&&d instanceof Error&&0!==y(d.stack)?i.parse(d):null,N={title:v,source:E&&E.length>0?E[0].fileName:null,detail:d?d.stack:null,severity:m,type:d?d.name:null,queryString:JSON.parse(JSON.stringify(C))};if(d&&d.cause&&"object"==typeof d.cause&&d.cause instanceof Error){var A=S(d);N.type=A.type,N.source=A.source}N=O(N,u())}else N=d;if(null!==t.filter&&t.filter(N)&&(_=0),1===_)if(N.title){if(o.length>0){if(N.breadcrumbs&&N.breadcrumbs.length>0){o=o.reverse();for(var M=0;M{N.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(e)}),L(d,w,N)}):N.errorObject&&N.errorObject instanceof Error?(d=N.errorObject,delete N.errorObject,T(d).then(e=>{N.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(e)}),L(d,w,N)})):(delete N.errorObject,w.send(JSON.stringify(N)))}else a("missing-title",w.statusText)},F=function(e,n,i,a,s){var c=e,g=n,f=s.message,h=s.message,m=a,y=Object.values(s.arguments),_=1,C=b();if("string"!=typeof(f=function(e,n){var t=e;if(n.length>1)if(String(e).match(/%[sdif]/g)){var r=0;t=String(e).replace(/%[sdif]/g,function(e){switch(e){case"%s":return n[++r]?String(n[r]):"%s";case"%d":return n[++r]?d(n[r])||v(n[r])?parseInt(n[r]):"NaN":"%d";case"%i":return n[++r]?d(n[r])||v(n[r])?parseInt(n[r]):"NaN":"%i";case"%f":return n[++r]?d(n[r])||v(n[r])?parseFloat(n[r]):"NaN":"%f";default:return e}});for(var o=n.length,i=n[++r];r=400&&S.status<=499&&(i("error",S.statusText),r.emit("error",S.status,S.statusText)))},S.onerror=function(e){i("error",S.statusText),r.emit("error",S.status,S.statusText)};var w={title:f,titleTemplate:h,detail:function(e,n,t){for(var r=[],o=0;o0&&(w.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(w)&&(_=0),1===_&&(w.title?(r.emit("message",w),S.send(JSON.stringify(w))):i("missing-title",S.statusText))};return r.error=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Error",e,n)},t.breadcrumbs?100:0)},r.verbose=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Verbose",e,n)},t.breadcrumbs?100:0)},r.debug=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Debug",e,n)},t.breadcrumbs?100:0)},r.information=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Information",e,n)},t.breadcrumbs?100:0)},r.warning=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Warning",e,n)},t.breadcrumbs?100:0)},r.fatal=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Fatal",e,n)},t.breadcrumbs?100:0)},r.log=function(e){setTimeout(function(){D(t.apiKey,t.logId,c,"Log",null,e)},t.breadcrumbs?100:0)},r.message=function(e){return function(e){if(!e)return u();var n=e,t=n&&0!==y(n.stack)?i.parse(n):null,r={title:n.message,source:t&&t.length>0?t[0].fileName:null,detail:n?n.stack:null,severity:"Error",type:n?n.name:null,errorObject:n};if(n&&n.cause&&"object"==typeof n.cause&&n.cause instanceof Error){var o=S(n);r.type=o.type,r.source=o.source}return r=O(r,u())}(e)},r.addBreadcrumb=function(e,n,t){k({severity:null!=n&&_(n)?n:"Information",action:null!=t&&_(t)?t:"Log",message:null!=e&&_(e)?e:"This is just a test message."})},r.on=function(e,n,t){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:n,ctx:t}),this},r.emit=function(e){for(var n=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=t.length;r0&&r<400?o="Information":r>399&&r<500?o="Warning":r>=500&&(o="Error"),k({severity:o,action:"Request",message:"["+n+"] "+t+(r>0?" ("+r+")":"")}))}(t,e,n)},!1),o.apply(this,arguments)}}}if(e.onerror=function(e,n,r,o,i){var a={message:e,source:n,lineno:r,colno:o,error:i};return setTimeout(function(){I(t.apiKey,t.logId,c,a)},t.breadcrumbs?100:0),!1},e.onunhandledrejection=function(e){var n={message:e.reason&&e.reason.message?e.reason.message:void 0,error:e.reason.message&&e.reason.stack?e.reason:void 0};return setTimeout(function(){I(t.apiKey,t.logId,c,n)},t.breadcrumbs?100:0),!1},n&&"none"!==n.captureConsoleMinimumLevel){if("info"===n.captureConsoleMinimumLevel||"warn"===n.captureConsoleMinimumLevel||"error"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var i=console.error;if(console.error=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Error",n)},t.breadcrumbs?100:0),i.apply(console,arguments)},"error"!==n.captureConsoleMinimumLevel){var a=console.warn;console.warn=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Warning",n)},t.breadcrumbs?100:0),a.apply(console,arguments)}}}if("info"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var s=console.info;console.info=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Information",n)},t.breadcrumbs?100:0),s.apply(console,arguments)}}if("debug"===n.captureConsoleMinimumLevel){var u=console.debug;console.debug=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Debug",n)},t.breadcrumbs?100:0),u.apply(console,arguments)}}}},r.init(n),t.debug&&console.log("%c"+g.label,g.labelCSS),r};return p&&l.hasOwnProperty("apiKey")&&l.hasOwnProperty("logId")?new E:E}); +!function(e,n){"function"==typeof define&&define.amd?define([],function(){return n(e)}):"object"==typeof exports?module.exports=n(e):e.Elmahio=n(e)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(e){"use strict";for(var n,t,r,o=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],i=["fileName","functionName","source"],a=r.concat(o,i,["args"]);function s(e){if(e instanceof Object)for(var t=0;t-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),t=n.match(/ (\(.+\)$)/);n=t?n.replace(t[0],""):n;var r=this.extractLocation(t?t[1]:n),i=t&&n||void 0,a=["eval",""].indexOf(r[0])>-1?void 0:r[0];return new o({functionName:i,fileName:a,lineNumber:r[1],columnNumber:r[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new o({functionName:e});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,t=e.match(n),r=t&&t[1]?t[1]:void 0,i=this.extractLocation(e.replace(n,""));return new o({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,t=e.message.split("\n"),r=[],i=2,a=t.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(n=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new o({functionName:a,args:s,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}),a=function(n,t){function r(e){return new Promise(function(n,t){var r=new XMLHttpRequest;r.open("get",e),r.onerror=t,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||"file://"===e.substr(0,7)&&r.responseText?n(r.responseText):t(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function o(n){if(void 0!==e&&e.atob)return e.atob(n);throw new Error("You must supply a polyfill for window.atob in this environment")}function i(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}return function e(a){if(!(this instanceof e))return new e(a);a=a||{},this.sourceCache=a.sourceCache||{},this.sourceMapConsumerCache=a.sourceMapConsumerCache||{},this.ajax=a.ajax||r,this._atob=a.atob||o,this._get=function(e){return new Promise(function(n,t){var r="data:"===e.substr(0,5);if(this.sourceCache[e])n(this.sourceCache[e]);else if(a.offline&&!r)t(new Error("Cannot make network requests in offline mode"));else if(r){var o=e.match(/^data:application\/json;([\w=:"-]+;)*base64,/);if(o){var i=o[0].length,s=e.substr(i),u=this._atob(s);this.sourceCache[e]=u,n(u)}else t(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(n,t)}}.bind(this))},this._getSourceMapConsumer=function(e,t){return new Promise(function(r,o){if(this.sourceMapConsumerCache[e])r(this.sourceMapConsumerCache[e]);else{var i=new Promise(function(r,o){return this._get(e).then(function(e){"string"==typeof e&&(e=function(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}(e.replace(/^\)\]\}'/,""))),void 0===e.sourceRoot&&(e.sourceRoot=t),r(new n.SourceMapConsumer(e))},o)}.bind(this));this.sourceMapConsumerCache[e]=i,r(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(n,t){this.getMappedLocation(e).then(function(e){function t(){n(e)}this.findFunctionName(e).then(n,t).catch(t)}.bind(this),t)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(n,r){i(e),this._get(e.fileName).then(function(r){var o=e.lineNumber,i=e.columnNumber,a=function(e,n){for(var t=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],r=e.split("\n"),o="",i=Math.min(n,20),a=0;a=0&&(s=s.substr(0,u)),s){o=s+o;for(var c=t.length,l=0;l=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var c=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==c;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,c.prototype=Object.create(u.prototype),c.prototype.consumer=u,c.fromSourceMap=function(e){var n=Object.create(c.prototype),t=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],p=n.__originalMappings=[],g=0,f=a.length;g1&&(t.source=m+i[1],m+=i[1],t.originalLine=f+i[2],f=t.originalLine,t.originalLine+=1,t.originalColumn=h+i[3],h=t.originalColumn,i.length>4&&(t.name=d+i[4],d+=i[4])),C.push(t),"number"==typeof t.originalLine&&_.push(t)}s(C,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,s(_,r.compareByOriginalPositions),this.__originalMappings=_},c.prototype._findMapping=function(e,n,t,r,i,a){if(e[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[t]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,n,i,a)},c.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[t];if(o.generatedLine===n.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=r.join(this.sourceRoot,i)));var a=r.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})},c.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=r.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var t;if(null!=this.sourceRoot&&(t=r.urlParse(this.sourceRoot))){var o=e.replace(/^file:\/\//,"");if("file"==t.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!t.path||"/"==t.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var n=r.getArg(e,"source");if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var t={source:n=this._sources.indexOf(n),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===t.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=c,p.prototype=Object.create(u.prototype),p.prototype.constructor=u,p.prototype._version=3,Object.defineProperty(p.prototype,"sources",{get:function(){for(var e=[],n=0;n=0;l--)"."===(a=u[l])?u.splice(l,1):".."===a?c++:c>0&&(""===a?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return""===(t=u.join("/"))&&(t=s?"/":"."),r?(r.path=t,i(r)):t}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){""===e&&(e="."),""===n&&(n=".");var t=o(n),s=o(e);if(s&&(e=s.path||"/"),t&&!t.scheme)return s&&(t.scheme=s.scheme),i(t);if(t||n.match(r))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u="/"===n.charAt(0)?n:a(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(t)},n.relative=function(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var t=0;0!==n.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return n;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function u(e){return e}function c(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function l(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return c(e)?"$"+e:e},n.fromSetString=s?u:function(e){return c(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,t){var r=e.source-n.source;return 0!==r?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)||t?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!=(r=e.generatedLine-n.generatedLine)?r:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,t){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)||t?r:0!=(r=e.source-n.source)?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!==(t=l(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:l(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,r,o){if(0===t.length)return-1;var i=function e(t,r,o,i,a,s){var u=Math.floor((r-t)/2)+t,c=a(o,i[u],!0);return 0===c?u:c>0?r-u>1?e(u,r,o,i,a,s):s==n.LEAST_UPPER_BOUND?r1?e(t,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:t<0?-1:t}(-1,t.length,e,t,r,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===r(t[i],t[i-1],!0);)--i;return i}},function(e,n,t){var r=t(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var t=new i,r=0,o=e.length;r=0&&e>>=5)>0&&(n|=32),o+=r.encode(n)}while(i>0);return o},n.decode=function(e,n,t){var o,i,a,s,u=e.length,c=0,l=0;do{if(n>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(n++))))throw new Error("Invalid base64 digit: "+e.charAt(n-1));o=!!(32&i),c+=(i&=31)<>1,1==(1&a)?-s:s),t.rest=n}},function(e,n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e ".length;e&&r++<5&&!("html"===(n=S(e))||r>1&&o+t.length*i+n.length>=80);)t.push(n),o+=n.length,e=e.parentNode;return t.reverse().join(" > ")}function S(e){var n,t,r,o,i,a=[];if(!e||!e.tagName)return"";if(a.push(e.tagName.toLowerCase()),e.id&&a.push("#"+e.id),(n=e.className)&&_(n))for(t=n.split(/\s+/),i=0;i0?a[0].fileName:null}"type"===o&&(t=n[o]),"inner"===o&&0!==n[o].length&&e(n[o])})}(n),{type:t,source:r}}function E(e,n,t,r){var o=null;return n.forEach(function(e,t){if(e.functionName)var r=e.functionName+" ";else r="";var i=" at "+r+"("+e.fileName+":"+e.lineNumber+":"+e.columnNumber+")";n[t]=i,0===t&&(o=e.fileName||null)}),t?n.unshift("\nCaused by: "+e):n.unshift(e),r?{newFrames:n,fileName:o}:n}function N(e){if(e){var n=new a;return new Promise(function(t){t(Promise.all(e.map(function(e){return new Promise(function(t){function r(){t(e)}n.pinpoint(e).then(t,r).catch(r)})})))})}return new Promise(function(e){return e([])})}function L(e,n,t){var r=m(e),o=[],a=[];!function e(n){Object.keys(n).forEach(function(t){"error"===t&&0!==y(n[t].stack)&&(o.push(n[t].toString().split("\n")[0]),a.push(N(i.parse(n[t])))),"inner"===t&&0!==n[t].length&&e(n[t])})}(r),Promise.all(a).then(e=>{e.forEach(function(e,n){0===n?t.detail=E(o[n],e,!1).join("\n"):t.detail+=E(o[n],e,!0).join("\n")})}).then(function(){n.send(JSON.stringify(t))})}function A(e){var n=typeof e.error;return n.charAt(0).toUpperCase()+n.slice(1)+": "+e.error+"\n at ("+e.source+":"+e.lineno+":"+e.colno+")"}function M(e,n){var t,r={};if(r.Id=(t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1).toUpperCase()})()+t(),"object"==typeof e&&null!==e){var o=e&&0!==y(e.stack)&&"object"==typeof e?i.parse(e):"";if(r.Type=e.name||null,r.Message=e.message||null,r.StackTrace=0!==y(e.stack)?i.parse(e):null,r.Source=o&&o.length>0?o[0].fileName:null,r.Inners=e.cause&&"object"==typeof e.cause&&e.cause instanceof Error?[M(e.cause)]:[],e.cause&&r.Inners instanceof Array&&0===r.Inners.length&&("number"!=typeof e.cause&&"string"!=typeof e.cause&&"boolean"!=typeof e.cause||(r.ExceptionSpecific=[{key:"cause",value:e.cause}]),"bigint"==typeof e.cause&&(r.ExceptionSpecific=[{key:"cause",value:e.cause.toString()+"n"}]),"symbol"==typeof e.cause&&(r.ExceptionSpecific=[{key:"cause",value:e.cause.toString()}]),"object"==typeof e.cause&&(0!==Object.keys(r).length||r.constructor!==Object))){let n=[];for(const[t,r]of Object.entries(e.cause))"number"!=typeof r&&"string"!=typeof r&&"boolean"!=typeof r||n.push({key:t,value:r}),"bigint"==typeof r&&n.push({key:t,value:r.toString()+"n"}),"symbol"==typeof r&&n.push({key:t,value:r.toString()});r.ExceptionSpecific=n}}else r.Type=typeof n.error||null,r.Message=n.message||null,r.StackTrace=A(n),r.Source=n.source||null,r.Inners=[];return r}function T(e){var n=M(e),t=[];function r(e,n){Object.keys(e).forEach(function(o){"StackTrace"===o&&(n?e[o].then(n=>{var t=E(e.Type+": "+e.Message,n,!1,!0);e[o]=t.newFrames.join("\n"),e.Source=t.fileName||null}):(e[o]=N(e[o]),t.push(e[o]))),"Inners"===o&&0!==e[o].length&&r(e[o][0],n)})}return r(n,!1),new Promise(function(e,o){Promise.all(t).then(function(e){r(n,!0)}).then(function(){e(n)})})}var k=function(e){var t=O({dateTime:(new Date).toISOString()},e),r=10;o.push(t),n.breadcrumbsNumber>=0&&"number"==typeof n.breadcrumbsNumber&&(n.breadcrumbsNumber>25?r=25:n.breadcrumbsNumber<=25&&(r=n.breadcrumbsNumber)),o.length>r&&o.shift()},x=function(e){var n;try{n=C(e.target)}catch(e){n=""}k({severity:"Information",action:"Click",message:n})},P=function(e){var n;try{n=C(e.target)}catch(e){n=""}k({severity:"Information",action:"Form submit",message:n})},j=function(n){var t=null;switch(n.type){case"load":t="Page loaded";break;case"DOMContentLoaded":t="DOMContentLoaded";break;case"pageshow":t="Page shown";break;case"pagehide":t="Page hidden";break;case"popstate":t="Navigated from: "+s+" to: "+e.location.href}k({severity:"Information",action:"Navigation",message:t})},R=function(e){var n=e.oldURL,t=e.newURL,r=null;r=n&&t?"from: '"+w(n)+"' to: '"+w(t)+"'":"to: '"+location.hash+"'",k({severity:"Information",action:"Navigation",message:"Hash changed "+r})},I=function(e,n,a,s){var c=e,f=n,h=s,m=1,d=b(),v=h.error&&0!==y(h.error.stack)&&"object"==typeof h.error?i.parse(h.error):"";if(!h||0!==h.colno||0!==h.lineno||v&&""!==v||!h.message||"Script error."!==h.message&&"Script error"!==h.message){if((null===c||null===f)&&2!==p)return console.log("Login api error");l.hasOwnProperty("apiKey")&&l.hasOwnProperty("logId")&&(c=l.apiKey,f=l.logId);var _=new XMLHttpRequest;_.open("POST","https://api.elmah.io/v3/messages/"+f+"?api_key="+c,!0),_.setRequestHeader("Content-type","application/json"),_.onload=function(e){4===_.readyState&&(201===_.status&&a("success",_.statusText),_.status>=400&&_.status<=499&&(a("error",_.statusText),r.emit("error",_.status,_.statusText)))},_.onerror=function(e){a("error",_.statusText),r.emit("error",_.status,_.statusText)};var C={detail:h.error?h.error.stack:null,title:h.message||"Unspecified error",source:v&&v.length>0?v[0].fileName:null,severity:"Error",type:h.error?h.error.name:null,queryString:JSON.parse(JSON.stringify(d))};if(h.error&&0===y(h.error.stack)&&void 0===C.detail){var w=typeof s.error,E=w.charAt(0).toUpperCase()+w.slice(1);C.detail=A(s),C.source=s.source,C.title="Uncaught "+E+": "+s.error}if(h.error&&h.error.cause&&"object"==typeof h.error.cause&&h.error.cause instanceof Error){var N=S(h.error);C.type=N.type,C.source=N.source}C=O(C,u()),o.length>0&&(C.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(C)&&(m=0),1===m&&(r.emit("message",C),h.error&&"object"==typeof h.error&&0!==y(h.error.stack)&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?T(h.error).then(e=>{C.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(e)}),L(h.error,_,C)}):(C.detail&&C.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(M(h.error,s))}),_.send(JSON.stringify(C))))}else t.debug&&console.log("%c ⯈ Error log: %c 🛈 Ignoring error from external script ",g.lightCSS,g.warningCSS)},D=function(e,n,a,s,c,g){var f=e,h=n,m=s,d=g,v=c,_=1,C=b();if((null===f||null===h)&&2!==p)return console.log("Login api error");l.hasOwnProperty("apiKey")&&l.hasOwnProperty("logId")&&(f=l.apiKey,h=l.logId);var w=new XMLHttpRequest;if(w.open("POST","https://api.elmah.io/v3/messages/"+h+"?api_key="+f,!0),w.setRequestHeader("Content-type","application/json"),w.onload=function(e){4===w.readyState&&(201===w.status&&a("success",w.statusText),w.status>=400&&w.status<=499&&(a("error",w.statusText),r.emit("error",w.status,w.statusText)))},w.onerror=function(e){a("error",w.statusText),r.emit("error",w.status,w.statusText)},"Log"!==m){var E=d&&d instanceof Error&&0!==y(d.stack)?i.parse(d):null,N={title:v,source:E&&E.length>0?E[0].fileName:null,detail:d?d.stack:null,severity:m,type:d?d.name:null,queryString:JSON.parse(JSON.stringify(C))};if(d&&d.cause&&"object"==typeof d.cause&&d.cause instanceof Error){var A=S(d);N.type=A.type,N.source=A.source}N=O(N,u())}else N=d;if(null!==t.filter&&t.filter(N)&&(_=0),1===_)if(N.title){if(o.length>0){if(N.breadcrumbs&&N.breadcrumbs.length>0){o=o.reverse();for(var M=0;M{N.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(e)}),L(d,w,N)}):N.errorObject&&N.errorObject instanceof Error?(d=N.errorObject,delete N.errorObject,T(d).then(e=>{N.data.push({key:"X-ELMAHIO-EXCEPTIONINSPECTOR",value:JSON.stringify(e)}),L(d,w,N)})):(delete N.errorObject,w.send(JSON.stringify(N)))}else a("missing-title",w.statusText)},F=function(e,n,i,a,s){var c=e,g=n,f=s.message,h=s.message,m=a,y=Object.values(s.arguments),_=1,C=b();if("string"!=typeof(f=function(e,n){var t=e;if(n.length>1)if(String(e).match(/%[sdif]/g)){var r=0;t=String(e).replace(/%[sdif]/g,function(e){switch(e){case"%s":return n[++r]?String(n[r]):"%s";case"%d":return n[++r]?d(n[r])||v(n[r])?parseInt(n[r]):"NaN":"%d";case"%i":return n[++r]?d(n[r])||v(n[r])?parseInt(n[r]):"NaN":"%i";case"%f":return n[++r]?d(n[r])||v(n[r])?parseFloat(n[r]):"NaN":"%f";default:return e}});for(var o=n.length,i=n[++r];r=400&&S.status<=499&&(i("error",S.statusText),r.emit("error",S.status,S.statusText)))},S.onerror=function(e){i("error",S.statusText),r.emit("error",S.status,S.statusText)};var w={title:f,titleTemplate:h,detail:function(e,n,t){for(var r=[],o=0;o0&&(w.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(w)&&(_=0),1===_&&(w.title?(r.emit("message",w),S.send(JSON.stringify(w))):i("missing-title",S.statusText))};return r.error=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Error",e,n)},t.breadcrumbs?100:0)},r.verbose=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Verbose",e,n)},t.breadcrumbs?100:0)},r.debug=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Debug",e,n)},t.breadcrumbs?100:0)},r.information=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Information",e,n)},t.breadcrumbs?100:0)},r.warning=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Warning",e,n)},t.breadcrumbs?100:0)},r.fatal=function(e,n){setTimeout(function(){D(t.apiKey,t.logId,c,"Fatal",e,n)},t.breadcrumbs?100:0)},r.log=function(e){setTimeout(function(){D(t.apiKey,t.logId,c,"Log",null,e)},t.breadcrumbs?100:0)},r.message=function(e){return function(e){if(!e)return u();var n=e,t=n&&0!==y(n.stack)?i.parse(n):null,r={title:n.message,source:t&&t.length>0?t[0].fileName:null,detail:n?n.stack:null,severity:"Error",type:n?n.name:null,errorObject:n};if(n&&n.cause&&"object"==typeof n.cause&&n.cause instanceof Error){var o=S(n);r.type=o.type,r.source=o.source}return r=O(r,u())}(e)},r.addBreadcrumb=function(e,n,t){k({severity:null!=n&&_(n)?n:"Information",action:null!=t&&_(t)?t:"Log",message:null!=e&&_(e)?e:"This is just a test message."})},r.on=function(e,n,t){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:n,ctx:t}),this},r.emit=function(e){for(var n=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=t.length;r0&&r<400?o="Information":r>399&&r<500?o="Warning":r>=500&&(o="Error"),k({severity:o,action:"Request",message:"["+n+"] "+t+(r>0?" ("+r+")":"")}))}(t,e,n)},!1),o.apply(this,arguments)}}}if(e.onerror=function(e,n,r,o,i){var a={message:e,source:n,lineno:r,colno:o,error:i};return setTimeout(function(){I(t.apiKey,t.logId,c,a)},t.breadcrumbs?100:0),!1},e.onunhandledrejection=function(e){var n={message:e.reason&&e.reason.message?e.reason.message:void 0,error:e.reason&&e.reason.message&&e.reason.stack?e.reason:void 0};return setTimeout(function(){I(t.apiKey,t.logId,c,n)},t.breadcrumbs?100:0),!1},n&&"none"!==n.captureConsoleMinimumLevel){if("info"===n.captureConsoleMinimumLevel||"warn"===n.captureConsoleMinimumLevel||"error"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var i=console.error;if(console.error=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Error",n)},t.breadcrumbs?100:0),i.apply(console,arguments)},"error"!==n.captureConsoleMinimumLevel){var a=console.warn;console.warn=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Warning",n)},t.breadcrumbs?100:0),a.apply(console,arguments)}}}if("info"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var s=console.info;console.info=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Information",n)},t.breadcrumbs?100:0),s.apply(console,arguments)}}if("debug"===n.captureConsoleMinimumLevel){var u=console.debug;console.debug=function(e){var n={message:e,arguments:arguments};setTimeout(function(){F(t.apiKey,t.logId,c,"Debug",n)},t.breadcrumbs?100:0),u.apply(console,arguments)}}}},r.init(n),t.debug&&console.log("%c"+g.label,g.labelCSS),r};return p&&l.hasOwnProperty("apiKey")&&l.hasOwnProperty("logId")?new E:E}); //# sourceMappingURL=elmahio.min.js.map diff --git a/dist/elmahio.min.js.map b/dist/elmahio.min.js.map index 750ab0d..f0e00c5 100644 --- a/dist/elmahio.min.js.map +++ b/dist/elmahio.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["elmahio.js"],"names":["root","factory","define","amd","exports","module","Elmahio","global","window","this","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","StackFrame","_isNumber","n","isNaN","parseFloat","isFinite","_capitalize","str","charAt","toUpperCase","substring","_getter","p","booleanProps","numericProps","stringProps","props","concat","obj","Object","i","length","hasOwnProperty","undefined","prototype","getArgs","args","setArgs","v","toString","call","TypeError","getEvalOrigin","evalOrigin","setEvalOrigin","getFunctionName","join","getFileName","getLineNumber","getColumnNumber","fromString","argsStartIndex","indexOf","argsEndIndex","lastIndexOf","functionName","split","locationString","parts","exec","fileName","lineNumber","columnNumber","Boolean","j","Number","k","String","ErrorStackParser","parse","error","stacktrace","parseOpera","stack","match","parseV8OrIE","parseFFOrSafari","Error","extractLocation","urlLike","replace","filter","line","map","sanitizedLine","location","locationParts","source","functionNameRegex","matches","e","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","push","argsRaw","tokens","pop","functionCall","shift","StackTraceGPS","SourceMap","_xdr","url","Promise","resolve","reject","req","XMLHttpRequest","open","onerror","onreadystatechange","readyState","status","substr","responseText","send","_atob","b64str","atob","_ensureStackFrameIsLegit","stackframe","opts","sourceCache","sourceMapConsumerCache","ajax","_get","isDataUrl","offline","sourceMapStart","encodedSource","xhrPromise","method","then","bind","_getSourceMapConsumer","sourceMappingURL","defaultSourceRoot","sourceMapConsumerPromise","sourceMapSource","string","JSON","_parseJson","sourceRoot","SourceMapConsumer","pinpoint","getMappedLocation","mappedStackFrame","resolveMappedStackFrame","findFunctionName","guessedFunctionName","syntaxes","code","maxLines","Math","min","commentPos","index","m","_findFunctionName","defineProperty","create","_ensureSupportedEnvironment","lastSourceMappingUrl","matchSourceMappingUrl","sourceMappingUrlRegExp","_findSourceMappingURL","test","sourceMapConsumer","loc","originalPositionFor","column","mappedSource","sourceContentFor","name","_extractLocationInfoFromSourceMapSource","r","t","o","id","loaded","c","ArraySet","a","s","quickSort","u","sections","l","getArg","g","_version","normalize","isAbsolute","relative","_names","fromArray","_sources","sourcesContent","_mappings","file","generatedLine","generatedColumn","originalLine","originalColumn","_sections","generatedOffset","consumer","fromSourceMap","__generatedMappings","get","_parseMappings","__originalMappings","_charIsMappingSeparator","GENERATED_ORDER","ORIGINAL_ORDER","GREATEST_LOWER_BOUND","LEAST_UPPER_BOUND","eachMapping","_generatedMappings","_originalMappings","at","forEach","allGeneratedPositionsFor","has","_findMapping","compareByOriginalPositions","lastColumn","toArray","_sourceRoot","_generateSourcesContent","_file","slice","h","f","d","_","C","A","y","L","decode","value","rest","compareByGeneratedPositionsDeflated","search","computeColumnSpans","lastGeneratedColumn","hasContentsOfAllSources","size","some","urlParse","scheme","path","generatedPositionFor","BasicSourceMapConsumer","constructor","sources","bias","every","add","IndexedSourceMapConsumer","arguments","auth","host","port","splice","urlGenerate","Array","charCodeAt","toSetString","fromSetString","compareByGeneratedPositionsInflated","floor","_array","_set","getOwnPropertyNames","encode","round","random","myScript","scriptFile","document","getElementsByTagName","isMe","params","query","Params","Pairs","KeyVal","key","unescape","val","parseQuery","src","paramsLength","objectLength","debugSettings","label","labelCSS","successCSS","errorCSS","warningCSS","lightCSS","defaults","apiKey","logId","debug","application","captureConsoleMinimumLevel","breadcrumbs","breadcrumbsNumber","extend","extended","deep","merge","prop","scriptElem","getAttribute","isInt","isFloat","getSearchParameters","prmstr","prmarr","tmparr","transformToAssocArray","merge_objects","obj1","obj2","obj3","attrname1","attrname2","isString","what","cssSelectorString","elem","nextStr","out","height","sepLength","htmlElementAsString","parentNode","reverse","className","classes","attr","tagName","toLowerCase","attrWhitelist","parseHash","Constructor","options","settings","publicAPIs","lastHref","href","getPayload","payload","pathname","payload_data","documentMode","innerWidth","documentElement","clientWidth","innerHeight","clientHeight","screen","msOrientation","orientation","mozOrientation","type","width","colorDepth","data","payload_serverVariables","navigator","language","userAgent","referrer","protocol","hostname","serverVariables","confirmResponse","response","console","log","Date","toLocaleString","generateErrorObject","inner","cause","getErrorTypeSource","object","iterateObj","keys","GenerateNewFrames","errorMessage","newFrames","lastInnerFileName","stackFrame","fn","stackString","unshift","GPSPromise","stackframes","gps","all","sf","resolveOriginal","stackGPS","xhr","jsonData","messagesArr","promiseArr","values","detail","stringify","typeOF","lineno","colno","inspectorObj","fullError","s4","Id","Type","Message","StackTrace","Source","Inners","ExceptionSpecific","objEntries","entries","inspectorGPS","inspectorObject","final","generateNewFrames","recordBreadcrumb","crumb","dateTime","toISOString","breadcrumbs_number","breadcrumbClickEventHandler","evt","target","severity","action","breadcrumbFormSubmitEventHandler","breadcrumbWindowEventHandler","breadcrumbHashChangeEventHandler","oldURL","newURL","hash","sendPayload","callback","errorLog","api_key","log_id","queryParams","setRequestHeader","onload","statusText","emit","title","queryString","typeOFCapitalized","typeAndSource","sendManualPayload","logType","messageLog","errorObject","sendPayloadFromConsole","messageTemplate","x","parseInt","format","titleTemplate","errorStack","manipulateStack","msg","setTimeout","verbose","information","warning","fatal","sendPrefilledLogMessage","addBreadcrumb","on","ctx","evtArr","apply","init","addEventListener","attachEvent","history","pushState","replaceState","old_onpopstate","onpopstate","event","breadcrumbXHRHandler","onunhandledrejection","reason","_error","errMessage","_warning","warn","warnMessage","_info","info","infoMessage","_debug","debugMessage"],"mappings":";;;;CAIA,SAAUA,EAAMC,GACQ,mBAAXC,QAAyBA,OAAOC,IACzCD,OAAO,GAAI,WACT,OAAOD,EAAQD,KAEW,iBAAZI,QAChBC,OAAOD,QAAUH,EAAQD,GAEzBA,EAAKM,QAAUL,EAAQD,GAR3B,CAUqB,oBAAXO,OAAyBA,OAA2B,oBAAXC,OAAyBA,OAASC,KAAM,SAASD,GAClG,aAm+BA,IAl+BA,IAiHME,EACAC,EACAC,EAnHFC,EAAa,WAGf,SAASC,EAAUC,GACjB,OAAQC,MAAMC,WAAWF,KAAOG,SAASH,GAG3C,SAASI,EAAYC,GACnB,OAAOA,EAAIC,OAAO,GAAGC,cAAgBF,EAAIG,UAAU,GAGrD,SAASC,EAAQC,GACf,OAAO,WACL,OAAOhB,KAAKgB,IAGhB,IAAIC,EAAe,CAAC,gBAAiB,SAAU,WAAY,cACvDC,EAAe,CAAC,eAAgB,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,CACnG,IAAIsM,EAAQ3H,QAAQ4H,KACpB5H,QAAQ4H,KAAO,SAASC,GACtB,IAAIvD,EAAW,CACbhX,QAAWua,EACXvP,UAAaA,WAEfyN,WAAW,WACTT,EAAuBtH,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,cAAewE,IACvFtG,EAAS1C,YAxiCC,IAwiCgC,GAC7CqM,EAAMlB,MAAMzG,QAAS1H,YAGzB,GAA2C,UAAvCyF,EAAQ1C,2BAAwC,CAClD,IAAIyM,EAAS9H,QAAQ7E,MACrB6E,QAAQ7E,MAAQ,SAAS4M,GACvB,IAAIzD,EAAW,CACbhX,QAAWya,EACXzP,UAAaA,WAEfyN,WAAW,WACTT,EAAuBtH,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,QAASwE,IACjFtG,EAAS1C,YArjCC,IAqjCgC,GAC7CwM,EAAOrB,MAAMzG,QAAS1H,eAK9B2F,EAAWyI,KAAK3I,GACZC,EAAS7C,OACX6E,QAAQC,IAAI,KAAOxF,EAAcC,MAAOD,EAAcE,UAEjDsD,GAET,OAAI1D,GAAgBV,EAAOlQ,eAAe,WAAakQ,EAAOlQ,eAAe,SACpE,IAAImU,EAEJA","sourcesContent":["/*!\n * elmah.io Javascript Logger - version 4.1.0\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n 'use strict';\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(,.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').replace(/^.*?\\s+/, '');\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\(.+\\)$)/);\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine\n // because this line doesn't have function name\n var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);\n var functionName = location && sanitizedLine || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function generateErrorObject(error) {\n return {\n error: error,\n type: error.name,\n message: error.message,\n inner: error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? generateErrorObject(error.cause) : []\n }\n }\n\n function getErrorTypeSource(error) {\n var object = generateErrorObject(error);\n var type = null;\n var source = null;\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n var stack = obj[key] ? ErrorStackParser.parse(obj[key]) : null;\n source = stack && stack.length > 0 ? stack[0].fileName : null;\n }\n }\n if (key === \"type\") {\n type = obj[key];\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n return { type: type, source: source };\n }\n\n function GenerateNewFrames(errorMessage, newFrames, cause, fileName) {\n var lastInnerFileName = null;\n\n newFrames.forEach(function(stackFrame, i) {\n if (stackFrame.functionName) {\n var fn = stackFrame.functionName + ' ';\n } else {\n var fn = '';\n }\n var stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n newFrames[i] = stackString;\n if (i === 0) {\n lastInnerFileName = stackFrame.fileName || null;\n }\n });\n \n if (!cause) {\n newFrames.unshift(errorMessage);\n } else {\n newFrames.unshift(\"\\nCaused by: \" + errorMessage);\n }\n\n if (fileName) {\n return {\n newFrames: newFrames,\n fileName: lastInnerFileName\n }\n }\n \n return newFrames;\n }\n\n function GPSPromise(stackframes) {\n if (stackframes) {\n var gps = new StackTraceGPS();\n\n return new Promise(function(resolve) {\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n });\n }\n\n return new Promise(function(resolve) {\n return resolve([]);\n });\n }\n\n function stackGPS(error, xhr, jsonData) {\n var object = generateErrorObject(error);\n var messagesArr = [];\n var promiseArr = [];\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n messagesArr.push(obj[key].toString().split(\"\\n\")[0]);\n promiseArr.push(GPSPromise(ErrorStackParser.parse(obj[key])));\n }\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n Promise.all(promiseArr).then((values) => {\n values.forEach(function(stackframe, index) {\n if (index === 0) {\n jsonData.detail = GenerateNewFrames(messagesArr[index], stackframe, false).join(\"\\n\");\n } else {\n jsonData.detail += GenerateNewFrames(messagesArr[index], stackframe, true).join(\"\\n\");\n }\n });\n }).then(function() {\n xhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n function guid() {\n var s4 = function() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1).toUpperCase();\n }\n return s4() + s4();\n }\n\n function inspectorObj (error, fullError) {\n var obj = {};\n obj.Id = guid();\n\n if (typeof error === \"object\" && error !== null) {\n var stack = error && objectLength(error.stack) !== 0 && typeof error === \"object\" ? ErrorStackParser.parse(error) : '';\n obj.Type = error.name || null;\n obj.Message = error.message || null;\n obj.StackTrace = objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n obj.Source = stack && stack.length > 0 ? stack[0].fileName : null;\n obj.Inners = error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? [inspectorObj(error.cause)] : [];\n\n if (error.cause && obj.Inners instanceof Array && obj.Inners.length === 0) {\n if (typeof error.cause === \"number\" || typeof error.cause === \"string\" || typeof error.cause === \"boolean\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause }];\n }\n if (typeof error.cause === \"bigint\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() + \"n\" }];\n }\n if (typeof error.cause === \"symbol\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() }];\n }\n if (typeof error.cause === \"object\") {\n if (!(Object.keys(obj).length === 0 && obj.constructor === Object)) {\n let objEntries = [];\n for (const [key, value] of Object.entries(error.cause)) {\n if (typeof value === \"number\" || typeof value === \"string\" || typeof value === \"boolean\") {\n objEntries.push({ key: key, value: value });\n }\n if (typeof value === \"bigint\") {\n objEntries.push({ key: key, value: value.toString() + \"n\" });\n }\n if (typeof value === \"symbol\") {\n objEntries.push({ key: key, value: value.toString() });\n }\n }\n obj.ExceptionSpecific = objEntries;\n }\n }\n }\n\n } else {\n obj.Type = typeof fullError.error || null;\n obj.Message = fullError.message || null;\n obj.StackTrace = stackString(fullError);\n obj.Source = fullError.source || null;\n obj.Inners = [];\n }\n\n return obj;\n }\n\n function inspectorGPS (error) {\n var inspectorObject = inspectorObj(error);\n var promiseArr = [];\n\n function iterateObj(obj, final) {\n Object.keys(obj).forEach(function(key){\n if (key === \"StackTrace\") {\n if (!final) {\n obj[key] = GPSPromise(obj[key]);\n promiseArr.push(obj[key]);\n } else {\n obj[key].then(result => {\n var generateNewFrames = GenerateNewFrames(obj.Type + ': ' + obj.Message, result, false, true);\n obj[key] = generateNewFrames.newFrames.join(\"\\n\");\n obj['Source'] = generateNewFrames.fileName || null;\n });\n }\n }\n if (key === \"Inners\" && obj[key].length !== 0) {\n iterateObj(obj[key][0], final);\n }\n });\n }\n\n iterateObj(inspectorObject, false);\n\n return new Promise(function(resolve, reject) {\n Promise.all(promiseArr).then(function(values) {\n iterateObj(inspectorObject, true);\n }).then(function() {\n resolve(inspectorObject);\n });\n });\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error.error && error.error.cause && typeof error.error.cause === \"object\" && error.error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error.error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error.error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error.error, xhr, jsonData);\n });\n\t } else {\n // Add inspector to jsonData\n if (jsonData.detail) {\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(inspectorObj(error.error, errorLog)) });\n }\n\n // send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error && error instanceof Error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && error instanceof Error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n // send message\n if(jsonData.errorObject && jsonData.errorObject instanceof Error) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n delete jsonData.errorObject;\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n };\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Log on window unhandled rejection\n window.onunhandledrejection = function (event) {\n var errorLog = {\n 'message': event.reason && event.reason.message ? event.reason.message : undefined,\n 'error': event.reason.message && event.reason.stack ? event.reason : undefined\n };\n\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.min.js"} \ No newline at end of file +{"version":3,"sources":["elmahio.js"],"names":["root","factory","define","amd","exports","module","Elmahio","global","window","this","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","StackFrame","_isNumber","n","isNaN","parseFloat","isFinite","_capitalize","str","charAt","toUpperCase","substring","_getter","p","booleanProps","numericProps","stringProps","props","concat","obj","Object","i","length","hasOwnProperty","undefined","prototype","getArgs","args","setArgs","v","toString","call","TypeError","getEvalOrigin","evalOrigin","setEvalOrigin","getFunctionName","join","getFileName","getLineNumber","getColumnNumber","fromString","argsStartIndex","indexOf","argsEndIndex","lastIndexOf","functionName","split","locationString","parts","exec","fileName","lineNumber","columnNumber","Boolean","j","Number","k","String","ErrorStackParser","parse","error","stacktrace","parseOpera","stack","match","parseV8OrIE","parseFFOrSafari","Error","extractLocation","urlLike","replace","filter","line","map","sanitizedLine","location","locationParts","source","functionNameRegex","matches","e","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","push","argsRaw","tokens","pop","functionCall","shift","StackTraceGPS","SourceMap","_xdr","url","Promise","resolve","reject","req","XMLHttpRequest","open","onerror","onreadystatechange","readyState","status","substr","responseText","send","_atob","b64str","atob","_ensureStackFrameIsLegit","stackframe","opts","sourceCache","sourceMapConsumerCache","ajax","_get","isDataUrl","offline","sourceMapStart","encodedSource","xhrPromise","method","then","bind","_getSourceMapConsumer","sourceMappingURL","defaultSourceRoot","sourceMapConsumerPromise","sourceMapSource","string","JSON","_parseJson","sourceRoot","SourceMapConsumer","pinpoint","getMappedLocation","mappedStackFrame","resolveMappedStackFrame","findFunctionName","guessedFunctionName","syntaxes","code","maxLines","Math","min","commentPos","index","m","_findFunctionName","defineProperty","create","_ensureSupportedEnvironment","lastSourceMappingUrl","matchSourceMappingUrl","sourceMappingUrlRegExp","_findSourceMappingURL","test","sourceMapConsumer","loc","originalPositionFor","column","mappedSource","sourceContentFor","name","_extractLocationInfoFromSourceMapSource","r","t","o","id","loaded","c","ArraySet","a","s","quickSort","u","sections","l","getArg","g","_version","normalize","isAbsolute","relative","_names","fromArray","_sources","sourcesContent","_mappings","file","generatedLine","generatedColumn","originalLine","originalColumn","_sections","generatedOffset","consumer","fromSourceMap","__generatedMappings","get","_parseMappings","__originalMappings","_charIsMappingSeparator","GENERATED_ORDER","ORIGINAL_ORDER","GREATEST_LOWER_BOUND","LEAST_UPPER_BOUND","eachMapping","_generatedMappings","_originalMappings","at","forEach","allGeneratedPositionsFor","has","_findMapping","compareByOriginalPositions","lastColumn","toArray","_sourceRoot","_generateSourcesContent","_file","slice","h","f","d","_","C","A","y","L","decode","value","rest","compareByGeneratedPositionsDeflated","search","computeColumnSpans","lastGeneratedColumn","hasContentsOfAllSources","size","some","urlParse","scheme","path","generatedPositionFor","BasicSourceMapConsumer","constructor","sources","bias","every","add","IndexedSourceMapConsumer","arguments","auth","host","port","splice","urlGenerate","Array","charCodeAt","toSetString","fromSetString","compareByGeneratedPositionsInflated","floor","_array","_set","getOwnPropertyNames","encode","round","random","myScript","scriptFile","document","getElementsByTagName","isMe","params","query","Params","Pairs","KeyVal","key","unescape","val","parseQuery","src","paramsLength","objectLength","debugSettings","label","labelCSS","successCSS","errorCSS","warningCSS","lightCSS","defaults","apiKey","logId","debug","application","captureConsoleMinimumLevel","breadcrumbs","breadcrumbsNumber","extend","extended","deep","merge","prop","scriptElem","getAttribute","isInt","isFloat","getSearchParameters","prmstr","prmarr","tmparr","transformToAssocArray","merge_objects","obj1","obj2","obj3","attrname1","attrname2","isString","what","cssSelectorString","elem","nextStr","out","height","sepLength","htmlElementAsString","parentNode","reverse","className","classes","attr","tagName","toLowerCase","attrWhitelist","parseHash","Constructor","options","settings","publicAPIs","lastHref","href","getPayload","payload","pathname","payload_data","documentMode","innerWidth","documentElement","clientWidth","innerHeight","clientHeight","screen","msOrientation","orientation","mozOrientation","type","width","colorDepth","data","payload_serverVariables","navigator","language","userAgent","referrer","protocol","hostname","serverVariables","confirmResponse","response","console","log","Date","toLocaleString","generateErrorObject","inner","cause","getErrorTypeSource","object","iterateObj","keys","GenerateNewFrames","errorMessage","newFrames","lastInnerFileName","stackFrame","fn","stackString","unshift","GPSPromise","stackframes","gps","all","sf","resolveOriginal","stackGPS","xhr","jsonData","messagesArr","promiseArr","values","detail","stringify","typeOF","lineno","colno","inspectorObj","fullError","s4","Id","Type","Message","StackTrace","Source","Inners","ExceptionSpecific","objEntries","entries","inspectorGPS","inspectorObject","final","generateNewFrames","recordBreadcrumb","crumb","dateTime","toISOString","breadcrumbs_number","breadcrumbClickEventHandler","evt","target","severity","action","breadcrumbFormSubmitEventHandler","breadcrumbWindowEventHandler","breadcrumbHashChangeEventHandler","oldURL","newURL","hash","sendPayload","callback","errorLog","api_key","log_id","queryParams","setRequestHeader","onload","statusText","emit","title","queryString","typeOFCapitalized","typeAndSource","sendManualPayload","logType","messageLog","errorObject","sendPayloadFromConsole","messageTemplate","x","parseInt","format","titleTemplate","errorStack","manipulateStack","msg","setTimeout","verbose","information","warning","fatal","sendPrefilledLogMessage","addBreadcrumb","on","ctx","evtArr","apply","init","addEventListener","attachEvent","history","pushState","replaceState","old_onpopstate","onpopstate","event","breadcrumbXHRHandler","onunhandledrejection","reason","_error","errMessage","_warning","warn","warnMessage","_info","info","infoMessage","_debug","debugMessage"],"mappings":";;;;CAIA,SAAUA,EAAMC,GACQ,mBAAXC,QAAyBA,OAAOC,IACzCD,OAAO,GAAI,WACT,OAAOD,EAAQD,KAEW,iBAAZI,QAChBC,OAAOD,QAAUH,EAAQD,GAEzBA,EAAKM,QAAUL,EAAQD,GAR3B,CAUqB,oBAAXO,OAAyBA,OAA2B,oBAAXC,OAAyBA,OAASC,KAAM,SAASD,GAClG,aAm+BA,IAl+BA,IA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xH,QAAQyH,KACvBzH,QAAQyH,KAAO,SAASC,GACtB,IAAIpD,EAAW,CACbhX,QAAWoa,EACXpP,UAAaA,WAEfyN,WAAW,WACTT,EAAuBtH,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,UAAWwE,IACnFtG,EAAS1C,YA1hCD,IA0hCkC,GAC7CkM,EAASf,MAAMzG,QAAS1H,aAI9B,GAA2C,SAAvCyF,EAAQ1C,4BAAgF,UAAvC0C,EAAQ1C,2BAAwC,CACnG,IAAIsM,EAAQ3H,QAAQ4H,KACpB5H,QAAQ4H,KAAO,SAASC,GACtB,IAAIvD,EAAW,CACbhX,QAAWua,EACXvP,UAAaA,WAEfyN,WAAW,WACTT,EAAuBtH,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,cAAewE,IACvFtG,EAAS1C,YAxiCC,IAwiCgC,GAC7CqM,EAAMlB,MAAMzG,QAAS1H,YAGzB,GAA2C,UAAvCyF,EAAQ1C,2BAAwC,CAClD,IAAIyM,EAAS9H,QAAQ7E,MACrB6E,QAAQ7E,MAAQ,SAAS4M,GACvB,IAAIzD,EAAW,CACbhX,QAAWya,EACXzP,UAAaA,WAEfyN,WAAW,WACTT,EAAuBtH,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,QAASwE,IACjFtG,EAAS1C,YArjCC,IAqjCgC,GAC7CwM,EAAOrB,MAAMzG,QAAS1H,eAK9B2F,EAAWyI,KAAK3I,GACZC,EAAS7C,OACX6E,QAAQC,IAAI,KAAOxF,EAAcC,MAAOD,EAAcE,UAEjDsD,GAET,OAAI1D,GAAgBV,EAAOlQ,eAAe,WAAakQ,EAAOlQ,eAAe,SACpE,IAAImU,EAEJA","sourcesContent":["/*!\n * elmah.io Javascript Logger - version 4.1.0\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n 'use strict';\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(,.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').replace(/^.*?\\s+/, '');\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\(.+\\)$)/);\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine\n // because this line doesn't have function name\n var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);\n var functionName = location && sanitizedLine || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function generateErrorObject(error) {\n return {\n error: error,\n type: error.name,\n message: error.message,\n inner: error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? generateErrorObject(error.cause) : []\n }\n }\n\n function getErrorTypeSource(error) {\n var object = generateErrorObject(error);\n var type = null;\n var source = null;\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n var stack = obj[key] ? ErrorStackParser.parse(obj[key]) : null;\n source = stack && stack.length > 0 ? stack[0].fileName : null;\n }\n }\n if (key === \"type\") {\n type = obj[key];\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n return { type: type, source: source };\n }\n\n function GenerateNewFrames(errorMessage, newFrames, cause, fileName) {\n var lastInnerFileName = null;\n\n newFrames.forEach(function(stackFrame, i) {\n if (stackFrame.functionName) {\n var fn = stackFrame.functionName + ' ';\n } else {\n var fn = '';\n }\n var stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n newFrames[i] = stackString;\n if (i === 0) {\n lastInnerFileName = stackFrame.fileName || null;\n }\n });\n \n if (!cause) {\n newFrames.unshift(errorMessage);\n } else {\n newFrames.unshift(\"\\nCaused by: \" + errorMessage);\n }\n\n if (fileName) {\n return {\n newFrames: newFrames,\n fileName: lastInnerFileName\n }\n }\n \n return newFrames;\n }\n\n function GPSPromise(stackframes) {\n if (stackframes) {\n var gps = new StackTraceGPS();\n\n return new Promise(function(resolve) {\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n });\n }\n\n return new Promise(function(resolve) {\n return resolve([]);\n });\n }\n\n function stackGPS(error, xhr, jsonData) {\n var object = generateErrorObject(error);\n var messagesArr = [];\n var promiseArr = [];\n\n function iterateObj(obj) {\n Object.keys(obj).forEach(function(key){\n if (key === \"error\") {\n if (objectLength(obj[key].stack) !== 0) {\n messagesArr.push(obj[key].toString().split(\"\\n\")[0]);\n promiseArr.push(GPSPromise(ErrorStackParser.parse(obj[key])));\n }\n }\n if (key === \"inner\" && obj[key].length !== 0) {\n iterateObj(obj[key]);\n }\n });\n }\n\n iterateObj(object);\n\n Promise.all(promiseArr).then((values) => {\n values.forEach(function(stackframe, index) {\n if (index === 0) {\n jsonData.detail = GenerateNewFrames(messagesArr[index], stackframe, false).join(\"\\n\");\n } else {\n jsonData.detail += GenerateNewFrames(messagesArr[index], stackframe, true).join(\"\\n\");\n }\n });\n }).then(function() {\n xhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n function guid() {\n var s4 = function() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1).toUpperCase();\n }\n return s4() + s4();\n }\n\n function inspectorObj (error, fullError) {\n var obj = {};\n obj.Id = guid();\n\n if (typeof error === \"object\" && error !== null) {\n var stack = error && objectLength(error.stack) !== 0 && typeof error === \"object\" ? ErrorStackParser.parse(error) : '';\n obj.Type = error.name || null;\n obj.Message = error.message || null;\n obj.StackTrace = objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n obj.Source = stack && stack.length > 0 ? stack[0].fileName : null;\n obj.Inners = error.cause && typeof error.cause === \"object\" && error.cause instanceof Error ? [inspectorObj(error.cause)] : [];\n\n if (error.cause && obj.Inners instanceof Array && obj.Inners.length === 0) {\n if (typeof error.cause === \"number\" || typeof error.cause === \"string\" || typeof error.cause === \"boolean\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause }];\n }\n if (typeof error.cause === \"bigint\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() + \"n\" }];\n }\n if (typeof error.cause === \"symbol\") {\n obj.ExceptionSpecific = [{ key: \"cause\", value: error.cause.toString() }];\n }\n if (typeof error.cause === \"object\") {\n if (!(Object.keys(obj).length === 0 && obj.constructor === Object)) {\n let objEntries = [];\n for (const [key, value] of Object.entries(error.cause)) {\n if (typeof value === \"number\" || typeof value === \"string\" || typeof value === \"boolean\") {\n objEntries.push({ key: key, value: value });\n }\n if (typeof value === \"bigint\") {\n objEntries.push({ key: key, value: value.toString() + \"n\" });\n }\n if (typeof value === \"symbol\") {\n objEntries.push({ key: key, value: value.toString() });\n }\n }\n obj.ExceptionSpecific = objEntries;\n }\n }\n }\n\n } else {\n obj.Type = typeof fullError.error || null;\n obj.Message = fullError.message || null;\n obj.StackTrace = stackString(fullError);\n obj.Source = fullError.source || null;\n obj.Inners = [];\n }\n\n return obj;\n }\n\n function inspectorGPS (error) {\n var inspectorObject = inspectorObj(error);\n var promiseArr = [];\n\n function iterateObj(obj, final) {\n Object.keys(obj).forEach(function(key){\n if (key === \"StackTrace\") {\n if (!final) {\n obj[key] = GPSPromise(obj[key]);\n promiseArr.push(obj[key]);\n } else {\n obj[key].then(result => {\n var generateNewFrames = GenerateNewFrames(obj.Type + ': ' + obj.Message, result, false, true);\n obj[key] = generateNewFrames.newFrames.join(\"\\n\");\n obj['Source'] = generateNewFrames.fileName || null;\n });\n }\n }\n if (key === \"Inners\" && obj[key].length !== 0) {\n iterateObj(obj[key][0], final);\n }\n });\n }\n\n iterateObj(inspectorObject, false);\n\n return new Promise(function(resolve, reject) {\n Promise.all(promiseArr).then(function(values) {\n iterateObj(inspectorObject, true);\n }).then(function() {\n resolve(inspectorObject);\n });\n });\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error.error && error.error.cause && typeof error.error.cause === \"object\" && error.error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error.error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error.error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error.error, xhr, jsonData);\n });\n\t } else {\n // Add inspector to jsonData\n if (jsonData.detail) {\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(inspectorObj(error.error, errorLog)) });\n }\n\n // send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error && error instanceof Error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && error instanceof Error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n // send message\n if(jsonData.errorObject && jsonData.errorObject instanceof Error) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n // try to pinpoint stackframes from error object\n inspectorGPS(error).then((result) => {\n // Add inspector to jsonData\n jsonData.data.push({ \"key\": \"X-ELMAHIO-EXCEPTIONINSPECTOR\", \"value\": JSON.stringify(result) });\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n });\n } else {\n delete jsonData.errorObject;\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error && objectLength(error.stack) !== 0 ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n // Check if the error sent has a cause\n // Then change the type and source with the most inner error type\n if(error && error.cause && typeof error.cause === \"object\" && error.cause instanceof Error) {\n var typeAndSource = getErrorTypeSource(error);\n jsonData.type = typeAndSource.type;\n jsonData.source = typeAndSource.source;\n }\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n };\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Log on window unhandled rejection\n window.onunhandledrejection = function (event) {\n var errorLog = {\n 'message': event.reason && event.reason.message ? event.reason.message : undefined,\n 'error': event.reason && event.reason.message && event.reason.stack ? event.reason : undefined\n };\n\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.min.js"} \ No newline at end of file diff --git a/src/elmahio.js b/src/elmahio.js index d012e12..ad041b2 100644 --- a/src/elmahio.js +++ b/src/elmahio.js @@ -1778,7 +1778,7 @@ window.onunhandledrejection = function (event) { var errorLog = { 'message': event.reason && event.reason.message ? event.reason.message : undefined, - 'error': event.reason.message && event.reason.stack ? event.reason : undefined + 'error': event.reason && event.reason.message && event.reason.stack ? event.reason : undefined }; setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);