diff --git a/dist/elmahio.js b/dist/elmahio.js index bfb52df..acba31a 100644 --- a/dist/elmahio.js +++ b/dist/elmahio.js @@ -1,5 +1,5 @@ /*! - * elmah.io Javascript Logger - version 3.5.4 + * elmah.io Javascript Logger - version 3.6.0 * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io */ (function(root, factory) { @@ -1507,14 +1507,14 @@ }, obj), breadcrumbs_number = 10; breadcrumbs.push(crumb); - if (options.breadcrumbsNumber && typeof options.breadcrumbsNumber === "number") { + if (options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === "number") { if (options.breadcrumbsNumber > 25) { breadcrumbs_number = 25; - } else if (options.breadcrumbsNumber >= 10 && options.breadcrumbsNumber <= 25) { + } else if (options.breadcrumbsNumber <= 25) { breadcrumbs_number = options.breadcrumbsNumber; } } - if (breadcrumbs.length >= breadcrumbs_number) { + if (breadcrumbs.length > breadcrumbs_number) { breadcrumbs.shift(); } } diff --git a/dist/elmahio.js.map b/dist/elmahio.js.map index 96564c3..5ea2571 100644 --- a/dist/elmahio.js.map +++ b/dist/elmahio.js.map @@ -1 +1 @@ -{"version":3,"names":[],"mappings":"","sources":["elmahio.js"],"sourcesContent":["/*!\r\n * elmah.io Javascript Logger - version 3.5.4\r\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define([], function () {\r\n return factory(root);\r\n });\r\n } else if (typeof exports === 'object') {\r\n module.exports = factory(root);\r\n } else {\r\n root.Elmahio = factory(root);\r\n }\r\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\r\n\r\n 'use strict';\r\n\r\n //\r\n // ==== STACKFRAME ====\r\n //\r\n\r\n var StackFrame = (function () {\r\n \"use strict\";\r\n function _isNumber(n) {\r\n return !isNaN(parseFloat(n)) && isFinite(n);\r\n }\r\n function _capitalize(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n }\r\n function _getter(p) {\r\n return function () {\r\n return this[p];\r\n };\r\n }\r\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\r\n var numericProps = [\"columnNumber\", \"lineNumber\"];\r\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\r\n var arrayProps = [\"args\"];\r\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\r\n function StackFrame(obj) {\r\n if (obj instanceof Object) {\r\n for (var i = 0; i < props.length; i++) {\r\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\r\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\r\n }\r\n }\r\n }\r\n }\r\n StackFrame.prototype = {\r\n getArgs: function () {\r\n return this.args;\r\n },\r\n setArgs: function (v) {\r\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\r\n throw new TypeError(\"Args must be an Array\");\r\n }\r\n this.args = v;\r\n },\r\n getEvalOrigin: function () {\r\n return this.evalOrigin;\r\n },\r\n setEvalOrigin: function (v) {\r\n if (v instanceof StackFrame) {\r\n this.evalOrigin = v;\r\n } else if (v instanceof Object) {\r\n this.evalOrigin = new StackFrame(v);\r\n } else {\r\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\r\n }\r\n },\r\n toString: function () {\r\n var functionName = this.getFunctionName() || \"{anonymous}\";\r\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\r\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\r\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\r\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\r\n return functionName + args + fileName + lineNumber + columnNumber;\r\n }\r\n };\r\n StackFrame.fromString = function StackFrame$$fromString(str) {\r\n var argsStartIndex = str.indexOf(\"(\");\r\n var argsEndIndex = str.lastIndexOf(\")\");\r\n var functionName = str.substring(0, argsStartIndex);\r\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\r\n var locationString = str.substring(argsEndIndex + 1);\r\n if (locationString.indexOf(\"@\") === 0) {\r\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\r\n var fileName = parts[1];\r\n var lineNumber = parts[2];\r\n var columnNumber = parts[3];\r\n }\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args || undefined,\r\n fileName: fileName,\r\n lineNumber: lineNumber || undefined,\r\n columnNumber: columnNumber || undefined\r\n });\r\n };\r\n for (var i = 0; i < booleanProps.length; i++) {\r\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\r\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\r\n return function (v) {\r\n this[p] = Boolean(v);\r\n };\r\n }(booleanProps[i]);\r\n }\r\n for (var j = 0; j < numericProps.length; j++) {\r\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\r\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\r\n return function (v) {\r\n if (!_isNumber(v)) {\r\n throw new TypeError(p + \" must be a Number\");\r\n }\r\n this[p] = Number(v);\r\n };\r\n }(numericProps[j]);\r\n }\r\n for (var k = 0; k < stringProps.length; k++) {\r\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\r\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\r\n return function (v) {\r\n this[p] = String(v);\r\n };\r\n }(stringProps[k]);\r\n }\r\n return StackFrame;\r\n })();\r\n\r\n //\r\n // ==== ERROR STACK PARSER ====\r\n //\r\n\r\n var ErrorStackParser = (function () {\r\n \"use strict\";\r\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\r\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\r\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\r\n return {\r\n /**\r\n * Given an Error object, extract the most information from it.\r\n *\r\n * @param {Error} error object\r\n * @return {Array} of StackFrames\r\n */\r\n parse: function ErrorStackParser$$parse(error) {\r\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\r\n return this.parseOpera(error);\r\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\r\n return this.parseV8OrIE(error);\r\n } else if (error.stack) {\r\n return this.parseFFOrSafari(error);\r\n } else {\r\n throw new Error(\"Cannot parse given Error object\");\r\n }\r\n },\r\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\r\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\r\n // Fail-fast but return locations like \"(native)\"\r\n if (urlLike.indexOf(\":\") === -1) {\r\n return [urlLike];\r\n }\r\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\r\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\r\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\r\n },\r\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(CHROME_IE_STACK_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n if (line.indexOf(\"(eval \") > -1) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\r\n }\r\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionName = tokens.join(\" \") || undefined;\r\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: fileName,\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n },\r\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n if (line.indexOf(\" > eval\") > -1) {\r\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\r\n }\r\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\r\n // Safari eval frames only have function names and nothing else\r\n return new StackFrame({\r\n functionName: line\r\n });\r\n } else {\r\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\r\n var matches = line.match(functionNameRegex);\r\n var functionName = matches && matches[1] ? matches[1] : undefined;\r\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }\r\n }, this);\r\n },\r\n parseOpera: function ErrorStackParser$$parseOpera(e) {\r\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\r\n return this.parseOpera9(e);\r\n } else if (!e.stack) {\r\n return this.parseOpera10(e);\r\n } else {\r\n return this.parseOpera11(e);\r\n }\r\n },\r\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\r\n var lines = e.message.split(\"\\n\");\r\n var result = [];\r\n for (var i = 2, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\r\n var lines = e.stacktrace.split(\"\\n\");\r\n var result = [];\r\n for (var i = 0, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n functionName: match[3] || undefined,\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n // Opera 10.65+ Error.stack very similar to FF/Safari\r\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\r\n }, this);\r\n return filtered.map(function (line) {\r\n var tokens = line.split(\"@\");\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionCall = tokens.shift() || \"\";\r\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\r\n var argsRaw;\r\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\r\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\r\n }\r\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n }\r\n };\r\n })();\r\n\r\n //\r\n // ==== STACKTRACE-GPS ====\r\n //\r\n\r\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) {\r\n resolve(req.responseText);\r\n } else {\r\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\r\n }\r\n }\r\n };\r\n req.send();\r\n });\r\n }\r\n /**\r\n * Convert a Base64-encoded string into its original representation.\r\n * Used for inline sourcemaps.\r\n *\r\n * @param {String} b64str Base-64 encoded string\r\n * @returns {String} original representation of the base64-encoded string.\r\n */\r\n function _atob(b64str) {\r\n if (typeof window !== \"undefined\" && window.atob) {\r\n return window.atob(b64str);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\r\n }\r\n }\r\n function _parseJson(string) {\r\n if (typeof JSON !== \"undefined\" && JSON.parse) {\r\n return JSON.parse(string);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\r\n }\r\n }\r\n function _findFunctionName(source, lineNumber) {\r\n var syntaxes = [ // {name} = function ({args}) TODO args capture\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\r\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\r\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\r\n var lines = source.split(\"\\n\");\r\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\r\n var code = \"\";\r\n var maxLines = Math.min(lineNumber, 20);\r\n for (var i = 0; i < maxLines; ++i) {\r\n // lineNo is 1-based, source[] is 0-based\r\n var line = lines[lineNumber - i - 1];\r\n var commentPos = line.indexOf(\"//\");\r\n if (commentPos >= 0) {\r\n line = line.substr(0, commentPos);\r\n }\r\n if (line) {\r\n code = line + code;\r\n var len = syntaxes.length;\r\n for (var index = 0; index < len; index++) {\r\n var m = syntaxes[index].exec(code);\r\n if (m && m[1]) {\r\n return m[1];\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n function _ensureSupportedEnvironment() {\r\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\r\n throw new Error(\"Unable to consume source maps in older browsers\");\r\n }\r\n }\r\n function _ensureStackFrameIsLegit(stackframe) {\r\n if (typeof stackframe !== \"object\") {\r\n throw new TypeError(\"Given StackFrame is not an object\");\r\n } else if (typeof stackframe.fileName !== \"string\") {\r\n throw new TypeError(\"Given file name is not a String\");\r\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\r\n throw new TypeError(\"Given line number must be a positive integer\");\r\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\r\n throw new TypeError(\"Given column number must be a non-negative integer\");\r\n }\r\n return true;\r\n }\r\n function _findSourceMappingURL(source) {\r\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\r\n var lastSourceMappingUrl;\r\n var matchSourceMappingUrl;\r\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\r\n // jshint ignore:line\r\n lastSourceMappingUrl = matchSourceMappingUrl[1];\r\n }\r\n if (lastSourceMappingUrl) {\r\n return lastSourceMappingUrl;\r\n } else {\r\n throw new Error(\"sourceMappingURL not found\");\r\n }\r\n }\r\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\r\n return new Promise(function (resolve, reject) {\r\n var loc = sourceMapConsumer.originalPositionFor({\r\n line: stackframe.lineNumber,\r\n column: stackframe.columnNumber\r\n });\r\n if (loc.source) {\r\n // cache mapped sources\r\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\r\n if (mappedSource) {\r\n sourceCache[loc.source] = mappedSource;\r\n }\r\n resolve(// given stackframe and source location, update stackframe\r\n new StackFrame({\r\n functionName: loc.name || stackframe.functionName,\r\n args: stackframe.args,\r\n fileName: loc.source,\r\n lineNumber: loc.line,\r\n columnNumber: loc.column\r\n }));\r\n } else {\r\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\r\n }\r\n });\r\n }\r\n /**\r\n * @constructor\r\n * @param {Object} opts\r\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\r\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\r\n * opts.offline = True to prevent network requests.\r\n * Best effort without sources or source maps.\r\n * opts.ajax = Promise returning function to make X-Domain requests\r\n */\r\n return function StackTraceGPS(opts) {\r\n if (!(this instanceof StackTraceGPS)) {\r\n return new StackTraceGPS(opts);\r\n }\r\n opts = opts || {};\r\n this.sourceCache = opts.sourceCache || {};\r\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\r\n this.ajax = opts.ajax || _xdr;\r\n this._atob = opts.atob || _atob;\r\n\r\n this._get = function _get(location) {\r\n return new Promise(function (resolve, reject) {\r\n var isDataUrl = location.substr(0, 5) === \"data:\";\r\n if (this.sourceCache[location]) {\r\n resolve(this.sourceCache[location]);\r\n } else if (opts.offline && !isDataUrl) {\r\n reject(new Error(\"Cannot make network requests in offline mode\"));\r\n } else {\r\n if (isDataUrl) {\r\n // data URLs can have parameters.\r\n // see http://tools.ietf.org/html/rfc2397\r\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\r\n var match = location.match(supportedEncodingRegexp);\r\n if (match) {\r\n var sourceMapStart = match[0].length;\r\n var encodedSource = location.substr(sourceMapStart);\r\n var source = this._atob(encodedSource);\r\n this.sourceCache[location] = source;\r\n resolve(source);\r\n } else {\r\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\r\n }\r\n } else {\r\n var xhrPromise = this.ajax(location, {\r\n method: \"get\"\r\n });\r\n // Cache the Promise to prevent duplicate in-flight requests\r\n this.sourceCache[location] = xhrPromise;\r\n xhrPromise.then(resolve, reject);\r\n }\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\r\n * SourceMapConsumer in a per-instance cache.\r\n *\r\n * @param {String} sourceMappingURL = URL to fetch source map from\r\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\r\n * @returns {Promise} that resolves a SourceMapConsumer\r\n */\r\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\r\n return new Promise(function (resolve, reject) {\r\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\r\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\r\n } else {\r\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\r\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\r\n if (typeof sourceMapSource === \"string\") {\r\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\r\n }\r\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\r\n sourceMapSource.sourceRoot = defaultSourceRoot;\r\n }\r\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\r\n }, reject);\r\n }.bind(this));\r\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\r\n resolve(sourceMapConsumerPromise);\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, enhance function name and use source maps for a\r\n * better StackFrame.\r\n *\r\n * @param {StackFrame} stackframe object\r\n * @returns {Promise} that resolves with with source-mapped StackFrame\r\n */\r\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\r\n function resolveMappedStackFrame() {\r\n resolve(mappedStackFrame);\r\n }\r\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\r\n }.bind(this), reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, guess function name from location information.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureStackFrameIsLegit(stackframe);\r\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\r\n var lineNumber = stackframe.lineNumber;\r\n var columnNumber = stackframe.columnNumber;\r\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\r\n // Only replace functionName if we found something\r\n if (guessedFunctionName) {\r\n resolve(new StackFrame({\r\n functionName: guessedFunctionName,\r\n args: stackframe.args,\r\n fileName: stackframe.fileName,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber\r\n }));\r\n } else {\r\n resolve(stackframe);\r\n }\r\n }, reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureSupportedEnvironment();\r\n _ensureStackFrameIsLegit(stackframe);\r\n var sourceCache = this.sourceCache;\r\n var fileName = stackframe.fileName;\r\n this._get(fileName).then(function (source) {\r\n var sourceMappingURL = _findSourceMappingURL(source);\r\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\r\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\r\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\r\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\r\n }\r\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\r\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\r\n resolve(stackframe);\r\n });\r\n });\r\n }.bind(this), reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n };\r\n })(SourceMap, StackFrame);\r\n\r\n //\r\n // Shared Variables\r\n //\r\n\r\n var myScript = null;\r\n var scriptFile = document.getElementsByTagName('script');\r\n \r\n for (var i = 0; i < scriptFile.length; ++i) {\r\n if(isMe(scriptFile[i])) {\r\n myScript = scriptFile[i];\r\n }\r\n }\r\n\r\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\r\n var params = parseQuery(queryString);\r\n var paramsLength = objectLength(params);\r\n\r\n var debugSettings = {\r\n label: ' elmah.io debugger : On ',\r\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\r\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\r\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\r\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\r\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\r\n };\r\n\r\n var defaults = {\r\n apiKey: null,\r\n logId: null,\r\n debug: false,\r\n application: null,\r\n filter: null,\r\n captureConsoleMinimumLevel: 'none',\r\n breadcrumbs: false,\r\n breadcrumbsNumber: 10\r\n };\r\n\r\n var breadcrumbsDelay = 100;\r\n\r\n //\r\n // Shared Methods\r\n //\r\n\r\n var extend = function () {\r\n\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n\r\n // Check if a deep merge\r\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\r\n deep = arguments[0];\r\n i++;\r\n }\r\n\r\n // Merge the object into the extended object\r\n var merge = function (obj) {\r\n for (var prop in obj) {\r\n if (obj.hasOwnProperty(prop)) {\r\n // If property is an object, merge properties\r\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\r\n extended[prop] = extend(extended[prop], obj[prop]);\r\n } else {\r\n extended[prop] = obj[prop];\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Loop through each object and conduct a merge\r\n for (; i < arguments.length; i++) {\r\n var obj = arguments[i];\r\n merge(obj);\r\n }\r\n\r\n return extended;\r\n\r\n };\r\n\r\n //\r\n // Helpers\r\n //\r\n\r\n function isMe(scriptElem){\r\n if(scriptElem.getAttribute('src') != null) {\r\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\r\n }\r\n }\r\n\r\n function parseQuery(query) {\r\n var Params = new Object();\r\n if (!query) return Params; // return empty object\r\n var Pairs = query.split(/[;&]/);\r\n for (var i = 0; i < Pairs.length; i++) {\r\n var KeyVal = Pairs[i].split('=');\r\n if (!KeyVal || KeyVal.length !== 2) continue;\r\n var key = unescape(KeyVal[0]);\r\n var val = unescape(KeyVal[1]);\r\n val = val.replace(/\\+/g, ' ');\r\n Params[key] = val;\r\n }\r\n return Params;\r\n }\r\n\r\n function objectLength(obj) {\r\n var size = 0, key;\r\n for (key in obj) {\r\n if (obj.hasOwnProperty(key)) size++;\r\n }\r\n return size;\r\n };\r\n\r\n function getSearchParameters() {\r\n var prmstr = window.location.search.substr(1);\r\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\r\n }\r\n\r\n function transformToAssocArray(prmstr) {\r\n var params = [];\r\n var prmarr = prmstr.split(\"&\");\r\n for (var i = 0; i < prmarr.length; i++) {\r\n var tmparr = prmarr[i].split(\"=\");\r\n params.push({\r\n 'key': tmparr[0],\r\n 'value': tmparr[1]\r\n });\r\n }\r\n return params;\r\n }\r\n\r\n function merge_objects(obj1, obj2) {\r\n var obj3 = {};\r\n for (var attrname1 in obj1) {\r\n obj3[attrname1] = obj1[attrname1];\r\n }\r\n for (var attrname2 in obj2) {\r\n obj3[attrname2] = obj2[attrname2];\r\n }\r\n\r\n return obj3;\r\n }\r\n\r\n // sprintf-js\r\n var sprintfjs = function() {\r\n 'use strict'\r\n var app = {};\r\n var re = {\r\n not_string: /[^s]/,\r\n not_bool: /[^t]/,\r\n not_type: /[^T]/,\r\n not_primitive: /[^v]/,\r\n number: /[diefg]/,\r\n numeric_arg: /[bcdiefguxX]/,\r\n json: /[j]/,\r\n not_json: /[^j]/,\r\n text: /^[^\\x25]+/,\r\n modulo: /^\\x25{2}/,\r\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\r\n key: /^([a-z_][a-z_\\d]*)/i,\r\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\r\n index_access: /^\\[(\\d+)\\]/,\r\n sign: /^[+-]/,\r\n mod: /^\\x25\\s/,\r\n notplaceholder: /^\\x25?([^b-gijostTuvxX])/\r\n }\r\n\r\n function sprintf(key) {\r\n // `arguments` is not an array, but should be fine for this call\r\n return sprintf_format(sprintf_parse(key), arguments)\r\n }\r\n\r\n function vsprintf(fmt, argv) {\r\n return sprintf.apply(null, [fmt].concat(argv || []))\r\n }\r\n\r\n function sprintf_format(parse_tree, argv) {\r\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign;\r\n for (i = 0; i < tree_length; i++) {\r\n if (typeof parse_tree[i] === 'string') {\r\n output += parse_tree[i]\r\n }\r\n else if (typeof parse_tree[i] === 'object') {\r\n ph = parse_tree[i]; // placeholder\r\n if (ph.keys) { // keyword argument\r\n arg = argv[cursor]\r\n for (k = 0; k < ph.keys.length; k++) {\r\n if (arg == undefined) {\r\n throw new Error(sprintf('[sprintf] Cannot access property \"%s\" of undefined value \"%s\"', ph.keys[k], ph.keys[k-1]))\r\n }\r\n arg = arg[ph.keys[k]]\r\n }\r\n }\r\n else if (ph.param_no) { // positional argument (explicit)\r\n arg = argv[ph.param_no]\r\n }\r\n else { // positional argument (implicit)\r\n arg = argv[cursor++]\r\n }\r\n\r\n if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {\r\n arg = arg()\r\n }\r\n\r\n if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg) && arg === undefined)) { // treat %_d as string if it has no argument\r\n arg = ph.placeholder;\r\n ph.type = \"s\";\r\n }\r\n\r\n if (re.number.test(ph.type)) {\r\n is_positive = typeof arg === \"string\" ? true : arg >= 0\r\n }\r\n\r\n switch (ph.type) {\r\n case 'b':\r\n arg = parseInt(arg, 10).toString(2)\r\n break\r\n case 'c':\r\n arg = String.fromCharCode(parseInt(arg, 10))\r\n break\r\n case 'd':\r\n case 'i':\r\n arg = typeof arg === \"number\" ? parseInt(arg, 10) : NaN\r\n break\r\n case 'j':\r\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\r\n break\r\n case 'e':\r\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\r\n break\r\n case 'f':\r\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\r\n break\r\n case 'g':\r\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\r\n break\r\n case 'o':\r\n arg = (parseInt(arg, 10) >>> 0).toString(8)\r\n break\r\n case 's':\r\n arg = String(arg)\r\n arg = arg === \"undefined\" ? ph.placeholder : (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 't':\r\n arg = String(!!arg)\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'T':\r\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'u':\r\n arg = parseInt(arg, 10) >>> 0\r\n break\r\n case 'v':\r\n arg = arg.valueOf()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'x':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16)\r\n break\r\n case 'X':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\r\n break\r\n }\r\n if (re.json.test(ph.type)) {\r\n output += arg\r\n }\r\n else {\r\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\r\n sign = is_positive ? '+' : '-'\r\n arg = arg.toString().replace(re.sign, '')\r\n }\r\n else {\r\n sign = ''\r\n }\r\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\r\n pad_length = ph.width - (sign + arg).length\r\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\r\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\r\n }\r\n }\r\n }\r\n return output\r\n }\r\n\r\n var sprintf_cache = Object.create(null)\r\n\r\n function sprintf_parse(fmt) {\r\n var _fmt = fmt, match, parse_tree = [], arg_names = 0;\r\n while (_fmt) {\r\n if ((match = re.text.exec(_fmt)) !== null) {\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.modulo.exec(_fmt)) !== null) {\r\n parse_tree.push('%');\r\n }\r\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\r\n if (match[2]) {\r\n arg_names |= 1\r\n var field_list = [], replacement_field = match[2], field_match = []\r\n if ((field_match = re.key.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\r\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n }\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n match[2] = field_list\r\n }\r\n else {\r\n arg_names |= 2\r\n }\r\n if (arg_names === 3) {\r\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\r\n }\r\n\r\n parse_tree.push(\r\n {\r\n placeholder: match[0],\r\n param_no: match[1],\r\n keys: match[2],\r\n sign: match[3],\r\n pad_char: match[4],\r\n align: match[5],\r\n width: match[6],\r\n precision: match[7],\r\n type: match[8]\r\n }\r\n )\r\n }\r\n else if ((match = re.mod.exec(_fmt)) !== null) { // treat %_SPACE as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.notplaceholder.exec(_fmt)) !== null) { // treat %_NOTPLACEHOLDER as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] unexpected placeholder')\r\n }\r\n _fmt = _fmt.substring(match[0].length)\r\n }\r\n return parse_tree\r\n }\r\n\r\n app.sprintf = sprintf;\r\n app.vsprintf = vsprintf;\r\n return app;\r\n }\r\n\r\n function isString(what) {\r\n return Object.prototype.toString.call(what) === '[object String]';\r\n }\r\n\r\n function cssSelectorString(elem) {\r\n var MAX_TRAVERSE_HEIGHT = 5,\r\n MAX_OUTPUT_LEN = 80,\r\n out = [],\r\n height = 0,\r\n len = 0,\r\n separator = ' > ',\r\n sepLength = separator.length,\r\n nextStr;\r\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\r\n nextStr = htmlElementAsString(elem);\r\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\r\n break;\r\n }\r\n out.push(nextStr);\r\n len += nextStr.length;\r\n elem = elem.parentNode;\r\n }\r\n return out.reverse().join(separator);\r\n }\r\n \r\n function htmlElementAsString(elem) {\r\n var out = [], className, classes, key, attr, i;\r\n if (!elem || !elem.tagName) {\r\n return '';\r\n }\r\n out.push(elem.tagName.toLowerCase());\r\n if (elem.id) {\r\n out.push('#' + elem.id);\r\n }\r\n className = elem.className;\r\n if (className && isString(className)) {\r\n classes = className.split(/\\s+/);\r\n for (i = 0; i < classes.length; i++) {\r\n out.push('.' + classes[i]);\r\n }\r\n }\r\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\r\n for (i = 0; i < attrWhitelist.length; i++) {\r\n key = attrWhitelist[i];\r\n attr = elem.getAttribute(key);\r\n if (attr) {\r\n out.push('[' + key + '=\"' + attr + '\"]');\r\n }\r\n }\r\n return out.join('');\r\n }\r\n\r\n var parseHash = function(url) {\r\n return url.split('#')[1] || '';\r\n };\r\n\r\n //\r\n // Constructor\r\n //\r\n\r\n var Constructor = function (options) {\r\n\r\n //\r\n // Variables\r\n //\r\n\r\n var publicAPIs = {};\r\n var settings;\r\n var breadcrumbs = [];\r\n var lastHref = window.location && window.location.href;\r\n\r\n function getPayload() {\r\n var payload = {\r\n \"url\": document.location.pathname || '/',\r\n \"application\": settings.application\r\n };\r\n\r\n var payload_data = [];\r\n\r\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\r\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 });\r\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 });\r\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] });\r\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\r\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\r\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\r\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\r\n\r\n payload.data = payload_data;\r\n\r\n var payload_serverVariables = [];\r\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\r\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\r\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\r\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\r\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\r\n\r\n payload.serverVariables = payload_serverVariables;\r\n\r\n return payload;\r\n }\r\n\r\n function confirmResponse(status, response) {\r\n if (settings.debug) {\r\n if (status === 'error') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n } else if (status === 'success') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\r\n } else {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n }\r\n }\r\n }\r\n\r\n function stackGPS(error, xhr, jsonData) {\r\n \tvar errorStack = error.toString().split(\"\\n\")[0];\r\n \tvar gps = new StackTraceGPS();\r\n var promise = new Promise(function(resolve) {\r\n\t var stackframes = ErrorStackParser.parse(error);\r\n\t resolve(Promise.all(stackframes.map(function(sf) {\r\n\t return new Promise(function(resolve) {\r\n\t function resolveOriginal() {\r\n\t resolve(sf);\r\n\t }\r\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\r\n\t });\r\n\t })));\t\r\n });\r\n\r\n promise.then(function(newFrames){\r\n \tnewFrames.forEach(function(stackFrame, i){\r\n\t\t\t\t\tif(stackFrame.functionName) {\r\n \t\t\tvar fn = stackFrame.functionName + ' ';\r\n \t\t} else {\r\n \t\t\tvar fn = '';\r\n \t\t}\r\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\r\n \t\tnewFrames[i] = stackString;\r\n \t});\r\n \tnewFrames.unshift(errorStack);\r\n \tjsonData.detail = newFrames.join(\"\\n\");\r\n \txhr.send(JSON.stringify(jsonData));\r\n });\r\n }\r\n\r\n function stackString(error) {\r\n \tvar typeOF = typeof error.error;\r\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\r\n }\r\n\r\n function manipulateStack (errorStack, severity, message) {\r\n var stack = [];\r\n for (var i = 0; i < errorStack.length; i++) {\r\n if(errorStack[i] === \"Error\") {\r\n stack.push(severity + \": \" + message);\r\n }\r\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\r\n stack.push(errorStack[i]);\r\n }\r\n }\r\n return stack.join('\\n');\r\n }\r\n\r\n // Private methods\r\n\r\n var recordBreadcrumb = function(obj) {\r\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\r\n breadcrumbs_number = 10;\r\n \r\n breadcrumbs.push(crumb);\r\n \r\n if(options.breadcrumbsNumber && typeof options.breadcrumbsNumber === \"number\" ) {\r\n if(options.breadcrumbsNumber > 25) {\r\n breadcrumbs_number = 25;\r\n } else if(options.breadcrumbsNumber >= 10 && options.breadcrumbsNumber <= 25) {\r\n breadcrumbs_number = options.breadcrumbsNumber;\r\n }\r\n }\r\n \r\n if (breadcrumbs.length >= breadcrumbs_number) {\r\n breadcrumbs.shift();\r\n }\r\n }\r\n\r\n var breadcrumbClickEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Click\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbFormSubmitEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Form submit\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbWindowEventHandler = function(evt) {\r\n var type = evt.type,\r\n message = null;\r\n\r\n switch (type) {\r\n case \"load\":\r\n message = \"Page loaded\"; break;\r\n case \"DOMContentLoaded\":\r\n message = \"DOMContentLoaded\"; break;\r\n case \"pageshow\":\r\n message = \"Page shown\"; break;\r\n case \"pagehide\":\r\n message = \"Page hidden\"; break;\r\n case \"popstate\":\r\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": message\r\n });\r\n }\r\n\r\n var breadcrumbHashChangeEventHandler = function(evt) {\r\n var oldURL = evt.oldURL,\r\n newURL = evt.newURL,\r\n from = null,\r\n to = null,\r\n message = null;\r\n\r\n if (oldURL && newURL) {\r\n from = parseHash(oldURL);\r\n to = parseHash(newURL);\r\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\r\n } else {\r\n to = location.hash;\r\n message = \"to: '\" + to + \"'\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": \"Hash changed \" + message\r\n });\r\n }\r\n\r\n var breadcrumbXHRHandler = function(evt, method, url) {\r\n var status = evt && evt.target ? evt.target.status : 0,\r\n severity = null,\r\n method = method.toUpperCase(),\r\n url = url,\r\n regex = /https:\\/\\/api.elmah.io/g;\r\n\r\n if(url.match(regex) == null) { \r\n if (status > 0 && status < 400) {\r\n severity = \"Information\";\r\n } else if (status > 399 && status < 500) {\r\n severity = \"Warning\";\r\n } else if (status >= 500) {\r\n severity = \"Error\";\r\n }\r\n\r\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\r\n\r\n recordBreadcrumb({\r\n \"severity\": severity,\r\n \"action\": \"Request\",\r\n \"message\": \"[\" + method + \"] \" + url + statusCode\r\n });\r\n }\r\n }\r\n\r\n var sendPayload = function (apiKey, logId, callback, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n error = errorLog,\r\n send = 1,\r\n queryParams = getSearchParameters(),\r\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\r\n\r\n // Ignoring error from an external script\r\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\r\n\t\t\t if (settings.debug) {\r\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\r\n\t\t\t }\r\n\t\t\t return;\r\n\t\t\t}\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"detail\": error.error ? error.error.stack : null,\r\n \"title\": error.message || 'Unspecified error',\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"severity\": \"Error\",\r\n \"type\": error.error ? error.error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Check if error sent is a string and not an object\r\n // Then create the articifial stacktrace and pass source & type of the error\r\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\r\n \tvar typeOF = typeof errorLog.error;\r\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \tjsonData.detail = stackString(errorLog);\r\n \tjsonData.source = errorLog.source;\r\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\r\n }\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n \t// send message trying to pinpoint stackframes\r\n \tstackGPS(error.error, xhr, jsonData);\r\n\t } else {\r\n\t \t// send message\r\n \txhr.send(JSON.stringify(jsonData));\r\n\t }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n type = logType,\r\n error = errorLog,\r\n message = messageLog,\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n if (type !== \"Log\") {\r\n\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": type,\r\n \"type\": error ? error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n } else {\r\n\r\n var jsonData = error;\r\n \r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n // If message contains breadcrumbs\r\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\r\n breadcrumbs = breadcrumbs.reverse();\r\n for (var i = 0; i < breadcrumbs.length; i++) {\r\n // Add breadcrumbs to jsonData object\r\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\r\n }\r\n } else {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n }\r\n \r\n // Reset breadcrumbs\r\n breadcrumbs = [];\r\n }\r\n\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n // send message trying to pinpoint stackframes\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n // send message\r\n if(jsonData.errorObject) {\r\n error = jsonData.errorObject;\r\n delete jsonData.errorObject;\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n xhr.send(JSON.stringify(jsonData));\r\n }\r\n }\r\n\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n message = errorLog.message,\r\n messageTemplate = errorLog.message,\r\n type = logType,\r\n args = Object.values(errorLog.arguments),\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n // If message has placeholders (%s or %d), check for arguments and replace them\r\n \tif(String(message).match(/(%d|%s)+/ig) && args.length > 1) {\r\n \t\tvar sprintfJS = new sprintfjs();\r\n // Remove the first argument from array, which represents the message\r\n \t\targs.shift();\r\n message = sprintfJS.vsprintf(message, args);\r\n }\r\n\r\n if(typeof message !== \"string\"){\r\n message = message.toString();\r\n }\r\n\r\n if(typeof messageTemplate !== \"string\") {\r\n messageTemplate = messageTemplate.toString();\r\n }\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"titleTemplate\": messageTemplate,\r\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\r\n \"severity\": type,\r\n \"type\": null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n // send message\r\n xhr.send(JSON.stringify(jsonData));\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPrefilledLogMessage = function(errorLog) {\r\n // without error object\r\n if(!errorLog) return getPayload();\r\n\r\n // with error object\r\n var error = errorLog;\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n var jsonData = {\r\n \"title\": error.message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": \"Error\",\r\n \"type\": error ? error.name : null,\r\n \"errorObject\": error\r\n };\r\n\r\n jsonData = merge_objects(jsonData, getPayload());\r\n \r\n return jsonData;\r\n };\r\n\r\n // Some public methods\r\n\r\n publicAPIs.error = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.verbose = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.debug = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.information = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.warning = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.fatal = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.log = function (obj) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.message = function(error) {\r\n return sendPrefilledLogMessage(error);\r\n };\r\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\r\n recordBreadcrumb({\r\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\r\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\r\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\r\n });\r\n };\r\n\r\n publicAPIs.on = function (name, callback, ctx) {\r\n var e = this.e || (this.e = {});\r\n\r\n (e[name] || (e[name] = [])).push({\r\n fn: callback,\r\n ctx: ctx\r\n });\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.emit = function (name) {\r\n var data = [].slice.call(arguments, 1);\r\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\r\n var i = 0;\r\n var len = evtArr.length;\r\n\r\n for (i; i < len; i++) {\r\n evtArr[i].fn.apply(evtArr[i].ctx, data);\r\n }\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.init = function (options) {\r\n\r\n // -- Merge options into defaults\r\n settings = extend(defaults, options || {});\r\n\r\n // -- Breadcrumbs\r\n if (settings.breadcrumbs) {\r\n // Breadcrumbs - Click & Submit form\r\n if (document.addEventListener) {\r\n document.addEventListener('click', breadcrumbClickEventHandler, false);\r\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\r\n } else if (document.attachEvent) {\r\n document.attachEvent('click', breadcrumbClickEventHandler, false);\r\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\r\n }\r\n\r\n // Breadcrumbs - Navigation\r\n if (window.addEventListener) {\r\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\r\n } else if (window.attachEvent) {\r\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\r\n }\r\n\r\n if(window.history && window.history.pushState && window.history.replaceState) {\r\n var old_onpopstate = window.onpopstate;\r\n window.onpopstate = function(evt) {\r\n breadcrumbWindowEventHandler(evt);\r\n if (old_onpopstate) {\r\n return old_onpopstate.apply(this, arguments);\r\n }\r\n };\r\n }\r\n\r\n // Breadcrumbs - XHR\r\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\r\n // Store a reference to the native method\r\n var open = XMLHttpRequest.prototype.open;\r\n \r\n // Overwrite the native method\r\n XMLHttpRequest.prototype.open = function(method, url) {\r\n // Assign an event listener\r\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\r\n // Call the stored reference to the native method\r\n open.apply(this, arguments);\r\n };\r\n }\r\n }\r\n\r\n // -- Log on window error\r\n window.onerror = function (message, source, lineno, colno, error) {\r\n var errorLog = {\r\n 'message': message,\r\n 'source': source,\r\n 'lineno': lineno,\r\n 'colno': colno,\r\n 'error': error\r\n }\r\n \r\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n\r\n return false;\r\n }\r\n\r\n // -- Overriding console methods\r\n // -- Then log messages into the app.elmah.io\r\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\r\n\r\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console errors\r\n var _error = console.error;\r\n console.error = function(errMessage){\r\n var errorLog = {\r\n \t\t'message': errMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _error.apply(console, arguments);\r\n };\r\n if(options.captureConsoleMinimumLevel !== \"error\") {\r\n // Log console warnings\r\n var _warning = console.warn;\r\n console.warn = function(warnMessage){\r\n var errorLog = {\r\n 'message': warnMessage,\r\n 'arguments': arguments\r\n }\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _warning.apply(console, arguments);\r\n };\r\n }\r\n }\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console info\r\n var _info = console.info;\r\n console.info = function(infoMessage){\r\n var errorLog = {\r\n \t\t'message': infoMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _info.apply(console, arguments);\r\n };\r\n }\r\n if(options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console debug\r\n var _debug = console.debug;\r\n console.debug = function(debugMessage){\r\n var errorLog = {\r\n \t\t'message': debugMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _debug.apply(console, arguments);\r\n };\r\n }\r\n }\r\n };\r\n\r\n // Initialize the plugin\r\n publicAPIs.init(options);\r\n\r\n if (settings.debug) {\r\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\r\n }\r\n\r\n // Return the public APIs\r\n return publicAPIs;\r\n\r\n };\r\n\r\n\r\n //\r\n // Return the constructor\r\n //\r\n\r\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n // Immediately-Invoked Function Expression (IIFE)\r\n return new Constructor;\r\n } else {\r\n // UMD Constructor\r\n return Constructor;\r\n }\r\n\r\n});"],"file":"elmahio.js"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["elmahio.js"],"sourcesContent":["/*!\r\n * elmah.io Javascript Logger - version 3.6.0\r\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define([], function () {\r\n return factory(root);\r\n });\r\n } else if (typeof exports === 'object') {\r\n module.exports = factory(root);\r\n } else {\r\n root.Elmahio = factory(root);\r\n }\r\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\r\n\r\n 'use strict';\r\n\r\n //\r\n // ==== STACKFRAME ====\r\n //\r\n\r\n var StackFrame = (function () {\r\n \"use strict\";\r\n function _isNumber(n) {\r\n return !isNaN(parseFloat(n)) && isFinite(n);\r\n }\r\n function _capitalize(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n }\r\n function _getter(p) {\r\n return function () {\r\n return this[p];\r\n };\r\n }\r\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\r\n var numericProps = [\"columnNumber\", \"lineNumber\"];\r\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\r\n var arrayProps = [\"args\"];\r\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\r\n function StackFrame(obj) {\r\n if (obj instanceof Object) {\r\n for (var i = 0; i < props.length; i++) {\r\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\r\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\r\n }\r\n }\r\n }\r\n }\r\n StackFrame.prototype = {\r\n getArgs: function () {\r\n return this.args;\r\n },\r\n setArgs: function (v) {\r\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\r\n throw new TypeError(\"Args must be an Array\");\r\n }\r\n this.args = v;\r\n },\r\n getEvalOrigin: function () {\r\n return this.evalOrigin;\r\n },\r\n setEvalOrigin: function (v) {\r\n if (v instanceof StackFrame) {\r\n this.evalOrigin = v;\r\n } else if (v instanceof Object) {\r\n this.evalOrigin = new StackFrame(v);\r\n } else {\r\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\r\n }\r\n },\r\n toString: function () {\r\n var functionName = this.getFunctionName() || \"{anonymous}\";\r\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\r\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\r\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\r\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\r\n return functionName + args + fileName + lineNumber + columnNumber;\r\n }\r\n };\r\n StackFrame.fromString = function StackFrame$$fromString(str) {\r\n var argsStartIndex = str.indexOf(\"(\");\r\n var argsEndIndex = str.lastIndexOf(\")\");\r\n var functionName = str.substring(0, argsStartIndex);\r\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\r\n var locationString = str.substring(argsEndIndex + 1);\r\n if (locationString.indexOf(\"@\") === 0) {\r\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\r\n var fileName = parts[1];\r\n var lineNumber = parts[2];\r\n var columnNumber = parts[3];\r\n }\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args || undefined,\r\n fileName: fileName,\r\n lineNumber: lineNumber || undefined,\r\n columnNumber: columnNumber || undefined\r\n });\r\n };\r\n for (var i = 0; i < booleanProps.length; i++) {\r\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\r\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\r\n return function (v) {\r\n this[p] = Boolean(v);\r\n };\r\n }(booleanProps[i]);\r\n }\r\n for (var j = 0; j < numericProps.length; j++) {\r\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\r\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\r\n return function (v) {\r\n if (!_isNumber(v)) {\r\n throw new TypeError(p + \" must be a Number\");\r\n }\r\n this[p] = Number(v);\r\n };\r\n }(numericProps[j]);\r\n }\r\n for (var k = 0; k < stringProps.length; k++) {\r\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\r\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\r\n return function (v) {\r\n this[p] = String(v);\r\n };\r\n }(stringProps[k]);\r\n }\r\n return StackFrame;\r\n })();\r\n\r\n //\r\n // ==== ERROR STACK PARSER ====\r\n //\r\n\r\n var ErrorStackParser = (function () {\r\n \"use strict\";\r\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\r\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\r\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\r\n return {\r\n /**\r\n * Given an Error object, extract the most information from it.\r\n *\r\n * @param {Error} error object\r\n * @return {Array} of StackFrames\r\n */\r\n parse: function ErrorStackParser$$parse(error) {\r\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\r\n return this.parseOpera(error);\r\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\r\n return this.parseV8OrIE(error);\r\n } else if (error.stack) {\r\n return this.parseFFOrSafari(error);\r\n } else {\r\n throw new Error(\"Cannot parse given Error object\");\r\n }\r\n },\r\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\r\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\r\n // Fail-fast but return locations like \"(native)\"\r\n if (urlLike.indexOf(\":\") === -1) {\r\n return [urlLike];\r\n }\r\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\r\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\r\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\r\n },\r\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(CHROME_IE_STACK_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n if (line.indexOf(\"(eval \") > -1) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\r\n }\r\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionName = tokens.join(\" \") || undefined;\r\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: fileName,\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n },\r\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n if (line.indexOf(\" > eval\") > -1) {\r\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\r\n }\r\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\r\n // Safari eval frames only have function names and nothing else\r\n return new StackFrame({\r\n functionName: line\r\n });\r\n } else {\r\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\r\n var matches = line.match(functionNameRegex);\r\n var functionName = matches && matches[1] ? matches[1] : undefined;\r\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }\r\n }, this);\r\n },\r\n parseOpera: function ErrorStackParser$$parseOpera(e) {\r\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\r\n return this.parseOpera9(e);\r\n } else if (!e.stack) {\r\n return this.parseOpera10(e);\r\n } else {\r\n return this.parseOpera11(e);\r\n }\r\n },\r\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\r\n var lines = e.message.split(\"\\n\");\r\n var result = [];\r\n for (var i = 2, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\r\n var lines = e.stacktrace.split(\"\\n\");\r\n var result = [];\r\n for (var i = 0, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n functionName: match[3] || undefined,\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n // Opera 10.65+ Error.stack very similar to FF/Safari\r\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\r\n }, this);\r\n return filtered.map(function (line) {\r\n var tokens = line.split(\"@\");\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionCall = tokens.shift() || \"\";\r\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\r\n var argsRaw;\r\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\r\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\r\n }\r\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n }\r\n };\r\n })();\r\n\r\n //\r\n // ==== STACKTRACE-GPS ====\r\n //\r\n\r\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) {\r\n resolve(req.responseText);\r\n } else {\r\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\r\n }\r\n }\r\n };\r\n req.send();\r\n });\r\n }\r\n /**\r\n * Convert a Base64-encoded string into its original representation.\r\n * Used for inline sourcemaps.\r\n *\r\n * @param {String} b64str Base-64 encoded string\r\n * @returns {String} original representation of the base64-encoded string.\r\n */\r\n function _atob(b64str) {\r\n if (typeof window !== \"undefined\" && window.atob) {\r\n return window.atob(b64str);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\r\n }\r\n }\r\n function _parseJson(string) {\r\n if (typeof JSON !== \"undefined\" && JSON.parse) {\r\n return JSON.parse(string);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\r\n }\r\n }\r\n function _findFunctionName(source, lineNumber) {\r\n var syntaxes = [ // {name} = function ({args}) TODO args capture\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\r\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\r\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\r\n var lines = source.split(\"\\n\");\r\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\r\n var code = \"\";\r\n var maxLines = Math.min(lineNumber, 20);\r\n for (var i = 0; i < maxLines; ++i) {\r\n // lineNo is 1-based, source[] is 0-based\r\n var line = lines[lineNumber - i - 1];\r\n var commentPos = line.indexOf(\"//\");\r\n if (commentPos >= 0) {\r\n line = line.substr(0, commentPos);\r\n }\r\n if (line) {\r\n code = line + code;\r\n var len = syntaxes.length;\r\n for (var index = 0; index < len; index++) {\r\n var m = syntaxes[index].exec(code);\r\n if (m && m[1]) {\r\n return m[1];\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n function _ensureSupportedEnvironment() {\r\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\r\n throw new Error(\"Unable to consume source maps in older browsers\");\r\n }\r\n }\r\n function _ensureStackFrameIsLegit(stackframe) {\r\n if (typeof stackframe !== \"object\") {\r\n throw new TypeError(\"Given StackFrame is not an object\");\r\n } else if (typeof stackframe.fileName !== \"string\") {\r\n throw new TypeError(\"Given file name is not a String\");\r\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\r\n throw new TypeError(\"Given line number must be a positive integer\");\r\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\r\n throw new TypeError(\"Given column number must be a non-negative integer\");\r\n }\r\n return true;\r\n }\r\n function _findSourceMappingURL(source) {\r\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\r\n var lastSourceMappingUrl;\r\n var matchSourceMappingUrl;\r\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\r\n // jshint ignore:line\r\n lastSourceMappingUrl = matchSourceMappingUrl[1];\r\n }\r\n if (lastSourceMappingUrl) {\r\n return lastSourceMappingUrl;\r\n } else {\r\n throw new Error(\"sourceMappingURL not found\");\r\n }\r\n }\r\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\r\n return new Promise(function (resolve, reject) {\r\n var loc = sourceMapConsumer.originalPositionFor({\r\n line: stackframe.lineNumber,\r\n column: stackframe.columnNumber\r\n });\r\n if (loc.source) {\r\n // cache mapped sources\r\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\r\n if (mappedSource) {\r\n sourceCache[loc.source] = mappedSource;\r\n }\r\n resolve(// given stackframe and source location, update stackframe\r\n new StackFrame({\r\n functionName: loc.name || stackframe.functionName,\r\n args: stackframe.args,\r\n fileName: loc.source,\r\n lineNumber: loc.line,\r\n columnNumber: loc.column\r\n }));\r\n } else {\r\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\r\n }\r\n });\r\n }\r\n /**\r\n * @constructor\r\n * @param {Object} opts\r\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\r\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\r\n * opts.offline = True to prevent network requests.\r\n * Best effort without sources or source maps.\r\n * opts.ajax = Promise returning function to make X-Domain requests\r\n */\r\n return function StackTraceGPS(opts) {\r\n if (!(this instanceof StackTraceGPS)) {\r\n return new StackTraceGPS(opts);\r\n }\r\n opts = opts || {};\r\n this.sourceCache = opts.sourceCache || {};\r\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\r\n this.ajax = opts.ajax || _xdr;\r\n this._atob = opts.atob || _atob;\r\n\r\n this._get = function _get(location) {\r\n return new Promise(function (resolve, reject) {\r\n var isDataUrl = location.substr(0, 5) === \"data:\";\r\n if (this.sourceCache[location]) {\r\n resolve(this.sourceCache[location]);\r\n } else if (opts.offline && !isDataUrl) {\r\n reject(new Error(\"Cannot make network requests in offline mode\"));\r\n } else {\r\n if (isDataUrl) {\r\n // data URLs can have parameters.\r\n // see http://tools.ietf.org/html/rfc2397\r\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\r\n var match = location.match(supportedEncodingRegexp);\r\n if (match) {\r\n var sourceMapStart = match[0].length;\r\n var encodedSource = location.substr(sourceMapStart);\r\n var source = this._atob(encodedSource);\r\n this.sourceCache[location] = source;\r\n resolve(source);\r\n } else {\r\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\r\n }\r\n } else {\r\n var xhrPromise = this.ajax(location, {\r\n method: \"get\"\r\n });\r\n // Cache the Promise to prevent duplicate in-flight requests\r\n this.sourceCache[location] = xhrPromise;\r\n xhrPromise.then(resolve, reject);\r\n }\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\r\n * SourceMapConsumer in a per-instance cache.\r\n *\r\n * @param {String} sourceMappingURL = URL to fetch source map from\r\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\r\n * @returns {Promise} that resolves a SourceMapConsumer\r\n */\r\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\r\n return new Promise(function (resolve, reject) {\r\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\r\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\r\n } else {\r\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\r\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\r\n if (typeof sourceMapSource === \"string\") {\r\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\r\n }\r\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\r\n sourceMapSource.sourceRoot = defaultSourceRoot;\r\n }\r\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\r\n }, reject);\r\n }.bind(this));\r\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\r\n resolve(sourceMapConsumerPromise);\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, enhance function name and use source maps for a\r\n * better StackFrame.\r\n *\r\n * @param {StackFrame} stackframe object\r\n * @returns {Promise} that resolves with with source-mapped StackFrame\r\n */\r\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\r\n function resolveMappedStackFrame() {\r\n resolve(mappedStackFrame);\r\n }\r\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\r\n }.bind(this), reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, guess function name from location information.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureStackFrameIsLegit(stackframe);\r\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\r\n var lineNumber = stackframe.lineNumber;\r\n var columnNumber = stackframe.columnNumber;\r\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\r\n // Only replace functionName if we found something\r\n if (guessedFunctionName) {\r\n resolve(new StackFrame({\r\n functionName: guessedFunctionName,\r\n args: stackframe.args,\r\n fileName: stackframe.fileName,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber\r\n }));\r\n } else {\r\n resolve(stackframe);\r\n }\r\n }, reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureSupportedEnvironment();\r\n _ensureStackFrameIsLegit(stackframe);\r\n var sourceCache = this.sourceCache;\r\n var fileName = stackframe.fileName;\r\n this._get(fileName).then(function (source) {\r\n var sourceMappingURL = _findSourceMappingURL(source);\r\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\r\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\r\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\r\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\r\n }\r\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\r\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\r\n resolve(stackframe);\r\n });\r\n });\r\n }.bind(this), reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n };\r\n })(SourceMap, StackFrame);\r\n\r\n //\r\n // Shared Variables\r\n //\r\n\r\n var myScript = null;\r\n var scriptFile = document.getElementsByTagName('script');\r\n \r\n for (var i = 0; i < scriptFile.length; ++i) {\r\n if(isMe(scriptFile[i])) {\r\n myScript = scriptFile[i];\r\n }\r\n }\r\n\r\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\r\n var params = parseQuery(queryString);\r\n var paramsLength = objectLength(params);\r\n\r\n var debugSettings = {\r\n label: ' elmah.io debugger : On ',\r\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\r\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\r\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\r\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\r\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\r\n };\r\n\r\n var defaults = {\r\n apiKey: null,\r\n logId: null,\r\n debug: false,\r\n application: null,\r\n filter: null,\r\n captureConsoleMinimumLevel: 'none',\r\n breadcrumbs: false,\r\n breadcrumbsNumber: 10\r\n };\r\n\r\n var breadcrumbsDelay = 100;\r\n\r\n //\r\n // Shared Methods\r\n //\r\n\r\n var extend = function () {\r\n\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n\r\n // Check if a deep merge\r\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\r\n deep = arguments[0];\r\n i++;\r\n }\r\n\r\n // Merge the object into the extended object\r\n var merge = function (obj) {\r\n for (var prop in obj) {\r\n if (obj.hasOwnProperty(prop)) {\r\n // If property is an object, merge properties\r\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\r\n extended[prop] = extend(extended[prop], obj[prop]);\r\n } else {\r\n extended[prop] = obj[prop];\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Loop through each object and conduct a merge\r\n for (; i < arguments.length; i++) {\r\n var obj = arguments[i];\r\n merge(obj);\r\n }\r\n\r\n return extended;\r\n\r\n };\r\n\r\n //\r\n // Helpers\r\n //\r\n\r\n function isMe(scriptElem){\r\n if(scriptElem.getAttribute('src') != null) {\r\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\r\n }\r\n }\r\n\r\n function parseQuery(query) {\r\n var Params = new Object();\r\n if (!query) return Params; // return empty object\r\n var Pairs = query.split(/[;&]/);\r\n for (var i = 0; i < Pairs.length; i++) {\r\n var KeyVal = Pairs[i].split('=');\r\n if (!KeyVal || KeyVal.length !== 2) continue;\r\n var key = unescape(KeyVal[0]);\r\n var val = unescape(KeyVal[1]);\r\n val = val.replace(/\\+/g, ' ');\r\n Params[key] = val;\r\n }\r\n return Params;\r\n }\r\n\r\n function objectLength(obj) {\r\n var size = 0, key;\r\n for (key in obj) {\r\n if (obj.hasOwnProperty(key)) size++;\r\n }\r\n return size;\r\n };\r\n\r\n function getSearchParameters() {\r\n var prmstr = window.location.search.substr(1);\r\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\r\n }\r\n\r\n function transformToAssocArray(prmstr) {\r\n var params = [];\r\n var prmarr = prmstr.split(\"&\");\r\n for (var i = 0; i < prmarr.length; i++) {\r\n var tmparr = prmarr[i].split(\"=\");\r\n params.push({\r\n 'key': tmparr[0],\r\n 'value': tmparr[1]\r\n });\r\n }\r\n return params;\r\n }\r\n\r\n function merge_objects(obj1, obj2) {\r\n var obj3 = {};\r\n for (var attrname1 in obj1) {\r\n obj3[attrname1] = obj1[attrname1];\r\n }\r\n for (var attrname2 in obj2) {\r\n obj3[attrname2] = obj2[attrname2];\r\n }\r\n\r\n return obj3;\r\n }\r\n\r\n // sprintf-js\r\n var sprintfjs = function() {\r\n 'use strict'\r\n var app = {};\r\n var re = {\r\n not_string: /[^s]/,\r\n not_bool: /[^t]/,\r\n not_type: /[^T]/,\r\n not_primitive: /[^v]/,\r\n number: /[diefg]/,\r\n numeric_arg: /[bcdiefguxX]/,\r\n json: /[j]/,\r\n not_json: /[^j]/,\r\n text: /^[^\\x25]+/,\r\n modulo: /^\\x25{2}/,\r\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\r\n key: /^([a-z_][a-z_\\d]*)/i,\r\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\r\n index_access: /^\\[(\\d+)\\]/,\r\n sign: /^[+-]/,\r\n mod: /^\\x25\\s/,\r\n notplaceholder: /^\\x25?([^b-gijostTuvxX])/\r\n }\r\n\r\n function sprintf(key) {\r\n // `arguments` is not an array, but should be fine for this call\r\n return sprintf_format(sprintf_parse(key), arguments)\r\n }\r\n\r\n function vsprintf(fmt, argv) {\r\n return sprintf.apply(null, [fmt].concat(argv || []))\r\n }\r\n\r\n function sprintf_format(parse_tree, argv) {\r\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign;\r\n for (i = 0; i < tree_length; i++) {\r\n if (typeof parse_tree[i] === 'string') {\r\n output += parse_tree[i]\r\n }\r\n else if (typeof parse_tree[i] === 'object') {\r\n ph = parse_tree[i]; // placeholder\r\n if (ph.keys) { // keyword argument\r\n arg = argv[cursor]\r\n for (k = 0; k < ph.keys.length; k++) {\r\n if (arg == undefined) {\r\n throw new Error(sprintf('[sprintf] Cannot access property \"%s\" of undefined value \"%s\"', ph.keys[k], ph.keys[k-1]))\r\n }\r\n arg = arg[ph.keys[k]]\r\n }\r\n }\r\n else if (ph.param_no) { // positional argument (explicit)\r\n arg = argv[ph.param_no]\r\n }\r\n else { // positional argument (implicit)\r\n arg = argv[cursor++]\r\n }\r\n\r\n if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {\r\n arg = arg()\r\n }\r\n\r\n if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg) && arg === undefined)) { // treat %_d as string if it has no argument\r\n arg = ph.placeholder;\r\n ph.type = \"s\";\r\n }\r\n\r\n if (re.number.test(ph.type)) {\r\n is_positive = typeof arg === \"string\" ? true : arg >= 0\r\n }\r\n\r\n switch (ph.type) {\r\n case 'b':\r\n arg = parseInt(arg, 10).toString(2)\r\n break\r\n case 'c':\r\n arg = String.fromCharCode(parseInt(arg, 10))\r\n break\r\n case 'd':\r\n case 'i':\r\n arg = typeof arg === \"number\" ? parseInt(arg, 10) : NaN\r\n break\r\n case 'j':\r\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\r\n break\r\n case 'e':\r\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\r\n break\r\n case 'f':\r\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\r\n break\r\n case 'g':\r\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\r\n break\r\n case 'o':\r\n arg = (parseInt(arg, 10) >>> 0).toString(8)\r\n break\r\n case 's':\r\n arg = String(arg)\r\n arg = arg === \"undefined\" ? ph.placeholder : (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 't':\r\n arg = String(!!arg)\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'T':\r\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'u':\r\n arg = parseInt(arg, 10) >>> 0\r\n break\r\n case 'v':\r\n arg = arg.valueOf()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'x':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16)\r\n break\r\n case 'X':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\r\n break\r\n }\r\n if (re.json.test(ph.type)) {\r\n output += arg\r\n }\r\n else {\r\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\r\n sign = is_positive ? '+' : '-'\r\n arg = arg.toString().replace(re.sign, '')\r\n }\r\n else {\r\n sign = ''\r\n }\r\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\r\n pad_length = ph.width - (sign + arg).length\r\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\r\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\r\n }\r\n }\r\n }\r\n return output\r\n }\r\n\r\n var sprintf_cache = Object.create(null)\r\n\r\n function sprintf_parse(fmt) {\r\n var _fmt = fmt, match, parse_tree = [], arg_names = 0;\r\n while (_fmt) {\r\n if ((match = re.text.exec(_fmt)) !== null) {\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.modulo.exec(_fmt)) !== null) {\r\n parse_tree.push('%');\r\n }\r\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\r\n if (match[2]) {\r\n arg_names |= 1\r\n var field_list = [], replacement_field = match[2], field_match = []\r\n if ((field_match = re.key.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\r\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n }\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n match[2] = field_list\r\n }\r\n else {\r\n arg_names |= 2\r\n }\r\n if (arg_names === 3) {\r\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\r\n }\r\n\r\n parse_tree.push(\r\n {\r\n placeholder: match[0],\r\n param_no: match[1],\r\n keys: match[2],\r\n sign: match[3],\r\n pad_char: match[4],\r\n align: match[5],\r\n width: match[6],\r\n precision: match[7],\r\n type: match[8]\r\n }\r\n )\r\n }\r\n else if ((match = re.mod.exec(_fmt)) !== null) { // treat %_SPACE as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.notplaceholder.exec(_fmt)) !== null) { // treat %_NOTPLACEHOLDER as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] unexpected placeholder')\r\n }\r\n _fmt = _fmt.substring(match[0].length)\r\n }\r\n return parse_tree\r\n }\r\n\r\n app.sprintf = sprintf;\r\n app.vsprintf = vsprintf;\r\n return app;\r\n }\r\n\r\n function isString(what) {\r\n return Object.prototype.toString.call(what) === '[object String]';\r\n }\r\n\r\n function cssSelectorString(elem) {\r\n var MAX_TRAVERSE_HEIGHT = 5,\r\n MAX_OUTPUT_LEN = 80,\r\n out = [],\r\n height = 0,\r\n len = 0,\r\n separator = ' > ',\r\n sepLength = separator.length,\r\n nextStr;\r\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\r\n nextStr = htmlElementAsString(elem);\r\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\r\n break;\r\n }\r\n out.push(nextStr);\r\n len += nextStr.length;\r\n elem = elem.parentNode;\r\n }\r\n return out.reverse().join(separator);\r\n }\r\n \r\n function htmlElementAsString(elem) {\r\n var out = [], className, classes, key, attr, i;\r\n if (!elem || !elem.tagName) {\r\n return '';\r\n }\r\n out.push(elem.tagName.toLowerCase());\r\n if (elem.id) {\r\n out.push('#' + elem.id);\r\n }\r\n className = elem.className;\r\n if (className && isString(className)) {\r\n classes = className.split(/\\s+/);\r\n for (i = 0; i < classes.length; i++) {\r\n out.push('.' + classes[i]);\r\n }\r\n }\r\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\r\n for (i = 0; i < attrWhitelist.length; i++) {\r\n key = attrWhitelist[i];\r\n attr = elem.getAttribute(key);\r\n if (attr) {\r\n out.push('[' + key + '=\"' + attr + '\"]');\r\n }\r\n }\r\n return out.join('');\r\n }\r\n\r\n var parseHash = function(url) {\r\n return url.split('#')[1] || '';\r\n };\r\n\r\n //\r\n // Constructor\r\n //\r\n\r\n var Constructor = function (options) {\r\n\r\n //\r\n // Variables\r\n //\r\n\r\n var publicAPIs = {};\r\n var settings;\r\n var breadcrumbs = [];\r\n var lastHref = window.location && window.location.href;\r\n\r\n function getPayload() {\r\n var payload = {\r\n \"url\": document.location.pathname || '/',\r\n \"application\": settings.application\r\n };\r\n\r\n var payload_data = [];\r\n\r\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\r\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 });\r\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 });\r\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] });\r\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\r\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\r\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\r\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\r\n\r\n payload.data = payload_data;\r\n\r\n var payload_serverVariables = [];\r\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\r\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\r\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\r\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\r\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\r\n\r\n payload.serverVariables = payload_serverVariables;\r\n\r\n return payload;\r\n }\r\n\r\n function confirmResponse(status, response) {\r\n if (settings.debug) {\r\n if (status === 'error') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n } else if (status === 'success') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\r\n } else {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n }\r\n }\r\n }\r\n\r\n function stackGPS(error, xhr, jsonData) {\r\n \tvar errorStack = error.toString().split(\"\\n\")[0];\r\n \tvar gps = new StackTraceGPS();\r\n var promise = new Promise(function(resolve) {\r\n\t var stackframes = ErrorStackParser.parse(error);\r\n\t resolve(Promise.all(stackframes.map(function(sf) {\r\n\t return new Promise(function(resolve) {\r\n\t function resolveOriginal() {\r\n\t resolve(sf);\r\n\t }\r\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\r\n\t });\r\n\t })));\t\r\n });\r\n\r\n promise.then(function(newFrames){\r\n \tnewFrames.forEach(function(stackFrame, i){\r\n\t\t\t\t\tif(stackFrame.functionName) {\r\n \t\t\tvar fn = stackFrame.functionName + ' ';\r\n \t\t} else {\r\n \t\t\tvar fn = '';\r\n \t\t}\r\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\r\n \t\tnewFrames[i] = stackString;\r\n \t});\r\n \tnewFrames.unshift(errorStack);\r\n \tjsonData.detail = newFrames.join(\"\\n\");\r\n \txhr.send(JSON.stringify(jsonData));\r\n });\r\n }\r\n\r\n function stackString(error) {\r\n \tvar typeOF = typeof error.error;\r\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\r\n }\r\n\r\n function manipulateStack (errorStack, severity, message) {\r\n var stack = [];\r\n for (var i = 0; i < errorStack.length; i++) {\r\n if(errorStack[i] === \"Error\") {\r\n stack.push(severity + \": \" + message);\r\n }\r\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\r\n stack.push(errorStack[i]);\r\n }\r\n }\r\n return stack.join('\\n');\r\n }\r\n\r\n // Private methods\r\n\r\n var recordBreadcrumb = function(obj) {\r\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\r\n breadcrumbs_number = 10;\r\n \r\n breadcrumbs.push(crumb);\r\n \r\n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\r\n if(options.breadcrumbsNumber > 25) {\r\n breadcrumbs_number = 25;\r\n } else if(options.breadcrumbsNumber <= 25) {\r\n breadcrumbs_number = options.breadcrumbsNumber;\r\n }\r\n }\r\n \r\n if (breadcrumbs.length > breadcrumbs_number) {\r\n breadcrumbs.shift();\r\n }\r\n }\r\n\r\n var breadcrumbClickEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Click\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbFormSubmitEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Form submit\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbWindowEventHandler = function(evt) {\r\n var type = evt.type,\r\n message = null;\r\n\r\n switch (type) {\r\n case \"load\":\r\n message = \"Page loaded\"; break;\r\n case \"DOMContentLoaded\":\r\n message = \"DOMContentLoaded\"; break;\r\n case \"pageshow\":\r\n message = \"Page shown\"; break;\r\n case \"pagehide\":\r\n message = \"Page hidden\"; break;\r\n case \"popstate\":\r\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": message\r\n });\r\n }\r\n\r\n var breadcrumbHashChangeEventHandler = function(evt) {\r\n var oldURL = evt.oldURL,\r\n newURL = evt.newURL,\r\n from = null,\r\n to = null,\r\n message = null;\r\n\r\n if (oldURL && newURL) {\r\n from = parseHash(oldURL);\r\n to = parseHash(newURL);\r\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\r\n } else {\r\n to = location.hash;\r\n message = \"to: '\" + to + \"'\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": \"Hash changed \" + message\r\n });\r\n }\r\n\r\n var breadcrumbXHRHandler = function(evt, method, url) {\r\n var status = evt && evt.target ? evt.target.status : 0,\r\n severity = null,\r\n method = method.toUpperCase(),\r\n url = url,\r\n regex = /https:\\/\\/api.elmah.io/g;\r\n\r\n if(url.match(regex) == null) { \r\n if (status > 0 && status < 400) {\r\n severity = \"Information\";\r\n } else if (status > 399 && status < 500) {\r\n severity = \"Warning\";\r\n } else if (status >= 500) {\r\n severity = \"Error\";\r\n }\r\n\r\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\r\n\r\n recordBreadcrumb({\r\n \"severity\": severity,\r\n \"action\": \"Request\",\r\n \"message\": \"[\" + method + \"] \" + url + statusCode\r\n });\r\n }\r\n }\r\n\r\n var sendPayload = function (apiKey, logId, callback, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n error = errorLog,\r\n send = 1,\r\n queryParams = getSearchParameters(),\r\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\r\n\r\n // Ignoring error from an external script\r\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\r\n\t\t\t if (settings.debug) {\r\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\r\n\t\t\t }\r\n\t\t\t return;\r\n\t\t\t}\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"detail\": error.error ? error.error.stack : null,\r\n \"title\": error.message || 'Unspecified error',\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"severity\": \"Error\",\r\n \"type\": error.error ? error.error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Check if error sent is a string and not an object\r\n // Then create the articifial stacktrace and pass source & type of the error\r\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\r\n \tvar typeOF = typeof errorLog.error;\r\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \tjsonData.detail = stackString(errorLog);\r\n \tjsonData.source = errorLog.source;\r\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\r\n }\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n \t// send message trying to pinpoint stackframes\r\n \tstackGPS(error.error, xhr, jsonData);\r\n\t } else {\r\n\t \t// send message\r\n \txhr.send(JSON.stringify(jsonData));\r\n\t }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n type = logType,\r\n error = errorLog,\r\n message = messageLog,\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n if (type !== \"Log\") {\r\n\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": type,\r\n \"type\": error ? error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n } else {\r\n\r\n var jsonData = error;\r\n \r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n // If message contains breadcrumbs\r\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\r\n breadcrumbs = breadcrumbs.reverse();\r\n for (var i = 0; i < breadcrumbs.length; i++) {\r\n // Add breadcrumbs to jsonData object\r\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\r\n }\r\n } else {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n }\r\n \r\n // Reset breadcrumbs\r\n breadcrumbs = [];\r\n }\r\n\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n // send message trying to pinpoint stackframes\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n // send message\r\n if(jsonData.errorObject) {\r\n error = jsonData.errorObject;\r\n delete jsonData.errorObject;\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n xhr.send(JSON.stringify(jsonData));\r\n }\r\n }\r\n\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n message = errorLog.message,\r\n messageTemplate = errorLog.message,\r\n type = logType,\r\n args = Object.values(errorLog.arguments),\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n // If message has placeholders (%s or %d), check for arguments and replace them\r\n \tif(String(message).match(/(%d|%s)+/ig) && args.length > 1) {\r\n \t\tvar sprintfJS = new sprintfjs();\r\n // Remove the first argument from array, which represents the message\r\n \t\targs.shift();\r\n message = sprintfJS.vsprintf(message, args);\r\n }\r\n\r\n if(typeof message !== \"string\"){\r\n message = message.toString();\r\n }\r\n\r\n if(typeof messageTemplate !== \"string\") {\r\n messageTemplate = messageTemplate.toString();\r\n }\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"titleTemplate\": messageTemplate,\r\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\r\n \"severity\": type,\r\n \"type\": null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n // send message\r\n xhr.send(JSON.stringify(jsonData));\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPrefilledLogMessage = function(errorLog) {\r\n // without error object\r\n if(!errorLog) return getPayload();\r\n\r\n // with error object\r\n var error = errorLog;\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n var jsonData = {\r\n \"title\": error.message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": \"Error\",\r\n \"type\": error ? error.name : null,\r\n \"errorObject\": error\r\n };\r\n\r\n jsonData = merge_objects(jsonData, getPayload());\r\n \r\n return jsonData;\r\n };\r\n\r\n // Some public methods\r\n\r\n publicAPIs.error = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.verbose = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.debug = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.information = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.warning = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.fatal = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.log = function (obj) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.message = function(error) {\r\n return sendPrefilledLogMessage(error);\r\n };\r\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\r\n recordBreadcrumb({\r\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\r\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\r\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\r\n });\r\n };\r\n\r\n publicAPIs.on = function (name, callback, ctx) {\r\n var e = this.e || (this.e = {});\r\n\r\n (e[name] || (e[name] = [])).push({\r\n fn: callback,\r\n ctx: ctx\r\n });\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.emit = function (name) {\r\n var data = [].slice.call(arguments, 1);\r\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\r\n var i = 0;\r\n var len = evtArr.length;\r\n\r\n for (i; i < len; i++) {\r\n evtArr[i].fn.apply(evtArr[i].ctx, data);\r\n }\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.init = function (options) {\r\n\r\n // -- Merge options into defaults\r\n settings = extend(defaults, options || {});\r\n\r\n // -- Breadcrumbs\r\n if (settings.breadcrumbs) {\r\n // Breadcrumbs - Click & Submit form\r\n if (document.addEventListener) {\r\n document.addEventListener('click', breadcrumbClickEventHandler, false);\r\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\r\n } else if (document.attachEvent) {\r\n document.attachEvent('click', breadcrumbClickEventHandler, false);\r\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\r\n }\r\n\r\n // Breadcrumbs - Navigation\r\n if (window.addEventListener) {\r\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\r\n } else if (window.attachEvent) {\r\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\r\n }\r\n\r\n if(window.history && window.history.pushState && window.history.replaceState) {\r\n var old_onpopstate = window.onpopstate;\r\n window.onpopstate = function(evt) {\r\n breadcrumbWindowEventHandler(evt);\r\n if (old_onpopstate) {\r\n return old_onpopstate.apply(this, arguments);\r\n }\r\n };\r\n }\r\n\r\n // Breadcrumbs - XHR\r\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\r\n // Store a reference to the native method\r\n var open = XMLHttpRequest.prototype.open;\r\n \r\n // Overwrite the native method\r\n XMLHttpRequest.prototype.open = function(method, url) {\r\n // Assign an event listener\r\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\r\n // Call the stored reference to the native method\r\n open.apply(this, arguments);\r\n };\r\n }\r\n }\r\n\r\n // -- Log on window error\r\n window.onerror = function (message, source, lineno, colno, error) {\r\n var errorLog = {\r\n 'message': message,\r\n 'source': source,\r\n 'lineno': lineno,\r\n 'colno': colno,\r\n 'error': error\r\n }\r\n \r\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n\r\n return false;\r\n }\r\n\r\n // -- Overriding console methods\r\n // -- Then log messages into the app.elmah.io\r\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\r\n\r\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console errors\r\n var _error = console.error;\r\n console.error = function(errMessage){\r\n var errorLog = {\r\n \t\t'message': errMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _error.apply(console, arguments);\r\n };\r\n if(options.captureConsoleMinimumLevel !== \"error\") {\r\n // Log console warnings\r\n var _warning = console.warn;\r\n console.warn = function(warnMessage){\r\n var errorLog = {\r\n 'message': warnMessage,\r\n 'arguments': arguments\r\n }\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _warning.apply(console, arguments);\r\n };\r\n }\r\n }\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console info\r\n var _info = console.info;\r\n console.info = function(infoMessage){\r\n var errorLog = {\r\n \t\t'message': infoMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _info.apply(console, arguments);\r\n };\r\n }\r\n if(options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console debug\r\n var _debug = console.debug;\r\n console.debug = function(debugMessage){\r\n var errorLog = {\r\n \t\t'message': debugMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _debug.apply(console, arguments);\r\n };\r\n }\r\n }\r\n };\r\n\r\n // Initialize the plugin\r\n publicAPIs.init(options);\r\n\r\n if (settings.debug) {\r\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\r\n }\r\n\r\n // Return the public APIs\r\n return publicAPIs;\r\n\r\n };\r\n\r\n\r\n //\r\n // Return the constructor\r\n //\r\n\r\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n // Immediately-Invoked Function Expression (IIFE)\r\n return new Constructor;\r\n } else {\r\n // UMD Constructor\r\n return Constructor;\r\n }\r\n\r\n});"],"file":"elmahio.js"} \ No newline at end of file diff --git a/dist/elmahio.min.js b/dist/elmahio.min.js index f052d70..8b43bf2 100644 --- a/dist/elmahio.min.js +++ b/dist/elmahio.min.js @@ -1,6 +1,6 @@ /*! - * elmah.io Javascript Logger - version 3.5.4 + * elmah.io Javascript Logger - version 3.6.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,"(").split(/\s+/).slice(1),t=this.extractLocation(n.pop()),r=n.join(" ")||void 0,i=["eval",""].indexOf(t[0])>-1?void 0:t[0];return new o({functionName:r,fileName:i,lineNumber:t[1],columnNumber:t[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 l=this.ajax(e,{method:"get"});this.sourceCache[e]=l,l.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 l=t.length,c=0;c=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 l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)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,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.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])),O.push(t),"number"==typeof t.originalLine&&w.push(t)}s(O,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=O,s(w,r.compareByOriginalPositions),this.__originalMappings=w},l.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)},l.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}},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=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.')},l.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=l,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;c--)"."===(a=u[c])?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));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 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 t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function c(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,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=c(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:c(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,l=a(o,i[u],!0);return 0===l?u:l>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,l=0,c=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),l+=(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=0),s.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o="number"==typeof o?parseInt(o,10):NaN;break;case"j":o=JSON.stringify(o,null,s.width?parseInt(s.width):0);break;case"e":o=s.precision?parseFloat(o).toExponential(s.precision):parseFloat(o).toExponential();break;case"f":o=s.precision?parseFloat(o).toFixed(s.precision):parseFloat(o);break;case"g":o=s.precision?String(Number(o.toPrecision(s.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o="undefined"===(o=String(o))?s.placeholder:s.precision?o.substring(0,s.precision):o;break;case"t":o=String(!!o),o=s.precision?o.substring(0,s.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=s.precision?o.substring(0,s.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=s.precision?o.substring(0,s.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase()}n.json.test(s.type)?m+=o:(!n.number.test(s.type)||p&&!s.sign?g="":(g=p?"+":"-",o=o.toString().replace(n.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(g+o).length,u=s.width&&c>0?l.repeat(c):"",m+=s.align?g+o+u:"0"===l?g+u+o:u+g+o)}return m}(function(e){var t,r=e,o=[],i=0;for(;r;){if(null!==(t=n.text.exec(r)))o.push(t[0]);else if(null!==(t=n.modulo.exec(r)))o.push("%");else if(null!==(t=n.placeholder.exec(r))){if(t[2]){i|=1;var a=[],s=t[2],u=[];if(null===(u=n.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(u[1]);""!==(s=s.substring(u[0].length));)if(null!==(u=n.key_access.exec(s)))a.push(u[1]);else{if(null===(u=n.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(u[1])}t[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");o.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}else if(null!==(t=n.mod.exec(r)))o.push(t[0]);else{if(null===(t=n.notplaceholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");o.push(t[0])}r=r.substring(t[0].length)}return o}(e),arguments)}Object.create(null);return e.sprintf=t,e.vsprintf=function(e,n){return t.apply(null,[e].concat(n||[]))},e};function _(e){return"[object String]"===Object.prototype.toString.call(e)}function w(e){for(var n,t=[],r=0,o=0,i=" > ".length;e&&r++<5&&!("html"===(n=O(e))||r>1&&o+t.length*i+n.length>=80);)t.push(n),o+=n.length,e=e.parentNode;return t.reverse().join(" > ")}function O(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;i25?r=25:n.breadcrumbsNumber>=10&&n.breadcrumbsNumber<=25&&(r=n.breadcrumbsNumber)),o.length>=r&&o.shift()},S=function(e){var n;try{n=w(e.target)}catch(e){n=""}O({severity:"Information",action:"Click",message:n})},E=function(e){var n;try{n=w(e.target)}catch(e){n=""}O({severity:"Information",action:"Form submit",message:n})},L=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}O({severity:"Information",action:"Navigation",message:t})},N=function(e){var n=e.oldURL,t=e.newURL,r=null;r=n&&t?"from: '"+C(n)+"' to: '"+C(t)+"'":"to: '"+location.hash+"'",O({severity:"Information",action:"Navigation",message:"Hash changed "+r})},A=function(e,n,a,s,l,g){var f=e,h=n,d=s,b=g,_=l,w=1,O=v();if((null===f||null===h)&&2!==p)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(f=c.apiKey,h=c.logId);var C=new XMLHttpRequest;if(C.open("POST","https://api.elmah.io/v3/messages/"+h+"?api_key="+f,!0),C.setRequestHeader("Content-type","application/json"),C.onload=function(e){4===C.readyState&&201===C.status&&a("success",C.statusText)},C.onerror=function(e){a("error",C.statusText),r.emit("error",C.status,C.statusText)},"Log"!==d){var S=b?i.parse(b):null;E=y(E={title:_,source:S&&S.length>0?S[0].fileName:null,detail:b?b.stack:null,severity:d,type:b?b.name:null,queryString:JSON.parse(JSON.stringify(O))},u())}else var E=b;if(null!==t.filter&&t.filter(E)&&(w=0),1===w)if(E.title){if(o.length>0){if(E.breadcrumbs&&E.breadcrumbs.length>0){o=o.reverse();for(var L=0;L1){var O=new b;d.shift(),f=O.vsprintf(f,d)}if("string"!=typeof f&&(f=f.toString()),"string"!=typeof h&&(h=h.toString()),(null===l||null===g)&&2!==p)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(l=c.apiKey,g=c.logId);var C=new XMLHttpRequest;C.open("POST","https://api.elmah.io/v3/messages/"+g+"?api_key="+l,!0),C.setRequestHeader("Content-type","application/json"),C.onload=function(e){4===C.readyState&&201===C.status&&i("success",C.statusText)},C.onerror=function(e){i("error",C.statusText),r.emit("error",C.status,C.statusText)};var S={title:f,titleTemplate:h,detail:function(e,n,t){for(var r=[],o=0;o0&&(S.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(S)&&(_=0),1===_&&(S.title?(r.emit("message",S),C.send(JSON.stringify(S))):i("missing-title",C.statusText))};return r.error=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Error",e,n)},t.breadcrumbs?100:0)},r.verbose=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Verbose",e,n)},t.breadcrumbs?100:0)},r.debug=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Debug",e,n)},t.breadcrumbs?100:0)},r.information=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Information",e,n)},t.breadcrumbs?100:0)},r.warning=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Warning",e,n)},t.breadcrumbs?100:0)},r.fatal=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Fatal",e,n)},t.breadcrumbs?100:0)},r.log=function(e){setTimeout(function(){A(t.apiKey,t.logId,l,"Log",null,e)},t.breadcrumbs?100:0)},r.message=function(e){return function(e){if(!e)return u();var n=e,t=n?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};return r=y(r,u())}(e)},r.addBreadcrumb=function(e,n,t){O({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"),O({severity:o,action:"Request",message:"["+n+"] "+t+(r>0?" ("+r+")":"")}))}(t,e,n)},!1),s.apply(this,arguments)}}}if(e.onerror=function(e,n,a,s,f){var h={message:e,source:n,lineno:a,colno:s,error:f};return setTimeout(function(){!function(e,n,a,s){var l=e,f=n,h=s,b=1,_=v(),w=h.error&&0!==d(h.error.stack)&&"object"==typeof h.error?i.parse(h.error):"";if(!h||0!==h.colno||0!==h.lineno||w&&""!==w||!h.message||"Script error."!==h.message&&"Script error"!==h.message){if((null===l||null===f)&&2!==p)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(l=c.apiKey,f=c.logId);var O=new XMLHttpRequest;O.open("POST","https://api.elmah.io/v3/messages/"+f+"?api_key="+l,!0),O.setRequestHeader("Content-type","application/json"),O.onload=function(e){4===O.readyState&&201===O.status&&a("success",O.statusText)},O.onerror=function(e){a("error",O.statusText),r.emit("error",O.status,O.statusText)};var C={detail:h.error?h.error.stack:null,title:h.message||"Unspecified error",source:w&&w.length>0?w[0].fileName:null,severity:"Error",type:h.error?h.error.name:null,queryString:JSON.parse(JSON.stringify(_))};if(h.error&&0===d(h.error.stack)&&void 0===C.detail){var S=typeof s.error,E=S.charAt(0).toUpperCase()+S.slice(1);C.detail=function(e){var n=typeof e.error;return n.charAt(0).toUpperCase()+n.slice(1)+": "+e.error+"\n at ("+e.source+":"+e.lineno+":"+e.colno+")"}(s),C.source=s.source,C.title="Uncaught "+E+": "+s.error}C=y(C,u()),o.length>0&&(C.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(C)&&(b=0),1===b&&(r.emit("message",C),h.error&&"object"==typeof h.error&&0!==d(h.error.stack)&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?m(h.error,O,C):O.send(JSON.stringify(C)))}else t.debug&&console.log("%c ⯈ Error log: %c 🛈 Ignoring error from external script ",g.lightCSS,g.warningCSS)}(t.apiKey,t.logId,l,h)},t.breadcrumbs?100:0),!1},n&&"none"!==n.captureConsoleMinimumLevel){if("info"===n.captureConsoleMinimumLevel||"warn"===n.captureConsoleMinimumLevel||"error"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var b=console.error;if(console.error=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Error",n)},t.breadcrumbs?100:0),b.apply(console,arguments)},"error"!==n.captureConsoleMinimumLevel){var _=console.warn;console.warn=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Warning",n)},t.breadcrumbs?100:0),_.apply(console,arguments)}}}if("info"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var w=console.info;console.info=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Information",n)},t.breadcrumbs?100:0),w.apply(console,arguments)}}if("debug"===n.captureConsoleMinimumLevel){var C=console.debug;console.debug=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Debug",n)},t.breadcrumbs?100:0),C.apply(console,arguments)}}}},r.init(n),t.debug&&console.log("%c"+g.label,g.labelCSS),r};return p&&c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")?new S:S}); +!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,"(").split(/\s+/).slice(1),t=this.extractLocation(n.pop()),r=n.join(" ")||void 0,i=["eval",""].indexOf(t[0])>-1?void 0:t[0];return new o({functionName:r,fileName:i,lineNumber:t[1],columnNumber:t[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 l=this.ajax(e,{method:"get"});this.sourceCache[e]=l,l.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 l=t.length,c=0;c=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 l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)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,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.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])),O.push(t),"number"==typeof t.originalLine&&w.push(t)}s(O,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=O,s(w,r.compareByOriginalPositions),this.__originalMappings=w},l.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)},l.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}},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=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.')},l.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=l,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;c--)"."===(a=u[c])?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));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 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 t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function c(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,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=c(e.source,n.source))?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:c(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,l=a(o,i[u],!0);return 0===l?u:l>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,l=0,c=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),l+=(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=0),s.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o="number"==typeof o?parseInt(o,10):NaN;break;case"j":o=JSON.stringify(o,null,s.width?parseInt(s.width):0);break;case"e":o=s.precision?parseFloat(o).toExponential(s.precision):parseFloat(o).toExponential();break;case"f":o=s.precision?parseFloat(o).toFixed(s.precision):parseFloat(o);break;case"g":o=s.precision?String(Number(o.toPrecision(s.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o="undefined"===(o=String(o))?s.placeholder:s.precision?o.substring(0,s.precision):o;break;case"t":o=String(!!o),o=s.precision?o.substring(0,s.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=s.precision?o.substring(0,s.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=s.precision?o.substring(0,s.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase()}n.json.test(s.type)?m+=o:(!n.number.test(s.type)||p&&!s.sign?g="":(g=p?"+":"-",o=o.toString().replace(n.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(g+o).length,u=s.width&&c>0?l.repeat(c):"",m+=s.align?g+o+u:"0"===l?g+u+o:u+g+o)}return m}(function(e){var t,r=e,o=[],i=0;for(;r;){if(null!==(t=n.text.exec(r)))o.push(t[0]);else if(null!==(t=n.modulo.exec(r)))o.push("%");else if(null!==(t=n.placeholder.exec(r))){if(t[2]){i|=1;var a=[],s=t[2],u=[];if(null===(u=n.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(u[1]);""!==(s=s.substring(u[0].length));)if(null!==(u=n.key_access.exec(s)))a.push(u[1]);else{if(null===(u=n.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(u[1])}t[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");o.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}else if(null!==(t=n.mod.exec(r)))o.push(t[0]);else{if(null===(t=n.notplaceholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");o.push(t[0])}r=r.substring(t[0].length)}return o}(e),arguments)}Object.create(null);return e.sprintf=t,e.vsprintf=function(e,n){return t.apply(null,[e].concat(n||[]))},e};function _(e){return"[object String]"===Object.prototype.toString.call(e)}function w(e){for(var n,t=[],r=0,o=0,i=" > ".length;e&&r++<5&&!("html"===(n=O(e))||r>1&&o+t.length*i+n.length>=80);)t.push(n),o+=n.length,e=e.parentNode;return t.reverse().join(" > ")}function O(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;i=0&&"number"==typeof n.breadcrumbsNumber&&(n.breadcrumbsNumber>25?r=25:n.breadcrumbsNumber<=25&&(r=n.breadcrumbsNumber)),o.length>r&&o.shift()},S=function(e){var n;try{n=w(e.target)}catch(e){n=""}O({severity:"Information",action:"Click",message:n})},E=function(e){var n;try{n=w(e.target)}catch(e){n=""}O({severity:"Information",action:"Form submit",message:n})},L=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}O({severity:"Information",action:"Navigation",message:t})},N=function(e){var n=e.oldURL,t=e.newURL,r=null;r=n&&t?"from: '"+C(n)+"' to: '"+C(t)+"'":"to: '"+location.hash+"'",O({severity:"Information",action:"Navigation",message:"Hash changed "+r})},A=function(e,n,a,s,l,g){var f=e,h=n,d=s,b=g,_=l,w=1,O=v();if((null===f||null===h)&&2!==p)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(f=c.apiKey,h=c.logId);var C=new XMLHttpRequest;if(C.open("POST","https://api.elmah.io/v3/messages/"+h+"?api_key="+f,!0),C.setRequestHeader("Content-type","application/json"),C.onload=function(e){4===C.readyState&&201===C.status&&a("success",C.statusText)},C.onerror=function(e){a("error",C.statusText),r.emit("error",C.status,C.statusText)},"Log"!==d){var S=b?i.parse(b):null;E=y(E={title:_,source:S&&S.length>0?S[0].fileName:null,detail:b?b.stack:null,severity:d,type:b?b.name:null,queryString:JSON.parse(JSON.stringify(O))},u())}else var E=b;if(null!==t.filter&&t.filter(E)&&(w=0),1===w)if(E.title){if(o.length>0){if(E.breadcrumbs&&E.breadcrumbs.length>0){o=o.reverse();for(var L=0;L1){var O=new b;d.shift(),f=O.vsprintf(f,d)}if("string"!=typeof f&&(f=f.toString()),"string"!=typeof h&&(h=h.toString()),(null===l||null===g)&&2!==p)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(l=c.apiKey,g=c.logId);var C=new XMLHttpRequest;C.open("POST","https://api.elmah.io/v3/messages/"+g+"?api_key="+l,!0),C.setRequestHeader("Content-type","application/json"),C.onload=function(e){4===C.readyState&&201===C.status&&i("success",C.statusText)},C.onerror=function(e){i("error",C.statusText),r.emit("error",C.status,C.statusText)};var S={title:f,titleTemplate:h,detail:function(e,n,t){for(var r=[],o=0;o0&&(S.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(S)&&(_=0),1===_&&(S.title?(r.emit("message",S),C.send(JSON.stringify(S))):i("missing-title",C.statusText))};return r.error=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Error",e,n)},t.breadcrumbs?100:0)},r.verbose=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Verbose",e,n)},t.breadcrumbs?100:0)},r.debug=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Debug",e,n)},t.breadcrumbs?100:0)},r.information=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Information",e,n)},t.breadcrumbs?100:0)},r.warning=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Warning",e,n)},t.breadcrumbs?100:0)},r.fatal=function(e,n){setTimeout(function(){A(t.apiKey,t.logId,l,"Fatal",e,n)},t.breadcrumbs?100:0)},r.log=function(e){setTimeout(function(){A(t.apiKey,t.logId,l,"Log",null,e)},t.breadcrumbs?100:0)},r.message=function(e){return function(e){if(!e)return u();var n=e,t=n?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};return r=y(r,u())}(e)},r.addBreadcrumb=function(e,n,t){O({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"),O({severity:o,action:"Request",message:"["+n+"] "+t+(r>0?" ("+r+")":"")}))}(t,e,n)},!1),s.apply(this,arguments)}}}if(e.onerror=function(e,n,a,s,f){var h={message:e,source:n,lineno:a,colno:s,error:f};return setTimeout(function(){!function(e,n,a,s){var l=e,f=n,h=s,b=1,_=v(),w=h.error&&0!==d(h.error.stack)&&"object"==typeof h.error?i.parse(h.error):"";if(!h||0!==h.colno||0!==h.lineno||w&&""!==w||!h.message||"Script error."!==h.message&&"Script error"!==h.message){if((null===l||null===f)&&2!==p)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(l=c.apiKey,f=c.logId);var O=new XMLHttpRequest;O.open("POST","https://api.elmah.io/v3/messages/"+f+"?api_key="+l,!0),O.setRequestHeader("Content-type","application/json"),O.onload=function(e){4===O.readyState&&201===O.status&&a("success",O.statusText)},O.onerror=function(e){a("error",O.statusText),r.emit("error",O.status,O.statusText)};var C={detail:h.error?h.error.stack:null,title:h.message||"Unspecified error",source:w&&w.length>0?w[0].fileName:null,severity:"Error",type:h.error?h.error.name:null,queryString:JSON.parse(JSON.stringify(_))};if(h.error&&0===d(h.error.stack)&&void 0===C.detail){var S=typeof s.error,E=S.charAt(0).toUpperCase()+S.slice(1);C.detail=function(e){var n=typeof e.error;return n.charAt(0).toUpperCase()+n.slice(1)+": "+e.error+"\n at ("+e.source+":"+e.lineno+":"+e.colno+")"}(s),C.source=s.source,C.title="Uncaught "+E+": "+s.error}C=y(C,u()),o.length>0&&(C.breadcrumbs=o,o=[]),null!==t.filter&&t.filter(C)&&(b=0),1===b&&(r.emit("message",C),h.error&&"object"==typeof h.error&&0!==d(h.error.stack)&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?m(h.error,O,C):O.send(JSON.stringify(C)))}else t.debug&&console.log("%c ⯈ Error log: %c 🛈 Ignoring error from external script ",g.lightCSS,g.warningCSS)}(t.apiKey,t.logId,l,h)},t.breadcrumbs?100:0),!1},n&&"none"!==n.captureConsoleMinimumLevel){if("info"===n.captureConsoleMinimumLevel||"warn"===n.captureConsoleMinimumLevel||"error"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var b=console.error;if(console.error=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Error",n)},t.breadcrumbs?100:0),b.apply(console,arguments)},"error"!==n.captureConsoleMinimumLevel){var _=console.warn;console.warn=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Warning",n)},t.breadcrumbs?100:0),_.apply(console,arguments)}}}if("info"===n.captureConsoleMinimumLevel||"debug"===n.captureConsoleMinimumLevel){var w=console.info;console.info=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Information",n)},t.breadcrumbs?100:0),w.apply(console,arguments)}}if("debug"===n.captureConsoleMinimumLevel){var C=console.debug;console.debug=function(e){var n={message:e,arguments:arguments};setTimeout(function(){x(t.apiKey,t.logId,l,"Debug",n)},t.breadcrumbs?100:0),C.apply(console,arguments)}}}},r.init(n),t.debug&&console.log("%c"+g.label,g.labelCSS),r};return p&&c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")?new S:S}); //# sourceMappingURL=elmahio.min.js.map diff --git a/dist/elmahio.min.js.map b/dist/elmahio.min.js.map index 077ed80..75711ca 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","tokens","slice","locationParts","pop","source","functionNameRegex","matches","e","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","push","argsRaw","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","location","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","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","getSearchParameters","prmstr","prmarr","tmparr","transformToAssocArray","merge_objects","obj1","obj2","obj3","attrname1","attrname2","sprintfjs","app","re","not_string","not_bool","not_type","not_primitive","number","numeric_arg","json","not_json","text","modulo","placeholder","key_access","index_access","sign","mod","notplaceholder","sprintf","parse_tree","argv","arg","ph","pad","pad_character","pad_length","is_positive","cursor","tree_length","output","keys","param_no","type","Function","parseInt","fromCharCode","NaN","stringify","width","precision","toExponential","toFixed","toPrecision","toLowerCase","valueOf","pad_char","repeat","align","sprintf_format","fmt","_fmt","arg_names","field_list","replacement_field","field_match","SyntaxError","sprintf_parse","vsprintf","apply","isString","what","cssSelectorString","elem","nextStr","out","height","sepLength","htmlElementAsString","parentNode","reverse","className","classes","attr","tagName","attrWhitelist","parseHash","Constructor","options","settings","publicAPIs","lastHref","href","getPayload","payload","pathname","payload_data","documentMode","innerWidth","documentElement","clientWidth","innerHeight","clientHeight","screen","msOrientation","orientation","mozOrientation","colorDepth","data","payload_serverVariables","navigator","language","userAgent","referrer","protocol","hostname","serverVariables","confirmResponse","response","console","log","Date","toLocaleString","stackGPS","xhr","jsonData","errorStack","gps","stackframes","all","sf","resolveOriginal","newFrames","stackFrame","fn","stackString","unshift","detail","recordBreadcrumb","crumb","dateTime","toISOString","breadcrumbs_number","breadcrumbClickEventHandler","evt","target","severity","action","breadcrumbFormSubmitEventHandler","breadcrumbWindowEventHandler","breadcrumbHashChangeEventHandler","oldURL","newURL","hash","sendManualPayload","callback","logType","messageLog","errorLog","api_key","log_id","queryParams","setRequestHeader","onload","statusText","emit","title","queryString","errorObject","sendPayloadFromConsole","messageTemplate","values","sprintfJS","titleTemplate","manipulateStack","msg","setTimeout","verbose","information","warning","fatal","sendPrefilledLogMessage","addBreadcrumb","on","ctx","evtArr","init","addEventListener","attachEvent","history","pushState","replaceState","old_onpopstate","onpopstate","event","breadcrumbXHRHandler","lineno","colno","typeOF","typeOFCapitalized","sendPayload","_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,aAi+BA,IAh+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,cAChCC,EAAc,CAAC,WAAY,eAAgB,UAE3CC,EAAQH,EAAaI,OAAOH,EAAcC,EAD7B,CAAC,SAGlB,SAASf,EAAWkB,GAClB,GAAIA,aAAeC,OACjB,IAAK,IAAIC,EAAI,EAAGA,EAAIJ,EAAMK,OAAQD,IAC5BF,EAAII,eAAeN,EAAMI,UAAyBG,IAAlBL,EAAIF,EAAMI,KAC5CxB,KAAK,MAAQU,EAAYU,EAAMI,KAAKF,EAAIF,EAAMI,KAKtDpB,EAAWwB,UAAY,CACrBC,QAAS,WACP,OAAO7B,KAAK8B,M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MkD,QAASjL,YAGzB,GAA2C,UAAvCkJ,EAAQnG,2BAAwC,CAClD,IAAI4N,EAAS1F,QAAQpI,MACrBoI,QAAQpI,MAAQ,SAAS+N,GACvB,IAAIpD,EAAW,CACbtY,QAAW0b,EACX5Q,UAAaA,WAEf0O,WAAW,WACTP,EAAuBhF,EAASxG,OAAQwG,EAASvG,MAAOmI,EAAiB,QAASyC,IACjFrE,EAASnG,YAn9BC,IAm9BgC,GAC7C2N,EAAO5I,MAAMkD,QAASjL,eAK9BoJ,EAAWgG,KAAKlG,GACZC,EAAStG,OACXoI,QAAQC,IAAI,KAAO/I,EAAcC,MAAOD,EAAcE,UAEjD+G,GAET,OAAInH,GAAgBV,EAAOjQ,eAAe,WAAaiQ,EAAOjQ,eAAe,SACpE,IAAI2X,EAEJA","sourcesContent":["/*!\r\n * elmah.io Javascript Logger - version 3.5.4\r\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define([], function () {\r\n return factory(root);\r\n });\r\n } else if (typeof exports === 'object') {\r\n module.exports = factory(root);\r\n } else {\r\n root.Elmahio = factory(root);\r\n }\r\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\r\n\r\n 'use strict';\r\n\r\n //\r\n // ==== STACKFRAME ====\r\n //\r\n\r\n var StackFrame = (function () {\r\n \"use strict\";\r\n function _isNumber(n) {\r\n return !isNaN(parseFloat(n)) && isFinite(n);\r\n }\r\n function _capitalize(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n }\r\n function _getter(p) {\r\n return function () {\r\n return this[p];\r\n };\r\n }\r\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\r\n var numericProps = [\"columnNumber\", \"lineNumber\"];\r\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\r\n var arrayProps = [\"args\"];\r\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\r\n function StackFrame(obj) {\r\n if (obj instanceof Object) {\r\n for (var i = 0; i < props.length; i++) {\r\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\r\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\r\n }\r\n }\r\n }\r\n }\r\n StackFrame.prototype = {\r\n getArgs: function () {\r\n return this.args;\r\n },\r\n setArgs: function (v) {\r\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\r\n throw new TypeError(\"Args must be an Array\");\r\n }\r\n this.args = v;\r\n },\r\n getEvalOrigin: function () {\r\n return this.evalOrigin;\r\n },\r\n setEvalOrigin: function (v) {\r\n if (v instanceof StackFrame) {\r\n this.evalOrigin = v;\r\n } else if (v instanceof Object) {\r\n this.evalOrigin = new StackFrame(v);\r\n } else {\r\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\r\n }\r\n },\r\n toString: function () {\r\n var functionName = this.getFunctionName() || \"{anonymous}\";\r\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\r\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\r\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\r\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\r\n return functionName + args + fileName + lineNumber + columnNumber;\r\n }\r\n };\r\n StackFrame.fromString = function StackFrame$$fromString(str) {\r\n var argsStartIndex = str.indexOf(\"(\");\r\n var argsEndIndex = str.lastIndexOf(\")\");\r\n var functionName = str.substring(0, argsStartIndex);\r\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\r\n var locationString = str.substring(argsEndIndex + 1);\r\n if (locationString.indexOf(\"@\") === 0) {\r\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\r\n var fileName = parts[1];\r\n var lineNumber = parts[2];\r\n var columnNumber = parts[3];\r\n }\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args || undefined,\r\n fileName: fileName,\r\n lineNumber: lineNumber || undefined,\r\n columnNumber: columnNumber || undefined\r\n });\r\n };\r\n for (var i = 0; i < booleanProps.length; i++) {\r\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\r\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\r\n return function (v) {\r\n this[p] = Boolean(v);\r\n };\r\n }(booleanProps[i]);\r\n }\r\n for (var j = 0; j < numericProps.length; j++) {\r\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\r\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\r\n return function (v) {\r\n if (!_isNumber(v)) {\r\n throw new TypeError(p + \" must be a Number\");\r\n }\r\n this[p] = Number(v);\r\n };\r\n }(numericProps[j]);\r\n }\r\n for (var k = 0; k < stringProps.length; k++) {\r\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\r\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\r\n return function (v) {\r\n this[p] = String(v);\r\n };\r\n }(stringProps[k]);\r\n }\r\n return StackFrame;\r\n })();\r\n\r\n //\r\n // ==== ERROR STACK PARSER ====\r\n //\r\n\r\n var ErrorStackParser = (function () {\r\n \"use strict\";\r\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\r\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\r\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\r\n return {\r\n /**\r\n * Given an Error object, extract the most information from it.\r\n *\r\n * @param {Error} error object\r\n * @return {Array} of StackFrames\r\n */\r\n parse: function ErrorStackParser$$parse(error) {\r\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\r\n return this.parseOpera(error);\r\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\r\n return this.parseV8OrIE(error);\r\n } else if (error.stack) {\r\n return this.parseFFOrSafari(error);\r\n } else {\r\n throw new Error(\"Cannot parse given Error object\");\r\n }\r\n },\r\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\r\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\r\n // Fail-fast but return locations like \"(native)\"\r\n if (urlLike.indexOf(\":\") === -1) {\r\n return [urlLike];\r\n }\r\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\r\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\r\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\r\n },\r\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(CHROME_IE_STACK_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n if (line.indexOf(\"(eval \") > -1) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\r\n }\r\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionName = tokens.join(\" \") || undefined;\r\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: fileName,\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n },\r\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n if (line.indexOf(\" > eval\") > -1) {\r\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\r\n }\r\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\r\n // Safari eval frames only have function names and nothing else\r\n return new StackFrame({\r\n functionName: line\r\n });\r\n } else {\r\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\r\n var matches = line.match(functionNameRegex);\r\n var functionName = matches && matches[1] ? matches[1] : undefined;\r\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }\r\n }, this);\r\n },\r\n parseOpera: function ErrorStackParser$$parseOpera(e) {\r\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\r\n return this.parseOpera9(e);\r\n } else if (!e.stack) {\r\n return this.parseOpera10(e);\r\n } else {\r\n return this.parseOpera11(e);\r\n }\r\n },\r\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\r\n var lines = e.message.split(\"\\n\");\r\n var result = [];\r\n for (var i = 2, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\r\n var lines = e.stacktrace.split(\"\\n\");\r\n var result = [];\r\n for (var i = 0, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n functionName: match[3] || undefined,\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n // Opera 10.65+ Error.stack very similar to FF/Safari\r\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\r\n }, this);\r\n return filtered.map(function (line) {\r\n var tokens = line.split(\"@\");\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionCall = tokens.shift() || \"\";\r\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\r\n var argsRaw;\r\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\r\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\r\n }\r\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n }\r\n };\r\n })();\r\n\r\n //\r\n // ==== STACKTRACE-GPS ====\r\n //\r\n\r\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) {\r\n resolve(req.responseText);\r\n } else {\r\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\r\n }\r\n }\r\n };\r\n req.send();\r\n });\r\n }\r\n /**\r\n * Convert a Base64-encoded string into its original representation.\r\n * Used for inline sourcemaps.\r\n *\r\n * @param {String} b64str Base-64 encoded string\r\n * @returns {String} original representation of the base64-encoded string.\r\n */\r\n function _atob(b64str) {\r\n if (typeof window !== \"undefined\" && window.atob) {\r\n return window.atob(b64str);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\r\n }\r\n }\r\n function _parseJson(string) {\r\n if (typeof JSON !== \"undefined\" && JSON.parse) {\r\n return JSON.parse(string);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\r\n }\r\n }\r\n function _findFunctionName(source, lineNumber) {\r\n var syntaxes = [ // {name} = function ({args}) TODO args capture\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\r\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\r\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\r\n var lines = source.split(\"\\n\");\r\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\r\n var code = \"\";\r\n var maxLines = Math.min(lineNumber, 20);\r\n for (var i = 0; i < maxLines; ++i) {\r\n // lineNo is 1-based, source[] is 0-based\r\n var line = lines[lineNumber - i - 1];\r\n var commentPos = line.indexOf(\"//\");\r\n if (commentPos >= 0) {\r\n line = line.substr(0, commentPos);\r\n }\r\n if (line) {\r\n code = line + code;\r\n var len = syntaxes.length;\r\n for (var index = 0; index < len; index++) {\r\n var m = syntaxes[index].exec(code);\r\n if (m && m[1]) {\r\n return m[1];\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n function _ensureSupportedEnvironment() {\r\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\r\n throw new Error(\"Unable to consume source maps in older browsers\");\r\n }\r\n }\r\n function _ensureStackFrameIsLegit(stackframe) {\r\n if (typeof stackframe !== \"object\") {\r\n throw new TypeError(\"Given StackFrame is not an object\");\r\n } else if (typeof stackframe.fileName !== \"string\") {\r\n throw new TypeError(\"Given file name is not a String\");\r\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\r\n throw new TypeError(\"Given line number must be a positive integer\");\r\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\r\n throw new TypeError(\"Given column number must be a non-negative integer\");\r\n }\r\n return true;\r\n }\r\n function _findSourceMappingURL(source) {\r\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\r\n var lastSourceMappingUrl;\r\n var matchSourceMappingUrl;\r\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\r\n // jshint ignore:line\r\n lastSourceMappingUrl = matchSourceMappingUrl[1];\r\n }\r\n if (lastSourceMappingUrl) {\r\n return lastSourceMappingUrl;\r\n } else {\r\n throw new Error(\"sourceMappingURL not found\");\r\n }\r\n }\r\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\r\n return new Promise(function (resolve, reject) {\r\n var loc = sourceMapConsumer.originalPositionFor({\r\n line: stackframe.lineNumber,\r\n column: stackframe.columnNumber\r\n });\r\n if (loc.source) {\r\n // cache mapped sources\r\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\r\n if (mappedSource) {\r\n sourceCache[loc.source] = mappedSource;\r\n }\r\n resolve(// given stackframe and source location, update stackframe\r\n new StackFrame({\r\n functionName: loc.name || stackframe.functionName,\r\n args: stackframe.args,\r\n fileName: loc.source,\r\n lineNumber: loc.line,\r\n columnNumber: loc.column\r\n }));\r\n } else {\r\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\r\n }\r\n });\r\n }\r\n /**\r\n * @constructor\r\n * @param {Object} opts\r\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\r\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\r\n * opts.offline = True to prevent network requests.\r\n * Best effort without sources or source maps.\r\n * opts.ajax = Promise returning function to make X-Domain requests\r\n */\r\n return function StackTraceGPS(opts) {\r\n if (!(this instanceof StackTraceGPS)) {\r\n return new StackTraceGPS(opts);\r\n }\r\n opts = opts || {};\r\n this.sourceCache = opts.sourceCache || {};\r\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\r\n this.ajax = opts.ajax || _xdr;\r\n this._atob = opts.atob || _atob;\r\n\r\n this._get = function _get(location) {\r\n return new Promise(function (resolve, reject) {\r\n var isDataUrl = location.substr(0, 5) === \"data:\";\r\n if (this.sourceCache[location]) {\r\n resolve(this.sourceCache[location]);\r\n } else if (opts.offline && !isDataUrl) {\r\n reject(new Error(\"Cannot make network requests in offline mode\"));\r\n } else {\r\n if (isDataUrl) {\r\n // data URLs can have parameters.\r\n // see http://tools.ietf.org/html/rfc2397\r\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\r\n var match = location.match(supportedEncodingRegexp);\r\n if (match) {\r\n var sourceMapStart = match[0].length;\r\n var encodedSource = location.substr(sourceMapStart);\r\n var source = this._atob(encodedSource);\r\n this.sourceCache[location] = source;\r\n resolve(source);\r\n } else {\r\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\r\n }\r\n } else {\r\n var xhrPromise = this.ajax(location, {\r\n method: \"get\"\r\n });\r\n // Cache the Promise to prevent duplicate in-flight requests\r\n this.sourceCache[location] = xhrPromise;\r\n xhrPromise.then(resolve, reject);\r\n }\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\r\n * SourceMapConsumer in a per-instance cache.\r\n *\r\n * @param {String} sourceMappingURL = URL to fetch source map from\r\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\r\n * @returns {Promise} that resolves a SourceMapConsumer\r\n */\r\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\r\n return new Promise(function (resolve, reject) {\r\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\r\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\r\n } else {\r\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\r\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\r\n if (typeof sourceMapSource === \"string\") {\r\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\r\n }\r\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\r\n sourceMapSource.sourceRoot = defaultSourceRoot;\r\n }\r\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\r\n }, reject);\r\n }.bind(this));\r\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\r\n resolve(sourceMapConsumerPromise);\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, enhance function name and use source maps for a\r\n * better StackFrame.\r\n *\r\n * @param {StackFrame} stackframe object\r\n * @returns {Promise} that resolves with with source-mapped StackFrame\r\n */\r\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\r\n function resolveMappedStackFrame() {\r\n resolve(mappedStackFrame);\r\n }\r\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\r\n }.bind(this), reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, guess function name from location information.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureStackFrameIsLegit(stackframe);\r\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\r\n var lineNumber = stackframe.lineNumber;\r\n var columnNumber = stackframe.columnNumber;\r\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\r\n // Only replace functionName if we found something\r\n if (guessedFunctionName) {\r\n resolve(new StackFrame({\r\n functionName: guessedFunctionName,\r\n args: stackframe.args,\r\n fileName: stackframe.fileName,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber\r\n }));\r\n } else {\r\n resolve(stackframe);\r\n }\r\n }, reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureSupportedEnvironment();\r\n _ensureStackFrameIsLegit(stackframe);\r\n var sourceCache = this.sourceCache;\r\n var fileName = stackframe.fileName;\r\n this._get(fileName).then(function (source) {\r\n var sourceMappingURL = _findSourceMappingURL(source);\r\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\r\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\r\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\r\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\r\n }\r\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\r\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\r\n resolve(stackframe);\r\n });\r\n });\r\n }.bind(this), reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n };\r\n })(SourceMap, StackFrame);\r\n\r\n //\r\n // Shared Variables\r\n //\r\n\r\n var myScript = null;\r\n var scriptFile = document.getElementsByTagName('script');\r\n \r\n for (var i = 0; i < scriptFile.length; ++i) {\r\n if(isMe(scriptFile[i])) {\r\n myScript = scriptFile[i];\r\n }\r\n }\r\n\r\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\r\n var params = parseQuery(queryString);\r\n var paramsLength = objectLength(params);\r\n\r\n var debugSettings = {\r\n label: ' elmah.io debugger : On ',\r\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\r\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\r\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\r\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\r\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\r\n };\r\n\r\n var defaults = {\r\n apiKey: null,\r\n logId: null,\r\n debug: false,\r\n application: null,\r\n filter: null,\r\n captureConsoleMinimumLevel: 'none',\r\n breadcrumbs: false,\r\n breadcrumbsNumber: 10\r\n };\r\n\r\n var breadcrumbsDelay = 100;\r\n\r\n //\r\n // Shared Methods\r\n //\r\n\r\n var extend = function () {\r\n\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n\r\n // Check if a deep merge\r\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\r\n deep = arguments[0];\r\n i++;\r\n }\r\n\r\n // Merge the object into the extended object\r\n var merge = function (obj) {\r\n for (var prop in obj) {\r\n if (obj.hasOwnProperty(prop)) {\r\n // If property is an object, merge properties\r\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\r\n extended[prop] = extend(extended[prop], obj[prop]);\r\n } else {\r\n extended[prop] = obj[prop];\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Loop through each object and conduct a merge\r\n for (; i < arguments.length; i++) {\r\n var obj = arguments[i];\r\n merge(obj);\r\n }\r\n\r\n return extended;\r\n\r\n };\r\n\r\n //\r\n // Helpers\r\n //\r\n\r\n function isMe(scriptElem){\r\n if(scriptElem.getAttribute('src') != null) {\r\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\r\n }\r\n }\r\n\r\n function parseQuery(query) {\r\n var Params = new Object();\r\n if (!query) return Params; // return empty object\r\n var Pairs = query.split(/[;&]/);\r\n for (var i = 0; i < Pairs.length; i++) {\r\n var KeyVal = Pairs[i].split('=');\r\n if (!KeyVal || KeyVal.length !== 2) continue;\r\n var key = unescape(KeyVal[0]);\r\n var val = unescape(KeyVal[1]);\r\n val = val.replace(/\\+/g, ' ');\r\n Params[key] = val;\r\n }\r\n return Params;\r\n }\r\n\r\n function objectLength(obj) {\r\n var size = 0, key;\r\n for (key in obj) {\r\n if (obj.hasOwnProperty(key)) size++;\r\n }\r\n return size;\r\n };\r\n\r\n function getSearchParameters() {\r\n var prmstr = window.location.search.substr(1);\r\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\r\n }\r\n\r\n function transformToAssocArray(prmstr) {\r\n var params = [];\r\n var prmarr = prmstr.split(\"&\");\r\n for (var i = 0; i < prmarr.length; i++) {\r\n var tmparr = prmarr[i].split(\"=\");\r\n params.push({\r\n 'key': tmparr[0],\r\n 'value': tmparr[1]\r\n });\r\n }\r\n return params;\r\n }\r\n\r\n function merge_objects(obj1, obj2) {\r\n var obj3 = {};\r\n for (var attrname1 in obj1) {\r\n obj3[attrname1] = obj1[attrname1];\r\n }\r\n for (var attrname2 in obj2) {\r\n obj3[attrname2] = obj2[attrname2];\r\n }\r\n\r\n return obj3;\r\n }\r\n\r\n // sprintf-js\r\n var sprintfjs = function() {\r\n 'use strict'\r\n var app = {};\r\n var re = {\r\n not_string: /[^s]/,\r\n not_bool: /[^t]/,\r\n not_type: /[^T]/,\r\n not_primitive: /[^v]/,\r\n number: /[diefg]/,\r\n numeric_arg: /[bcdiefguxX]/,\r\n json: /[j]/,\r\n not_json: /[^j]/,\r\n text: /^[^\\x25]+/,\r\n modulo: /^\\x25{2}/,\r\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\r\n key: /^([a-z_][a-z_\\d]*)/i,\r\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\r\n index_access: /^\\[(\\d+)\\]/,\r\n sign: /^[+-]/,\r\n mod: /^\\x25\\s/,\r\n notplaceholder: /^\\x25?([^b-gijostTuvxX])/\r\n }\r\n\r\n function sprintf(key) {\r\n // `arguments` is not an array, but should be fine for this call\r\n return sprintf_format(sprintf_parse(key), arguments)\r\n }\r\n\r\n function vsprintf(fmt, argv) {\r\n return sprintf.apply(null, [fmt].concat(argv || []))\r\n }\r\n\r\n function sprintf_format(parse_tree, argv) {\r\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign;\r\n for (i = 0; i < tree_length; i++) {\r\n if (typeof parse_tree[i] === 'string') {\r\n output += parse_tree[i]\r\n }\r\n else if (typeof parse_tree[i] === 'object') {\r\n ph = parse_tree[i]; // placeholder\r\n if (ph.keys) { // keyword argument\r\n arg = argv[cursor]\r\n for (k = 0; k < ph.keys.length; k++) {\r\n if (arg == undefined) {\r\n throw new Error(sprintf('[sprintf] Cannot access property \"%s\" of undefined value \"%s\"', ph.keys[k], ph.keys[k-1]))\r\n }\r\n arg = arg[ph.keys[k]]\r\n }\r\n }\r\n else if (ph.param_no) { // positional argument (explicit)\r\n arg = argv[ph.param_no]\r\n }\r\n else { // positional argument (implicit)\r\n arg = argv[cursor++]\r\n }\r\n\r\n if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {\r\n arg = arg()\r\n }\r\n\r\n if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg) && arg === undefined)) { // treat %_d as string if it has no argument\r\n arg = ph.placeholder;\r\n ph.type = \"s\";\r\n }\r\n\r\n if (re.number.test(ph.type)) {\r\n is_positive = typeof arg === \"string\" ? true : arg >= 0\r\n }\r\n\r\n switch (ph.type) {\r\n case 'b':\r\n arg = parseInt(arg, 10).toString(2)\r\n break\r\n case 'c':\r\n arg = String.fromCharCode(parseInt(arg, 10))\r\n break\r\n case 'd':\r\n case 'i':\r\n arg = typeof arg === \"number\" ? parseInt(arg, 10) : NaN\r\n break\r\n case 'j':\r\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\r\n break\r\n case 'e':\r\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\r\n break\r\n case 'f':\r\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\r\n break\r\n case 'g':\r\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\r\n break\r\n case 'o':\r\n arg = (parseInt(arg, 10) >>> 0).toString(8)\r\n break\r\n case 's':\r\n arg = String(arg)\r\n arg = arg === \"undefined\" ? ph.placeholder : (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 't':\r\n arg = String(!!arg)\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'T':\r\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'u':\r\n arg = parseInt(arg, 10) >>> 0\r\n break\r\n case 'v':\r\n arg = arg.valueOf()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'x':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16)\r\n break\r\n case 'X':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\r\n break\r\n }\r\n if (re.json.test(ph.type)) {\r\n output += arg\r\n }\r\n else {\r\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\r\n sign = is_positive ? '+' : '-'\r\n arg = arg.toString().replace(re.sign, '')\r\n }\r\n else {\r\n sign = ''\r\n }\r\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\r\n pad_length = ph.width - (sign + arg).length\r\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\r\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\r\n }\r\n }\r\n }\r\n return output\r\n }\r\n\r\n var sprintf_cache = Object.create(null)\r\n\r\n function sprintf_parse(fmt) {\r\n var _fmt = fmt, match, parse_tree = [], arg_names = 0;\r\n while (_fmt) {\r\n if ((match = re.text.exec(_fmt)) !== null) {\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.modulo.exec(_fmt)) !== null) {\r\n parse_tree.push('%');\r\n }\r\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\r\n if (match[2]) {\r\n arg_names |= 1\r\n var field_list = [], replacement_field = match[2], field_match = []\r\n if ((field_match = re.key.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\r\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n }\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n match[2] = field_list\r\n }\r\n else {\r\n arg_names |= 2\r\n }\r\n if (arg_names === 3) {\r\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\r\n }\r\n\r\n parse_tree.push(\r\n {\r\n placeholder: match[0],\r\n param_no: match[1],\r\n keys: match[2],\r\n sign: match[3],\r\n pad_char: match[4],\r\n align: match[5],\r\n width: match[6],\r\n precision: match[7],\r\n type: match[8]\r\n }\r\n )\r\n }\r\n else if ((match = re.mod.exec(_fmt)) !== null) { // treat %_SPACE as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.notplaceholder.exec(_fmt)) !== null) { // treat %_NOTPLACEHOLDER as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] unexpected placeholder')\r\n }\r\n _fmt = _fmt.substring(match[0].length)\r\n }\r\n return parse_tree\r\n }\r\n\r\n app.sprintf = sprintf;\r\n app.vsprintf = vsprintf;\r\n return app;\r\n }\r\n\r\n function isString(what) {\r\n return Object.prototype.toString.call(what) === '[object String]';\r\n }\r\n\r\n function cssSelectorString(elem) {\r\n var MAX_TRAVERSE_HEIGHT = 5,\r\n MAX_OUTPUT_LEN = 80,\r\n out = [],\r\n height = 0,\r\n len = 0,\r\n separator = ' > ',\r\n sepLength = separator.length,\r\n nextStr;\r\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\r\n nextStr = htmlElementAsString(elem);\r\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\r\n break;\r\n }\r\n out.push(nextStr);\r\n len += nextStr.length;\r\n elem = elem.parentNode;\r\n }\r\n return out.reverse().join(separator);\r\n }\r\n \r\n function htmlElementAsString(elem) {\r\n var out = [], className, classes, key, attr, i;\r\n if (!elem || !elem.tagName) {\r\n return '';\r\n }\r\n out.push(elem.tagName.toLowerCase());\r\n if (elem.id) {\r\n out.push('#' + elem.id);\r\n }\r\n className = elem.className;\r\n if (className && isString(className)) {\r\n classes = className.split(/\\s+/);\r\n for (i = 0; i < classes.length; i++) {\r\n out.push('.' + classes[i]);\r\n }\r\n }\r\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\r\n for (i = 0; i < attrWhitelist.length; i++) {\r\n key = attrWhitelist[i];\r\n attr = elem.getAttribute(key);\r\n if (attr) {\r\n out.push('[' + key + '=\"' + attr + '\"]');\r\n }\r\n }\r\n return out.join('');\r\n }\r\n\r\n var parseHash = function(url) {\r\n return url.split('#')[1] || '';\r\n };\r\n\r\n //\r\n // Constructor\r\n //\r\n\r\n var Constructor = function (options) {\r\n\r\n //\r\n // Variables\r\n //\r\n\r\n var publicAPIs = {};\r\n var settings;\r\n var breadcrumbs = [];\r\n var lastHref = window.location && window.location.href;\r\n\r\n function getPayload() {\r\n var payload = {\r\n \"url\": document.location.pathname || '/',\r\n \"application\": settings.application\r\n };\r\n\r\n var payload_data = [];\r\n\r\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\r\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 });\r\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 });\r\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] });\r\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\r\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\r\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\r\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\r\n\r\n payload.data = payload_data;\r\n\r\n var payload_serverVariables = [];\r\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\r\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\r\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\r\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\r\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\r\n\r\n payload.serverVariables = payload_serverVariables;\r\n\r\n return payload;\r\n }\r\n\r\n function confirmResponse(status, response) {\r\n if (settings.debug) {\r\n if (status === 'error') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n } else if (status === 'success') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\r\n } else {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n }\r\n }\r\n }\r\n\r\n function stackGPS(error, xhr, jsonData) {\r\n \tvar errorStack = error.toString().split(\"\\n\")[0];\r\n \tvar gps = new StackTraceGPS();\r\n var promise = new Promise(function(resolve) {\r\n\t var stackframes = ErrorStackParser.parse(error);\r\n\t resolve(Promise.all(stackframes.map(function(sf) {\r\n\t return new Promise(function(resolve) {\r\n\t function resolveOriginal() {\r\n\t resolve(sf);\r\n\t }\r\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\r\n\t });\r\n\t })));\t\r\n });\r\n\r\n promise.then(function(newFrames){\r\n \tnewFrames.forEach(function(stackFrame, i){\r\n\t\t\t\t\tif(stackFrame.functionName) {\r\n \t\t\tvar fn = stackFrame.functionName + ' ';\r\n \t\t} else {\r\n \t\t\tvar fn = '';\r\n \t\t}\r\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\r\n \t\tnewFrames[i] = stackString;\r\n \t});\r\n \tnewFrames.unshift(errorStack);\r\n \tjsonData.detail = newFrames.join(\"\\n\");\r\n \txhr.send(JSON.stringify(jsonData));\r\n });\r\n }\r\n\r\n function stackString(error) {\r\n \tvar typeOF = typeof error.error;\r\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\r\n }\r\n\r\n function manipulateStack (errorStack, severity, message) {\r\n var stack = [];\r\n for (var i = 0; i < errorStack.length; i++) {\r\n if(errorStack[i] === \"Error\") {\r\n stack.push(severity + \": \" + message);\r\n }\r\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\r\n stack.push(errorStack[i]);\r\n }\r\n }\r\n return stack.join('\\n');\r\n }\r\n\r\n // Private methods\r\n\r\n var recordBreadcrumb = function(obj) {\r\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\r\n breadcrumbs_number = 10;\r\n \r\n breadcrumbs.push(crumb);\r\n \r\n if(options.breadcrumbsNumber && typeof options.breadcrumbsNumber === \"number\" ) {\r\n if(options.breadcrumbsNumber > 25) {\r\n breadcrumbs_number = 25;\r\n } else if(options.breadcrumbsNumber >= 10 && options.breadcrumbsNumber <= 25) {\r\n breadcrumbs_number = options.breadcrumbsNumber;\r\n }\r\n }\r\n \r\n if (breadcrumbs.length >= breadcrumbs_number) {\r\n breadcrumbs.shift();\r\n }\r\n }\r\n\r\n var breadcrumbClickEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Click\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbFormSubmitEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Form submit\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbWindowEventHandler = function(evt) {\r\n var type = evt.type,\r\n message = null;\r\n\r\n switch (type) {\r\n case \"load\":\r\n message = \"Page loaded\"; break;\r\n case \"DOMContentLoaded\":\r\n message = \"DOMContentLoaded\"; break;\r\n case \"pageshow\":\r\n message = \"Page shown\"; break;\r\n case \"pagehide\":\r\n message = \"Page hidden\"; break;\r\n case \"popstate\":\r\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": message\r\n });\r\n }\r\n\r\n var breadcrumbHashChangeEventHandler = function(evt) {\r\n var oldURL = evt.oldURL,\r\n newURL = evt.newURL,\r\n from = null,\r\n to = null,\r\n message = null;\r\n\r\n if (oldURL && newURL) {\r\n from = parseHash(oldURL);\r\n to = parseHash(newURL);\r\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\r\n } else {\r\n to = location.hash;\r\n message = \"to: '\" + to + \"'\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": \"Hash changed \" + message\r\n });\r\n }\r\n\r\n var breadcrumbXHRHandler = function(evt, method, url) {\r\n var status = evt && evt.target ? evt.target.status : 0,\r\n severity = null,\r\n method = method.toUpperCase(),\r\n url = url,\r\n regex = /https:\\/\\/api.elmah.io/g;\r\n\r\n if(url.match(regex) == null) { \r\n if (status > 0 && status < 400) {\r\n severity = \"Information\";\r\n } else if (status > 399 && status < 500) {\r\n severity = \"Warning\";\r\n } else if (status >= 500) {\r\n severity = \"Error\";\r\n }\r\n\r\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\r\n\r\n recordBreadcrumb({\r\n \"severity\": severity,\r\n \"action\": \"Request\",\r\n \"message\": \"[\" + method + \"] \" + url + statusCode\r\n });\r\n }\r\n }\r\n\r\n var sendPayload = function (apiKey, logId, callback, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n error = errorLog,\r\n send = 1,\r\n queryParams = getSearchParameters(),\r\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\r\n\r\n // Ignoring error from an external script\r\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\r\n\t\t\t if (settings.debug) {\r\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\r\n\t\t\t }\r\n\t\t\t return;\r\n\t\t\t}\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"detail\": error.error ? error.error.stack : null,\r\n \"title\": error.message || 'Unspecified error',\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"severity\": \"Error\",\r\n \"type\": error.error ? error.error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Check if error sent is a string and not an object\r\n // Then create the articifial stacktrace and pass source & type of the error\r\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\r\n \tvar typeOF = typeof errorLog.error;\r\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \tjsonData.detail = stackString(errorLog);\r\n \tjsonData.source = errorLog.source;\r\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\r\n }\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n \t// send message trying to pinpoint stackframes\r\n \tstackGPS(error.error, xhr, jsonData);\r\n\t } else {\r\n\t \t// send message\r\n \txhr.send(JSON.stringify(jsonData));\r\n\t }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n type = logType,\r\n error = errorLog,\r\n message = messageLog,\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n if (type !== \"Log\") {\r\n\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": type,\r\n \"type\": error ? error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n } else {\r\n\r\n var jsonData = error;\r\n \r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n // If message contains breadcrumbs\r\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\r\n breadcrumbs = breadcrumbs.reverse();\r\n for (var i = 0; i < breadcrumbs.length; i++) {\r\n // Add breadcrumbs to jsonData object\r\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\r\n }\r\n } else {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n }\r\n \r\n // Reset breadcrumbs\r\n breadcrumbs = [];\r\n }\r\n\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n // send message trying to pinpoint stackframes\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n // send message\r\n if(jsonData.errorObject) {\r\n error = jsonData.errorObject;\r\n delete jsonData.errorObject;\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n xhr.send(JSON.stringify(jsonData));\r\n }\r\n }\r\n\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n message = errorLog.message,\r\n messageTemplate = errorLog.message,\r\n type = logType,\r\n args = Object.values(errorLog.arguments),\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n // If message has placeholders (%s or %d), check for arguments and replace them\r\n \tif(String(message).match(/(%d|%s)+/ig) && args.length > 1) {\r\n \t\tvar sprintfJS = new sprintfjs();\r\n // Remove the first argument from array, which represents the message\r\n \t\targs.shift();\r\n message = sprintfJS.vsprintf(message, args);\r\n }\r\n\r\n if(typeof message !== \"string\"){\r\n message = message.toString();\r\n }\r\n\r\n if(typeof messageTemplate !== \"string\") {\r\n messageTemplate = messageTemplate.toString();\r\n }\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"titleTemplate\": messageTemplate,\r\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\r\n \"severity\": type,\r\n \"type\": null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n // send message\r\n xhr.send(JSON.stringify(jsonData));\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPrefilledLogMessage = function(errorLog) {\r\n // without error object\r\n if(!errorLog) return getPayload();\r\n\r\n // with error object\r\n var error = errorLog;\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n var jsonData = {\r\n \"title\": error.message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": \"Error\",\r\n \"type\": error ? error.name : null,\r\n \"errorObject\": error\r\n };\r\n\r\n jsonData = merge_objects(jsonData, getPayload());\r\n \r\n return jsonData;\r\n };\r\n\r\n // Some public methods\r\n\r\n publicAPIs.error = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.verbose = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.debug = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.information = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.warning = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.fatal = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.log = function (obj) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.message = function(error) {\r\n return sendPrefilledLogMessage(error);\r\n };\r\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\r\n recordBreadcrumb({\r\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\r\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\r\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\r\n });\r\n };\r\n\r\n publicAPIs.on = function (name, callback, ctx) {\r\n var e = this.e || (this.e = {});\r\n\r\n (e[name] || (e[name] = [])).push({\r\n fn: callback,\r\n ctx: ctx\r\n });\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.emit = function (name) {\r\n var data = [].slice.call(arguments, 1);\r\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\r\n var i = 0;\r\n var len = evtArr.length;\r\n\r\n for (i; i < len; i++) {\r\n evtArr[i].fn.apply(evtArr[i].ctx, data);\r\n }\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.init = function (options) {\r\n\r\n // -- Merge options into defaults\r\n settings = extend(defaults, options || {});\r\n\r\n // -- Breadcrumbs\r\n if (settings.breadcrumbs) {\r\n // Breadcrumbs - Click & Submit form\r\n if (document.addEventListener) {\r\n document.addEventListener('click', breadcrumbClickEventHandler, false);\r\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\r\n } else if (document.attachEvent) {\r\n document.attachEvent('click', breadcrumbClickEventHandler, false);\r\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\r\n }\r\n\r\n // Breadcrumbs - Navigation\r\n if (window.addEventListener) {\r\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\r\n } else if (window.attachEvent) {\r\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\r\n }\r\n\r\n if(window.history && window.history.pushState && window.history.replaceState) {\r\n var old_onpopstate = window.onpopstate;\r\n window.onpopstate = function(evt) {\r\n breadcrumbWindowEventHandler(evt);\r\n if (old_onpopstate) {\r\n return old_onpopstate.apply(this, arguments);\r\n }\r\n };\r\n }\r\n\r\n // Breadcrumbs - XHR\r\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\r\n // Store a reference to the native method\r\n var open = XMLHttpRequest.prototype.open;\r\n \r\n // Overwrite the native method\r\n XMLHttpRequest.prototype.open = function(method, url) {\r\n // Assign an event listener\r\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\r\n // Call the stored reference to the native method\r\n open.apply(this, arguments);\r\n };\r\n }\r\n }\r\n\r\n // -- Log on window error\r\n window.onerror = function (message, source, lineno, colno, error) {\r\n var errorLog = {\r\n 'message': message,\r\n 'source': source,\r\n 'lineno': lineno,\r\n 'colno': colno,\r\n 'error': error\r\n }\r\n \r\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n\r\n return false;\r\n }\r\n\r\n // -- Overriding console methods\r\n // -- Then log messages into the app.elmah.io\r\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\r\n\r\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console errors\r\n var _error = console.error;\r\n console.error = function(errMessage){\r\n var errorLog = {\r\n \t\t'message': errMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _error.apply(console, arguments);\r\n };\r\n if(options.captureConsoleMinimumLevel !== \"error\") {\r\n // Log console warnings\r\n var _warning = console.warn;\r\n console.warn = function(warnMessage){\r\n var errorLog = {\r\n 'message': warnMessage,\r\n 'arguments': arguments\r\n }\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _warning.apply(console, arguments);\r\n };\r\n }\r\n }\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console info\r\n var _info = console.info;\r\n console.info = function(infoMessage){\r\n var errorLog = {\r\n \t\t'message': infoMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _info.apply(console, arguments);\r\n };\r\n }\r\n if(options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console debug\r\n var _debug = console.debug;\r\n console.debug = function(debugMessage){\r\n var errorLog = {\r\n \t\t'message': debugMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _debug.apply(console, arguments);\r\n };\r\n }\r\n }\r\n };\r\n\r\n // Initialize the plugin\r\n publicAPIs.init(options);\r\n\r\n if (settings.debug) {\r\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\r\n }\r\n\r\n // Return the public APIs\r\n return publicAPIs;\r\n\r\n };\r\n\r\n\r\n //\r\n // Return the constructor\r\n //\r\n\r\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n // Immediately-Invoked Function Expression (IIFE)\r\n return new Constructor;\r\n } else {\r\n // UMD Constructor\r\n return Constructor;\r\n }\r\n\r\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","tokens","slice","locationParts","pop","source","functionNameRegex","matches","e","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","push","argsRaw","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","location","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","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","getSearchParameters","prmstr","prmarr","tmparr","transformToAssocArray","merge_objects","obj1","obj2","obj3","attrname1","attrname2","sprintfjs","app","re","not_string","not_bool","not_type","not_primitive","number","numeric_arg","json","not_json","text","modulo","placeholder","key_access","index_access","sign","mod","notplaceholder","sprintf","parse_tree","argv","arg","ph","pad","pad_character","pad_length","is_positive","cursor","tree_length","output","keys","param_no","type","Function","parseInt","fromCharCode","NaN","stringify","width","precision","toExponential","toFixed","toPrecision","toLowerCase","valueOf","pad_char","repeat","align","sprintf_format","fmt","_fmt","arg_names","field_list","replacement_field","field_match","SyntaxError","sprintf_parse","vsprintf","apply","isString","what","cssSelectorString","elem","nextStr","out","height","sepLength","htmlElementAsString","parentNode","reverse","className","classes","attr","tagName","attrWhitelist","parseHash","Constructor","options","settings","publicAPIs","lastHref","href","getPayload","payload","pathname","payload_data","documentMode","innerWidth","documentElement","clientWidth","innerHeight","clientHeight","screen","msOrientation","orientation","mozOrientation","colorDepth","data","payload_serverVariables","navigator","language","userAgent","referrer","protocol","hostname","serverVariables","confirmResponse","response","console","log","Date","toLocaleString","stackGPS","xhr","jsonData","errorStack","gps","stackframes","all","sf","resolveOriginal","newFrames","stackFrame","fn","stackString","unshift","detail","recordBreadcrumb","crumb","dateTime","toISOString","breadcrumbs_number","breadcrumbClickEventHandler","evt","target","severity","action","breadcrumbFormSubmitEventHandler","breadcrumbWindowEventHandler","breadcrumbHashChangeEventHandler","oldURL","newURL","hash","sendManualPayload","callback","logType","messageLog","errorLog","api_key","log_id","queryParams","setRequestHeader","onload","statusText","emit","title","queryString","errorObject","sendPayloadFromConsole","messageTemplate","values","sprintfJS","titleTemplate","manipulateStack","msg","setTimeout","verbose","information","warning","fatal","sendPrefilledLogMessage","addBreadcrumb","on","ctx","evtArr","init","addEventListener","attachEvent","history","pushState","replaceState","old_onpopstate","onpopstate","event","breadcrumbXHRHandler","lineno","colno","typeOF","typeOFCapitalized","sendPayload","_error","errMessage","_warning","warn","warnMessage","_info","info","infoMessage","_debug","debugMessage"],"mappings":";;;;CAIA,SAAUA,EAAMC,GACQ,mBAAXC,QAAyBA,OAAOC,IACzCD,OAAO,GAAI,WACT,OAAOD,E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AAInH,GAAgBV,EAAOjQ,eAAe,WAAaiQ,EAAOjQ,eAAe,SACpE,IAAI2X,EAEJA","sourcesContent":["/*!\r\n * elmah.io Javascript Logger - version 3.6.0\r\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define([], function () {\r\n return factory(root);\r\n });\r\n } else if (typeof exports === 'object') {\r\n module.exports = factory(root);\r\n } else {\r\n root.Elmahio = factory(root);\r\n }\r\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\r\n\r\n 'use strict';\r\n\r\n //\r\n // ==== STACKFRAME ====\r\n //\r\n\r\n var StackFrame = (function () {\r\n \"use strict\";\r\n function _isNumber(n) {\r\n return !isNaN(parseFloat(n)) && isFinite(n);\r\n }\r\n function _capitalize(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n }\r\n function _getter(p) {\r\n return function () {\r\n return this[p];\r\n };\r\n }\r\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\r\n var numericProps = [\"columnNumber\", \"lineNumber\"];\r\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\r\n var arrayProps = [\"args\"];\r\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\r\n function StackFrame(obj) {\r\n if (obj instanceof Object) {\r\n for (var i = 0; i < props.length; i++) {\r\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\r\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\r\n }\r\n }\r\n }\r\n }\r\n StackFrame.prototype = {\r\n getArgs: function () {\r\n return this.args;\r\n },\r\n setArgs: function (v) {\r\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\r\n throw new TypeError(\"Args must be an Array\");\r\n }\r\n this.args = v;\r\n },\r\n getEvalOrigin: function () {\r\n return this.evalOrigin;\r\n },\r\n setEvalOrigin: function (v) {\r\n if (v instanceof StackFrame) {\r\n this.evalOrigin = v;\r\n } else if (v instanceof Object) {\r\n this.evalOrigin = new StackFrame(v);\r\n } else {\r\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\r\n }\r\n },\r\n toString: function () {\r\n var functionName = this.getFunctionName() || \"{anonymous}\";\r\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\r\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\r\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\r\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\r\n return functionName + args + fileName + lineNumber + columnNumber;\r\n }\r\n };\r\n StackFrame.fromString = function StackFrame$$fromString(str) {\r\n var argsStartIndex = str.indexOf(\"(\");\r\n var argsEndIndex = str.lastIndexOf(\")\");\r\n var functionName = str.substring(0, argsStartIndex);\r\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\r\n var locationString = str.substring(argsEndIndex + 1);\r\n if (locationString.indexOf(\"@\") === 0) {\r\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\r\n var fileName = parts[1];\r\n var lineNumber = parts[2];\r\n var columnNumber = parts[3];\r\n }\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args || undefined,\r\n fileName: fileName,\r\n lineNumber: lineNumber || undefined,\r\n columnNumber: columnNumber || undefined\r\n });\r\n };\r\n for (var i = 0; i < booleanProps.length; i++) {\r\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\r\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\r\n return function (v) {\r\n this[p] = Boolean(v);\r\n };\r\n }(booleanProps[i]);\r\n }\r\n for (var j = 0; j < numericProps.length; j++) {\r\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\r\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\r\n return function (v) {\r\n if (!_isNumber(v)) {\r\n throw new TypeError(p + \" must be a Number\");\r\n }\r\n this[p] = Number(v);\r\n };\r\n }(numericProps[j]);\r\n }\r\n for (var k = 0; k < stringProps.length; k++) {\r\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\r\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\r\n return function (v) {\r\n this[p] = String(v);\r\n };\r\n }(stringProps[k]);\r\n }\r\n return StackFrame;\r\n })();\r\n\r\n //\r\n // ==== ERROR STACK PARSER ====\r\n //\r\n\r\n var ErrorStackParser = (function () {\r\n \"use strict\";\r\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\r\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\r\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\r\n return {\r\n /**\r\n * Given an Error object, extract the most information from it.\r\n *\r\n * @param {Error} error object\r\n * @return {Array} of StackFrames\r\n */\r\n parse: function ErrorStackParser$$parse(error) {\r\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\r\n return this.parseOpera(error);\r\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\r\n return this.parseV8OrIE(error);\r\n } else if (error.stack) {\r\n return this.parseFFOrSafari(error);\r\n } else {\r\n throw new Error(\"Cannot parse given Error object\");\r\n }\r\n },\r\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\r\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\r\n // Fail-fast but return locations like \"(native)\"\r\n if (urlLike.indexOf(\":\") === -1) {\r\n return [urlLike];\r\n }\r\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\r\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\r\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\r\n },\r\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(CHROME_IE_STACK_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n if (line.indexOf(\"(eval \") > -1) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\r\n }\r\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionName = tokens.join(\" \") || undefined;\r\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: fileName,\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n },\r\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n // Throw away eval information until we implement stacktrace.js/stackframe#8\r\n if (line.indexOf(\" > eval\") > -1) {\r\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\r\n }\r\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\r\n // Safari eval frames only have function names and nothing else\r\n return new StackFrame({\r\n functionName: line\r\n });\r\n } else {\r\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\r\n var matches = line.match(functionNameRegex);\r\n var functionName = matches && matches[1] ? matches[1] : undefined;\r\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\r\n return new StackFrame({\r\n functionName: functionName,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }\r\n }, this);\r\n },\r\n parseOpera: function ErrorStackParser$$parseOpera(e) {\r\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\r\n return this.parseOpera9(e);\r\n } else if (!e.stack) {\r\n return this.parseOpera10(e);\r\n } else {\r\n return this.parseOpera11(e);\r\n }\r\n },\r\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\r\n var lines = e.message.split(\"\\n\");\r\n var result = [];\r\n for (var i = 2, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\r\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\r\n var lines = e.stacktrace.split(\"\\n\");\r\n var result = [];\r\n for (var i = 0, len = lines.length; i < len; i += 2) {\r\n var match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n functionName: match[3] || undefined,\r\n fileName: match[2],\r\n lineNumber: match[1],\r\n source: lines[i]\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n // Opera 10.65+ Error.stack very similar to FF/Safari\r\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\r\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\r\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\r\n }, this);\r\n return filtered.map(function (line) {\r\n var tokens = line.split(\"@\");\r\n var locationParts = this.extractLocation(tokens.pop());\r\n var functionCall = tokens.shift() || \"\";\r\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\r\n var argsRaw;\r\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\r\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\r\n }\r\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\r\n return new StackFrame({\r\n functionName: functionName,\r\n args: args,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n source: line\r\n });\r\n }, this);\r\n }\r\n };\r\n })();\r\n\r\n //\r\n // ==== STACKTRACE-GPS ====\r\n //\r\n\r\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) {\r\n resolve(req.responseText);\r\n } else {\r\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\r\n }\r\n }\r\n };\r\n req.send();\r\n });\r\n }\r\n /**\r\n * Convert a Base64-encoded string into its original representation.\r\n * Used for inline sourcemaps.\r\n *\r\n * @param {String} b64str Base-64 encoded string\r\n * @returns {String} original representation of the base64-encoded string.\r\n */\r\n function _atob(b64str) {\r\n if (typeof window !== \"undefined\" && window.atob) {\r\n return window.atob(b64str);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\r\n }\r\n }\r\n function _parseJson(string) {\r\n if (typeof JSON !== \"undefined\" && JSON.parse) {\r\n return JSON.parse(string);\r\n } else {\r\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\r\n }\r\n }\r\n function _findFunctionName(source, lineNumber) {\r\n var syntaxes = [ // {name} = function ({args}) TODO args capture\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\r\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\r\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\r\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\r\n var lines = source.split(\"\\n\");\r\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\r\n var code = \"\";\r\n var maxLines = Math.min(lineNumber, 20);\r\n for (var i = 0; i < maxLines; ++i) {\r\n // lineNo is 1-based, source[] is 0-based\r\n var line = lines[lineNumber - i - 1];\r\n var commentPos = line.indexOf(\"//\");\r\n if (commentPos >= 0) {\r\n line = line.substr(0, commentPos);\r\n }\r\n if (line) {\r\n code = line + code;\r\n var len = syntaxes.length;\r\n for (var index = 0; index < len; index++) {\r\n var m = syntaxes[index].exec(code);\r\n if (m && m[1]) {\r\n return m[1];\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n function _ensureSupportedEnvironment() {\r\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\r\n throw new Error(\"Unable to consume source maps in older browsers\");\r\n }\r\n }\r\n function _ensureStackFrameIsLegit(stackframe) {\r\n if (typeof stackframe !== \"object\") {\r\n throw new TypeError(\"Given StackFrame is not an object\");\r\n } else if (typeof stackframe.fileName !== \"string\") {\r\n throw new TypeError(\"Given file name is not a String\");\r\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\r\n throw new TypeError(\"Given line number must be a positive integer\");\r\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\r\n throw new TypeError(\"Given column number must be a non-negative integer\");\r\n }\r\n return true;\r\n }\r\n function _findSourceMappingURL(source) {\r\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\r\n var lastSourceMappingUrl;\r\n var matchSourceMappingUrl;\r\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\r\n // jshint ignore:line\r\n lastSourceMappingUrl = matchSourceMappingUrl[1];\r\n }\r\n if (lastSourceMappingUrl) {\r\n return lastSourceMappingUrl;\r\n } else {\r\n throw new Error(\"sourceMappingURL not found\");\r\n }\r\n }\r\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\r\n return new Promise(function (resolve, reject) {\r\n var loc = sourceMapConsumer.originalPositionFor({\r\n line: stackframe.lineNumber,\r\n column: stackframe.columnNumber\r\n });\r\n if (loc.source) {\r\n // cache mapped sources\r\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\r\n if (mappedSource) {\r\n sourceCache[loc.source] = mappedSource;\r\n }\r\n resolve(// given stackframe and source location, update stackframe\r\n new StackFrame({\r\n functionName: loc.name || stackframe.functionName,\r\n args: stackframe.args,\r\n fileName: loc.source,\r\n lineNumber: loc.line,\r\n columnNumber: loc.column\r\n }));\r\n } else {\r\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\r\n }\r\n });\r\n }\r\n /**\r\n * @constructor\r\n * @param {Object} opts\r\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\r\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\r\n * opts.offline = True to prevent network requests.\r\n * Best effort without sources or source maps.\r\n * opts.ajax = Promise returning function to make X-Domain requests\r\n */\r\n return function StackTraceGPS(opts) {\r\n if (!(this instanceof StackTraceGPS)) {\r\n return new StackTraceGPS(opts);\r\n }\r\n opts = opts || {};\r\n this.sourceCache = opts.sourceCache || {};\r\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\r\n this.ajax = opts.ajax || _xdr;\r\n this._atob = opts.atob || _atob;\r\n\r\n this._get = function _get(location) {\r\n return new Promise(function (resolve, reject) {\r\n var isDataUrl = location.substr(0, 5) === \"data:\";\r\n if (this.sourceCache[location]) {\r\n resolve(this.sourceCache[location]);\r\n } else if (opts.offline && !isDataUrl) {\r\n reject(new Error(\"Cannot make network requests in offline mode\"));\r\n } else {\r\n if (isDataUrl) {\r\n // data URLs can have parameters.\r\n // see http://tools.ietf.org/html/rfc2397\r\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\r\n var match = location.match(supportedEncodingRegexp);\r\n if (match) {\r\n var sourceMapStart = match[0].length;\r\n var encodedSource = location.substr(sourceMapStart);\r\n var source = this._atob(encodedSource);\r\n this.sourceCache[location] = source;\r\n resolve(source);\r\n } else {\r\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\r\n }\r\n } else {\r\n var xhrPromise = this.ajax(location, {\r\n method: \"get\"\r\n });\r\n // Cache the Promise to prevent duplicate in-flight requests\r\n this.sourceCache[location] = xhrPromise;\r\n xhrPromise.then(resolve, reject);\r\n }\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\r\n * SourceMapConsumer in a per-instance cache.\r\n *\r\n * @param {String} sourceMappingURL = URL to fetch source map from\r\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\r\n * @returns {Promise} that resolves a SourceMapConsumer\r\n */\r\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\r\n return new Promise(function (resolve, reject) {\r\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\r\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\r\n } else {\r\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\r\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\r\n if (typeof sourceMapSource === \"string\") {\r\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\r\n }\r\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\r\n sourceMapSource.sourceRoot = defaultSourceRoot;\r\n }\r\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\r\n }, reject);\r\n }.bind(this));\r\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\r\n resolve(sourceMapConsumerPromise);\r\n }\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, enhance function name and use source maps for a\r\n * better StackFrame.\r\n *\r\n * @param {StackFrame} stackframe object\r\n * @returns {Promise} that resolves with with source-mapped StackFrame\r\n */\r\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\r\n function resolveMappedStackFrame() {\r\n resolve(mappedStackFrame);\r\n }\r\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\r\n }.bind(this), reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, guess function name from location information.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureStackFrameIsLegit(stackframe);\r\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\r\n var lineNumber = stackframe.lineNumber;\r\n var columnNumber = stackframe.columnNumber;\r\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\r\n // Only replace functionName if we found something\r\n if (guessedFunctionName) {\r\n resolve(new StackFrame({\r\n functionName: guessedFunctionName,\r\n args: stackframe.args,\r\n fileName: stackframe.fileName,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber\r\n }));\r\n } else {\r\n resolve(stackframe);\r\n }\r\n }, reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n /**\r\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\r\n *\r\n * @param {StackFrame} stackframe\r\n * @returns {Promise} that resolves with enhanced StackFrame.\r\n */\r\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\r\n return new Promise(function (resolve, reject) {\r\n _ensureSupportedEnvironment();\r\n _ensureStackFrameIsLegit(stackframe);\r\n var sourceCache = this.sourceCache;\r\n var fileName = stackframe.fileName;\r\n this._get(fileName).then(function (source) {\r\n var sourceMappingURL = _findSourceMappingURL(source);\r\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\r\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\r\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\r\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\r\n }\r\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\r\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\r\n resolve(stackframe);\r\n });\r\n });\r\n }.bind(this), reject)[\"catch\"](reject);\r\n }.bind(this));\r\n };\r\n };\r\n })(SourceMap, StackFrame);\r\n\r\n //\r\n // Shared Variables\r\n //\r\n\r\n var myScript = null;\r\n var scriptFile = document.getElementsByTagName('script');\r\n \r\n for (var i = 0; i < scriptFile.length; ++i) {\r\n if(isMe(scriptFile[i])) {\r\n myScript = scriptFile[i];\r\n }\r\n }\r\n\r\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\r\n var params = parseQuery(queryString);\r\n var paramsLength = objectLength(params);\r\n\r\n var debugSettings = {\r\n label: ' elmah.io debugger : On ',\r\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\r\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\r\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\r\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\r\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\r\n };\r\n\r\n var defaults = {\r\n apiKey: null,\r\n logId: null,\r\n debug: false,\r\n application: null,\r\n filter: null,\r\n captureConsoleMinimumLevel: 'none',\r\n breadcrumbs: false,\r\n breadcrumbsNumber: 10\r\n };\r\n\r\n var breadcrumbsDelay = 100;\r\n\r\n //\r\n // Shared Methods\r\n //\r\n\r\n var extend = function () {\r\n\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n\r\n // Check if a deep merge\r\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\r\n deep = arguments[0];\r\n i++;\r\n }\r\n\r\n // Merge the object into the extended object\r\n var merge = function (obj) {\r\n for (var prop in obj) {\r\n if (obj.hasOwnProperty(prop)) {\r\n // If property is an object, merge properties\r\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\r\n extended[prop] = extend(extended[prop], obj[prop]);\r\n } else {\r\n extended[prop] = obj[prop];\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Loop through each object and conduct a merge\r\n for (; i < arguments.length; i++) {\r\n var obj = arguments[i];\r\n merge(obj);\r\n }\r\n\r\n return extended;\r\n\r\n };\r\n\r\n //\r\n // Helpers\r\n //\r\n\r\n function isMe(scriptElem){\r\n if(scriptElem.getAttribute('src') != null) {\r\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\r\n }\r\n }\r\n\r\n function parseQuery(query) {\r\n var Params = new Object();\r\n if (!query) return Params; // return empty object\r\n var Pairs = query.split(/[;&]/);\r\n for (var i = 0; i < Pairs.length; i++) {\r\n var KeyVal = Pairs[i].split('=');\r\n if (!KeyVal || KeyVal.length !== 2) continue;\r\n var key = unescape(KeyVal[0]);\r\n var val = unescape(KeyVal[1]);\r\n val = val.replace(/\\+/g, ' ');\r\n Params[key] = val;\r\n }\r\n return Params;\r\n }\r\n\r\n function objectLength(obj) {\r\n var size = 0, key;\r\n for (key in obj) {\r\n if (obj.hasOwnProperty(key)) size++;\r\n }\r\n return size;\r\n };\r\n\r\n function getSearchParameters() {\r\n var prmstr = window.location.search.substr(1);\r\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\r\n }\r\n\r\n function transformToAssocArray(prmstr) {\r\n var params = [];\r\n var prmarr = prmstr.split(\"&\");\r\n for (var i = 0; i < prmarr.length; i++) {\r\n var tmparr = prmarr[i].split(\"=\");\r\n params.push({\r\n 'key': tmparr[0],\r\n 'value': tmparr[1]\r\n });\r\n }\r\n return params;\r\n }\r\n\r\n function merge_objects(obj1, obj2) {\r\n var obj3 = {};\r\n for (var attrname1 in obj1) {\r\n obj3[attrname1] = obj1[attrname1];\r\n }\r\n for (var attrname2 in obj2) {\r\n obj3[attrname2] = obj2[attrname2];\r\n }\r\n\r\n return obj3;\r\n }\r\n\r\n // sprintf-js\r\n var sprintfjs = function() {\r\n 'use strict'\r\n var app = {};\r\n var re = {\r\n not_string: /[^s]/,\r\n not_bool: /[^t]/,\r\n not_type: /[^T]/,\r\n not_primitive: /[^v]/,\r\n number: /[diefg]/,\r\n numeric_arg: /[bcdiefguxX]/,\r\n json: /[j]/,\r\n not_json: /[^j]/,\r\n text: /^[^\\x25]+/,\r\n modulo: /^\\x25{2}/,\r\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\r\n key: /^([a-z_][a-z_\\d]*)/i,\r\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\r\n index_access: /^\\[(\\d+)\\]/,\r\n sign: /^[+-]/,\r\n mod: /^\\x25\\s/,\r\n notplaceholder: /^\\x25?([^b-gijostTuvxX])/\r\n }\r\n\r\n function sprintf(key) {\r\n // `arguments` is not an array, but should be fine for this call\r\n return sprintf_format(sprintf_parse(key), arguments)\r\n }\r\n\r\n function vsprintf(fmt, argv) {\r\n return sprintf.apply(null, [fmt].concat(argv || []))\r\n }\r\n\r\n function sprintf_format(parse_tree, argv) {\r\n var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign;\r\n for (i = 0; i < tree_length; i++) {\r\n if (typeof parse_tree[i] === 'string') {\r\n output += parse_tree[i]\r\n }\r\n else if (typeof parse_tree[i] === 'object') {\r\n ph = parse_tree[i]; // placeholder\r\n if (ph.keys) { // keyword argument\r\n arg = argv[cursor]\r\n for (k = 0; k < ph.keys.length; k++) {\r\n if (arg == undefined) {\r\n throw new Error(sprintf('[sprintf] Cannot access property \"%s\" of undefined value \"%s\"', ph.keys[k], ph.keys[k-1]))\r\n }\r\n arg = arg[ph.keys[k]]\r\n }\r\n }\r\n else if (ph.param_no) { // positional argument (explicit)\r\n arg = argv[ph.param_no]\r\n }\r\n else { // positional argument (implicit)\r\n arg = argv[cursor++]\r\n }\r\n\r\n if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {\r\n arg = arg()\r\n }\r\n\r\n if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg) && arg === undefined)) { // treat %_d as string if it has no argument\r\n arg = ph.placeholder;\r\n ph.type = \"s\";\r\n }\r\n\r\n if (re.number.test(ph.type)) {\r\n is_positive = typeof arg === \"string\" ? true : arg >= 0\r\n }\r\n\r\n switch (ph.type) {\r\n case 'b':\r\n arg = parseInt(arg, 10).toString(2)\r\n break\r\n case 'c':\r\n arg = String.fromCharCode(parseInt(arg, 10))\r\n break\r\n case 'd':\r\n case 'i':\r\n arg = typeof arg === \"number\" ? parseInt(arg, 10) : NaN\r\n break\r\n case 'j':\r\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\r\n break\r\n case 'e':\r\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\r\n break\r\n case 'f':\r\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\r\n break\r\n case 'g':\r\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\r\n break\r\n case 'o':\r\n arg = (parseInt(arg, 10) >>> 0).toString(8)\r\n break\r\n case 's':\r\n arg = String(arg)\r\n arg = arg === \"undefined\" ? ph.placeholder : (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 't':\r\n arg = String(!!arg)\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'T':\r\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'u':\r\n arg = parseInt(arg, 10) >>> 0\r\n break\r\n case 'v':\r\n arg = arg.valueOf()\r\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\r\n break\r\n case 'x':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16)\r\n break\r\n case 'X':\r\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\r\n break\r\n }\r\n if (re.json.test(ph.type)) {\r\n output += arg\r\n }\r\n else {\r\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\r\n sign = is_positive ? '+' : '-'\r\n arg = arg.toString().replace(re.sign, '')\r\n }\r\n else {\r\n sign = ''\r\n }\r\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\r\n pad_length = ph.width - (sign + arg).length\r\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\r\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\r\n }\r\n }\r\n }\r\n return output\r\n }\r\n\r\n var sprintf_cache = Object.create(null)\r\n\r\n function sprintf_parse(fmt) {\r\n var _fmt = fmt, match, parse_tree = [], arg_names = 0;\r\n while (_fmt) {\r\n if ((match = re.text.exec(_fmt)) !== null) {\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.modulo.exec(_fmt)) !== null) {\r\n parse_tree.push('%');\r\n }\r\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\r\n if (match[2]) {\r\n arg_names |= 1\r\n var field_list = [], replacement_field = match[2], field_match = []\r\n if ((field_match = re.key.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\r\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\r\n field_list.push(field_match[1])\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n }\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] failed to parse named argument key')\r\n }\r\n match[2] = field_list\r\n }\r\n else {\r\n arg_names |= 2\r\n }\r\n if (arg_names === 3) {\r\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\r\n }\r\n\r\n parse_tree.push(\r\n {\r\n placeholder: match[0],\r\n param_no: match[1],\r\n keys: match[2],\r\n sign: match[3],\r\n pad_char: match[4],\r\n align: match[5],\r\n width: match[6],\r\n precision: match[7],\r\n type: match[8]\r\n }\r\n )\r\n }\r\n else if ((match = re.mod.exec(_fmt)) !== null) { // treat %_SPACE as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else if ((match = re.notplaceholder.exec(_fmt)) !== null) { // treat %_NOTPLACEHOLDER as a string\r\n parse_tree.push(match[0]);\r\n }\r\n else {\r\n throw new SyntaxError('[sprintf] unexpected placeholder')\r\n }\r\n _fmt = _fmt.substring(match[0].length)\r\n }\r\n return parse_tree\r\n }\r\n\r\n app.sprintf = sprintf;\r\n app.vsprintf = vsprintf;\r\n return app;\r\n }\r\n\r\n function isString(what) {\r\n return Object.prototype.toString.call(what) === '[object String]';\r\n }\r\n\r\n function cssSelectorString(elem) {\r\n var MAX_TRAVERSE_HEIGHT = 5,\r\n MAX_OUTPUT_LEN = 80,\r\n out = [],\r\n height = 0,\r\n len = 0,\r\n separator = ' > ',\r\n sepLength = separator.length,\r\n nextStr;\r\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\r\n nextStr = htmlElementAsString(elem);\r\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\r\n break;\r\n }\r\n out.push(nextStr);\r\n len += nextStr.length;\r\n elem = elem.parentNode;\r\n }\r\n return out.reverse().join(separator);\r\n }\r\n \r\n function htmlElementAsString(elem) {\r\n var out = [], className, classes, key, attr, i;\r\n if (!elem || !elem.tagName) {\r\n return '';\r\n }\r\n out.push(elem.tagName.toLowerCase());\r\n if (elem.id) {\r\n out.push('#' + elem.id);\r\n }\r\n className = elem.className;\r\n if (className && isString(className)) {\r\n classes = className.split(/\\s+/);\r\n for (i = 0; i < classes.length; i++) {\r\n out.push('.' + classes[i]);\r\n }\r\n }\r\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\r\n for (i = 0; i < attrWhitelist.length; i++) {\r\n key = attrWhitelist[i];\r\n attr = elem.getAttribute(key);\r\n if (attr) {\r\n out.push('[' + key + '=\"' + attr + '\"]');\r\n }\r\n }\r\n return out.join('');\r\n }\r\n\r\n var parseHash = function(url) {\r\n return url.split('#')[1] || '';\r\n };\r\n\r\n //\r\n // Constructor\r\n //\r\n\r\n var Constructor = function (options) {\r\n\r\n //\r\n // Variables\r\n //\r\n\r\n var publicAPIs = {};\r\n var settings;\r\n var breadcrumbs = [];\r\n var lastHref = window.location && window.location.href;\r\n\r\n function getPayload() {\r\n var payload = {\r\n \"url\": document.location.pathname || '/',\r\n \"application\": settings.application\r\n };\r\n\r\n var payload_data = [];\r\n\r\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\r\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 });\r\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 });\r\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] });\r\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\r\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\r\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\r\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\r\n\r\n payload.data = payload_data;\r\n\r\n var payload_serverVariables = [];\r\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\r\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\r\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\r\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\r\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\r\n\r\n payload.serverVariables = payload_serverVariables;\r\n\r\n return payload;\r\n }\r\n\r\n function confirmResponse(status, response) {\r\n if (settings.debug) {\r\n if (status === 'error') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n } else if (status === 'success') {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\r\n } else {\r\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\r\n }\r\n }\r\n }\r\n\r\n function stackGPS(error, xhr, jsonData) {\r\n \tvar errorStack = error.toString().split(\"\\n\")[0];\r\n \tvar gps = new StackTraceGPS();\r\n var promise = new Promise(function(resolve) {\r\n\t var stackframes = ErrorStackParser.parse(error);\r\n\t resolve(Promise.all(stackframes.map(function(sf) {\r\n\t return new Promise(function(resolve) {\r\n\t function resolveOriginal() {\r\n\t resolve(sf);\r\n\t }\r\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\r\n\t });\r\n\t })));\t\r\n });\r\n\r\n promise.then(function(newFrames){\r\n \tnewFrames.forEach(function(stackFrame, i){\r\n\t\t\t\t\tif(stackFrame.functionName) {\r\n \t\t\tvar fn = stackFrame.functionName + ' ';\r\n \t\t} else {\r\n \t\t\tvar fn = '';\r\n \t\t}\r\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\r\n \t\tnewFrames[i] = stackString;\r\n \t});\r\n \tnewFrames.unshift(errorStack);\r\n \tjsonData.detail = newFrames.join(\"\\n\");\r\n \txhr.send(JSON.stringify(jsonData));\r\n });\r\n }\r\n\r\n function stackString(error) {\r\n \tvar typeOF = typeof error.error;\r\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\r\n }\r\n\r\n function manipulateStack (errorStack, severity, message) {\r\n var stack = [];\r\n for (var i = 0; i < errorStack.length; i++) {\r\n if(errorStack[i] === \"Error\") {\r\n stack.push(severity + \": \" + message);\r\n }\r\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\r\n stack.push(errorStack[i]);\r\n }\r\n }\r\n return stack.join('\\n');\r\n }\r\n\r\n // Private methods\r\n\r\n var recordBreadcrumb = function(obj) {\r\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\r\n breadcrumbs_number = 10;\r\n \r\n breadcrumbs.push(crumb);\r\n \r\n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\r\n if(options.breadcrumbsNumber > 25) {\r\n breadcrumbs_number = 25;\r\n } else if(options.breadcrumbsNumber <= 25) {\r\n breadcrumbs_number = options.breadcrumbsNumber;\r\n }\r\n }\r\n \r\n if (breadcrumbs.length > breadcrumbs_number) {\r\n breadcrumbs.shift();\r\n }\r\n }\r\n\r\n var breadcrumbClickEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Click\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbFormSubmitEventHandler = function(evt) {\r\n var target;\r\n try {\r\n target = cssSelectorString(evt.target);\r\n } catch (e) {\r\n target = \"\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Form submit\",\r\n \"message\": target\r\n });\r\n }\r\n\r\n var breadcrumbWindowEventHandler = function(evt) {\r\n var type = evt.type,\r\n message = null;\r\n\r\n switch (type) {\r\n case \"load\":\r\n message = \"Page loaded\"; break;\r\n case \"DOMContentLoaded\":\r\n message = \"DOMContentLoaded\"; break;\r\n case \"pageshow\":\r\n message = \"Page shown\"; break;\r\n case \"pagehide\":\r\n message = \"Page hidden\"; break;\r\n case \"popstate\":\r\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": message\r\n });\r\n }\r\n\r\n var breadcrumbHashChangeEventHandler = function(evt) {\r\n var oldURL = evt.oldURL,\r\n newURL = evt.newURL,\r\n from = null,\r\n to = null,\r\n message = null;\r\n\r\n if (oldURL && newURL) {\r\n from = parseHash(oldURL);\r\n to = parseHash(newURL);\r\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\r\n } else {\r\n to = location.hash;\r\n message = \"to: '\" + to + \"'\";\r\n }\r\n\r\n recordBreadcrumb({\r\n \"severity\": \"Information\",\r\n \"action\": \"Navigation\",\r\n \"message\": \"Hash changed \" + message\r\n });\r\n }\r\n\r\n var breadcrumbXHRHandler = function(evt, method, url) {\r\n var status = evt && evt.target ? evt.target.status : 0,\r\n severity = null,\r\n method = method.toUpperCase(),\r\n url = url,\r\n regex = /https:\\/\\/api.elmah.io/g;\r\n\r\n if(url.match(regex) == null) { \r\n if (status > 0 && status < 400) {\r\n severity = \"Information\";\r\n } else if (status > 399 && status < 500) {\r\n severity = \"Warning\";\r\n } else if (status >= 500) {\r\n severity = \"Error\";\r\n }\r\n\r\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\r\n\r\n recordBreadcrumb({\r\n \"severity\": severity,\r\n \"action\": \"Request\",\r\n \"message\": \"[\" + method + \"] \" + url + statusCode\r\n });\r\n }\r\n }\r\n\r\n var sendPayload = function (apiKey, logId, callback, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n error = errorLog,\r\n send = 1,\r\n queryParams = getSearchParameters(),\r\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\r\n\r\n // Ignoring error from an external script\r\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\r\n\t\t\t if (settings.debug) {\r\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\r\n\t\t\t }\r\n\t\t\t return;\r\n\t\t\t}\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"detail\": error.error ? error.error.stack : null,\r\n \"title\": error.message || 'Unspecified error',\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"severity\": \"Error\",\r\n \"type\": error.error ? error.error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Check if error sent is a string and not an object\r\n // Then create the articifial stacktrace and pass source & type of the error\r\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\r\n \tvar typeOF = typeof errorLog.error;\r\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\r\n\r\n \tjsonData.detail = stackString(errorLog);\r\n \tjsonData.source = errorLog.source;\r\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\r\n }\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n \t// send message trying to pinpoint stackframes\r\n \tstackGPS(error.error, xhr, jsonData);\r\n\t } else {\r\n\t \t// send message\r\n \txhr.send(JSON.stringify(jsonData));\r\n\t }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n type = logType,\r\n error = errorLog,\r\n message = messageLog,\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n if (type !== \"Log\") {\r\n\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": type,\r\n \"type\": error ? error.name : null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n } else {\r\n\r\n var jsonData = error;\r\n \r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n // If message contains breadcrumbs\r\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\r\n breadcrumbs = breadcrumbs.reverse();\r\n for (var i = 0; i < breadcrumbs.length; i++) {\r\n // Add breadcrumbs to jsonData object\r\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\r\n }\r\n } else {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n }\r\n \r\n // Reset breadcrumbs\r\n breadcrumbs = [];\r\n }\r\n\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n\r\n if (error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\r\n // send message trying to pinpoint stackframes\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n // send message\r\n if(jsonData.errorObject) {\r\n error = jsonData.errorObject;\r\n delete jsonData.errorObject;\r\n stackGPS(error, xhr, jsonData);\r\n } else {\r\n xhr.send(JSON.stringify(jsonData));\r\n }\r\n }\r\n\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\r\n var api_key = apiKey,\r\n log_id = logId,\r\n message = errorLog.message,\r\n messageTemplate = errorLog.message,\r\n type = logType,\r\n args = Object.values(errorLog.arguments),\r\n send = 1,\r\n queryParams = getSearchParameters();\r\n\r\n // If message has placeholders (%s or %d), check for arguments and replace them\r\n \tif(String(message).match(/(%d|%s)+/ig) && args.length > 1) {\r\n \t\tvar sprintfJS = new sprintfjs();\r\n // Remove the first argument from array, which represents the message\r\n \t\targs.shift();\r\n message = sprintfJS.vsprintf(message, args);\r\n }\r\n\r\n if(typeof message !== \"string\"){\r\n message = message.toString();\r\n }\r\n\r\n if(typeof messageTemplate !== \"string\") {\r\n messageTemplate = messageTemplate.toString();\r\n }\r\n\r\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\r\n\r\n // Priority for parameters\r\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n api_key = params['apiKey'];\r\n log_id = params['logId'];\r\n }\r\n\r\n // get new XHR object\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\r\n xhr.setRequestHeader('Content-type', 'application/json');\r\n\r\n xhr.onload = function (e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 201) {\r\n callback('success', xhr.statusText);\r\n }\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n callback('error', xhr.statusText);\r\n // on error event\r\n publicAPIs.emit('error', xhr.status, xhr.statusText);\r\n }\r\n\r\n var jsonData = {\r\n \"title\": message,\r\n \"titleTemplate\": messageTemplate,\r\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\r\n \"severity\": type,\r\n \"type\": null,\r\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\r\n };\r\n\r\n // Add payload to jsonData\r\n jsonData = merge_objects(jsonData, getPayload());\r\n\r\n // Add breadcrumbs to jsonData\r\n if(breadcrumbs.length > 0) {\r\n jsonData.breadcrumbs = breadcrumbs;\r\n breadcrumbs = [];\r\n }\r\n\r\n // filter callback\r\n if (settings.filter !== null) {\r\n if (settings.filter(jsonData)) {\r\n send = 0;\r\n }\r\n }\r\n\r\n if (send === 1) {\r\n if (jsonData.title) {\r\n // on message event\r\n publicAPIs.emit('message', jsonData);\r\n // send message\r\n xhr.send(JSON.stringify(jsonData));\r\n } else {\r\n callback('missing-title', xhr.statusText);\r\n }\r\n }\r\n\r\n } else {\r\n return console.log('Login api error');\r\n }\r\n };\r\n\r\n var sendPrefilledLogMessage = function(errorLog) {\r\n // without error object\r\n if(!errorLog) return getPayload();\r\n\r\n // with error object\r\n var error = errorLog;\r\n var stack = error ? ErrorStackParser.parse(error) : null;\r\n var jsonData = {\r\n \"title\": error.message,\r\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\r\n \"detail\": error ? error.stack : null,\r\n \"severity\": \"Error\",\r\n \"type\": error ? error.name : null,\r\n \"errorObject\": error\r\n };\r\n\r\n jsonData = merge_objects(jsonData, getPayload());\r\n \r\n return jsonData;\r\n };\r\n\r\n // Some public methods\r\n\r\n publicAPIs.error = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.verbose = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.debug = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.information = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.warning = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.fatal = function (msg, error) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.log = function (obj) {\r\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n };\r\n publicAPIs.message = function(error) {\r\n return sendPrefilledLogMessage(error);\r\n };\r\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\r\n recordBreadcrumb({\r\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\r\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\r\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\r\n });\r\n };\r\n\r\n publicAPIs.on = function (name, callback, ctx) {\r\n var e = this.e || (this.e = {});\r\n\r\n (e[name] || (e[name] = [])).push({\r\n fn: callback,\r\n ctx: ctx\r\n });\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.emit = function (name) {\r\n var data = [].slice.call(arguments, 1);\r\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\r\n var i = 0;\r\n var len = evtArr.length;\r\n\r\n for (i; i < len; i++) {\r\n evtArr[i].fn.apply(evtArr[i].ctx, data);\r\n }\r\n\r\n return this;\r\n };\r\n\r\n publicAPIs.init = function (options) {\r\n\r\n // -- Merge options into defaults\r\n settings = extend(defaults, options || {});\r\n\r\n // -- Breadcrumbs\r\n if (settings.breadcrumbs) {\r\n // Breadcrumbs - Click & Submit form\r\n if (document.addEventListener) {\r\n document.addEventListener('click', breadcrumbClickEventHandler, false);\r\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\r\n } else if (document.attachEvent) {\r\n document.attachEvent('click', breadcrumbClickEventHandler, false);\r\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\r\n }\r\n\r\n // Breadcrumbs - Navigation\r\n if (window.addEventListener) {\r\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\r\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\r\n } else if (window.attachEvent) {\r\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\r\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\r\n }\r\n\r\n if(window.history && window.history.pushState && window.history.replaceState) {\r\n var old_onpopstate = window.onpopstate;\r\n window.onpopstate = function(evt) {\r\n breadcrumbWindowEventHandler(evt);\r\n if (old_onpopstate) {\r\n return old_onpopstate.apply(this, arguments);\r\n }\r\n };\r\n }\r\n\r\n // Breadcrumbs - XHR\r\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\r\n // Store a reference to the native method\r\n var open = XMLHttpRequest.prototype.open;\r\n \r\n // Overwrite the native method\r\n XMLHttpRequest.prototype.open = function(method, url) {\r\n // Assign an event listener\r\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\r\n // Call the stored reference to the native method\r\n open.apply(this, arguments);\r\n };\r\n }\r\n }\r\n\r\n // -- Log on window error\r\n window.onerror = function (message, source, lineno, colno, error) {\r\n var errorLog = {\r\n 'message': message,\r\n 'source': source,\r\n 'lineno': lineno,\r\n 'colno': colno,\r\n 'error': error\r\n }\r\n \r\n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n\r\n return false;\r\n }\r\n\r\n // -- Overriding console methods\r\n // -- Then log messages into the app.elmah.io\r\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\r\n\r\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console errors\r\n var _error = console.error;\r\n console.error = function(errMessage){\r\n var errorLog = {\r\n \t\t'message': errMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _error.apply(console, arguments);\r\n };\r\n if(options.captureConsoleMinimumLevel !== \"error\") {\r\n // Log console warnings\r\n var _warning = console.warn;\r\n console.warn = function(warnMessage){\r\n var errorLog = {\r\n 'message': warnMessage,\r\n 'arguments': arguments\r\n }\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _warning.apply(console, arguments);\r\n };\r\n }\r\n }\r\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console info\r\n var _info = console.info;\r\n console.info = function(infoMessage){\r\n var errorLog = {\r\n \t\t'message': infoMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _info.apply(console, arguments);\r\n };\r\n }\r\n if(options.captureConsoleMinimumLevel === \"debug\") {\r\n // Log console debug\r\n var _debug = console.debug;\r\n console.debug = function(debugMessage){\r\n var errorLog = {\r\n \t\t'message': debugMessage,\r\n \t\t'arguments': arguments\r\n \t}\r\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\r\n _debug.apply(console, arguments);\r\n };\r\n }\r\n }\r\n };\r\n\r\n // Initialize the plugin\r\n publicAPIs.init(options);\r\n\r\n if (settings.debug) {\r\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\r\n }\r\n\r\n // Return the public APIs\r\n return publicAPIs;\r\n\r\n };\r\n\r\n\r\n //\r\n // Return the constructor\r\n //\r\n\r\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\r\n // Immediately-Invoked Function Expression (IIFE)\r\n return new Constructor;\r\n } else {\r\n // UMD Constructor\r\n return Constructor;\r\n }\r\n\r\n});"],"file":"elmahio.min.js"} \ No newline at end of file diff --git a/elmah.io.javascript.nuspec b/elmah.io.javascript.nuspec index 91b1049..535f9f1 100644 --- a/elmah.io.javascript.nuspec +++ b/elmah.io.javascript.nuspec @@ -1,7 +1,7 @@  - 3.5.4 + 3.6.0 elmah.io elmah.io elmah.io.javascript diff --git a/package.json b/package.json index 98fe5fd..c8b8756 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elmah.io.javascript", "description": "elmah.io javascript logger.", - "version": "3.5.4", + "version": "3.6.0", "repository": "https://github.com/elmahio/elmah.io.javascript", "license": "Apache-2.0", "main": "dist/elmahio.js", diff --git a/src/elmahio.js b/src/elmahio.js index f15352e..6c699ce 100644 --- a/src/elmahio.js +++ b/src/elmahio.js @@ -1,5 +1,5 @@ /*! - * elmah.io Javascript Logger - version 3.5.4 + * elmah.io Javascript Logger - version 3.6.0 * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io */ @@ -1116,15 +1116,15 @@ breadcrumbs.push(crumb); - if(options.breadcrumbsNumber && typeof options.breadcrumbsNumber === "number" ) { + if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === "number" ) { if(options.breadcrumbsNumber > 25) { breadcrumbs_number = 25; - } else if(options.breadcrumbsNumber >= 10 && options.breadcrumbsNumber <= 25) { + } else if(options.breadcrumbsNumber <= 25) { breadcrumbs_number = options.breadcrumbsNumber; } } - if (breadcrumbs.length >= breadcrumbs_number) { + if (breadcrumbs.length > breadcrumbs_number) { breadcrumbs.shift(); } } diff --git a/typescript/elmahio.d.ts b/typescript/elmahio.d.ts index 9d9d7ae..386a893 100644 --- a/typescript/elmahio.d.ts +++ b/typescript/elmahio.d.ts @@ -101,7 +101,7 @@ declare namespace Elmahio { breadcrumbs?: boolean; /** * Number of breadcrumbs to log. - * Minimum 10, maximum 25 breadcrumbs. + * Maximum 25 breadcrumbs. */ breadcrumbsNumber?: number; }