{ "version": 3, "sources": ["../../../node_modules/stackframe/stackframe.js", "../../../node_modules/error-stack-parser/error-stack-parser.js", "../../../node_modules/stack-generator/stack-generator.js", "../../../node_modules/stacktrace-gps/node_modules/source-map/lib/util.js", "../../../node_modules/stacktrace-gps/node_modules/source-map/lib/binary-search.js", "../../../node_modules/stacktrace-gps/node_modules/source-map/lib/array-set.js", "../../../node_modules/stacktrace-gps/node_modules/source-map/lib/base64.js", "../../../node_modules/stacktrace-gps/node_modules/source-map/lib/base64-vlq.js", "../../../node_modules/stacktrace-gps/node_modules/source-map/lib/quick-sort.js", "../../../node_modules/stacktrace-gps/node_modules/source-map/lib/source-map-consumer.js", "../../../node_modules/stacktrace-gps/stacktrace-gps.js", "../../../node_modules/stacktrace-js/stacktrace.js", "../../core/src/lastReferenceIdManager/DefaultLastReferenceIdManager.ts", "../../core/src/logging/ConsoleLog.ts", "../../core/src/logging/NullLog.ts", "../../core/src/models/Event.ts", "../../core/src/Utils.ts", "../../core/src/plugins/default/HeartbeatPlugin.ts", "../../core/src/plugins/default/SessionIdManagementPlugin.ts", "../../core/src/plugins/default/ConfigurationDefaultsPlugin.ts", "../../core/src/plugins/default/DuplicateCheckerPlugin.ts", "../../core/src/plugins/default/EventExclusionPlugin.ts", "../../core/src/plugins/default/ReferenceIdPlugin.ts", "../../core/src/plugins/default/SimpleErrorPlugin.ts", "../../core/src/plugins/default/SubmissionMethodPlugin.ts", "../../core/src/plugins/EventPluginManager.ts", "../../core/src/queue/DefaultEventQueue.ts", "../../core/src/configuration/SettingsManager.ts", "../../core/src/submission/Response.ts", "../../core/src/submission/DefaultSubmissionClient.ts", "../../core/src/storage/InMemoryStorage.ts", "../../core/src/storage/LocalStorage.ts", "../../core/src/configuration/Configuration.ts", "../../core/src/models/EventContext.ts", "../../core/src/plugins/PluginContext.ts", "../../core/src/plugins/EventPluginContext.ts", "../../core/src/EventBuilder.ts", "../../core/src/ExceptionlessClient.ts", "../src/plugins/BrowserErrorPlugin.ts", "../src/plugins/BrowserGlobalHandlerPlugin.ts", "../src/plugins/BrowserIgnoreExtensionErrorsPlugin.ts", "../src/plugins/BrowserLifeCyclePlugin.ts", "../src/plugins/BrowserModuleInfoPlugin.ts", "../src/plugins/BrowserRequestInfoPlugin.ts", "../src/BrowserExceptionlessClient.ts", "../src/index.ts"], "sourcesContent": ["(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function() {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n\n function _getter(p) {\n return function() {\n return this[p];\n };\n }\n\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n var objectProps = ['evalOrigin'];\n\n var props = booleanProps.concat(numericProps, stringProps, arrayProps, objectProps);\n\n function StackFrame(obj) {\n if (!obj) return;\n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n\n StackFrame.prototype = {\n getArgs: function() {\n return this.args;\n },\n setArgs: function(v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n getEvalOrigin: function() {\n return this.evalOrigin;\n },\n setEvalOrigin: function(v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n\n toString: function() {\n var fileName = this.getFileName() || '';\n var lineNumber = this.getLineNumber() || '';\n var columnNumber = this.getColumnNumber() || '';\n var functionName = this.getFunctionName() || '';\n if (this.getIsEval()) {\n if (fileName) {\n return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return '[eval]:' + lineNumber + ':' + columnNumber;\n }\n if (functionName) {\n return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return fileName + ':' + lineNumber + ':' + columnNumber;\n }\n };\n\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf('(');\n var argsEndIndex = str.lastIndexOf(')');\n\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');\n var locationString = str.substring(argsEndIndex + 1);\n\n if (locationString.indexOf('@') === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, '');\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = (function(p) {\n return function(v) {\n this[p] = Boolean(v);\n };\n })(booleanProps[i]);\n }\n\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = (function(p) {\n return function(v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n })(numericProps[j]);\n }\n\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = (function(p) {\n return function(v) {\n this[p] = String(v);\n };\n })(stringProps[k]);\n }\n\n return StackFrame;\n}));\n", "(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(\\),.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n\n var tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n var locationParts = this.extractLocation(location ? location[1] : tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n}));\n", "(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stack-generator', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.StackGenerator = factory(root.StackFrame);\n }\n}(this, function(StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({functionName: RegExp.$1 || undefined, args: args}));\n } else {\n stack.push(new StackFrame({args: args}));\n }\n\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n}));\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = util.toSetString(aStr);\n var isDuplicate = has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n this._set[sStr] = idx;\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap)\n : new BasicSourceMapConsumer(sourceMap);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n if (source != null && sourceRoot != null) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: Optional. the column number in the original source.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n if (this.sourceRoot != null) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n if (!this._sources.has(needle.source)) {\n return [];\n }\n needle.source = this._sources.indexOf(needle.source);\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n if (this.sourceRoot != null) {\n source = util.join(this.sourceRoot, source);\n }\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot != null) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n if (this.sourceRoot != null) {\n source = util.relative(this.sourceRoot, source);\n }\n if (!this._sources.has(source)) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n source = this._sources.indexOf(source);\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The only parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if (section.consumer.sourceRoot !== null) {\n source = util.join(section.consumer.sourceRoot, source);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n", "(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace-gps', ['source-map', 'stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('source-map/lib/source-map-consumer'), require('stackframe'));\n } else {\n root.StackTraceGPS = factory(root.SourceMap || root.sourceMap, root.StackFrame);\n }\n}(this, function(SourceMap, StackFrame) {\n 'use strict';\n\n /**\n * Make a X-Domain request to url and callback.\n *\n * @param {String} url\n * @returns {Promise} with response text if fulfilled\n */\n function _xdr(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('get', url);\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if ((req.status >= 200 && req.status < 300) ||\n (url.substr(0, 7) === 'file://' && req.responseText)) {\n resolve(req.responseText);\n } else {\n reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));\n }\n }\n };\n req.send();\n });\n\n }\n\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== 'undefined' && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error('You must supply a polyfill for window.atob in this environment');\n }\n }\n\n function _parseJson(string) {\n if (typeof JSON !== 'undefined' && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error('You must supply a polyfill for JSON.parse in this environment');\n }\n }\n\n function _findFunctionName(source, lineNumber/*, columnNumber*/) {\n var syntaxes = [\n // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/,\n // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/,\n // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/,\n // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/,\n // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/\n ];\n var lines = source.split('\\n');\n\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = '';\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf('//');\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== 'function' || typeof Object.create !== 'function') {\n throw new Error('Unable to consume source maps in older browsers');\n }\n }\n\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== 'object') {\n throw new TypeError('Given StackFrame is not an object');\n } else if (typeof stackframe.fileName !== 'string') {\n throw new TypeError('Given file name is not a String');\n } else if (typeof stackframe.lineNumber !== 'number' ||\n stackframe.lineNumber % 1 !== 0 ||\n stackframe.lineNumber < 1) {\n throw new TypeError('Given line number must be a positive integer');\n } else if (typeof stackframe.columnNumber !== 'number' ||\n stackframe.columnNumber % 1 !== 0 ||\n stackframe.columnNumber < 0) {\n throw new TypeError('Given column number must be a non-negative integer');\n }\n return true;\n }\n\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/mg;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n // eslint-disable-next-line no-cond-assign\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error('sourceMappingURL not found');\n }\n }\n\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function(resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n\n resolve(\n // given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error('Could not get original source for given stackframe and source map'));\n }\n });\n }\n\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n\n this.ajax = opts.ajax || _xdr;\n\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function(resolve, reject) {\n var isDataUrl = location.substr(0, 5) === 'data:';\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error('Cannot make network requests in offline mode'));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp =\n /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error('The encoding of the inline sourcemap is not supported'));\n }\n } else {\n var xhrPromise = this.ajax(location, {method: 'get'});\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function(resolve) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function(resolve, reject) {\n return this._get(sourceMappingURL).then(function(sourceMapSource) {\n if (typeof sourceMapSource === 'string') {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, ''));\n }\n if (typeof sourceMapSource.sourceRoot === 'undefined') {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function(resolve, reject) {\n this.getMappedLocation(stackframe).then(function(mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n\n this.findFunctionName(mappedStackFrame)\n .then(resolve, resolveMappedStackFrame)\n // eslint-disable-next-line no-unexpected-multiline\n ['catch'](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)['catch'](reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function(source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);\n\n if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\\/\\/|^\\/\\//i).test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot)\n .then(function(sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)\n .then(resolve)['catch'](function() {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)['catch'](reject);\n }.bind(this));\n };\n };\n}));\n", "(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace', ['error-stack-parser', 'stack-generator', 'stacktrace-gps'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('error-stack-parser'), require('stack-generator'), require('stacktrace-gps'));\n } else {\n root.StackTrace = factory(root.ErrorStackParser, root.StackGenerator, root.StackTraceGPS);\n }\n}(this, function StackTrace(ErrorStackParser, StackGenerator, StackTraceGPS) {\n var _options = {\n filter: function(stackframe) {\n // Filter out stackframes for this library by default\n return (stackframe.functionName || '').indexOf('StackTrace$$') === -1 &&\n (stackframe.functionName || '').indexOf('ErrorStackParser$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackTraceGPS$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackGenerator$$') === -1;\n },\n sourceCache: {}\n };\n\n var _generateError = function StackTrace$$GenerateError() {\n try {\n // Error must be thrown to get stack in IE\n throw new Error();\n } catch (err) {\n return err;\n }\n };\n\n /**\n * Merge 2 given Objects. If a conflict occurs the second object wins.\n * Does not do deep merges.\n *\n * @param {Object} first base object\n * @param {Object} second overrides\n * @returns {Object} merged first and second\n * @private\n */\n function _merge(first, second) {\n var target = {};\n\n [first, second].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n return target;\n });\n\n return target;\n }\n\n function _isShapedLikeParsableError(err) {\n return err.stack || err['opera#sourceloc'];\n }\n\n function _filtered(stackframes, filter) {\n if (typeof filter === 'function') {\n return stackframes.filter(filter);\n }\n return stackframes;\n }\n\n return {\n /**\n * Get a backtrace from invocation point.\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n get: function StackTrace$$get(opts) {\n var err = _generateError();\n return _isShapedLikeParsableError(err) ? this.fromError(err, opts) : this.generateArtificially(opts);\n },\n\n /**\n * Get a backtrace from invocation point.\n * IMPORTANT: Does not handle source maps or guess function names!\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n getSync: function StackTrace$$getSync(opts) {\n opts = _merge(_options, opts);\n var err = _generateError();\n var stack = _isShapedLikeParsableError(err) ? ErrorStackParser.parse(err) : StackGenerator.backtrace(opts);\n return _filtered(stack, opts.filter);\n },\n\n /**\n * Given an error object, parse it.\n *\n * @param {Error} error object\n * @param {Object} opts\n * @returns {Promise} for Array[StackFrame}\n */\n fromError: function StackTrace$$fromError(error, opts) {\n opts = _merge(_options, opts);\n var gps = new StackTraceGPS(opts);\n return new Promise(function(resolve) {\n var stackframes = _filtered(ErrorStackParser.parse(error), opts.filter);\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n }.bind(this));\n },\n\n /**\n * Use StackGenerator to generate a backtrace.\n *\n * @param {Object} opts\n * @returns {Promise} of Array[StackFrame]\n */\n generateArtificially: function StackTrace$$generateArtificially(opts) {\n opts = _merge(_options, opts);\n var stackFrames = StackGenerator.backtrace(opts);\n if (typeof opts.filter === 'function') {\n stackFrames = stackFrames.filter(opts.filter);\n }\n return Promise.resolve(stackFrames);\n },\n\n /**\n * Given a function, wrap it such that invocations trigger a callback that\n * is called with a stack trace.\n *\n * @param {Function} fn to be instrumented\n * @param {Function} callback function to call with a stack trace on invocation\n * @param {Function} errback optional function to call with error if unable to get stack trace.\n * @param {Object} thisArg optional context object (e.g. window)\n */\n instrument: function StackTrace$$instrument(fn, callback, errback, thisArg) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n // Already instrumented, return given Function\n return fn;\n }\n\n var instrumented = function StackTrace$$instrumented() {\n try {\n this.get().then(callback, errback)['catch'](errback);\n return fn.apply(thisArg || this, arguments);\n } catch (e) {\n if (_isShapedLikeParsableError(e)) {\n this.fromError(e).then(callback, errback)['catch'](errback);\n }\n throw e;\n }\n }.bind(this);\n instrumented.__stacktraceOriginalFn = fn;\n\n return instrumented;\n },\n\n /**\n * Given a function that has been instrumented,\n * revert the function to it's original (non-instrumented) state.\n *\n * @param {Function} fn to de-instrument\n */\n deinstrument: function StackTrace$$deinstrument(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot de-instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n return fn.__stacktraceOriginalFn;\n } else {\n // Function not instrumented, return original\n return fn;\n }\n },\n\n /**\n * Given an error message and Array of StackFrames, serialize and POST to given URL.\n *\n * @param {Array} stackframes\n * @param {String} url\n * @param {String} errorMsg\n * @param {Object} requestOptions\n */\n report: function StackTrace$$report(stackframes, url, errorMsg, requestOptions) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {\n resolve(req.responseText);\n } else {\n reject(new Error('POST to ' + url + ' failed with status: ' + req.status));\n }\n }\n };\n req.open('post', url);\n\n // Set request headers\n req.setRequestHeader('Content-Type', 'application/json');\n if (requestOptions && typeof requestOptions.headers === 'object') {\n var headers = requestOptions.headers;\n for (var header in headers) {\n if (Object.prototype.hasOwnProperty.call(headers, header)) {\n req.setRequestHeader(header, headers[header]);\n }\n }\n }\n\n var reportPayload = {stack: stackframes};\n if (errorMsg !== undefined && errorMsg !== null) {\n reportPayload.message = errorMsg;\n }\n\n req.send(JSON.stringify(reportPayload));\n });\n }\n };\n}));\n", "import { ILastReferenceIdManager } from \"./ILastReferenceIdManager.js\";\n\nexport class DefaultLastReferenceIdManager implements ILastReferenceIdManager {\n /**\n * Gets the last event's reference id that was submitted to the server.\n */\n private _lastReferenceId: string | null = null;\n\n /**\n * Gets the last event's reference id that was submitted to the server.\n */\n public getLast(): string | null {\n return this._lastReferenceId;\n }\n\n /**\n * Clears the last event's reference id.\n */\n public clearLast(): void {\n this._lastReferenceId = null;\n }\n\n /**\n * Sets the last event's reference id.\n */\n public setLast(eventId: string): void {\n this._lastReferenceId = eventId;\n }\n}\n", "import { ILog } from \"./ILog.js\";\n\nexport class ConsoleLog implements ILog {\n public trace(message: string): void {\n this.log(\"debug\", message);\n }\n\n public info(message: string): void {\n this.log(\"info\", message);\n }\n\n public warn(message: string): void {\n this.log(\"warn\", message);\n }\n\n public error(message: string): void {\n this.log(\"error\", message);\n }\n\n private log(level: keyof Console, message: string) {\n if (console) {\n const msg = `Exceptionless:${new Date().toISOString()} [${level}] ${message}`;\n const logFn = console[level] as (msg: string) => void;\n if (logFn) {\n logFn(msg);\n } else if (console[\"log\"]) {\n console[\"log\"](msg);\n }\n }\n }\n}\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { ILog } from \"./ILog.js\";\n\nexport class NullLog implements ILog {\n public trace(_: string): void {\n /* empty */\n }\n public info(_: string): void {\n /* empty */\n }\n public warn(_: string): void {\n /* empty */\n }\n public error(_: string): void {\n /* empty */\n }\n}\n", "import { ErrorInfo, SimpleError } from \"./data/ErrorInfo.js\";\nimport { EnvironmentInfo } from \"./data/EnvironmentInfo.js\";\nimport { RequestInfo } from \"./data/RequestInfo.js\";\nimport { UserInfo } from \"./data/UserInfo.js\";\nimport { UserDescription } from \"./data/UserDescription.js\";\nimport { ManualStackingInfo } from \"./data/ManualStackingInfo.js\";\n\nexport type EventType = \"error\" | \"usage\" | \"log\" | \"404\" | \"session\" | string;\n\nexport interface Event {\n /** The event type (ie. error, log message, feature usage). */\n type?: EventType;\n /** The event source (ie. machine name, log name, feature name). */\n source?: string;\n /** The date that the event occurred on. */\n date?: Date;\n /** A list of tags used to categorize this event. */\n tags?: string[];\n /** The event message. */\n message?: string;\n /** The geo coordinates where the event happened. */\n geo?: string;\n /** The value of the event if any. */\n value?: number;\n /** The number of duplicated events. */\n count?: number;\n /** An optional identifier to be used for referencing this event instance at a later time. */\n reference_id?: string;\n /** Optional data entries that contain additional information about this event. */\n data?: IEventData;\n}\n\nexport enum KnownEventDataKeys {\n Error = \"@error\",\n SimpleError = \"@simple_error\",\n RequestInfo = \"@request\",\n TraceLog = \"@trace\",\n EnvironmentInfo = \"@environment\",\n UserInfo = \"@user\",\n UserDescription = \"@user_description\",\n Version = \"@version\",\n Level = \"@level\",\n SubmissionMethod = \"@submission_method\",\n ManualStackingInfo = \"@stack\"\n}\n\nexport type LogLevel = \"trace\" | \"debug\" | \"info\" | \"warn\" | \"error\" | \"fatal\" | string;\n\nexport interface IEventData extends Record {\n \"@error\"?: ErrorInfo;\n \"@simple_error\"?: SimpleError;\n \"@request\"?: RequestInfo;\n \"@environment\"?: EnvironmentInfo;\n \"@user\"?: UserInfo;\n \"@user_description\"?: UserDescription;\n \"@version\"?: string;\n \"@level\"?: LogLevel;\n \"@submission_method\"?: string;\n \"@stack\"?: ManualStackingInfo;\n}\n", "export function getHashCode(source: string): number {\n if (!source || source.length === 0) {\n return 0;\n }\n\n let hash = 0;\n for (let index = 0; index < source.length; index++) {\n const character = source.charCodeAt(index);\n hash = (hash << 5) - hash + character;\n hash |= 0;\n }\n\n return hash;\n}\n\nexport function getCookies(cookies: string, exclusions?: string[]): Record | null {\n const result: Record = {};\n\n const parts: string[] = (cookies || \"\").split(\"; \");\n for (const part of parts) {\n const cookie: string[] = part.split(\"=\");\n if (!isMatch(cookie[0], exclusions || [])) {\n result[cookie[0]] = cookie[1];\n }\n }\n\n return !isEmpty(result) ? result : null;\n}\n\nexport function guid(): string {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return s4() + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + \"-\" + s4() + s4() + s4();\n}\n\nexport function parseVersion(source: string): string | null {\n if (!source) {\n return null;\n }\n\n const versionRegex = /(v?((\\d+)\\.(\\d+)(\\.(\\d+))?)(?:-([\\dA-Za-z-]+(?:\\.[\\dA-Za-z-]+)*))?(?:\\+([\\dA-Za-z-]+(?:\\.[\\dA-Za-z-]+)*))?)/;\n const matches = versionRegex.exec(source);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n\n return null;\n}\n\nexport function parseQueryString(query: string, exclusions?: string[]): Record {\n if (!query || query.length === 0) {\n return {};\n }\n\n const pairs: string[] = query.split(\"&\");\n if (pairs.length === 0) {\n return {};\n }\n\n const result: Record = {};\n for (const pair of pairs) {\n const parts = pair.split(\"=\");\n if (!exclusions || !isMatch(parts[0], exclusions)) {\n result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);\n }\n }\n\n return !isEmpty(result) ? result : {};\n}\n\nexport function randomNumber(): number {\n return Math.floor(Math.random() * 9007199254740992);\n}\n\n/**\n * Checks to see if a value matches a pattern.\n * @param input the value to check against the @pattern.\n * @param pattern The pattern to check, supports wild cards (*).\n */\nexport function isMatch(input: string | undefined, patterns: string[], ignoreCase = true): boolean {\n if (typeof input !== \"string\") {\n return false;\n }\n\n const trim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n input = (ignoreCase ? input.toLowerCase() : input).replace(trim, \"\");\n\n return (patterns || []).some((pattern) => {\n if (typeof pattern !== \"string\") {\n return false;\n }\n\n if (pattern) {\n pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, \"\");\n }\n\n if (!pattern) {\n return input === undefined || input === null;\n }\n\n if (pattern === \"*\") {\n return true;\n }\n\n if (input === undefined || input === null) {\n return false;\n }\n\n const startsWithWildcard: boolean = pattern[0] === \"*\";\n if (startsWithWildcard) {\n pattern = pattern.slice(1);\n }\n\n const endsWithWildcard: boolean = pattern[pattern.length - 1] === \"*\";\n if (endsWithWildcard) {\n pattern = pattern.substring(0, pattern.length - 1);\n }\n\n if (startsWithWildcard && endsWithWildcard) {\n return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1;\n }\n\n if (startsWithWildcard) {\n return endsWith(input, pattern);\n }\n\n if (endsWithWildcard) {\n return startsWith(input, pattern);\n }\n\n return input === pattern;\n });\n}\n\n/**\n * Very simple implementation to check primitive types for emptiness.\n * - If the input is null or undefined, it will return true.\n * - If the input is an array, it will return true if the array is empty.\n * - If the input is an object, it will return true if the object has no properties.\n * - If the input is a string, it will return true if the string is empty or \"{}\" or \"[]\".\n * @param input The input to check.\n */\nexport function isEmpty(input: Record | null | undefined | unknown): input is null | undefined | Record {\n if (input === null || input === undefined) {\n return true;\n }\n\n if (typeof input === \"object\") {\n if (Array.isArray(input)) {\n return input.length === 0;\n }\n\n if (input instanceof Date) {\n return false;\n }\n\n return Object.getOwnPropertyNames(input).length === 0;\n }\n\n if (typeof input === \"string\") {\n const trimmedInput = input.trim();\n return trimmedInput.length === 0 || trimmedInput === \"{}\" || trimmedInput === \"[]\";\n }\n\n return false;\n}\n\nexport function startsWith(input: string, prefix: string): boolean {\n return input.substring(0, prefix.length) === prefix;\n}\n\nexport function endsWith(input: string, suffix: string): boolean {\n return input.indexOf(suffix, input.length - suffix.length) !== -1;\n}\n\n/**\n * This function will prune an object to a certain depth and return a new object.\n * The following rules will be applied:\n * 1. If the value is null or undefined, it will be returned as is.\n * 2. If the value is a function or unsupported type it will be return undefined.\n * 3. If the value is an array, it will be pruned to the specified depth.\n * 4. If the value is an object, it will be pruned to the specified depth and\n * a. If the object is a Circular Reference it will return undefined.\n * b. If the object is a Map, it will be converted to an object. Some data loss might occur if map keys are object types as last in wins.\n * c. If the object is a Set, it will be converted to an array.\n * d. If the object contains prototype properties, they will be picked up.\n * e. If the object contains a toJSON function, it will be called and it's value will be normalized.\n * f. If the object is is not iterable or cloneable (e.g., WeakMap, WeakSet, etc.), it will return undefined.\n * g. If a symbol property is encountered, it will be converted to a string representation and could overwrite existing object keys.\n * 5. If the value is an Error, we will treat it as an object.\n * 6. If the value is a primitive, it will be returned as is.\n * 7. If the value is a Regexp, Symbol we will convert it to the string representation.\n * 8. BigInt and other typed arrays will be converted to a string unless number type works.\n * 9. All other values will be returned as undefined (E.g., Buffer, DataView, Promises, Generators etc..)\n */\nexport function prune(value: unknown, depth: number = 10): unknown {\n function isUnsupportedType(value: unknown): boolean {\n if (value === null || value === undefined) {\n return false;\n }\n\n switch (typeof value) {\n case \"function\":\n return true;\n case \"object\":\n switch (Object.prototype.toString.call(value)) {\n case \"[object AsyncGenerator]\":\n case \"[object Generator]\":\n case \"[object ArrayBuffer]\":\n case \"[object Buffer]\":\n case \"[object DataView]\":\n case \"[object Promise]\":\n case \"[object WeakMap]\":\n case \"[object WeakSet]\":\n return true;\n }\n\n // Check for buffer;\n if (\"writeBigInt64LE\" in value) {\n return true;\n }\n\n break;\n }\n\n return false;\n }\n\n function normalizeValue(value: unknown): unknown {\n function hasToJSONFunction(value: unknown): value is { toJSON: () => unknown } {\n return value !== null && typeof value === \"object\" && typeof (value as { toJSON?: unknown }).toJSON === \"function\";\n }\n\n if (typeof value === \"bigint\") {\n return `${value.toString()}n`;\n }\n\n if (typeof value === \"object\") {\n if (Array.isArray(value)) {\n return value;\n }\n\n if (value instanceof Date) {\n return value;\n }\n\n if (value instanceof Map) {\n const result: Record = {};\n for (const [key, val] of value) {\n result[key] = val;\n }\n\n return result;\n }\n\n if (value instanceof RegExp) {\n return value.toString();\n }\n\n if (value instanceof Set) {\n return Array.from(value);\n }\n\n // Check for typed arrays\n const TypedArray = Object.getPrototypeOf(Uint8Array);\n if (value instanceof TypedArray) {\n return Array.from(value as Iterable);\n }\n\n if (hasToJSONFunction(value)) {\n // NOTE: We are not checking for circular references or overflow\n return normalizeValue(value.toJSON());\n }\n\n return value;\n }\n\n if (typeof value === \"symbol\") {\n return value.description;\n }\n\n return value;\n }\n\n function pruneImpl(\n value: unknown,\n maxDepth: number,\n currentDepth: number = 10,\n seen: WeakSet = new WeakSet(),\n parentIsArray: boolean = false\n ): unknown {\n if (value === null || value === undefined) {\n return value;\n }\n\n if (currentDepth > maxDepth) {\n return undefined;\n }\n\n if (isUnsupportedType(value)) {\n return undefined;\n }\n\n const normalizedValue = normalizeValue(value);\n if (typeof normalizedValue === \"object\") {\n if (currentDepth == maxDepth) {\n return undefined;\n }\n\n if (Array.isArray(normalizedValue)) {\n // Treat an object inside of an array as a single level\n const depth: number = parentIsArray ? currentDepth + 1 : currentDepth;\n return normalizedValue.map((e) => pruneImpl(e, maxDepth, depth, seen, true));\n }\n\n if (normalizedValue instanceof Date) {\n return normalizedValue;\n }\n\n // Check for circular references\n if (Object.prototype.toString.call(normalizedValue) === \"[object Object]\") {\n if (seen.has(normalizedValue as object)) {\n return undefined;\n }\n\n seen.add(normalizedValue as object);\n }\n\n const keys = new Set([...Object.getOwnPropertyNames(normalizedValue), ...Object.getOwnPropertySymbols(normalizedValue)]);\n // Loop over and add any inherited prototype properties\n for (const key in normalizedValue) {\n keys.add(key);\n }\n\n type NonSymbolPropertyKey = Exclude;\n const result: Record = {};\n for (const key of keys) {\n // Normalize the key so Symbols are converted to strings.\n const normalizedKey = normalizeValue(key) as NonSymbolPropertyKey;\n\n const objectValue = (normalizedValue as { [index: PropertyKey]: unknown })[key];\n result[normalizedKey] = pruneImpl(objectValue, maxDepth, currentDepth + 1, seen);\n }\n\n return result;\n }\n\n return normalizedValue;\n }\n\n if (depth < 0) {\n return undefined;\n }\n\n return pruneImpl(value, depth, 0);\n}\n\nexport function stringify(data: unknown, exclusions?: string[], maxDepth: number = 10): string | undefined {\n function stringifyImpl(obj: unknown, excludedKeys: string[]): string {\n return JSON.stringify(obj, (key: string, value: unknown) => {\n if (isMatch(key, excludedKeys)) {\n return;\n }\n\n return value;\n });\n }\n\n if (data === undefined) {\n return data;\n }\n\n const prunedData = prune(data, maxDepth);\n return stringifyImpl(prunedData, exclusions || []);\n}\n\nexport function toBoolean(input: unknown, defaultValue: boolean = false): boolean {\n if (typeof input === \"boolean\") {\n return input;\n }\n\n if (input === null || (typeof input !== \"number\" && typeof input !== \"string\")) {\n return defaultValue;\n }\n\n switch ((input + \"\").toLowerCase().trim()) {\n case \"true\":\n case \"yes\":\n case \"1\":\n return true;\n case \"false\":\n case \"no\":\n case \"0\":\n case null:\n return false;\n }\n\n return defaultValue;\n}\n\nexport function toError(errorOrMessage: unknown, defaultMessage = \"Unknown Error\"): Error {\n if (errorOrMessage === null || errorOrMessage === undefined) {\n const error = new Error(defaultMessage);\n error.stack = undefined!;\n return error;\n }\n\n if (errorOrMessage instanceof Error) {\n return errorOrMessage;\n }\n\n if (typeof errorOrMessage === \"string\") {\n const error = new Error(errorOrMessage);\n error.stack = undefined!;\n return error;\n }\n\n const error = new Error(stringify(errorOrMessage) || defaultMessage);\n error.stack = undefined!;\n return error;\n}\n\n/**\n * Unrefs a timeout or interval. When called, the active Timeout object will not require the Node.js event loop to remain active\n */\nexport function allowProcessToExitWithoutWaitingForTimerOrInterval(timeoutOrIntervalId: ReturnType | undefined): void {\n if (typeof timeoutOrIntervalId === \"object\" && \"unref\" in timeoutOrIntervalId) {\n (timeoutOrIntervalId as { unref: () => ReturnType }).unref();\n }\n}\n", "import { KnownEventDataKeys } from \"../../models/Event.js\";\nimport { allowProcessToExitWithoutWaitingForTimerOrInterval } from \"../../Utils.js\";\nimport { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\n\nexport class HeartbeatPlugin implements IEventPlugin {\n public priority = 100;\n public name = \"HeartbeatPlugin\";\n\n private _interval: number;\n private _intervalId: ReturnType | undefined;\n\n constructor(heartbeatInterval: number = 60000) {\n this._interval = heartbeatInterval >= 30000 ? heartbeatInterval : 60000;\n }\n\n public startup(): Promise {\n clearInterval(this._intervalId);\n this._intervalId = undefined;\n // TODO: Do we want to send a heartbeat for the last user?\n return Promise.resolve();\n }\n\n public suspend(): Promise {\n clearInterval(this._intervalId);\n this._intervalId = undefined;\n return Promise.resolve();\n }\n\n public run(context: EventPluginContext): Promise {\n if (this._interval <= 0) {\n return Promise.resolve();\n }\n\n clearInterval(this._intervalId);\n this._intervalId = undefined;\n\n const { config } = context.client;\n if (!config.currentSessionIdentifier) {\n const user = context.event.data?.[KnownEventDataKeys.UserInfo];\n if (!user?.identity) {\n return Promise.resolve();\n }\n\n config.currentSessionIdentifier = user.identity;\n }\n\n if (config.currentSessionIdentifier) {\n this._intervalId = setInterval(() => void context.client.submitSessionHeartbeat(config.currentSessionIdentifier), this._interval);\n\n allowProcessToExitWithoutWaitingForTimerOrInterval(this._intervalId);\n }\n\n return Promise.resolve();\n }\n}\n", "import { guid } from \"../../Utils.js\";\nimport { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\n\nexport class SessionIdManagementPlugin implements IEventPlugin {\n public priority = 25;\n public name = \"SessionIdManagementPlugin\";\n\n public run(context: EventPluginContext): Promise {\n const ev = context.event;\n const isSessionStart: boolean = ev.type === \"session\";\n const { config } = context.client;\n if (isSessionStart || !config.currentSessionIdentifier) {\n config.currentSessionIdentifier = guid().replaceAll(\"-\", \"\");\n }\n\n if (isSessionStart) {\n ev.reference_id = config.currentSessionIdentifier;\n } else {\n if (!ev.data) {\n ev.data = {};\n }\n\n ev.data[\"@ref:session\"] = config.currentSessionIdentifier;\n }\n\n return Promise.resolve();\n }\n}\n", "import { isEmpty, stringify } from \"../../Utils.js\";\nimport { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\n\nexport class ConfigurationDefaultsPlugin implements IEventPlugin {\n public priority = 10;\n public name = \"ConfigurationDefaultsPlugin\";\n\n public run(context: EventPluginContext): Promise {\n const { dataExclusions, defaultData, defaultTags } = context.client.config;\n const ev = context.event;\n\n if (defaultTags) {\n ev.tags = [...(ev.tags || []), ...defaultTags];\n }\n\n if (defaultData) {\n if (!ev.data) {\n ev.data = {};\n }\n\n for (const key in defaultData) {\n if (ev.data[key] !== undefined || isEmpty(defaultData[key])) {\n continue;\n }\n\n const data = stringify(defaultData[key], dataExclusions);\n if (!isEmpty(data)) {\n ev.data[key] = JSON.parse(data);\n }\n }\n }\n\n return Promise.resolve();\n }\n}\n", "import { InnerErrorInfo } from \"../../models/data/ErrorInfo.js\";\nimport { KnownEventDataKeys } from \"../../models/Event.js\";\nimport { allowProcessToExitWithoutWaitingForTimerOrInterval, getHashCode } from \"../../Utils.js\";\nimport { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\n\nexport class DuplicateCheckerPlugin implements IEventPlugin {\n public priority = 1010;\n public name = \"DuplicateCheckerPlugin\";\n\n private _mergedEvents: MergedEvent[] = [];\n private _processedHashCodes: TimestampedHash[] = [];\n private _getCurrentTime: () => number;\n private _intervalId: ReturnType | undefined;\n private _interval: number;\n\n constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) {\n this._getCurrentTime = getCurrentTime;\n this._interval = interval;\n }\n\n public startup(): Promise {\n clearInterval(this._intervalId);\n this._intervalId = setInterval(() => void this.submitEvents(), this._interval);\n allowProcessToExitWithoutWaitingForTimerOrInterval(this._intervalId);\n return Promise.resolve();\n }\n\n public async suspend(): Promise {\n clearInterval(this._intervalId);\n this._intervalId = undefined;\n await this.submitEvents();\n }\n\n public run(context: EventPluginContext): Promise {\n function calculateHashCode(error: InnerErrorInfo | undefined): number {\n let hash = 0;\n while (error) {\n if (error.message && error.message.length) {\n hash += (hash * 397) ^ getHashCode(error.message);\n }\n if (error.stack_trace && error.stack_trace.length) {\n hash += (hash * 397) ^ getHashCode(JSON.stringify(error.stack_trace));\n }\n error = error.inner;\n }\n\n return hash;\n }\n\n const error = context.event.data?.[KnownEventDataKeys.Error];\n const hashCode = calculateHashCode(error);\n if (hashCode) {\n const count = context.event.count || 1;\n const now = this._getCurrentTime();\n\n const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0];\n if (merged) {\n merged.incrementCount(count);\n merged.updateDate(context.event.date);\n context.log.info(\"Ignoring duplicate event with hash: \" + hashCode);\n context.cancelled = true;\n }\n\n if (!context.cancelled && this._processedHashCodes.some((h) => h.hash === hashCode && h.timestamp >= now - this._interval)) {\n context.log.trace(\"Adding event with hash: \" + hashCode);\n this._mergedEvents.push(new MergedEvent(hashCode, context, count));\n context.cancelled = true;\n }\n\n if (!context.cancelled) {\n context.log.trace(`Enqueueing event with hash: ${hashCode} to cache`);\n this._processedHashCodes.push({ hash: hashCode, timestamp: now });\n\n // Only keep the last 50 recent errors.\n while (this._processedHashCodes.length > 50) {\n this._processedHashCodes.shift();\n }\n }\n }\n\n return Promise.resolve();\n }\n\n private async submitEvents(): Promise {\n while (this._mergedEvents.length > 0) {\n await this._mergedEvents.shift()?.resubmit();\n }\n }\n}\n\ninterface TimestampedHash {\n hash: number;\n timestamp: number;\n}\n\nclass MergedEvent {\n public hashCode: number;\n private _count: number;\n private _context: EventPluginContext;\n\n constructor(hashCode: number, context: EventPluginContext, count: number) {\n this.hashCode = hashCode;\n this._context = context;\n this._count = count;\n }\n\n public incrementCount(count: number): void {\n this._count += count;\n }\n\n public async resubmit(): Promise {\n this._context.event.count = this._count;\n await this._context.client.config.services.queue.enqueue(this._context.event);\n }\n\n public updateDate(date?: Date): void {\n const ev = this._context.event;\n if (date && ev.date && date > ev.date) {\n ev.date = date;\n }\n }\n}\n", "import { KnownEventDataKeys, LogLevel } from \"../../models/Event.js\";\nimport { isMatch, startsWith, toBoolean } from \"../../Utils.js\";\nimport { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\n\nexport class EventExclusionPlugin implements IEventPlugin {\n public priority = 45;\n public name = \"EventExclusionPlugin\";\n\n public run(context: EventPluginContext): Promise {\n const ev = context.event;\n const log = context.log;\n const settings = context.client.config.settings;\n\n if (ev.type === \"log\") {\n const minLogLevel = this.getMinLogLevel(settings, ev.source);\n const logLevel = this.getLogLevel(ev.data && ev.data[KnownEventDataKeys.Level]);\n\n if (logLevel !== -1 && (logLevel === 6 || logLevel < minLogLevel)) {\n log.info(\"Cancelling log event due to minimum log level.\");\n context.cancelled = true;\n }\n } else if (ev.type === \"error\") {\n let error = ev.data && ev.data[KnownEventDataKeys.Error];\n while (!context.cancelled && error) {\n if (this.getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) {\n log.info(`Cancelling error from excluded exception type: ${error.type}`);\n context.cancelled = true;\n }\n\n error = error.inner;\n }\n } else if (this.getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) {\n log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`);\n context.cancelled = true;\n }\n\n return Promise.resolve();\n }\n\n public getLogLevel(level: LogLevel | undefined): number {\n switch ((level || \"\").toLowerCase().trim()) {\n case \"trace\":\n case \"true\":\n case \"1\":\n case \"yes\":\n return 0;\n case \"debug\":\n return 1;\n case \"info\":\n return 2;\n case \"warn\":\n return 3;\n case \"error\":\n return 4;\n case \"fatal\":\n return 5;\n case \"off\":\n case \"false\":\n case \"0\":\n case \"no\":\n return 6;\n default:\n return -1;\n }\n }\n\n public getMinLogLevel(configSettings: Record, source: string | undefined): number {\n return this.getLogLevel(this.getTypeAndSourceSetting(configSettings, \"log\", source, \"other\") + \"\");\n }\n\n private getTypeAndSourceSetting(\n configSettings: Record = {},\n type: string | undefined,\n source: string | undefined,\n defaultValue: string | boolean\n ): string | boolean {\n if (!type) {\n return defaultValue;\n }\n\n if (!source) {\n source = \"\";\n }\n\n const isLog: boolean = type === \"log\";\n const sourcePrefix = `@@${type}:`;\n\n const value: string = configSettings[sourcePrefix + source];\n if (value) {\n return isLog ? value : toBoolean(value);\n }\n\n // sort object keys longest first, then alphabetically.\n const sortedKeys = Object.keys(configSettings).sort((a, b) => b.length - a.length || a.localeCompare(b));\n for (const key of sortedKeys) {\n if (!startsWith(key.toLowerCase(), sourcePrefix)) {\n continue;\n }\n\n // check for wildcard match\n const cleanKey: string = key.substring(sourcePrefix.length);\n if (isMatch(source, [cleanKey])) {\n return isLog ? configSettings[key] : toBoolean(configSettings[key]);\n }\n }\n\n return defaultValue;\n }\n}\n", "import { guid } from \"../../Utils.js\";\nimport { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\n\nexport class ReferenceIdPlugin implements IEventPlugin {\n public priority = 20;\n public name = \"ReferenceIdPlugin\";\n\n public run(context: EventPluginContext): Promise {\n if (!context.event.reference_id && context.event.type === \"error\") {\n // PERF: Optimize identifier creation.\n context.event.reference_id = guid().replaceAll(\"-\", \"\").substring(0, 10);\n }\n\n return Promise.resolve();\n }\n}\n", "import { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\nimport { isEmpty, stringify } from \"../../Utils.js\";\nimport { SimpleError } from \"../../models/data/ErrorInfo.js\";\nimport { KnownEventDataKeys } from \"../../models/Event.js\";\n\nexport const IgnoredErrorProperties: string[] = [\n \"arguments\",\n \"column\",\n \"columnNumber\",\n \"description\",\n \"fileName\",\n \"message\",\n \"name\",\n \"number\",\n \"line\",\n \"lineNumber\",\n \"opera#sourceloc\",\n \"sourceId\",\n \"sourceURL\",\n \"stack\",\n \"stackArray\",\n \"stacktrace\"\n];\n\nexport class SimpleErrorPlugin implements IEventPlugin {\n public priority = 30;\n public name = \"SimpleErrorPlugin\";\n\n public async run(context: EventPluginContext): Promise {\n const exception = context.eventContext.getException();\n if (exception) {\n if (!context.event.type) {\n context.event.type = \"error\";\n }\n\n if (context.event.data && !context.event.data[KnownEventDataKeys.SimpleError]) {\n const error = {\n type: exception.name || \"Error\",\n message: exception.message,\n stack_trace: exception.stack,\n data: {}\n };\n\n const exclusions = context.client.config.dataExclusions.concat(IgnoredErrorProperties);\n const additionalData = stringify(exception, exclusions);\n if (!isEmpty(additionalData)) {\n error.data![\"@ext\"] = JSON.parse(additionalData);\n }\n\n context.event.data[KnownEventDataKeys.SimpleError] = error;\n }\n }\n\n return Promise.resolve();\n }\n}\n", "import { KnownEventDataKeys } from \"../../models/Event.js\";\nimport { EventPluginContext } from \"../EventPluginContext.js\";\nimport { IEventPlugin } from \"../IEventPlugin.js\";\n\nexport class SubmissionMethodPlugin implements IEventPlugin {\n public priority = 100;\n public name = \"SubmissionMethodPlugin\";\n\n public run(context: EventPluginContext): Promise {\n const submissionMethod = context.eventContext.getSubmissionMethod();\n if (submissionMethod && context.event.data) {\n context.event.data[KnownEventDataKeys.SubmissionMethod] = submissionMethod;\n }\n\n return Promise.resolve();\n }\n}\n", "import { Configuration } from \"../configuration/Configuration.js\";\nimport { ConfigurationDefaultsPlugin } from \"./default/ConfigurationDefaultsPlugin.js\";\nimport { DuplicateCheckerPlugin } from \"./default/DuplicateCheckerPlugin.js\";\nimport { EventPluginContext } from \"./EventPluginContext.js\";\nimport { EventExclusionPlugin } from \"./default/EventExclusionPlugin.js\";\nimport { PluginContext } from \"./PluginContext.js\";\nimport { ReferenceIdPlugin } from \"./default/ReferenceIdPlugin.js\";\nimport { SimpleErrorPlugin } from \"./default/SimpleErrorPlugin.js\";\nimport { SubmissionMethodPlugin } from \"./default/SubmissionMethodPlugin.js\";\n\nexport class EventPluginManager {\n public static async startup(context: PluginContext): Promise {\n for (const plugin of context.client.config.plugins) {\n if (!plugin.startup) {\n continue;\n }\n\n try {\n await plugin.startup(context);\n } catch (ex) {\n context.log.error(`Error running plugin startup\"${plugin.name}\": ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n }\n\n public static async suspend(context: PluginContext): Promise {\n for (const plugin of context.client.config.plugins) {\n if (!plugin.suspend) {\n continue;\n }\n\n try {\n await plugin.suspend(context);\n } catch (ex) {\n context.log.error(`Error running plugin suspend\"${plugin.name}\": ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n }\n\n public static async run(context: EventPluginContext): Promise {\n for (const plugin of context.client.config.plugins) {\n if (context.cancelled) {\n break;\n }\n\n if (!plugin.run) {\n continue;\n }\n\n try {\n await plugin.run(context);\n } catch (ex) {\n context.cancelled = true;\n context.log.error(`Error running plugin \"${plugin.name}\": ${ex instanceof Error ? ex.message : ex + \"\"}. Discarding Event.`);\n }\n }\n }\n\n public static addDefaultPlugins(config: Configuration): void {\n config.addPlugin(new ConfigurationDefaultsPlugin());\n config.addPlugin(new SimpleErrorPlugin());\n config.addPlugin(new ReferenceIdPlugin());\n config.addPlugin(new DuplicateCheckerPlugin());\n config.addPlugin(new EventExclusionPlugin());\n config.addPlugin(new SubmissionMethodPlugin());\n }\n}\n", "import { Configuration } from \"../configuration/Configuration.js\";\nimport { ILog } from \"../logging/ILog.js\";\nimport { Event } from \"../models/Event.js\";\nimport { IEventQueue } from \"../queue/IEventQueue.js\";\nimport { Response } from \"../submission/Response.js\";\nimport { allowProcessToExitWithoutWaitingForTimerOrInterval } from \"../Utils.js\";\n\ninterface EventQueueItem {\n file: string;\n event: Event;\n}\n\nexport class DefaultEventQueue implements IEventQueue {\n /**\n * A list of handlers that will be fired when events are submitted.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(events: Event[], response: Response) => Promise> = [];\n\n /**\n * Suspends processing until the specified time.\n * @type {Date}\n * @private\n */\n private _suspendProcessingUntil?: Date;\n\n /**\n * Discards queued items until the specified time.\n * @type {Date}\n * @private\n */\n private _discardQueuedItemsUntil?: Date;\n\n /**\n * Returns true if the queue is processing.\n * @type {boolean}\n * @private\n */\n private _processingQueue = false;\n\n /**\n * Processes the queue every xx seconds.\n * @type {Interval}\n * @private\n */\n private _queueIntervalId: ReturnType | undefined;\n\n private readonly QUEUE_PREFIX: string = \"q:\";\n private _lastFileTimestamp = 0;\n private _queue: EventQueueItem[] = [];\n private _loadPersistedEvents = true;\n\n constructor(\n private config: Configuration,\n private maxItems: number = 250\n ) {}\n\n public async enqueue(event: Event): Promise {\n const eventWillNotBeQueued = \"The event will not be queued.\";\n const config: Configuration = this.config;\n const log: ILog = config.services.log;\n\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (this.areQueuedItemsDiscarded()) {\n log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`);\n return;\n }\n\n const file = await this.enqueueEvent(event);\n const logText = `type=${event.type} reference_id=${event.reference_id} source=${event.source} message=${event.message}`;\n log.info(`Enqueued event: ${file} (${logText})`);\n }\n\n public async process(): Promise {\n const queueNotProcessed = \"The queue will not be processed\";\n const { log } = this.config.services;\n\n if (this._processingQueue) {\n return;\n }\n\n log.trace(\"Processing queue...\");\n if (!this.config.enabled) {\n log.info(`Configuration is disabled: ${queueNotProcessed}`);\n return;\n }\n\n if (!this.config.isValid) {\n log.info(`Invalid Api Key: ${queueNotProcessed}`);\n return;\n }\n\n this._processingQueue = true;\n try {\n if (this._loadPersistedEvents) {\n if (this.config.usePersistedQueueStorage) {\n await this.loadEvents();\n }\n\n this._loadPersistedEvents = false;\n }\n\n const items = this._queue.slice(0, this.config.submissionBatchSize);\n if (!items || items.length === 0) {\n this._processingQueue = false;\n return;\n }\n\n log.info(`Sending ${items.length} events to ${this.config.serverUrl}`);\n const events = items.map((i) => i.event);\n const response = await this.config.services.submissionClient.submitEvents(events);\n await this.processSubmissionResponse(response, items);\n await this.eventsPosted(events, response);\n log.trace(\"Finished processing queue\");\n this._processingQueue = false;\n } catch (ex) {\n log.error(`Error processing queue: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n await this.suspendProcessing();\n this._processingQueue = false;\n }\n }\n\n public startup(): Promise {\n if (!this._queueIntervalId) {\n // TODO: Fix awaiting promise.\n this._queueIntervalId = setInterval(() => void this.onProcessQueue(), 10000);\n allowProcessToExitWithoutWaitingForTimerOrInterval(this._queueIntervalId);\n }\n\n return Promise.resolve();\n }\n\n public suspend(): Promise {\n clearInterval(this._queueIntervalId);\n this._queueIntervalId = undefined;\n return Promise.resolve();\n }\n\n public async suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): Promise {\n const config: Configuration = this.config; // Optimization for minifier.\n\n const currentDate = new Date();\n if (!durationInMinutes || durationInMinutes <= 0) {\n durationInMinutes = Math.ceil(currentDate.getMinutes() / 15) * 15 - currentDate.getMinutes();\n }\n\n config.services.log.info(`Suspending processing for ${durationInMinutes} minutes.`);\n this._suspendProcessingUntil = new Date(currentDate.getTime() + durationInMinutes * 60000);\n\n if (discardFutureQueuedItems) {\n this._discardQueuedItemsUntil = this._suspendProcessingUntil;\n }\n\n if (clearQueue) {\n // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors.\n await this.removeEvents(this._queue);\n }\n }\n\n // TODO: See if this makes sense.\n public onEventsPosted(handler: (events: Event[], response: Response) => Promise): void {\n handler && this._handlers.push(handler);\n }\n\n private async eventsPosted(events: Event[], response: Response): Promise {\n const handlers = this._handlers;\n for (const handler of handlers) {\n try {\n await handler(events, response);\n } catch (ex) {\n this.config.services.log.error(`Error calling onEventsPosted handler: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n }\n\n private areQueuedItemsDiscarded(): boolean {\n return (this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date()) || false;\n }\n\n private isQueueProcessingSuspended(): boolean {\n return (this._suspendProcessingUntil && this._suspendProcessingUntil > new Date()) || false;\n }\n\n private async onProcessQueue(): Promise {\n if (!this.isQueueProcessingSuspended() && !this._processingQueue) {\n await this.process();\n }\n }\n\n private async processSubmissionResponse(response: Response, items: EventQueueItem[]): Promise {\n const noSubmission = \"The event will not be submitted\";\n const config: Configuration = this.config;\n const log: ILog = config.services.log;\n\n if (response.status === 202) {\n log.info(`Sent ${items.length} events`);\n await this.removeEvents(items);\n return;\n }\n\n if (response.status === 429 || response.rateLimitRemaining === 0 || response.status === 503) {\n // You are currently over your rate limit or the servers are under stress.\n log.error(\"Server returned service unavailable\");\n await this.suspendProcessing();\n return;\n }\n\n if (response.status === 402) {\n // If the organization over the rate limit then discard the event.\n log.info(\"Too many events have been submitted, please upgrade your plan\");\n await this.suspendProcessing(0, true, true);\n return;\n }\n\n if (response.status === 401 || response.status === 403) {\n // The api key was suspended or could not be authorized.\n log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`);\n await this.suspendProcessing(15);\n await this.removeEvents(items);\n return;\n }\n\n if (response.status === 400 || response.status === 404) {\n // The service end point could not be found.\n log.error(`Error while trying to submit data: ${response.message}`);\n await this.suspendProcessing(60 * 4);\n await this.removeEvents(items);\n return;\n }\n\n if (response.status === 413) {\n const message = \"Event submission discarded for being too large.\";\n if (config.submissionBatchSize > 1) {\n log.error(`${message} Retrying with smaller batch size.`);\n config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5));\n } else {\n log.error(`${message} ${noSubmission}`);\n await this.removeEvents(items);\n }\n\n return;\n }\n\n log.error(`Error submitting events: ${response.message || \"Please check the network tab for more info.\"}`);\n await this.suspendProcessing();\n }\n\n private async loadEvents(): Promise {\n if (this.config.usePersistedQueueStorage) {\n const { log, storage } = this.config.services;\n\n try {\n const files: string[] = await storage.keys();\n\n for (const file of files) {\n if (file?.startsWith(this.QUEUE_PREFIX)) {\n const json = await storage.getItem(file);\n if (json) this._queue.push({ file, event: JSON.parse(json) as Event });\n }\n }\n } catch (ex) {\n log.error(`Error loading queue items from storage: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n }\n\n private async enqueueEvent(event: Event): Promise {\n this._lastFileTimestamp = Math.max(Date.now(), this._lastFileTimestamp + 1);\n const file = `${this.QUEUE_PREFIX}${this._lastFileTimestamp}.json`;\n\n const { log, storage } = this.config.services;\n const useStorage: boolean = this.config.usePersistedQueueStorage;\n if (this._queue.push({ file, event }) > this.maxItems) {\n log.trace(\"Removing oldest queue entry: maxItems exceeded\");\n const item = this._queue.shift();\n if (useStorage && item) {\n try {\n await storage.removeItem(item.file);\n } catch (ex) {\n log.error(`Error removing oldest queue entry from storage: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n }\n\n if (useStorage) {\n try {\n await storage.setItem(file, JSON.stringify(event));\n } catch (ex) {\n log.error(`Error saving queue entry to storage: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n\n return file;\n }\n\n private async removeEvents(items: EventQueueItem[]): Promise {\n const files = items.map((i) => i.file);\n if (this.config.usePersistedQueueStorage) {\n const { log, storage } = this.config.services;\n\n for (const file of files) {\n try {\n await storage.removeItem(file);\n } catch (ex) {\n log.error(`Error removing queue item from storage: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n }\n\n this._queue = this._queue.filter((i) => !files.includes(i.file));\n }\n}\n", "import { Configuration } from \"./Configuration.js\";\n\nexport class ServerSettings {\n constructor(\n public settings: Record,\n public version: number\n ) {}\n}\n\nexport class SettingsManager {\n private static readonly SettingsKey: string = \"settings\";\n private static _isUpdatingSettings = false;\n\n public static async applySavedServerSettings(config: Configuration): Promise {\n if (!config?.isValid) {\n return;\n }\n\n const savedSettings = await this.getSavedServerSettings(config);\n if (savedSettings) {\n config.applyServerSettings(savedSettings);\n }\n }\n\n public static async updateSettings(config: Configuration): Promise {\n if (!config?.enabled || this._isUpdatingSettings) {\n return;\n }\n\n this._isUpdatingSettings = true;\n const { log, storage, submissionClient } = config.services;\n\n try {\n const unableToUpdateMessage = \"Unable to update settings\";\n if (!config.isValid) {\n log.error(`${unableToUpdateMessage}: ApiKey is not set`);\n return;\n }\n\n const version = config.settingsVersion;\n log.trace(`Checking for updated settings from: v${version}`);\n const response = await submissionClient.getSettings(version);\n\n if (response.status === 304) {\n log.trace(\"Settings are up-to-date\");\n return;\n }\n\n if (!response?.success || !response.data) {\n log.warn(`${unableToUpdateMessage}: ${response.message}`);\n return;\n }\n\n config.applyServerSettings(response.data);\n\n await storage.setItem(SettingsManager.SettingsKey, JSON.stringify(response.data));\n log.trace(`Updated settings: v${response.data.version}`);\n } catch (ex) {\n log.error(`Error updating settings: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n } finally {\n this._isUpdatingSettings = false;\n }\n }\n\n private static async getSavedServerSettings(config: Configuration): Promise {\n const { log, storage } = config.services;\n try {\n const settings = await storage.getItem(SettingsManager.SettingsKey);\n return (settings && (JSON.parse(settings) as ServerSettings)) || new ServerSettings({}, 0);\n } catch (ex) {\n log.error(`Error getting saved settings: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n return new ServerSettings({}, 0);\n }\n }\n}\n", "export class Response {\n constructor(\n public status: number,\n public message: string,\n public rateLimitRemaining: number,\n public settingsVersion: number,\n public data: T\n ) {}\n\n public get success(): boolean {\n return this.status >= 200 && this.status <= 299;\n }\n}\n", "import { Configuration } from \"../configuration/Configuration.js\";\nimport { ServerSettings, SettingsManager } from \"../configuration/SettingsManager.js\";\nimport { Event } from \"../models/Event.js\";\nimport { UserDescription } from \"../models/data/UserDescription.js\";\nimport { ISubmissionClient } from \"./ISubmissionClient.js\";\nimport { Response } from \"./Response.js\";\n\nexport class DefaultSubmissionClient implements ISubmissionClient {\n protected readonly RateLimitRemainingHeader: string = \"x-ratelimit-remaining\";\n protected readonly ConfigurationVersionHeader: string = \"x-exceptionless-configversion\";\n\n public constructor(\n protected config: Configuration,\n private fetch = globalThis.fetch?.bind(globalThis)\n ) {}\n\n public getSettings(version: number): Promise> {\n const url = `${this.config.serverUrl}/api/v2/projects/config?v=${version}`;\n return this.apiFetch(url, {\n method: \"GET\"\n });\n }\n\n public async submitEvents(events: Event[]): Promise {\n const url = `${this.config.serverUrl}/api/v2/events`;\n const response = await this.apiFetch(url, {\n method: \"POST\",\n body: JSON.stringify(events)\n });\n\n await this.updateSettingsVersion(response.settingsVersion);\n return response;\n }\n\n public async submitUserDescription(referenceId: string, description: UserDescription): Promise {\n const url = `${this.config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`;\n\n const response = await this.apiFetch(url, {\n method: \"POST\",\n body: JSON.stringify(description)\n });\n\n await this.updateSettingsVersion(response.settingsVersion);\n\n return response;\n }\n\n public async submitHeartbeat(sessionIdOrUserId: string, closeSession: boolean): Promise> {\n const url = `${this.config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession + \"\"}`;\n return await this.apiFetch(url, {\n method: \"GET\"\n });\n }\n\n protected async updateSettingsVersion(serverSettingsVersion: number): Promise {\n if (isNaN(serverSettingsVersion)) {\n this.config.services.log.error(\"No config version header was returned.\");\n } else if (serverSettingsVersion > this.config.settingsVersion) {\n await SettingsManager.updateSettings(this.config);\n }\n }\n\n protected async apiFetch(url: string, options: FetchOptions): Promise> {\n // TODO: Figure out how to set a 10000 timeout.\n const requestOptions: RequestInit = {\n method: options.method,\n headers: {\n Accept: \"application/json\",\n Authorization: `Bearer ${this.config.apiKey}`,\n \"User-Agent\": this.config.userAgent\n },\n body: options.body ?? null\n };\n\n // TODO: Can we properly calculate content size?\n if (options.method === \"POST\" && this.isHeaders(requestOptions.headers)) {\n requestOptions.headers[\"Content-Type\"] = \"application/json\";\n }\n\n const response = await this.fetch(url, requestOptions);\n const rateLimitRemaining: number = parseInt(response.headers.get(this.RateLimitRemainingHeader) || \"\", 10);\n const settingsVersion: number = parseInt(response.headers.get(this.ConfigurationVersionHeader) || \"\", 10);\n\n const responseText = await response.text();\n const data = responseText && responseText.length > 0 ? (JSON.parse(responseText) as T) : null;\n\n return new Response(response.status, response.statusText, rateLimitRemaining, settingsVersion, data);\n }\n\n private isHeaders(headers: HeadersInit | undefined): headers is Record {\n return (headers as Record) !== undefined;\n }\n}\n\nexport interface FetchOptions {\n method: \"GET\" | \"POST\";\n body?: string;\n}\n", "import { IStorage } from \"./IStorage.js\";\n\nexport class InMemoryStorage implements IStorage {\n private items = new Map();\n\n public length(): Promise {\n return Promise.resolve(this.items.size);\n }\n\n public clear(): Promise {\n this.items.clear();\n return Promise.resolve();\n }\n\n public getItem(key: string): Promise {\n const value = this.items.get(key);\n return Promise.resolve(value ? value : null);\n }\n\n public async key(index: number): Promise {\n if (index < 0) return Promise.resolve(null);\n\n const keys = await this.keys();\n\n if (index > keys.length) return Promise.resolve(null);\n\n const key = keys[index];\n return Promise.resolve(key ? key : null);\n }\n\n public keys(): Promise {\n return Promise.resolve(Array.from(this.items.keys()));\n }\n\n public removeItem(key: string): Promise {\n this.items.delete(key);\n return Promise.resolve();\n }\n\n public setItem(key: string, value: string): Promise {\n this.items.set(key, value);\n return Promise.resolve();\n }\n}\n", "import { IStorage } from \"./IStorage.js\";\n\nexport class LocalStorage implements IStorage {\n constructor(\n private prefix: string = \"exceptionless-\",\n private storage: Storage = globalThis.localStorage\n ) {}\n\n public length(): Promise {\n return Promise.resolve(this.getKeys().length);\n }\n\n public clear(): Promise {\n for (const key of this.getKeys()) {\n this.storage.removeItem(this.getKey(key));\n }\n\n return Promise.resolve();\n }\n\n public getItem(key: string): Promise {\n return Promise.resolve(this.storage.getItem(this.getKey(key)));\n }\n\n public key(index: number): Promise {\n const keys = this.getKeys();\n return Promise.resolve(index < keys.length ? keys[index] : null);\n }\n\n public keys(): Promise {\n return Promise.resolve(this.getKeys());\n }\n\n public removeItem(key: string): Promise {\n this.storage.removeItem(this.getKey(key));\n return Promise.resolve();\n }\n\n public setItem(key: string, value: string): Promise {\n this.storage.setItem(this.getKey(key), value);\n return Promise.resolve();\n }\n\n private getKeys(): string[] {\n return Object.keys(this.storage)\n .filter((key) => key.startsWith(this.prefix))\n .map((key) => key?.substr(this.prefix.length));\n }\n\n private getKey(key: string): string {\n return this.prefix + key;\n }\n}\n", "import { DefaultLastReferenceIdManager } from \"../lastReferenceIdManager/DefaultLastReferenceIdManager.js\";\nimport { ILastReferenceIdManager } from \"../lastReferenceIdManager/ILastReferenceIdManager.js\";\nimport { ILog } from \"../logging/ILog.js\";\nimport { ConsoleLog } from \"../logging/ConsoleLog.js\";\nimport { NullLog } from \"../logging/NullLog.js\";\nimport { UserInfo } from \"../models/data/UserInfo.js\";\nimport { HeartbeatPlugin } from \"../plugins/default/HeartbeatPlugin.js\";\nimport { SessionIdManagementPlugin } from \"../plugins/default/SessionIdManagementPlugin.js\";\nimport { EventPluginContext } from \"../plugins/EventPluginContext.js\";\nimport { EventPluginManager } from \"../plugins/EventPluginManager.js\";\nimport { IEventPlugin } from \"../plugins/IEventPlugin.js\";\nimport { DefaultEventQueue } from \"../queue/DefaultEventQueue.js\";\nimport { IEventQueue } from \"../queue/IEventQueue.js\";\nimport { ISubmissionClient } from \"../submission/ISubmissionClient.js\";\nimport { DefaultSubmissionClient } from \"../submission/DefaultSubmissionClient.js\";\nimport { guid } from \"../Utils.js\";\nimport { KnownEventDataKeys } from \"../models/Event.js\";\nimport { InMemoryStorage } from \"../storage/InMemoryStorage.js\";\nimport { IStorage } from \"../storage/IStorage.js\";\nimport { LocalStorage } from \"../storage/LocalStorage.js\";\nimport { ServerSettings } from \"./SettingsManager.js\";\n\nexport class Configuration {\n constructor() {\n this.services = {\n lastReferenceIdManager: new DefaultLastReferenceIdManager(),\n log: new NullLog(),\n storage: new InMemoryStorage(),\n queue: new DefaultEventQueue(this),\n submissionClient: new DefaultSubmissionClient(this)\n };\n\n EventPluginManager.addDefaultPlugins(this);\n }\n\n /**\n * A default list of tags that will automatically be added to every\n * report submitted to the server.\n */\n public defaultTags: string[] = [];\n\n /**\n * A default list of of extended data objects that will automatically\n * be added to every report submitted to the server.\n */\n public defaultData: Record = {};\n\n /**\n * Whether the client is currently enabled or not. If it is disabled,\n * submitted errors will be discarded and no data will be sent to the server.\n *\n * @returns {boolean}\n */\n public enabled = true;\n\n public services: IConfigurationServices;\n\n /**\n * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50)\n */\n public submissionBatchSize = 50;\n\n /**\n * Contains a dictionary of custom settings that can be used to control\n * the client and will be automatically updated from the server.\n */\n public settings: Record = {};\n public settingsVersion = 0;\n\n /**\n * The API key that will be used when sending events to the server.\n */\n public apiKey = \"\";\n\n /**\n * The server url that all events will be sent to.\n * @type {string}\n */\n private _serverUrl = \"https://collector.exceptionless.io\";\n\n /**\n * The config server url that all configuration will be retrieved from.\n */\n public configServerUrl = \"https://config.exceptionless.io\";\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n */\n public heartbeatServerUrl = \"https://heartbeat.exceptionless.io\";\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n */\n private _updateSettingsWhenIdleInterval = 120000;\n\n /**\n * A list of exclusion patterns.\n */\n private _dataExclusions: string[] = [];\n\n private _includePrivateInformation = true;\n private _includeUserName = true;\n private _includeMachineName = true;\n private _includeIpAddress = true;\n private _includeHeaders = true;\n private _includeCookies = true;\n private _includePostData = true;\n private _includeQueryString = true;\n\n /**\n * A list of user agent patterns.\n */\n private _userAgentBotPatterns: string[] = [];\n\n /**\n * The list of plugins that will be used in this configuration.\n */\n private _plugins: IEventPlugin[] = [];\n\n /**\n * A list of subscribers that will be fired when configuration changes.\n */\n private _subscribers: Array<(config: Configuration) => void> = [];\n\n /**\n * Returns true if the apiKey is valid.\n */\n public get isValid(): boolean {\n return this.apiKey?.length >= 10;\n }\n\n /**\n * The server url that all events will be sent to.\n */\n public get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * The server url that all events will be sent to.\n */\n public set serverUrl(value: string) {\n if (value) {\n this._serverUrl = value;\n this.configServerUrl = value;\n this.heartbeatServerUrl = value;\n }\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n */\n public get updateSettingsWhenIdleInterval(): number {\n return this._updateSettingsWhenIdleInterval;\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n */\n public set updateSettingsWhenIdleInterval(value: number) {\n if (typeof value !== \"number\") {\n return;\n }\n\n if (value <= 0) {\n value = -1;\n } else if (value > 0 && value < 120000) {\n value = 120000;\n }\n\n this._updateSettingsWhenIdleInterval = value;\n }\n\n /**\n * A list of exclusion patterns that will automatically remove any data that\n * matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties,\n * form fields, cookies and query parameters from the report.\n */\n public get dataExclusions(): string[] {\n // TODO: Known settings keys.\n const exclusions: string = this.settings[\"@@DataExclusions\"];\n return this._dataExclusions.concat((exclusions && exclusions.split(\",\")) || []);\n }\n\n /**\n * Add items to the list of exclusion patterns that will automatically remove any\n * data that matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties, form\n * fields, cookies and query parameters from the report.\n */\n public addDataExclusions(...exclusions: string[]): void {\n this._dataExclusions = [...this._dataExclusions, ...exclusions];\n }\n\n /**\n * Gets a value indicating whether to include private information about the local machine.\n */\n public get includePrivateInformation(): boolean {\n return this._includePrivateInformation;\n }\n\n /**\n * Sets a value indicating whether to include private information about the local machine\n */\n public set includePrivateInformation(value: boolean) {\n const val = value === true;\n this._includePrivateInformation = val;\n this._includeUserName = val;\n this._includeMachineName = val;\n this._includeIpAddress = val;\n this._includeHeaders = val;\n this._includeCookies = val;\n this._includePostData = val;\n this._includeQueryString = val;\n }\n\n /**\n * Gets a value indicating whether to include User Name.\n */\n public get includeUserName(): boolean {\n return this._includeUserName;\n }\n\n /**\n * Sets a value indicating whether to include User Name.\n */\n public set includeUserName(value: boolean) {\n this._includeUserName = value === true;\n }\n\n /**\n * Gets a value indicating whether to include MachineName in MachineInfo.\n */\n public get includeMachineName(): boolean {\n return this._includeMachineName;\n }\n\n /**\n * Sets a value indicating whether to include MachineName in MachineInfo.\n */\n public set includeMachineName(value: boolean) {\n this._includeMachineName = value === true;\n }\n\n /**\n * Gets a value indicating whether to include Ip Addresses in MachineInfo and RequestInfo.\n */\n public get includeIpAddress(): boolean {\n return this._includeIpAddress;\n }\n\n /**\n * Sets a value indicating whether to include Ip Addresses in MachineInfo and RequestInfo.\n */\n public set includeIpAddress(value: boolean) {\n this._includeIpAddress = value === true;\n }\n\n /**\n * Gets a value indicating whether to include Headers.\n * NOTE: DataExclusions are applied to all Header keys when enabled.\n */\n public get includeHeaders(): boolean {\n return this._includeHeaders;\n }\n\n /**\n * Sets a value indicating whether to include Headers.\n * NOTE: DataExclusions are applied to all Headers keys when enabled.\n */\n public set includeHeaders(value: boolean) {\n this._includeHeaders = value === true;\n }\n\n /**\n * Gets a value indicating whether to include Cookies.\n * NOTE: DataExclusions are applied to all Cookie keys when enabled.\n */\n public get includeCookies(): boolean {\n return this._includeCookies;\n }\n\n /**\n * Sets a value indicating whether to include Cookies.\n * NOTE: DataExclusions are applied to all Cookie keys when enabled.\n */\n public set includeCookies(value: boolean) {\n this._includeCookies = value === true;\n }\n\n /**\n * Gets a value indicating whether to include Form/POST Data.\n * NOTE: DataExclusions are only applied to Form data keys when enabled.\n */\n public get includePostData(): boolean {\n return this._includePostData;\n }\n\n /**\n * Sets a value indicating whether to include Form/POST Data.\n * NOTE: DataExclusions are only applied to Form data keys when enabled.\n */\n public set includePostData(value: boolean) {\n this._includePostData = value === true;\n }\n\n /**\n * Gets a value indicating whether to include query string information.\n * NOTE: DataExclusions are applied to all Query String keys when enabled.\n */\n public get includeQueryString(): boolean {\n return this._includeQueryString;\n }\n\n /**\n * Sets a value indicating whether to include query string information.\n * NOTE: DataExclusions are applied to all Query String keys when enabled.\n */\n public set includeQueryString(value: boolean) {\n this._includeQueryString = value === true;\n }\n\n /**\n * A list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n */\n public get userAgentBotPatterns(): string[] {\n // TODO: Known settings keys.\n const patterns: string = this.settings[\"@@UserAgentBotPatterns\"];\n return this._userAgentBotPatterns.concat((patterns && patterns.split(\",\")) || []);\n }\n\n /**\n * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n */\n public addUserAgentBotPatterns(...userAgentBotPatterns: string[]): void {\n this._userAgentBotPatterns = [...this._userAgentBotPatterns, ...userAgentBotPatterns];\n }\n\n /**\n * The list of plugins that will be used in this configuration.\n */\n public get plugins(): IEventPlugin[] {\n return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => {\n if (p1 == null && p2 == null) {\n return 0;\n }\n\n if (p1?.priority == null) {\n return -1;\n }\n\n if (p2?.priority == null) {\n return 1;\n }\n\n if (p1.priority == p2.priority) {\n return 0;\n }\n\n return p1.priority > p2.priority ? 1 : -1;\n });\n }\n\n /**\n * Register an plugin to be used in this configuration.\n */\n public addPlugin(plugin: IEventPlugin): void;\n\n /**\n * Register an plugin to be used in this configuration.\n */\n public addPlugin(name: string | undefined, priority: number, pluginAction: (context: EventPluginContext) => Promise): void;\n public addPlugin(pluginOrName: IEventPlugin | string | undefined, priority?: number, pluginAction?: (context: EventPluginContext) => Promise): void {\n const plugin: IEventPlugin = pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : (pluginOrName as IEventPlugin);\n\n if (!plugin || !(plugin.startup || plugin.run)) {\n this.services.log.error(\"Add plugin failed: startup or run method not defined\");\n return;\n }\n\n if (!plugin.name) {\n plugin.name = guid();\n }\n\n if (!plugin.priority) {\n plugin.priority = 0;\n }\n\n if (!this._plugins.find((f) => f.name === plugin.name)) {\n this._plugins.push(plugin);\n }\n }\n\n /**\n * Remove an plugin by key from this configuration.\n */\n public removePlugin(pluginOrName: IEventPlugin | string): void {\n const name: string = typeof pluginOrName === \"string\" ? pluginOrName : pluginOrName.name || \"\";\n if (!name) {\n this.services.log.error(\"Remove plugin failed: Plugin name not defined\");\n return;\n }\n\n const plugins = this._plugins; // optimization for minifier.\n for (let index = 0; index < plugins.length; index++) {\n if (plugins[index].name === name) {\n plugins.splice(index, 1);\n break;\n }\n }\n }\n\n /**\n * The application version for events.\n */\n public get version(): string {\n return this.defaultData[KnownEventDataKeys.Version];\n }\n\n /**\n * Set the application version for events.\n */\n public set version(version: string) {\n if (version) {\n this.defaultData[KnownEventDataKeys.Version] = version;\n } else {\n delete this.defaultData[KnownEventDataKeys.Version];\n }\n }\n\n /**\n * Set the default user identity for all events.\n */\n public setUserIdentity(userInfo: UserInfo): void;\n public setUserIdentity(identity: string): void;\n public setUserIdentity(identity: string, name: string): void;\n public setUserIdentity(userInfoOrIdentity: UserInfo | string, name?: string): void {\n const userInfo: UserInfo = typeof userInfoOrIdentity !== \"string\" ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n\n const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name);\n if (shouldRemove) {\n delete this.defaultData[KnownEventDataKeys.UserInfo];\n } else {\n this.defaultData[KnownEventDataKeys.UserInfo] = userInfo;\n }\n\n this.services.log.info(`user identity: ${shouldRemove ? \"null\" : userInfo.identity}`);\n }\n\n /**\n * Used to identify the client that sent the events to the server.\n */\n public get userAgent(): string {\n return \"exceptionless-js/3.1.0\";\n }\n\n /**\n * Use localStorage for persisting things like server configuration cache and persisted queue entries (depends on usePersistedQueueStorage).\n */\n public useLocalStorage(): void {\n if (globalThis?.localStorage) {\n this.services.storage = new LocalStorage();\n }\n }\n\n /**\n * Writes events to storage on enqueue and removes them when submitted. (Defaults to false)\n * This setting only works in environments that supports persisted storage.\n * There is also a performance penalty of extra IO/serialization.\n */\n public usePersistedQueueStorage: boolean = false;\n\n /**\n * Gets or sets a value indicating whether to automatically send session start,\n * session heartbeats and session end events.\n */\n public sessionsEnabled = false;\n\n /**\n * Internal property used to track the current session identifier.\n */\n public currentSessionIdentifier: string | null = null;\n\n /**\n *\n * @param sendHeartbeats Controls whether heartbeat events are sent on an interval.\n * @param heartbeatInterval The interval at which heartbeats are sent after the last sent event. The default is 1 minutes.\n * @param useSessionIdManagement Allows you to manually control the session id. This is only recommended for single user desktop environments.\n */\n public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 60000, useSessionIdManagement: boolean = false) {\n this.sessionsEnabled = true;\n\n if (useSessionIdManagement) {\n this.addPlugin(new SessionIdManagementPlugin());\n }\n\n const plugin = new HeartbeatPlugin(heartbeatInterval);\n if (sendHeartbeats) {\n this.addPlugin(plugin);\n } else {\n this.removePlugin(plugin);\n }\n }\n\n private originalSettings?: Record;\n\n public applyServerSettings(serverSettings: ServerSettings): void {\n if (!this.originalSettings) {\n this.originalSettings = JSON.parse(JSON.stringify(this.settings)) as Record;\n }\n\n this.services.log.trace(`Applying saved settings: v${serverSettings.version}`);\n this.settings = Object.assign(this.originalSettings, serverSettings.settings);\n this.settingsVersion = serverSettings.version;\n this.notifySubscribers();\n }\n\n // TODO: Support a min log level.\n public useDebugLogger(): void {\n this.services.log = new ConsoleLog();\n }\n\n public subscribeServerSettingsChange(handler: (config: Configuration) => void): void {\n handler && this._subscribers.push(handler);\n }\n\n private notifySubscribers() {\n for (const handler of this._subscribers) {\n try {\n handler(this);\n } catch (ex) {\n this.services.log.error(`Error calling subscribe handler: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n }\n}\n\ninterface IConfigurationServices {\n lastReferenceIdManager: ILastReferenceIdManager;\n log: ILog;\n submissionClient: ISubmissionClient;\n storage: IStorage;\n queue: IEventQueue;\n}\n", "const enum KnownContextKeys {\n Exception = \"@@_Exception\",\n IsUnhandledError = \"@@_IsUnhandledError\",\n SubmissionMethod = \"@@_SubmissionMethod\"\n}\n\nexport class EventContext implements Record {\n [x: string]: unknown;\n\n public getException(): Error | null {\n return (this[KnownContextKeys.Exception] as Error) || null;\n }\n\n public setException(exception: Error): void {\n if (exception) {\n this[KnownContextKeys.Exception] = exception;\n }\n }\n\n public get hasException(): boolean {\n return !!this[KnownContextKeys.Exception];\n }\n\n public markAsUnhandledError(): void {\n this[KnownContextKeys.IsUnhandledError] = true;\n }\n\n public get isUnhandledError(): boolean {\n return !!this[KnownContextKeys.IsUnhandledError];\n }\n\n public getSubmissionMethod(): string | null {\n return (this[KnownContextKeys.SubmissionMethod] as string) || null;\n }\n\n public setSubmissionMethod(method: string): void {\n if (method) {\n this[KnownContextKeys.SubmissionMethod] = method;\n }\n }\n}\n", "import { ExceptionlessClient } from \"../ExceptionlessClient.js\";\nimport { ILog } from \"../logging/ILog.js\";\n\nexport class PluginContext {\n constructor(public client: ExceptionlessClient) {}\n\n public get log(): ILog {\n return this.client.config.services.log;\n }\n}\n", "import { ExceptionlessClient } from \"../ExceptionlessClient.js\";\nimport { ILog } from \"../logging/ILog.js\";\nimport { Event } from \"../models/Event.js\";\nimport { EventContext } from \"../models/EventContext.js\";\n\nexport class EventPluginContext {\n public cancelled: boolean = false;\n\n constructor(\n public client: ExceptionlessClient,\n public event: Event,\n public eventContext: EventContext\n ) {\n if (!this.eventContext) this.eventContext = new EventContext();\n }\n\n public get log(): ILog {\n return this.client.config.services.log;\n }\n}\n", "import { ExceptionlessClient } from \"./ExceptionlessClient.js\";\nimport { Event, EventType, KnownEventDataKeys } from \"./models/Event.js\";\nimport { ManualStackingInfo } from \"./models/data/ManualStackingInfo.js\";\nimport { UserInfo } from \"./models/data/UserInfo.js\";\nimport { EventContext } from \"./models/EventContext.js\";\nimport { isEmpty, stringify } from \"./Utils.js\";\nimport { EventPluginContext } from \"./plugins/EventPluginContext.js\";\n\nexport class EventBuilder {\n public target: Event;\n public client: ExceptionlessClient;\n public context: EventContext;\n\n private _validIdentifierErrorMessage = \"must contain between 8 and 100 alphanumeric or '-' characters.\";\n\n constructor(event: Event, client: ExceptionlessClient, context?: EventContext) {\n this.target = event;\n this.client = client;\n this.context = context || new EventContext();\n }\n\n public setType(type: EventType): EventBuilder {\n if (type) {\n this.target.type = type;\n }\n\n return this;\n }\n\n public setSource(source: string): EventBuilder {\n if (source) {\n this.target.source = source;\n }\n\n return this;\n }\n\n public setReferenceId(referenceId: string): EventBuilder {\n if (!this.isValidIdentifier(referenceId)) {\n throw new Error(`ReferenceId ${this._validIdentifierErrorMessage}`);\n }\n\n this.target.reference_id = referenceId;\n return this;\n }\n\n /**\n * Allows you to reference a parent event by its ReferenceId property. This allows you to have parent and child relationships.\n * @param name Reference name\n * @param id The reference id that points to a specific event\n */\n public setEventReference(name: string, id: string): EventBuilder {\n if (!name) {\n throw new Error(\"Invalid name\");\n }\n\n if (!id || !this.isValidIdentifier(id)) {\n throw new Error(`Id ${this._validIdentifierErrorMessage}`);\n }\n\n this.setProperty(\"@ref:\" + name, id);\n return this;\n }\n\n public setMessage(message: string | null | undefined): EventBuilder {\n if (message) {\n this.target.message = message;\n }\n\n return this;\n }\n\n public setGeo(latitude: number, longitude: number): EventBuilder {\n if (latitude < -90.0 || latitude > 90.0) {\n throw new Error(\"Must be a valid latitude value between -90.0 and 90.0.\");\n }\n\n if (longitude < -180.0 || longitude > 180.0) {\n throw new Error(\"Must be a valid longitude value between -180.0 and 180.0.\");\n }\n\n this.target.geo = `${latitude},${longitude}`;\n return this;\n }\n\n public setUserIdentity(userInfo: UserInfo): EventBuilder;\n public setUserIdentity(identity: string): EventBuilder;\n public setUserIdentity(identity: string, name: string): EventBuilder;\n public setUserIdentity(userInfoOrIdentity: UserInfo | string, name?: string): EventBuilder {\n const userInfo = typeof userInfoOrIdentity !== \"string\" ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n if (!userInfo || (!userInfo.identity && !userInfo.name)) {\n return this;\n }\n\n this.setProperty(KnownEventDataKeys.UserInfo, userInfo);\n return this;\n }\n\n /**\n * Sets the user\"s description of the event.\n *\n * @param emailAddress The email address\n * @param description The user\"s description of the event.\n */\n public setUserDescription(emailAddress: string, description: string): EventBuilder {\n if (emailAddress && description) {\n this.setProperty(KnownEventDataKeys.UserDescription, {\n email_address: emailAddress,\n description\n });\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting manual\n * stacking information.\n * @param signatureData A dictionary of strings to use for stacking.\n * @param title An optional title for the stacking information.\n */\n public setManualStackingInfo(signatureData: Record, title?: string): EventBuilder {\n if (signatureData) {\n const stack: ManualStackingInfo = { signature_data: signatureData };\n if (title) {\n stack.title = title;\n }\n\n this.setProperty(KnownEventDataKeys.ManualStackingInfo, stack);\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting the stacking key.\n * @param manualStackingKey The manual stacking key.\n * @param title An optional title for the stacking information.\n */\n public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {\n if (manualStackingKey) {\n const data = { ManualStackingKey: manualStackingKey };\n this.setManualStackingInfo(data, title);\n }\n\n return this;\n }\n\n /**\n * Sets the event value.\n * @param value The value of the event.\n */\n public setValue(value: number): EventBuilder {\n if (value) {\n this.target.value = value;\n }\n\n return this;\n }\n\n public addTags(...tags: string[]): EventBuilder {\n this.target.tags = [...(this.target.tags || []), ...tags];\n return this;\n }\n\n /**\n * Adds the object to extended data. Uses @excludedPropertyNames\n * to exclude data from being included in the event.\n * @param name The name of the object to add.\n * @param value The data object to add.\n * @param maxDepth The max depth of the object to include.\n * @param excludedPropertyNames Any property names that should be excluded.\n */\n public setProperty(name: string, value: unknown, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder {\n if (!name || value === undefined || value == null) {\n return this;\n }\n\n if (!this.target.data) {\n this.target.data = {};\n }\n\n const exclusions = this.client.config.dataExclusions.concat(excludedPropertyNames || []);\n const json = stringify(value, exclusions, maxDepth);\n if (!isEmpty(json)) {\n this.target.data[name] = JSON.parse(json);\n }\n\n return this;\n }\n\n public setContextProperty(name: string, value: unknown): EventBuilder {\n this.context[name] = value;\n return this;\n }\n\n public markAsCritical(critical: boolean): EventBuilder {\n if (critical) {\n this.addTags(\"Critical\");\n }\n\n return this;\n }\n\n public submit(): Promise {\n return this.client.submitEvent(this.target, this.context);\n }\n\n private isValidIdentifier(value: string): boolean {\n if (!value) {\n return true;\n }\n\n if (value.length < 8 || value.length > 100) {\n return false;\n }\n\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index);\n const isDigit = code >= 48 && code <= 57;\n const isLetter = (code >= 65 && code <= 90) || (code >= 97 && code <= 122);\n const isMinus = code === 45;\n\n if (!(isDigit || isLetter) && !isMinus) {\n return false;\n }\n }\n\n return true;\n }\n}\n", "import { Configuration } from \"./configuration/Configuration.js\";\nimport { SettingsManager } from \"./configuration/SettingsManager.js\";\nimport { EventBuilder } from \"./EventBuilder.js\";\nimport { Event, KnownEventDataKeys, LogLevel } from \"./models/Event.js\";\nimport { UserDescription } from \"./models/data/UserDescription.js\";\nimport { EventContext } from \"./models/EventContext.js\";\nimport { EventPluginContext } from \"./plugins/EventPluginContext.js\";\nimport { EventPluginManager } from \"./plugins/EventPluginManager.js\";\nimport { PluginContext } from \"./plugins/PluginContext.js\";\nimport { allowProcessToExitWithoutWaitingForTimerOrInterval } from \"./Utils.js\";\n\nexport class ExceptionlessClient {\n private _intervalId: ReturnType | undefined;\n private _timeoutId: ReturnType | undefined;\n protected _initialized = false;\n\n public constructor(public config: Configuration = new Configuration()) {}\n\n /** Resume background submission, resume any timers. */\n public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise {\n if (configurationOrApiKey && !this._initialized) {\n this._initialized = true;\n\n if (typeof configurationOrApiKey === \"string\") {\n this.config.apiKey = configurationOrApiKey;\n } else {\n configurationOrApiKey(this.config);\n }\n\n this.config.services.queue.onEventsPosted(() => Promise.resolve(this.updateSettingsTimer()));\n await SettingsManager.applySavedServerSettings(this.config);\n }\n\n if (!this.config.isValid) {\n this.config.services.log.warn(\"Exceptionless is not configured and will not process events.\");\n return;\n }\n\n this.updateSettingsTimer(!!configurationOrApiKey);\n await EventPluginManager.startup(new PluginContext(this));\n\n const { queue } = this.config.services;\n await queue.startup();\n if (this.config.usePersistedQueueStorage) {\n // TODO: Can we schedule this as part of startup?\n await queue.process();\n }\n\n if (this.config.sessionsEnabled) {\n await this.submitSessionStart();\n }\n }\n\n /** Submit events, pause any timers and go into low power mode. */\n public async suspend(): Promise {\n await EventPluginManager.suspend(new PluginContext(this));\n const { queue } = this.config.services;\n await queue.suspend();\n await queue.process();\n this.suspendSettingsTimer();\n }\n\n private suspendSettingsTimer(): void {\n clearTimeout(this._timeoutId);\n this._timeoutId = undefined;\n clearInterval(this._intervalId);\n this._intervalId = undefined;\n }\n\n public async processQueue(): Promise {\n await this.config.services.queue.process();\n }\n\n private updateSettingsTimer(startingUp: boolean = false) {\n this.suspendSettingsTimer();\n\n if (!this.config.isValid) {\n return;\n }\n\n const interval = this.config.updateSettingsWhenIdleInterval;\n if (interval > 0) {\n let initialDelay: number = interval;\n if (startingUp) {\n initialDelay = this.config.settingsVersion > 0 ? 15000 : 5000;\n }\n\n this.config.services.log.info(`Update settings every ${interval}ms (${initialDelay || 0}ms delay)`);\n // TODO: Look into better async scheduling..\n const updateSettings = () => void SettingsManager.updateSettings(this.config);\n if (initialDelay < interval) {\n this._timeoutId = setTimeout(updateSettings, initialDelay);\n allowProcessToExitWithoutWaitingForTimerOrInterval(this._timeoutId);\n }\n\n this._intervalId = setInterval(updateSettings, interval);\n allowProcessToExitWithoutWaitingForTimerOrInterval(this._intervalId);\n }\n }\n\n public createException(exception: Error): EventBuilder {\n const pluginContextData = new EventContext();\n pluginContextData.setException(exception);\n return this.createEvent(pluginContextData).setType(\"error\");\n }\n\n public submitException(exception: Error): Promise {\n return this.createException(exception).submit();\n }\n\n public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder {\n const builder = this.createException(exception);\n builder.context.markAsUnhandledError();\n builder.context.setSubmissionMethod(submissionMethod || \"\");\n\n return builder;\n }\n\n public submitUnhandledException(exception: Error, submissionMethod?: string): Promise {\n return this.createUnhandledException(exception, submissionMethod).submit();\n }\n\n public createFeatureUsage(feature: string): EventBuilder {\n return this.createEvent().setType(\"usage\").setSource(feature);\n }\n\n public submitFeatureUsage(feature: string): Promise {\n return this.createFeatureUsage(feature).submit();\n }\n\n public createLog(message: string): EventBuilder;\n public createLog(source: string, message: string): EventBuilder;\n public createLog(source: string | undefined, message: string, level: LogLevel): EventBuilder;\n public createLog(sourceOrMessage: string, message?: string, level?: LogLevel): EventBuilder {\n let builder = this.createEvent().setType(\"log\");\n\n if (level) {\n builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty(KnownEventDataKeys.Level, level);\n } else if (message) {\n builder = builder.setSource(sourceOrMessage).setMessage(message);\n } else {\n builder = builder.setMessage(sourceOrMessage);\n\n try {\n // TODO: Look into using https://www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/\n const caller = this.createLog.caller;\n builder = builder.setSource(caller && caller.caller && caller.caller.name);\n } catch (ex) {\n this.config.services.log.trace(`Unable to resolve log source: ${ex instanceof Error ? ex.message : ex + \"\"}`);\n }\n }\n\n return builder;\n }\n\n public submitLog(message: string): Promise;\n public submitLog(source: string, message: string): Promise;\n public submitLog(source: string | undefined, message: string, level: LogLevel): Promise;\n public submitLog(sourceOrMessage: string, message?: string, level?: LogLevel): Promise {\n return this.createLog(sourceOrMessage, message, level).submit();\n }\n\n public createNotFound(resource: string): EventBuilder {\n return this.createEvent().setType(\"404\").setSource(resource);\n }\n\n public submitNotFound(resource: string): Promise {\n return this.createNotFound(resource).submit();\n }\n\n public createSessionStart(): EventBuilder {\n return this.createEvent().setType(\"session\");\n }\n\n public submitSessionStart(): Promise {\n return this.createSessionStart().submit();\n }\n\n public async submitSessionEnd(sessionIdOrUserId?: string): Promise {\n const { currentSessionIdentifier, enabled, isValid, services } = this.config;\n const sessionId = sessionIdOrUserId || currentSessionIdentifier;\n if (sessionId && enabled && isValid) {\n services.log.info(`Submitting session end: ${sessionId}`);\n await services.submissionClient.submitHeartbeat(sessionId, true);\n }\n }\n\n public async submitSessionHeartbeat(sessionIdOrUserId?: string): Promise {\n const { currentSessionIdentifier, enabled, isValid, services } = this.config;\n const sessionId = sessionIdOrUserId || currentSessionIdentifier;\n if (sessionId && enabled && isValid) {\n services.log.info(`Submitting session heartbeat: ${sessionId}`);\n await services.submissionClient.submitHeartbeat(sessionId, false);\n }\n }\n\n public createEvent(context?: EventContext): EventBuilder {\n return new EventBuilder({ date: new Date() }, this, context);\n }\n\n /**\n * Submits the event to the server.\n *\n * @param event The event\n * @param context Contextual data used by event plugins to enrich the event details\n */\n public async submitEvent(event: Event, context?: EventContext): Promise {\n const pluginContext = new EventPluginContext(this, event, context ?? new EventContext());\n\n if (!event) {\n pluginContext.cancelled = true;\n return pluginContext;\n }\n\n if (!this.config.enabled || !this.config.isValid) {\n this.config.services.log.info(\"Event submission is currently disabled.\");\n pluginContext.cancelled = true;\n return pluginContext;\n }\n\n if (!event.data) {\n event.data = {};\n }\n\n if (!event.tags || !event.tags.length) {\n event.tags = [];\n }\n\n await EventPluginManager.run(pluginContext);\n if (pluginContext.cancelled) {\n return pluginContext;\n }\n\n const ev = pluginContext.event;\n\n // ensure all required data\n if (!ev.type || ev.type.length === 0) {\n ev.type = \"log\";\n }\n\n if (!ev.date) {\n ev.date = new Date();\n }\n\n await this.config.services.queue.enqueue(ev);\n\n if (ev.reference_id && ev.reference_id.length > 0) {\n pluginContext.log.info(`Setting last reference id \"${ev.reference_id}\"`);\n this.config.services.lastReferenceIdManager.setLast(ev.reference_id);\n }\n\n return pluginContext;\n }\n\n /**\n * Updates the user\"s email address and description of an event for the specified reference id.\n * @param referenceId The reference id of the event to update.\n * @param email The user\"s email address to set on the event.\n * @param description The user\"s description of the event.\n * @param callback The submission response.\n */\n public async updateUserEmailAndDescription(referenceId: string, email: string, description: string): Promise {\n if (!referenceId || !email || !description || !this.config.enabled || !this.config.isValid) {\n return;\n }\n\n const userDescription: UserDescription = { email_address: email, description };\n const response = await this.config.services.submissionClient.submitUserDescription(referenceId, userDescription);\n if (!response.success) {\n this.config.services.log.error(`Failed to submit user email and description for event \"${referenceId}\": ${response.status} ${response.message}`);\n }\n }\n\n /**\n * Gets the last event client id that was submitted to the server.\n * @returns {string} The event client id.\n */\n public getLastReferenceId(): string | null {\n return this.config.services.lastReferenceIdManager.getLast();\n }\n}\n", "import {\n ErrorInfo,\n EventPluginContext,\n IEventPlugin,\n IgnoredErrorProperties,\n KnownEventDataKeys,\n ParameterInfo,\n StackFrameInfo,\n stringify,\n isEmpty\n} from \"@exceptionless/core\";\n\nimport { fromError, StackFrame } from \"stacktrace-js\";\n\nexport class BrowserErrorPlugin implements IEventPlugin {\n public priority = 30;\n public name = \"BrowserErrorPlugin\";\n\n public async run(context: EventPluginContext): Promise {\n const exception = context.eventContext.getException();\n if (exception) {\n if (!context.event.type) {\n context.event.type = \"error\";\n }\n\n if (context.event.data && !context.event.data[KnownEventDataKeys.Error]) {\n const result = await this.parse(exception);\n if (result) {\n const exclusions = context.client.config.dataExclusions.concat(IgnoredErrorProperties);\n const additionalData = stringify(exception, exclusions);\n if (!isEmpty(additionalData)) {\n if (!result.data) {\n result.data = {};\n }\n\n result.data[\"@ext\"] = JSON.parse(additionalData);\n }\n\n context.event.data[KnownEventDataKeys.Error] = result;\n }\n }\n }\n }\n\n public async parse(exception: Error): Promise {\n function getParameters(parameters: string | string[]): ParameterInfo[] {\n const params: string[] = (typeof parameters === \"string\" ? [parameters] : parameters) || [];\n\n const items: ParameterInfo[] = [];\n for (const param of params) {\n items.push({ name: param });\n }\n\n return items;\n }\n\n function getStackFrames(stackFrames: StackFrame[]): StackFrameInfo[] {\n const ANONYMOUS: string = \"\";\n const frames: StackFrameInfo[] = [];\n\n for (const frame of stackFrames) {\n const fileName: string = frame.getFileName();\n frames.push({\n name: (frame.getFunctionName() || ANONYMOUS).replace(\"?\", ANONYMOUS),\n parameters: getParameters(frame.getArgs()),\n file_name: fileName,\n line_number: frame.getLineNumber() || 0,\n column: frame.getColumnNumber() || 0,\n data: {\n is_native: frame.getIsNative() || (fileName && fileName[0] !== \"/\" && fileName[0] !== \".\")\n }\n });\n }\n\n return frames;\n }\n\n const result: StackFrame[] = exception.stack ? await fromError(exception) : [];\n if (!result) {\n throw new Error(\"Unable to parse the exception stack trace\");\n }\n\n // TODO: Test with reference error.\n return Promise.resolve({\n type: exception.name || \"Error\",\n message: exception.message,\n stack_trace: getStackFrames(result || [])\n });\n }\n}\n", "import { ExceptionlessClient, IEventPlugin, PluginContext, toError } from \"@exceptionless/core\";\n\ndeclare let $: (document: Document) => {\n ajaxError: {\n (document: (event: Event, xhr: { responseText: string; status: number }, settings: { data: unknown; url: string }, error: string) => void): void;\n };\n};\n\nexport class BrowserGlobalHandlerPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = \"BrowserGlobalHandlerPlugin\";\n\n private _client: ExceptionlessClient | null = null;\n\n public startup(context: PluginContext): Promise {\n if (this._client || typeof window !== \"object\") {\n return Promise.resolve();\n }\n\n this._client = context.client;\n\n // TODO: Discus if we want to unwire this handler in suspend?\n window.addEventListener(\"error\", (event) => {\n void this._client?.submitUnhandledException(this.getError(event), \"onerror\");\n });\n\n window.addEventListener(\"unhandledrejection\", (event) => {\n let reason: unknown = event.reason;\n if (!(reason instanceof Error)) {\n try {\n // Check for reason in legacy CustomEvents (https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)\n const detailReason = (<{ detail?: { reason: string } }>event).detail?.reason;\n if (detailReason) {\n reason = detailReason;\n }\n } catch (ex) {\n /* empty */\n }\n }\n\n if (!(reason instanceof Error)) {\n try {\n const error = event.reason.error;\n if (error) {\n reason = error;\n }\n } catch (ex) {\n /* empty */\n }\n }\n\n const error: Error = toError(reason, \"Unhandled rejection\");\n void this._client?.submitUnhandledException(error, \"onunhandledrejection\");\n });\n\n if (typeof $ !== \"undefined\" && $(document)) {\n $(document).ajaxError((_: Event, xhr: { responseText: string; status: number }, settings: { data: unknown; url: string }, error: string) => {\n if (xhr.status === 404) {\n // TODO: Handle async\n void this._client?.submitNotFound(settings.url);\n } else if (xhr.status !== 401) {\n // TODO: Handle async\n void this._client\n ?.createUnhandledException(toError(error), \"JQuery.ajaxError\")\n .setSource(settings.url)\n .setProperty(\"status\", xhr.status)\n .setProperty(\"request\", settings.data)\n .setProperty(\"response\", xhr.responseText?.slice(0, 1024))\n .submit();\n }\n });\n }\n\n return Promise.resolve();\n }\n\n private getError(event: ErrorEvent): Error {\n const { error, message, filename, lineno, colno } = event;\n if (typeof error === \"object\") {\n return error as Error;\n }\n\n let name: string = \"Error\";\n let msg: string = message || event.error;\n if (msg) {\n const errorNameRegex: RegExp = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Aggregate|Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n const regexResult = errorNameRegex.exec(msg);\n if (regexResult) {\n const [, errorName, errorMessage] = regexResult;\n if (errorName) {\n name = errorName;\n }\n if (errorMessage) {\n msg = errorMessage;\n }\n }\n }\n\n const ex = new Error(msg || \"Script error.\");\n ex.name = name;\n ex.stack = `at ${filename || \"\"}:${!isNaN(lineno) ? lineno : 0}${!isNaN(colno) ? `:${colno}` : \"\"}`;\n return ex;\n }\n}\n", "import { EventPluginContext, IEventPlugin } from \"@exceptionless/core\";\n\nexport class BrowserIgnoreExtensionErrorsPlugin implements IEventPlugin {\n public priority = 15;\n public name = \"BrowserIgnoreExtensionErrorsPlugin\";\n\n public async run(context: EventPluginContext): Promise {\n const exception = context.eventContext.getException();\n if (exception?.stack && exception.stack.includes(\"-extension://\")) {\n // Handles all extensions like chrome-extension://, moz-extension://, ms-browser-extension://, safari-extension://\n context.log.info(\"Ignoring event with error stack containing browser extension\");\n context.cancelled = true;\n }\n\n return Promise.resolve();\n }\n}\n", "import { ExceptionlessClient, IEventPlugin, PluginContext } from \"@exceptionless/core\";\n\nexport class BrowserLifeCyclePlugin implements IEventPlugin {\n public priority: number = 105;\n public name: string = \"BrowserLifeCyclePlugin\";\n\n private _client: ExceptionlessClient | null = null;\n\n public startup(context: PluginContext): Promise {\n if (this._client || typeof document !== \"object\") {\n return Promise.resolve();\n }\n\n this._client = context.client;\n\n globalThis.addEventListener(\"beforeunload\", () => {\n if (this._client?.config.sessionsEnabled) {\n void this._client?.submitSessionEnd();\n }\n\n void this._client?.suspend();\n });\n\n document.addEventListener(\"visibilitychange\", () => {\n if (document.visibilityState === \"visible\") {\n void this._client?.startup();\n } else {\n void this._client?.suspend();\n }\n });\n\n return Promise.resolve();\n }\n}\n", "import { EventPluginContext, getHashCode, IEventPlugin, KnownEventDataKeys, ModuleInfo, parseVersion } from \"@exceptionless/core\";\n\nexport class BrowserModuleInfoPlugin implements IEventPlugin {\n public priority: number = 50;\n public name: string = \"BrowserModuleInfoPlugin\";\n private _modules: ModuleInfo[] | undefined;\n\n public startup(): Promise {\n if (!this._modules) {\n this._modules = this.getModules();\n }\n\n return Promise.resolve();\n }\n\n public run(context: EventPluginContext): Promise {\n const error = context.event.data?.[KnownEventDataKeys.Error];\n if (error && !error?.modules && this._modules?.length) {\n error.modules = this._modules;\n }\n\n return Promise.resolve();\n }\n\n private getModules(): ModuleInfo[] | undefined {\n if (typeof document !== \"object\" || !document.getElementsByTagName) {\n return;\n }\n\n const modules: ModuleInfo[] = [];\n const scripts: HTMLCollectionOf = document.getElementsByTagName(\"script\");\n if (scripts && scripts.length > 0) {\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src) {\n modules.push({\n module_id: index,\n name: scripts[index].src.split(\"?\")[0],\n version: parseVersion(scripts[index].src)\n });\n } else if (scripts[index].innerHTML) {\n modules.push({\n module_id: index,\n name: \"Script Tag\",\n version: getHashCode(scripts[index].innerHTML).toString()\n });\n }\n }\n }\n\n return modules;\n }\n}\n", "import { EventPluginContext, getCookies, IEventPlugin, isMatch, KnownEventDataKeys, parseQueryString, RequestInfo } from \"@exceptionless/core\";\n\nexport class BrowserRequestInfoPlugin implements IEventPlugin {\n public priority: number = 70;\n public name: string = \"BrowserRequestInfoPlugin\";\n\n public run(context: EventPluginContext): Promise {\n if (context.event.data && !context.event.data[KnownEventDataKeys.RequestInfo]) {\n const requestInfo: RequestInfo | undefined = this.getRequestInfo(context);\n if (requestInfo) {\n if (isMatch(requestInfo.user_agent, context.client.config.userAgentBotPatterns)) {\n context.log.info(\"Cancelling event as the request user agent matches a known bot pattern\");\n context.cancelled = true;\n } else {\n context.event.data[KnownEventDataKeys.RequestInfo] = requestInfo;\n }\n }\n }\n\n return Promise.resolve();\n }\n\n private getRequestInfo(context: EventPluginContext): RequestInfo | undefined {\n if (typeof document !== \"object\" || typeof navigator !== \"object\" || typeof location !== \"object\") {\n return;\n }\n\n const config = context.client.config;\n const exclusions = config.dataExclusions;\n const requestInfo: RequestInfo = {\n user_agent: navigator.userAgent,\n is_secure: location.protocol === \"https:\",\n host: location.hostname,\n port: location.port && location.port !== \"\" ? parseInt(location.port, 10) : 80,\n path: location.pathname\n };\n\n if (config.includeCookies) {\n requestInfo.cookies = getCookies(document.cookie, exclusions) as Record;\n }\n\n if (config.includeQueryString) {\n requestInfo.query_string = parseQueryString(location.search.substring(1), exclusions);\n }\n\n if (document.referrer && document.referrer !== \"\") {\n requestInfo.referrer = document.referrer;\n }\n\n return requestInfo;\n }\n}\n", "import { Configuration, ExceptionlessClient, SimpleErrorPlugin } from \"@exceptionless/core\";\n\nimport { BrowserErrorPlugin } from \"./plugins/BrowserErrorPlugin.js\";\nimport { BrowserGlobalHandlerPlugin } from \"./plugins/BrowserGlobalHandlerPlugin.js\";\nimport { BrowserIgnoreExtensionErrorsPlugin } from \"./plugins/BrowserIgnoreExtensionErrorsPlugin.js\";\nimport { BrowserLifeCyclePlugin } from \"./plugins/BrowserLifeCyclePlugin.js\";\nimport { BrowserModuleInfoPlugin } from \"./plugins/BrowserModuleInfoPlugin.js\";\nimport { BrowserRequestInfoPlugin } from \"./plugins/BrowserRequestInfoPlugin.js\";\n\nexport class BrowserExceptionlessClient extends ExceptionlessClient {\n public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise {\n const config = this.config;\n if (configurationOrApiKey && !this._initialized) {\n config.useLocalStorage();\n\n config.addPlugin(new BrowserGlobalHandlerPlugin());\n config.addPlugin(new BrowserIgnoreExtensionErrorsPlugin());\n config.addPlugin(new BrowserLifeCyclePlugin());\n config.addPlugin(new BrowserModuleInfoPlugin());\n config.addPlugin(new BrowserRequestInfoPlugin());\n config.addPlugin(new BrowserErrorPlugin());\n config.removePlugin(new SimpleErrorPlugin());\n }\n\n await super.startup(configurationOrApiKey);\n }\n}\n", "export * from \"@exceptionless/core\";\n\nexport { BrowserErrorPlugin } from \"./plugins/BrowserErrorPlugin.js\";\nexport { BrowserGlobalHandlerPlugin } from \"./plugins/BrowserGlobalHandlerPlugin.js\";\nexport { BrowserIgnoreExtensionErrorsPlugin } from \"./plugins/BrowserIgnoreExtensionErrorsPlugin.js\";\nexport { BrowserLifeCyclePlugin } from \"./plugins/BrowserLifeCyclePlugin.js\";\nexport { BrowserModuleInfoPlugin } from \"./plugins/BrowserModuleInfoPlugin.js\";\nexport { BrowserRequestInfoPlugin } from \"./plugins/BrowserRequestInfoPlugin.js\";\nexport { BrowserExceptionlessClient } from \"./BrowserExceptionlessClient.js\";\n\nimport { BrowserExceptionlessClient } from \"./BrowserExceptionlessClient.js\";\nexport const Exceptionless = new BrowserExceptionlessClient();\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,KAAC,SAAS,MAAM,SAAS;AACrB;AAIA,UAAI,OAAO,WAAW,cAAc,OAAO,KAAK;AAC5C,eAAO,cAAc,CAAC,GAAG,OAAO;AAAA,MACpC,WAAW,OAAO,YAAY,UAAU;AACpC,eAAO,UAAU,QAAQ;AAAA,MAC7B,OAAO;AACH,aAAK,aAAa,QAAQ;AAAA,MAC9B;AAAA,IACJ,GAAE,SAAM,WAAW;AACf;AACA,eAAS,UAAU,GAAG;AAClB,eAAO,CAAC,MAAM,WAAW,CAAC,CAAC,KAAK,SAAS,CAAC;AAAA,MAC9C;AAEA,eAAS,YAAY,KAAK;AACtB,eAAO,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,UAAU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AC1CO,IAAM,6BAAN,cAAyC,oBAAoB;AAAA,EAClE,MAAa,QAAQ,uBAAiF;AACpG,UAAM,SAAS,KAAK;AACpB,QAAI,yBAAyB,CAAC,KAAK,cAAc;AAC/C,aAAO,gBAAgB;AAEvB,aAAO,UAAU,IAAI,2BAA2B,CAAC;AACjD,aAAO,UAAU,IAAI,mCAAmC,CAAC;AACzD,aAAO,UAAU,IAAI,uBAAuB,CAAC;AAC7C,aAAO,UAAU,IAAI,wBAAwB,CAAC;AAC9C,aAAO,UAAU,IAAI,yBAAyB,CAAC;AAC/C,aAAO,UAAU,IAAI,mBAAmB,CAAC;AACzC,aAAO,aAAa,IAAI,kBAAkB,CAAC;AAAA,IAC7C;AAEA,UAAM,MAAM,QAAQ,qBAAqB;AAAA,EAC3C;AACF;;;ACfO,IAAM,gBAAgB,IAAI,2BAA2B;", "names": ["StackFrame", "i", "StackFrame", "location", "StackFrame", "needle", "section", "StackFrame", "location", "resolve", "resolve", "KnownEventDataKeys", "value", "depth", "error", "error", "KnownContextKeys", "error"] }