@xylabs/log 2.11.23 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/Log.cjs +1 -1
- package/dist/node/Log.cjs +105 -0
- package/dist/node/Log.cjs.map +1 -0
- package/dist/node/Log.js +8 -8313
- package/dist/node/Log.js.map +1 -1
- package/dist/node/index.cjs +107 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.js +8 -8315
- package/dist/node/index.js.map +1 -1
- package/package.json +7 -9
- package/dist/node/Log.mjs +0 -8375
- package/dist/node/Log.mjs.map +0 -1
- package/dist/node/index.mjs +0 -8375
- package/dist/node/index.mjs.map +0 -1
- package/dist/node/package-M4LPGYNL.json +0 -158
package/dist/node/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/rollbar/src/merge.js","../../../../node_modules/rollbar/src/utility.js","../../../../node_modules/rollbar/src/rateLimiter.js","../../../../node_modules/rollbar/src/queue.js","../../../../node_modules/rollbar/src/notifier.js","../../../../node_modules/rollbar/src/rollbar.js","../../../../node_modules/rollbar/src/apiUtility.js","../../../../node_modules/rollbar/src/api.js","../../../../node_modules/rollbar/src/server/logger.js","../../../../node_modules/rollbar/src/utility/traverse.js","../../../../node_modules/rollbar/src/truncation.js","../../../../node_modules/json-stringify-safe/stringify.js","../../../../node_modules/rollbar/src/server/transport.js","../../../../node_modules/rollbar/src/telemetry.js","../../../../node_modules/rollbar/src/server/telemetry/urlHelpers.js","../../../../node_modules/rollbar/src/server/telemetry.js","../../../../node_modules/async/dist/async.mjs","../../../../node_modules/rollbar/node_modules/lru-cache/lib/lru-cache.js","../../../../node_modules/rollbar/node_modules/source-map/lib/base64.js","../../../../node_modules/rollbar/node_modules/source-map/lib/base64-vlq.js","../../../../node_modules/rollbar/node_modules/source-map/lib/util.js","../../../../node_modules/rollbar/node_modules/source-map/lib/array-set.js","../../../../node_modules/rollbar/node_modules/source-map/lib/mapping-list.js","../../../../node_modules/rollbar/node_modules/source-map/lib/source-map-generator.js","../../../../node_modules/rollbar/node_modules/source-map/lib/binary-search.js","../../../../node_modules/rollbar/node_modules/source-map/lib/quick-sort.js","../../../../node_modules/rollbar/node_modules/source-map/lib/source-map-consumer.js","../../../../node_modules/rollbar/node_modules/source-map/lib/source-node.js","../../../../node_modules/rollbar/node_modules/source-map/source-map.js","../../../../node_modules/rollbar/src/server/sourceMap/stackTrace.js","../../../../node_modules/rollbar/src/server/parser.js","../../../../node_modules/request-ip/lib/is.js","../../../../node_modules/request-ip/lib/index.js","../../../../node_modules/rollbar/src/scrub.js","../../../../node_modules/rollbar/src/server/transforms.js","../../../../node_modules/rollbar/src/transforms.js","../../../../node_modules/rollbar/src/predicates.js","../../../../node_modules/rollbar/vendor/JSON-js/json3.js","../../../../node_modules/rollbar/src/server/rollbar.js","../../src/Log.ts"],"sourcesContent":["'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nfunction setupJSON(polyfillJSON) {\n if (isFunction(RollbarJSON.stringify) && isFunction(RollbarJSON.parse)) {\n return;\n }\n\n if (isDefined(JSON)) {\n // If polyfill is provided, prefer it over existing non-native shims.\n if(polyfillJSON) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n } else { // else accept any interface that is present.\n if (isFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n polyfillJSON && polyfillJSON(RollbarJSON);\n }\n}\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/**\n * isFiniteNumber - determines whether the passed value is a finite number\n *\n * @param {*} n - any value\n * @returns true if value is a finite number\n */\n function isFiniteNumber(n) {\n return Number.isFinite(n);\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\n/* isPromise - a convenience function for checking if a value is a promise\n *\n * @param p - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isPromise(p) {\n return isObject(p) && isType(p.then, 'function');\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction maxByteSize(string) {\n // The transport will use utf-8, so assume utf-8 encoding.\n //\n // This minimal implementation will accurately count bytes for all UCS-2 and\n // single code point UTF-16. If presented with multi code point UTF-16,\n // which should be rare, it will safely overcount, not undercount.\n //\n // While robust utf-8 encoders exist, this is far smaller and far more performant.\n // For quickly counting payload size for truncation, smaller is better.\n\n var count = 0;\n var length = string.length;\n\n for (var i = 0; i < length; i++) {\n var code = string.charCodeAt(i);\n if (code < 128) { // up to 7 bits\n count = count + 1;\n } else if (code < 2048) { // up to 11 bits\n count = count + 2;\n } else if (code < 65536) { // up to 16 bits\n count = count + 3;\n }\n }\n\n return count;\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = typeof document !== 'undefined' && document && document.location && document.location.href;\n var useragent = typeof window !== 'undefined' && window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction nonCircularClone(obj) {\n var seen = [obj];\n\n function clone(obj, seen) {\n var value, name, newSeen, result = {};\n\n try {\n for (name in obj) {\n value = obj[name];\n\n if (value && (isType(value, 'object') || isType(value, 'array'))) {\n if (seen.includes(value)) {\n result[name] = 'Removed circular reference: ' + typeName(value);\n } else {\n newSeen = seen.slice();\n newSeen.push(value);\n result[name] = clone(value, newSeen);\n }\n continue;\n }\n\n result[name] = value;\n }\n } catch (e) {\n result = 'Failed cloning custom data: ' + e.message;\n }\n return result;\n }\n return clone(obj, seen);\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n var diagnostic = {};\n var argTypes = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n argTypes.push(typ);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n // if custom is an array this turns it into an object with integer keys\n if (custom) custom = nonCircularClone(custom);\n\n if (extraArgs.length > 0) {\n if (!custom) custom = nonCircularClone({});\n custom.extraArgs = nonCircularClone(extraArgs);\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n notifier: notifier,\n diagnostic: diagnostic,\n uuid: uuid4()\n };\n\n setCustomItemKeys(item, custom);\n\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n item.diagnostic.original_arg_types = argTypes;\n return item;\n}\n\nfunction setCustomItemKeys(item, custom) {\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (custom && custom.skipFrames !== undefined) {\n item.skipFrames = custom.skipFrames;\n delete custom.skipFrames;\n }\n}\n\nfunction addErrorContext(item, errors) {\n var custom = item.data.custom || {};\n var contextAdded = false;\n\n try {\n for (var i = 0; i < errors.length; ++i) {\n if (errors[i].hasOwnProperty('rollbarContext')) {\n custom = merge(custom, nonCircularClone(errors[i].rollbarContext));\n contextAdded = true;\n }\n }\n\n // Avoid adding an empty object to the data.\n if (contextAdded) {\n item.data.custom = custom;\n }\n } catch (e) {\n item.diagnostic.error_context = 'Failed: ' + e.message;\n }\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (!type && arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (!level && arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload, logger) {\n var result = merge(current, input, payload);\n result = updateDeprecatedOptions(result, logger);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nfunction updateDeprecatedOptions(options, logger) {\n if(options.hostWhiteList && !options.hostSafeList) {\n options.hostSafeList = options.hostWhiteList;\n options.hostWhiteList = undefined;\n logger && logger.log('hostWhiteList is deprecated. Use hostSafeList.');\n }\n if(options.hostBlackList && !options.hostBlockList) {\n options.hostBlockList = options.hostBlackList;\n options.hostBlackList = undefined;\n logger && logger.log('hostBlackList is deprecated. Use hostBlockList.');\n }\n return options;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n addErrorContext: addErrorContext,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFiniteNumber: isFiniteNumber,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isObject: isObject,\n isString: isString,\n isType: isType,\n isPromise: isPromise,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n RollbarJSON: RollbarJSON,\n sanitizeUrl: sanitizeUrl,\n set: set,\n setupJSON: setupJSON,\n stringify: stringify,\n maxByteSize: maxByteSize,\n typeName: typeName,\n uuid4: uuid4\n};\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n if (shouldRetry && _.isFiniteNumber(this.options.maxRetries)) {\n item.retries = item.retries ? item.retries + 1 : 1;\n if (item.retries > this.options.maxRetries) {\n shouldRetry = false;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n this.diagnostic = {};\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, telemeter, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n\n // This must happen before the Notifier is created\n var tracer = this.options.tracer || null;\n if (validateTracer(tracer)) {\n this.tracer = tracer;\n // set to a string for api response serialization\n this.options.tracer = 'opentracing-tracer-enabled';\n this.options._configuredOptions.tracer = 'opentracing-tracer-enabled';\n } else {\n this.tracer = null;\n }\n\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = telemeter;\n setStackTraceLimit(options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function (options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function (options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = { payload: payloadData };\n }\n\n this.options = _.merge(oldOptions, options, payload);\n\n // This must happen before the Notifier is configured\n var tracer = this.options.tracer || null;\n if (validateTracer(tracer)) {\n this.tracer = tracer;\n // set to a string for api response serialization\n this.options.tracer = 'opentracing-tracer-enabled';\n this.options._configuredOptions.tracer = 'opentracing-tracer-enabled';\n } else {\n this.tracer = null;\n }\n\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n setStackTraceLimit(options);\n this.global(this.options);\n\n if (validateTracer(options.tracer)) {\n this.tracer = options.tracer\n }\n\n return this;\n};\n\nRollbar.prototype.log = function (item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function (item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function (item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function (item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function (item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function (item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function (item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function (callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function (type, metadata, level) {\n return this.telemeter && this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function (ts) {\n return this.telemeter && this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function (ts) {\n return this.telemeter && this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function (item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function (jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function (defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n this._addTracingInfo(item);\n item.level = item.level || defaultLevel;\n this.telemeter && this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = (this.telemeter && this.telemeter.copyEvents()) || [];\n this.notifier.log(item, callback);\n } catch (e) {\n if (callback) {\n callback(e);\n }\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function () {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function (item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nRollbar.prototype._addTracingInfo = function (item) {\n // Tracer validation occurs in the constructor\n // or in the Rollbar.prototype.configure methods\n if (this.tracer) {\n // add rollbar occurrence uuid to span\n var span = this.tracer.scope().active();\n\n if (validateSpan(span)) {\n span.setTag('rollbar.error_uuid', item.uuid);\n span.setTag('rollbar.has_error', true);\n span.setTag('error', true);\n span.setTag('rollbar.item_url', `https://rollbar.com/item/uuid/?uuid=${item.uuid}`);\n span.setTag('rollbar.occurrence_url', `https://rollbar.com/occurrence/uuid/?uuid=${item.uuid}`);\n\n // add span ID & trace ID to occurrence\n var opentracingSpanId = span.context().toSpanId();\n var opentracingTraceId = span.context().toTraceId();\n\n if (item.custom) {\n item.custom.opentracing_span_id = opentracingSpanId;\n item.custom.opentracing_trace_id = opentracingTraceId;\n } else {\n item.custom = {\n opentracing_span_id: opentracingSpanId,\n opentracing_trace_id: opentracingTraceId\n };\n }\n }\n }\n}\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\n// Node.js, Chrome, Safari, and some other browsers support this property\n// which globally sets the number of stack frames returned in an Error object.\n// If a browser can't use it, no harm done.\nfunction setStackTraceLimit(options) {\n if (options.stackTraceLimit) {\n Error.stackTraceLimit = options.stackTraceLimit;\n }\n}\n\n/**\n * Validate the Tracer object provided to the Client\n * is valid for our Opentracing use case.\n * @param {opentracer.Tracer} tracer\n */\nfunction validateTracer(tracer) {\n if (!tracer) {\n return false;\n }\n\n if (!tracer.scope || typeof tracer.scope !== 'function') {\n return false;\n }\n\n var scope = tracer.scope();\n\n if (!scope || !scope.active || typeof scope.active !== 'function') {\n return false;\n }\n\n return true;\n}\n\n/**\n * Validate the Span object provided\n * @param {opentracer.Span} span\n */\nfunction validateSpan(span) {\n if (!span || !span.context || typeof span.context !== 'function') {\n return false;\n }\n\n var spanContext = span.context();\n\n if (!spanContext\n || !spanContext.toSpanId\n || !spanContext.toTraceId\n || typeof spanContext.toSpanId !== 'function'\n || typeof spanContext.toTraceId !== 'function') {\n return false\n }\n\n return true;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n var timeout = options.timeout;\n var transport = detectTransport(options)\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n timeout: timeout,\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy,\n transport: transport\n };\n}\n\nfunction detectTransport(options) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var transport = options.defaultTransport || 'xhr';\n if (typeof gWindow.fetch === 'undefined') transport = 'xhr';\n if (typeof gWindow.XMLHttpRequest === 'undefined') transport = 'fetch';\n return transport;\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n var timeout = transport.timeout;\n var transportAPI = transport.transport;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n timeout: timeout,\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method,\n transport: transportAPI\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, transport, urllib, truncation, jsonBackup) {\n this.options = options;\n this.transport = transport;\n this.url = urllib;\n this.truncation = truncation;\n this.jsonBackup = jsonBackup;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, urllib);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n var self = this;\n\n // ensure the network request is scheduled after the current tick.\n setTimeout(function() {\n self.transport.post(self.accessToken, transportOptions, payload, callback);\n }, 0);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult;\n if (this.truncation) {\n stringifyResult = this.truncation.truncate(payload);\n } else {\n stringifyResult = _.stringify(payload)\n }\n\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","'use strict';\n\nvar verbose = true;\n\nvar logger = {\n /* eslint-disable no-console */\n log: function() {\n if (verbose) {\n console.log.apply(console, arguments);\n }\n },\n error: function() {\n if (verbose) {\n console.error.apply(console, arguments);\n }\n },\n /* eslint-enable no-console */\n setVerbose: function(val) {\n verbose = val;\n }\n};\n\nmodule.exports = logger;\n","var _ = require('../utility');\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = _.isType(obj, 'object');\n var isArray = _.isType(obj, 'array');\n var keys = [];\n var seenIndex;\n\n // Best might be to use Map here with `obj` as the keys, but we want to support IE < 11.\n seen = seen || { obj: [], mapped: []};\n\n if (isObj) {\n seenIndex = seen.obj.indexOf(obj);\n\n if (isObj && seenIndex !== -1) {\n // Prefer the mapped object if there is one.\n return seen.mapped[seenIndex] || seen.obj[seenIndex];\n }\n\n seen.obj.push(obj);\n seenIndex = seen.obj.length - 1;\n }\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n if (isObj && !same) {\n seen.mapped[seenIndex] = result;\n }\n\n return !same ? result : obj;\n}\n\nmodule.exports = traverse;\n","var _ = require('./utility');\nvar traverse = require('./utility/traverse');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = traverse(payload, truncator);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return _.maxByteSize(payload) > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","var _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\nvar http = require('http');\nvar https = require('https');\nvar jsonBackup = require('json-stringify-safe');\n\nvar MAX_RATE_LIMIT_INTERVAL = 60;\n\n/*\n * accessToken may be embedded in payload but that should not be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs to be\n * appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\nfunction Transport() {\n this.rateLimitExpires = 0;\n}\n\nTransport.prototype.get = function(accessToken, options, params, callback, transportFactory) {\n var t;\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n options = options || {};\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n options.headers = _headers(accessToken, options);\n if (transportFactory) {\n t = transportFactory(options);\n } else {\n t = _transport(options);\n }\n if (!t) {\n logger.error('Unknown transport based on given protocol: ' + options.protocol);\n return callback(new Error('Unknown transport'));\n }\n var req = t.request(options, function(resp) {\n this.handleResponse(resp, callback);\n }.bind(this));\n req.on('error', function(err) {\n callback(err);\n });\n req.end();\n}\n\nTransport.prototype.post = function(accessToken, options, payload, callback, transportFactory) {\n var t;\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n if (_currentTime() < this.rateLimitExpires) {\n return callback(new Error('Exceeded rate limit'));\n }\n options = options || {};\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n var stringifyResult = truncation.truncate(payload, jsonBackup);\n if (stringifyResult.error) {\n logger.error('Problem stringifying payload. Giving up');\n return callback(stringifyResult.error);\n }\n var writeData = stringifyResult.value;\n options.headers = _headers(accessToken, options, writeData);\n if (transportFactory) {\n t = transportFactory(options);\n } else {\n t = _transport(options);\n }\n if (!t) {\n logger.error('Unknown transport based on given protocol: ' + options.protocol);\n return callback(new Error('Unknown transport'));\n }\n var req = t.request(options, function(resp) {\n this.handleResponse(resp, _wrapPostCallback(callback));\n }.bind(this));\n req.on('error', function(err) {\n callback(err);\n });\n if (writeData) {\n req.write(writeData);\n }\n req.end();\n}\n\nTransport.prototype.updateRateLimit = function(resp) {\n var remaining = parseInt(resp.headers['x-rate-limit-remaining'] || 0);\n var remainingSeconds = Math.min(MAX_RATE_LIMIT_INTERVAL, resp.headers['x-rate-limit-remaining-seconds'] || 0);\n var currentTime = _currentTime();\n\n if ((resp.statusCode === 429) && (remaining === 0)) {\n this.rateLimitExpires = currentTime + remainingSeconds;\n } else {\n this.rateLimitExpires = currentTime;\n }\n}\n\nTransport.prototype.handleResponse = function(resp, callback) {\n this.updateRateLimit(resp);\n\n var respData = [];\n resp.setEncoding('utf8');\n resp.on('data', function(chunk) {\n respData.push(chunk);\n });\n\n resp.on('end', function() {\n respData = respData.join('');\n _parseApiResponse(respData, callback);\n });\n}\n\n/** Helpers **/\n\nfunction _headers(accessToken, options, data) {\n var headers = (options && options.headers) || {};\n headers['Content-Type'] = 'application/json';\n if (data) {\n try {\n headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n } catch (e) {\n logger.error('Could not get the content length of the data');\n }\n }\n headers['X-Rollbar-Access-Token'] = accessToken;\n return headers;\n}\n\nfunction _transport(options) {\n return {'http:': http, 'https:': https}[options.protocol];\n}\n\nfunction _parseApiResponse(data, callback) {\n var parsedData = _.jsonParse(data);\n if (parsedData.error) {\n logger.error('Could not parse api response, err: ' + parsedData.error);\n return callback(parsedData.error);\n }\n data = parsedData.value;\n\n if (data.err) {\n logger.error('Received error: ' + data.message);\n return callback(new Error('Api error: ' + (data.message || 'Unknown error')));\n }\n\n callback(null, data);\n}\n\nfunction _wrapPostCallback(callback) {\n return function(err, data) {\n if (err) {\n return callback(err);\n }\n if (data.result && data.result.uuid) {\n logger.log([\n 'Successful api response.',\n ' Link: https://rollbar.com/occurrence/uuid/?uuid=' + data.result.uuid\n ].join(''));\n } else {\n logger.log('Successful api response');\n }\n callback(null, data.result);\n }\n}\n\nfunction _currentTime() {\n return Math.floor(Date.now() / 1000);\n}\n\nmodule.exports = Transport;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.queue.length > newMaxEvents) {\n deleteCount = this.queue.length - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var url = require('url');\nvar { URL } = require('url');\nvar merge = require('../../merge');\n\n// This function replicates the relevant logic in node/lib/http.js as closely\n// as possible in order to produce the same result. Therefore, the code is\n// replicated as is, favoring the closest match to the original code without style changes.\n//\n// The code here is only used to build telemetry metadata and is not used to\n// build actual http requests.\nfunction mergeOptions(input, options, cb) {\n if (typeof input === 'string') {\n const urlStr = input;\n input = urlToHttpOptions(new URL(urlStr));\n } else if (input && input[url.searchParamsSymbol] &&\n input[url.searchParamsSymbol][url.searchParamsSymbol]) {\n // url.URL instance\n input = urlToHttpOptions(input);\n } else {\n cb = options;\n options = input;\n input = null;\n }\n\n if (typeof options === 'function') {\n cb = options;\n options = input || {};\n } else {\n options = merge(input || {}, options);\n }\n return {options: options, cb: cb};\n}\n\n// This function replicates the relevant logic in node/lib/url.js as closely\n// as possible in order to produce the same result. Therefore, the code is\n// replicated as is, favoring the closest match to the original code without style changes.\n//\n// The code here is only used to build telemetry metadata and is not used to\n// build actual http requests.\nfunction urlToHttpOptions(url) {\n const options = {\n protocol: url.protocol,\n hostname: typeof url.hostname === 'string' &&\n url.hostname.startsWith('[') ?\n url.hostname.slice(1, -1) :\n url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname || ''}${url.search || ''}`,\n href: url.href\n };\n if (url.port !== '') {\n options.port = Number(url.port);\n }\n if (url.username || url.password) {\n options.auth = `${url.username}:${url.password}`;\n }\n return options;\n}\n\nfunction constructUrl(options) {\n var url = options.protocol || 'http:';\n url += '//';\n if (options.auth) {\n url += `${options.auth}@`;\n }\n url += options.hostname || options.host || 'localhost';\n if (options.port) {\n url += `:${options.port}`\n }\n url += options.path || '/';\n\n return url;\n}\n\nmodule.exports = {\n mergeOptions,\n constructUrl\n};\n","var http = require('http');\nvar https = require('https');\nvar _ = require('../utility');\nvar urlHelpers = require('./telemetry/urlHelpers');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkRequestHeaders: false,\n log: true\n};\n\nfunction Instrumenter(options, telemeter, rollbar) {\n this.options = options;\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this.diagnostic = rollbar.client.notifier.diagnostic;\n this.replacements = {\n network: [],\n log: []\n };\n}\n\nInstrumenter.prototype.configure = function(options) {\n this.options = _.merge(this.options, options);\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n replace(http, 'request', networkRequestWrapper.bind(this), this.replacements, 'network');\n replace(https, 'request', networkRequestWrapper.bind(this), this.replacements, 'network');\n};\n\nfunction networkRequestWrapper(orig) {\n var telemeter = this.telemeter;\n var self = this;\n\n return function(url, options, cb) {\n var mergedOptions = urlHelpers.mergeOptions(url, options, cb);\n\n var metadata = {\n method: mergedOptions.options.method || 'GET',\n url: urlHelpers.constructUrl(mergedOptions.options),\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n\n if (self.autoInstrument.networkRequestHeaders) {\n metadata.request_headers = mergedOptions.options.headers;\n }\n telemeter.captureNetwork(metadata, 'http');\n\n // Call the original method with the original arguments and wrapped callback.\n var wrappedArgs = Array.from(arguments);\n var wrappedCallback = responseCallbackWrapper(self.autoInstrument, metadata, mergedOptions.cb);\n if (mergedOptions.cb) {\n wrappedArgs.pop();\n }\n wrappedArgs.push(wrappedCallback);\n var req = orig.apply(https, wrappedArgs);\n\n req.on('error', err => {\n metadata.status_code = 0;\n metadata.error = [err.name, err.message].join(': ') ;\n });\n\n return req;\n }\n}\n\nfunction responseCallbackWrapper(options, metadata, callback) {\n return function (res) {\n metadata.end_time_ms = _.now();\n metadata.status_code = res.statusCode;\n metadata.response = {};\n if (options.networkResponseHeaders) {\n metadata.response.headers = res.headers;\n }\n\n if (callback) {\n return callback.apply(undefined, arguments);\n }\n }\n}\n\nInstrumenter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID) {\n return this.telemeter.captureNetwork(metadata, subtype, rollbarUUID);\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n restore(this.replacements, 'log');\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n var telemeter = this.telemeter;\n\n var stdout = process.stdout;\n replace(stdout, 'write', function(orig) {\n return function(string) {\n telemeter.captureLog(string, 'info');\n return orig.apply(stdout, arguments);\n }\n }, this.replacements, 'log');\n\n var stderr = process.stderr;\n replace(stderr, 'write', function(orig) {\n return function(string) {\n telemeter.captureLog(string, 'error');\n return orig.apply(stderr, arguments);\n }\n }, this.replacements, 'log');\n};\n\n// TODO: These helpers are duplicated in src/browser/telemetry.js,\n// and may be candidates for extraction into a shared module.\n// It is recommended that before doing so, the author should allow\n// for more telemetry types to be implemented for the Node target\n// to ensure that the implementations of these helpers don't diverge.\n// If they do diverge, there's little point in the shared module.\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nmodule.exports = Instrumenter;\n","/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} fn - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @returns {Function} the partially-applied function\n * @example\n *\n * // using apply\n * async.parallel([\n * async.apply(fs.writeFile, 'testfile1', 'test1'),\n * async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n * function(callback) {\n * fs.writeFile('testfile1', 'test1', callback);\n * },\n * function(callback) {\n * fs.writeFile('testfile2', 'test2', callback);\n * }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nfunction apply(fn, ...args) {\n return (...callArgs) => fn(...args,...callArgs);\n}\n\nfunction initialParams (fn) {\n return function (...args/*, callback*/) {\n var callback = args.pop();\n return fn.call(this, args, callback);\n };\n}\n\n/* istanbul ignore file */\n\nvar hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask;\nvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n return (fn, ...args) => defer(() => fn(...args));\n}\n\nvar _defer;\n\nif (hasQueueMicrotask) {\n _defer = queueMicrotask;\n} else if (hasSetImmediate) {\n _defer = setImmediate;\n} else if (hasNextTick) {\n _defer = process.nextTick;\n} else {\n _defer = fallback;\n}\n\nvar setImmediate$1 = wrap(_defer);\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(JSON.parse),\n * function (data, next) {\n * // data is the result of parsing the text.\n * // If there was a parsing error, it would have been caught.\n * }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(function (contents) {\n * return db.model.create(contents);\n * }),\n * function (model, next) {\n * // `model` is the instantiated model object.\n * // If there was an error, this function would be skipped.\n * }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n * var intermediateStep = await processFile(file);\n * return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n if (isAsync(func)) {\n return function (...args/*, callback*/) {\n const callback = args.pop();\n const promise = func.apply(this, args);\n return handlePromise(promise, callback)\n }\n }\n\n return initialParams(function (args, callback) {\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if (result && typeof result.then === 'function') {\n return handlePromise(result, callback)\n } else {\n callback(null, result);\n }\n });\n}\n\nfunction handlePromise(promise, callback) {\n return promise.then(value => {\n invokeCallback(callback, null, value);\n }, err => {\n invokeCallback(callback, err && err.message ? err : new Error(err));\n });\n}\n\nfunction invokeCallback(callback, error, value) {\n try {\n callback(error, value);\n } catch (err) {\n setImmediate$1(e => { throw e }, err);\n }\n}\n\nfunction isAsync(fn) {\n return fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction isAsyncGenerator(fn) {\n return fn[Symbol.toStringTag] === 'AsyncGenerator';\n}\n\nfunction isAsyncIterable(obj) {\n return typeof obj[Symbol.asyncIterator] === 'function';\n}\n\nfunction wrapAsync(asyncFn) {\n if (typeof asyncFn !== 'function') throw new Error('expected a function')\n return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;\n}\n\n// conditionally promisify a function.\n// only return a promise if a callback is omitted\nfunction awaitify (asyncFn, arity = asyncFn.length) {\n if (!arity) throw new Error('arity is undefined')\n function awaitable (...args) {\n if (typeof args[arity - 1] === 'function') {\n return asyncFn.apply(this, args)\n }\n\n return new Promise((resolve, reject) => {\n args[arity - 1] = (err, ...cbArgs) => {\n if (err) return reject(err)\n resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n };\n asyncFn.apply(this, args);\n })\n }\n\n return awaitable\n}\n\nfunction applyEach (eachfn) {\n return function applyEach(fns, ...callArgs) {\n const go = awaitify(function (callback) {\n var that = this;\n return eachfn(fns, (fn, cb) => {\n wrapAsync(fn).apply(that, callArgs.concat(cb));\n }, callback);\n });\n return go;\n };\n}\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n arr = arr || [];\n var results = [];\n var counter = 0;\n var _iteratee = wrapAsync(iteratee);\n\n return eachfn(arr, (value, _, iterCb) => {\n var index = counter++;\n _iteratee(value, (err, v) => {\n results[index] = v;\n iterCb(err);\n });\n }, err => {\n callback(err, results);\n });\n}\n\nfunction isArrayLike(value) {\n return value &&\n typeof value.length === 'number' &&\n value.length >= 0 &&\n value.length % 1 === 0;\n}\n\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nconst breakLoop = {};\n\nfunction once(fn) {\n function wrapper (...args) {\n if (fn === null) return;\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n }\n Object.assign(wrapper, fn);\n return wrapper\n}\n\nfunction getIterator (coll) {\n return coll[Symbol.iterator] && coll[Symbol.iterator]();\n}\n\nfunction createArrayIterator(coll) {\n var i = -1;\n var len = coll.length;\n return function next() {\n return ++i < len ? {value: coll[i], key: i} : null;\n }\n}\n\nfunction createES2015Iterator(iterator) {\n var i = -1;\n return function next() {\n var item = iterator.next();\n if (item.done)\n return null;\n i++;\n return {value: item.value, key: i};\n }\n}\n\nfunction createObjectIterator(obj) {\n var okeys = obj ? Object.keys(obj) : [];\n var i = -1;\n var len = okeys.length;\n return function next() {\n var key = okeys[++i];\n if (key === '__proto__') {\n return next();\n }\n return i < len ? {value: obj[key], key} : null;\n };\n}\n\nfunction createIterator(coll) {\n if (isArrayLike(coll)) {\n return createArrayIterator(coll);\n }\n\n var iterator = getIterator(coll);\n return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\n\nfunction onlyOnce(fn) {\n return function (...args) {\n if (fn === null) throw new Error(\"Callback was already called.\");\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n };\n}\n\n// for async generators\nfunction asyncEachOfLimit(generator, limit, iteratee, callback) {\n let done = false;\n let canceled = false;\n let awaiting = false;\n let running = 0;\n let idx = 0;\n\n function replenish() {\n //console.log('replenish')\n if (running >= limit || awaiting || done) return\n //console.log('replenish awaiting')\n awaiting = true;\n generator.next().then(({value, done: iterDone}) => {\n //console.log('got value', value)\n if (canceled || done) return\n awaiting = false;\n if (iterDone) {\n done = true;\n if (running <= 0) {\n //console.log('done nextCb')\n callback(null);\n }\n return;\n }\n running++;\n iteratee(value, idx, iterateeCallback);\n idx++;\n replenish();\n }).catch(handleError);\n }\n\n function iterateeCallback(err, result) {\n //console.log('iterateeCallback')\n running -= 1;\n if (canceled) return\n if (err) return handleError(err)\n\n if (err === false) {\n done = true;\n canceled = true;\n return\n }\n\n if (result === breakLoop || (done && running <= 0)) {\n done = true;\n //console.log('done iterCb')\n return callback(null);\n }\n replenish();\n }\n\n function handleError(err) {\n if (canceled) return\n awaiting = false;\n done = true;\n callback(err);\n }\n\n replenish();\n}\n\nvar eachOfLimit = (limit) => {\n return (obj, iteratee, callback) => {\n callback = once(callback);\n if (limit <= 0) {\n throw new RangeError('concurrency limit cannot be less than 1')\n }\n if (!obj) {\n return callback(null);\n }\n if (isAsyncGenerator(obj)) {\n return asyncEachOfLimit(obj, limit, iteratee, callback)\n }\n if (isAsyncIterable(obj)) {\n return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback)\n }\n var nextElem = createIterator(obj);\n var done = false;\n var canceled = false;\n var running = 0;\n var looping = false;\n\n function iterateeCallback(err, value) {\n if (canceled) return\n running -= 1;\n if (err) {\n done = true;\n callback(err);\n }\n else if (err === false) {\n done = true;\n canceled = true;\n }\n else if (value === breakLoop || (done && running <= 0)) {\n done = true;\n return callback(null);\n }\n else if (!looping) {\n replenish();\n }\n }\n\n function replenish () {\n looping = true;\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n }\n looping = false;\n }\n\n replenish();\n };\n};\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfLimit$1(coll, limit, iteratee, callback) {\n return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);\n}\n\nvar eachOfLimit$2 = awaitify(eachOfLimit$1, 4);\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback);\n var index = 0,\n completed = 0,\n {length} = coll,\n canceled = false;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err === false) {\n canceled = true;\n }\n if (canceled === true) return\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nfunction eachOfGeneric (coll, iteratee, callback) {\n return eachOfLimit$2(coll, Infinity, iteratee, callback);\n}\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dev.json is a file containing a valid json object config for dev environment\n * // dev.json is a file containing a valid json object config for test environment\n * // prod.json is a file containing a valid json object config for prod environment\n * // invalid.json is a file with a malformed json object\n *\n * let configs = {}; //global variable\n * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'};\n * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'};\n *\n * // asynchronous function that reads a json file and parses the contents as json object\n * function parseFile(file, key, callback) {\n * fs.readFile(file, \"utf8\", function(err, data) {\n * if (err) return calback(err);\n * try {\n * configs[key] = JSON.parse(data);\n * } catch (e) {\n * return callback(e);\n * }\n * callback();\n * });\n * }\n *\n * // Using callbacks\n * async.forEachOf(validConfigFileMap, parseFile, function (err) {\n * if (err) {\n * console.error(err);\n * } else {\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }\n * });\n *\n * //Error handing\n * async.forEachOf(invalidConfigFileMap, parseFile, function (err) {\n * if (err) {\n * console.error(err);\n * // JSON parse error exception\n * } else {\n * console.log(configs);\n * }\n * });\n *\n * // Using Promises\n * async.forEachOf(validConfigFileMap, parseFile)\n * .then( () => {\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }).catch( err => {\n * console.error(err);\n * });\n *\n * //Error handing\n * async.forEachOf(invalidConfigFileMap, parseFile)\n * .then( () => {\n * console.log(configs);\n * }).catch( err => {\n * console.error(err);\n * // JSON parse error exception\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.forEachOf(validConfigFileMap, parseFile);\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * //Error handing\n * async () => {\n * try {\n * let result = await async.forEachOf(invalidConfigFileMap, parseFile);\n * console.log(configs);\n * }\n * catch (err) {\n * console.log(err);\n * // JSON parse error exception\n * }\n * }\n *\n */\nfunction eachOf(coll, iteratee, callback) {\n var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n return eachOfImplementation(coll, wrapAsync(iteratee), callback);\n}\n\nvar eachOf$1 = awaitify(eachOf, 3);\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callbacks\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array. The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n * // file4.txt does not exist\n *\n * const fileList = ['file1.txt','file2.txt','file3.txt'];\n * const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.map(fileList, getFileSizeInBytes, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }\n * });\n *\n * // Error Handling\n * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(results);\n * }\n * });\n *\n * // Using Promises\n * async.map(fileList, getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.map(withMissingFileList, getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.map(fileList, getFileSizeInBytes);\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let results = await async.map(withMissingFileList, getFileSizeInBytes);\n * console.log(results);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction map (coll, iteratee, callback) {\n return _asyncMap(eachOf$1, coll, iteratee, callback)\n}\nvar map$1 = awaitify(map, 3);\n\n/**\n * Applies the provided arguments to each function in the array, calling\n * `callback` after all functions have completed. If you only provide the first\n * argument, `fns`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, `callback` is required while `args` is still optional. The results\n * for each of the applied async functions are passed to the final callback\n * as an array.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - Returns a function that takes no args other than\n * an optional callback, that is the result of applying the `args` to each\n * of the functions.\n * @example\n *\n * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')\n *\n * appliedFn((err, results) => {\n * // results[0] is the results for `enableSearch`\n * // results[1] is the results for `updateSchema`\n * });\n *\n * // partial application example:\n * async.each(\n * buckets,\n * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),\n * callback\n * );\n */\nvar applyEach$1 = applyEach(map$1);\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n *\n * @name eachOfSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfSeries(coll, iteratee, callback) {\n return eachOfLimit$2(coll, 1, iteratee, callback)\n}\nvar eachOfSeries$1 = awaitify(eachOfSeries, 3);\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapSeries (coll, iteratee, callback) {\n return _asyncMap(eachOfSeries$1, coll, iteratee, callback)\n}\nvar mapSeries$1 = awaitify(mapSeries, 3);\n\n/**\n * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - A function, that when called, is the result of\n * appling the `args` to the list of functions. It takes no args, other than\n * a callback.\n */\nvar applyEachSeries = applyEach(mapSeries$1);\n\nconst PROMISE_SYMBOL = Symbol('promiseCallback');\n\nfunction promiseCallback () {\n let resolve, reject;\n function callback (err, ...args) {\n if (err) return reject(err)\n resolve(args.length > 1 ? args : args[0]);\n }\n\n callback[PROMISE_SYMBOL] = new Promise((res, rej) => {\n resolve = res,\n reject = rej;\n });\n\n return callback\n}\n\n/**\n * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on\n * their requirements. Each function can optionally depend on other functions\n * being completed first, and each function is run as soon as its requirements\n * are satisfied.\n *\n * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence\n * will stop. Further tasks will not execute (so any other functions depending\n * on it will not run), and the main `callback` is immediately called with the\n * error.\n *\n * {@link AsyncFunction}s also receive an object containing the results of functions which\n * have completed so far as the first argument, if they have dependencies. If a\n * task function has no dependencies, it will only be passed a callback.\n *\n * @name auto\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Object} tasks - An object. Each of its properties is either a\n * function or an array of requirements, with the {@link AsyncFunction} itself the last item\n * in the array. The object's key of a property serves as the name of the task\n * defined by that property, i.e. can be used when specifying requirements for\n * other tasks. The function receives one or two arguments:\n * * a `results` object, containing the results of the previously executed\n * functions, only passed if the task has any dependencies,\n * * a `callback(err, result)` function, which must be called when finished,\n * passing an `error` (which can be `null`) and the result of the function's\n * execution.\n * @param {number} [concurrency=Infinity] - An optional `integer` for\n * determining the maximum number of tasks that can be run in parallel. By\n * default, as many as possible.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback. Results are always returned; however, if an\n * error occurs, no further `tasks` will be performed, and the results object\n * will only contain partial results. Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n * @example\n *\n * //Using Callbacks\n * async.auto({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }, function(err, results) {\n * if (err) {\n * console.log('err = ', err);\n * }\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * });\n *\n * //Using Promises\n * async.auto({\n * get_data: function(callback) {\n * console.log('in get_data');\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * console.log('in make_folder');\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }).then(results => {\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * }).catch(err => {\n * console.log('err = ', err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.auto({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * });\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction auto(tasks, concurrency, callback) {\n if (typeof concurrency !== 'number') {\n // concurrency is optional, shift the args.\n callback = concurrency;\n concurrency = null;\n }\n callback = once(callback || promiseCallback());\n var numTasks = Object.keys(tasks).length;\n if (!numTasks) {\n return callback(null);\n }\n if (!concurrency) {\n concurrency = numTasks;\n }\n\n var results = {};\n var runningTasks = 0;\n var canceled = false;\n var hasError = false;\n\n var listeners = Object.create(null);\n\n var readyTasks = [];\n\n // for cycle detection:\n var readyToCheck = []; // tasks that have been identified as reachable\n // without the possibility of returning to an ancestor task\n var uncheckedDependencies = {};\n\n Object.keys(tasks).forEach(key => {\n var task = tasks[key];\n if (!Array.isArray(task)) {\n // no dependencies\n enqueueTask(key, [task]);\n readyToCheck.push(key);\n return;\n }\n\n var dependencies = task.slice(0, task.length - 1);\n var remainingDependencies = dependencies.length;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n readyToCheck.push(key);\n return;\n }\n uncheckedDependencies[key] = remainingDependencies;\n\n dependencies.forEach(dependencyName => {\n if (!tasks[dependencyName]) {\n throw new Error('async.auto task `' + key +\n '` has a non-existent dependency `' +\n dependencyName + '` in ' +\n dependencies.join(', '));\n }\n addListener(dependencyName, () => {\n remainingDependencies--;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n }\n });\n });\n });\n\n checkForDeadlocks();\n processQueue();\n\n function enqueueTask(key, task) {\n readyTasks.push(() => runTask(key, task));\n }\n\n function processQueue() {\n if (canceled) return\n if (readyTasks.length === 0 && runningTasks === 0) {\n return callback(null, results);\n }\n while(readyTasks.length && runningTasks < concurrency) {\n var run = readyTasks.shift();\n run();\n }\n\n }\n\n function addListener(taskName, fn) {\n var taskListeners = listeners[taskName];\n if (!taskListeners) {\n taskListeners = listeners[taskName] = [];\n }\n\n taskListeners.push(fn);\n }\n\n function taskComplete(taskName) {\n var taskListeners = listeners[taskName] || [];\n taskListeners.forEach(fn => fn());\n processQueue();\n }\n\n\n function runTask(key, task) {\n if (hasError) return;\n\n var taskCallback = onlyOnce((err, ...result) => {\n runningTasks--;\n if (err === false) {\n canceled = true;\n return\n }\n if (result.length < 2) {\n [result] = result;\n }\n if (err) {\n var safeResults = {};\n Object.keys(results).forEach(rkey => {\n safeResults[rkey] = results[rkey];\n });\n safeResults[key] = result;\n hasError = true;\n listeners = Object.create(null);\n if (canceled) return\n callback(err, safeResults);\n } else {\n results[key] = result;\n taskComplete(key);\n }\n });\n\n runningTasks++;\n var taskFn = wrapAsync(task[task.length - 1]);\n if (task.length > 1) {\n taskFn(results, taskCallback);\n } else {\n taskFn(taskCallback);\n }\n }\n\n function checkForDeadlocks() {\n // Kahn's algorithm\n // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm\n // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html\n var currentTask;\n var counter = 0;\n while (readyToCheck.length) {\n currentTask = readyToCheck.pop();\n counter++;\n getDependents(currentTask).forEach(dependent => {\n if (--uncheckedDependencies[dependent] === 0) {\n readyToCheck.push(dependent);\n }\n });\n }\n\n if (counter !== numTasks) {\n throw new Error(\n 'async.auto cannot execute tasks due to a recursive dependency'\n );\n }\n }\n\n function getDependents(taskName) {\n var result = [];\n Object.keys(tasks).forEach(key => {\n const task = tasks[key];\n if (Array.isArray(task) && task.indexOf(taskName) >= 0) {\n result.push(key);\n }\n });\n return result;\n }\n\n return callback[PROMISE_SYMBOL]\n}\n\nvar FN_ARGS = /^(?:async\\s+)?(?:function)?\\s*\\w*\\s*\\(\\s*([^)]+)\\s*\\)(?:\\s*{)/;\nvar ARROW_FN_ARGS = /^(?:async\\s+)?\\(?\\s*([^)=]+)\\s*\\)?(?:\\s*=>)/;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /(=.+)?(\\s*)$/;\n\nfunction stripComments(string) {\n let stripped = '';\n let index = 0;\n let endBlockComment = string.indexOf('*/');\n while (index < string.length) {\n if (string[index] === '/' && string[index+1] === '/') {\n // inline comment\n let endIndex = string.indexOf('\\n', index);\n index = (endIndex === -1) ? string.length : endIndex;\n } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) {\n // block comment\n let endIndex = string.indexOf('*/', index);\n if (endIndex !== -1) {\n index = endIndex + 2;\n endBlockComment = string.indexOf('*/', index);\n } else {\n stripped += string[index];\n index++;\n }\n } else {\n stripped += string[index];\n index++;\n }\n }\n return stripped;\n}\n\nfunction parseParams(func) {\n const src = stripComments(func.toString());\n let match = src.match(FN_ARGS);\n if (!match) {\n match = src.match(ARROW_FN_ARGS);\n }\n if (!match) throw new Error('could not parse args in autoInject\\nSource:\\n' + src)\n let [, args] = match;\n return args\n .replace(/\\s/g, '')\n .split(FN_ARG_SPLIT)\n .map((arg) => arg.replace(FN_ARG, '').trim());\n}\n\n/**\n * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent\n * tasks are specified as parameters to the function, after the usual callback\n * parameter, with the parameter names matching the names of the tasks it\n * depends on. This can provide even more readable task graphs which can be\n * easier to maintain.\n *\n * If a final callback is specified, the task results are similarly injected,\n * specified as named parameters after the initial error parameter.\n *\n * The autoInject function is purely syntactic sugar and its semantics are\n * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.\n *\n * @name autoInject\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.auto]{@link module:ControlFlow.auto}\n * @category Control Flow\n * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of\n * the form 'func([dependencies...], callback). The object's key of a property\n * serves as the name of the task defined by that property, i.e. can be used\n * when specifying requirements for other tasks.\n * * The `callback` parameter is a `callback(err, result)` which must be called\n * when finished, passing an `error` (which can be `null`) and the result of\n * the function's execution. The remaining parameters name other tasks on\n * which the task is dependent, and the results from those tasks are the\n * arguments of those parameters.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback, and a `results` object with any completed\n * task results, similar to `auto`.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // The example from `auto` can be rewritten as follows:\n * async.autoInject({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: function(get_data, make_folder, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * },\n * email_link: function(write_file, callback) {\n * // once the file is written let's email a link to it...\n * // write_file contains the filename returned by write_file.\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n *\n * // If you are using a JS minifier that mangles parameter names, `autoInject`\n * // will not work with plain functions, since the parameter names will be\n * // collapsed to a single letter identifier. To work around this, you can\n * // explicitly specify the names of the parameters your task function needs\n * // in an array, similar to Angular.js dependency injection.\n *\n * // This still has an advantage over plain `auto`, since the results a task\n * // depends on are still spread into arguments.\n * async.autoInject({\n * //...\n * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(write_file, callback) {\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }]\n * //...\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n */\nfunction autoInject(tasks, callback) {\n var newTasks = {};\n\n Object.keys(tasks).forEach(key => {\n var taskFn = tasks[key];\n var params;\n var fnIsAsync = isAsync(taskFn);\n var hasNoDeps =\n (!fnIsAsync && taskFn.length === 1) ||\n (fnIsAsync && taskFn.length === 0);\n\n if (Array.isArray(taskFn)) {\n params = [...taskFn];\n taskFn = params.pop();\n\n newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);\n } else if (hasNoDeps) {\n // no dependencies, use the function as-is\n newTasks[key] = taskFn;\n } else {\n params = parseParams(taskFn);\n if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) {\n throw new Error(\"autoInject task functions require explicit parameters.\");\n }\n\n // remove callback param\n if (!fnIsAsync) params.pop();\n\n newTasks[key] = params.concat(newTask);\n }\n\n function newTask(results, taskCb) {\n var newArgs = params.map(name => results[name]);\n newArgs.push(taskCb);\n wrapAsync(taskFn)(...newArgs);\n }\n });\n\n return auto(newTasks, callback);\n}\n\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nclass DLL {\n constructor() {\n this.head = this.tail = null;\n this.length = 0;\n }\n\n removeLink(node) {\n if (node.prev) node.prev.next = node.next;\n else this.head = node.next;\n if (node.next) node.next.prev = node.prev;\n else this.tail = node.prev;\n\n node.prev = node.next = null;\n this.length -= 1;\n return node;\n }\n\n empty () {\n while(this.head) this.shift();\n return this;\n }\n\n insertAfter(node, newNode) {\n newNode.prev = node;\n newNode.next = node.next;\n if (node.next) node.next.prev = newNode;\n else this.tail = newNode;\n node.next = newNode;\n this.length += 1;\n }\n\n insertBefore(node, newNode) {\n newNode.prev = node.prev;\n newNode.next = node;\n if (node.prev) node.prev.next = newNode;\n else this.head = newNode;\n node.prev = newNode;\n this.length += 1;\n }\n\n unshift(node) {\n if (this.head) this.insertBefore(this.head, node);\n else setInitial(this, node);\n }\n\n push(node) {\n if (this.tail) this.insertAfter(this.tail, node);\n else setInitial(this, node);\n }\n\n shift() {\n return this.head && this.removeLink(this.head);\n }\n\n pop() {\n return this.tail && this.removeLink(this.tail);\n }\n\n toArray() {\n return [...this]\n }\n\n *[Symbol.iterator] () {\n var cur = this.head;\n while (cur) {\n yield cur.data;\n cur = cur.next;\n }\n }\n\n remove (testFn) {\n var curr = this.head;\n while(curr) {\n var {next} = curr;\n if (testFn(curr)) {\n this.removeLink(curr);\n }\n curr = next;\n }\n return this;\n }\n}\n\nfunction setInitial(dll, node) {\n dll.length = 1;\n dll.head = dll.tail = node;\n}\n\nfunction queue(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n }\n else if(concurrency === 0) {\n throw new RangeError('Concurrency must not be zero');\n }\n\n var _worker = wrapAsync(worker);\n var numRunning = 0;\n var workersList = [];\n const events = {\n error: [],\n drain: [],\n saturated: [],\n unsaturated: [],\n empty: []\n };\n\n function on (event, handler) {\n events[event].push(handler);\n }\n\n function once (event, handler) {\n const handleAndRemove = (...args) => {\n off(event, handleAndRemove);\n handler(...args);\n };\n events[event].push(handleAndRemove);\n }\n\n function off (event, handler) {\n if (!event) return Object.keys(events).forEach(ev => events[ev] = [])\n if (!handler) return events[event] = []\n events[event] = events[event].filter(ev => ev !== handler);\n }\n\n function trigger (event, ...args) {\n events[event].forEach(handler => handler(...args));\n }\n\n var processingScheduled = false;\n function _insert(data, insertAtFront, rejectOnError, callback) {\n if (callback != null && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n\n var res, rej;\n function promiseCallback (err, ...args) {\n // we don't care about the error, let the global error handler\n // deal with it\n if (err) return rejectOnError ? rej(err) : res()\n if (args.length <= 1) return res(args[0])\n res(args);\n }\n\n var item = q._createTaskItem(\n data,\n rejectOnError ? promiseCallback :\n (callback || promiseCallback)\n );\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n if (!processingScheduled) {\n processingScheduled = true;\n setImmediate$1(() => {\n processingScheduled = false;\n q.process();\n });\n }\n\n if (rejectOnError || !callback) {\n return new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n })\n }\n }\n\n function _createCB(tasks) {\n return function (err, ...args) {\n numRunning -= 1;\n\n for (var i = 0, l = tasks.length; i < l; i++) {\n var task = tasks[i];\n\n var index = workersList.indexOf(task);\n if (index === 0) {\n workersList.shift();\n } else if (index > 0) {\n workersList.splice(index, 1);\n }\n\n task.callback(err, ...args);\n\n if (err != null) {\n trigger('error', err, task.data);\n }\n }\n\n if (numRunning <= (q.concurrency - q.buffer) ) {\n trigger('unsaturated');\n }\n\n if (q.idle()) {\n trigger('drain');\n }\n q.process();\n };\n }\n\n function _maybeDrain(data) {\n if (data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n setImmediate$1(() => trigger('drain'));\n return true\n }\n return false\n }\n\n const eventMethod = (name) => (handler) => {\n if (!handler) {\n return new Promise((resolve, reject) => {\n once(name, (err, data) => {\n if (err) return reject(err)\n resolve(data);\n });\n })\n }\n off(name);\n on(name, handler);\n\n };\n\n var isProcessing = false;\n var q = {\n _tasks: new DLL(),\n _createTaskItem (data, callback) {\n return {\n data,\n callback\n };\n },\n *[Symbol.iterator] () {\n yield* q._tasks[Symbol.iterator]();\n },\n concurrency,\n payload,\n buffer: concurrency / 4,\n started: false,\n paused: false,\n push (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, false, false, callback))\n }\n return _insert(data, false, false, callback);\n },\n pushAsync (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, false, true, callback))\n }\n return _insert(data, false, true, callback);\n },\n kill () {\n off();\n q._tasks.empty();\n },\n unshift (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, true, false, callback))\n }\n return _insert(data, true, false, callback);\n },\n unshiftAsync (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, true, true, callback))\n }\n return _insert(data, true, true, callback);\n },\n remove (testFn) {\n q._tasks.remove(testFn);\n },\n process () {\n // Avoid trying to start too many processing operations. This can occur\n // when callbacks resolve synchronously (#1267).\n if (isProcessing) {\n return;\n }\n isProcessing = true;\n while(!q.paused && numRunning < q.concurrency && q._tasks.length){\n var tasks = [], data = [];\n var l = q._tasks.length;\n if (q.payload) l = Math.min(l, q.payload);\n for (var i = 0; i < l; i++) {\n var node = q._tasks.shift();\n tasks.push(node);\n workersList.push(node);\n data.push(node.data);\n }\n\n numRunning += 1;\n\n if (q._tasks.length === 0) {\n trigger('empty');\n }\n\n if (numRunning === q.concurrency) {\n trigger('saturated');\n }\n\n var cb = onlyOnce(_createCB(tasks));\n _worker(data, cb);\n }\n isProcessing = false;\n },\n length () {\n return q._tasks.length;\n },\n running () {\n return numRunning;\n },\n workersList () {\n return workersList;\n },\n idle() {\n return q._tasks.length + numRunning === 0;\n },\n pause () {\n q.paused = true;\n },\n resume () {\n if (q.paused === false) { return; }\n q.paused = false;\n setImmediate$1(q.process);\n }\n };\n // define these as fixed properties, so people get useful errors when updating\n Object.defineProperties(q, {\n saturated: {\n writable: false,\n value: eventMethod('saturated')\n },\n unsaturated: {\n writable: false,\n value: eventMethod('unsaturated')\n },\n empty: {\n writable: false,\n value: eventMethod('empty')\n },\n drain: {\n writable: false,\n value: eventMethod('drain')\n },\n error: {\n writable: false,\n value: eventMethod('error')\n },\n });\n return q;\n}\n\n/**\n * Creates a `cargo` object with the specified payload. Tasks added to the\n * cargo will be processed altogether (up to the `payload` limit). If the\n * `worker` is in progress, the task is queued until it becomes available. Once\n * the `worker` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how `cargo` and `queue` work.\n *\n * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, cargo passes an array of tasks to a single worker, repeating\n * when the worker is finished.\n *\n * @name cargo\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with `(tasks, callback)`.\n * @param {number} [payload=Infinity] - An optional `integer` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargo and inner queue.\n * @example\n *\n * // create a cargo object with payload 2\n * var cargo = async.cargo(function(tasks, callback) {\n * for (var i=0; i<tasks.length; i++) {\n * console.log('hello ' + tasks[i].name);\n * }\n * callback();\n * }, 2);\n *\n * // add some items\n * cargo.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * cargo.push({name: 'bar'}, function(err) {\n * console.log('finished processing bar');\n * });\n * await cargo.push({name: 'baz'});\n * console.log('finished processing baz');\n */\nfunction cargo(worker, payload) {\n return queue(worker, 1, payload);\n}\n\n/**\n * Creates a `cargoQueue` object with the specified payload. Tasks added to the\n * cargoQueue will be processed together (up to the `payload` limit) in `concurrency` parallel workers.\n * If the all `workers` are in progress, the task is queued until one becomes available. Once\n * a `worker` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how `cargo` and `queue` work.\n *\n * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, and [`cargo`]{@link module:ControlFlow.cargo} passes an array of tasks to a single worker,\n * the cargoQueue passes an array of tasks to multiple parallel workers.\n *\n * @name cargoQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @see [async.cargo]{@link module:ControlFLow.cargo}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with `(tasks, callback)`.\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel. If omitted, the concurrency\n * defaults to `1`. If the concurrency is `0`, an error is thrown.\n * @param {number} [payload=Infinity] - An optional `integer` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.QueueObject} A cargoQueue object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargoQueue and inner queue.\n * @example\n *\n * // create a cargoQueue object with payload 2 and concurrency 2\n * var cargoQueue = async.cargoQueue(function(tasks, callback) {\n * for (var i=0; i<tasks.length; i++) {\n * console.log('hello ' + tasks[i].name);\n * }\n * callback();\n * }, 2, 2);\n *\n * // add some items\n * cargoQueue.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * cargoQueue.push({name: 'bar'}, function(err) {\n * console.log('finished processing bar');\n * });\n * cargoQueue.push({name: 'baz'}, function(err) {\n * console.log('finished processing baz');\n * });\n * cargoQueue.push({name: 'boo'}, function(err) {\n * console.log('finished processing boo');\n * });\n */\nfunction cargo$1(worker, concurrency, payload) {\n return queue(worker, concurrency, payload);\n}\n\n/**\n * Reduces `coll` into a single value using an async `iteratee` to return each\n * successive step. `memo` is the initial state of the reduction. This function\n * only operates in series.\n *\n * For performance reasons, it may make sense to split a call to this function\n * into a parallel map, and then use the normal `Array.prototype.reduce` on the\n * results. This function is for situations where each step in the reduction\n * needs to be async; if you can get the data before reducing it, then it's\n * probably a good idea to do so.\n *\n * @name reduce\n * @static\n * @memberOf module:Collections\n * @method\n * @alias inject\n * @alias foldl\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee completes with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n * // file4.txt does not exist\n *\n * const fileList = ['file1.txt','file2.txt','file3.txt'];\n * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt'];\n *\n * // asynchronous function that computes the file size in bytes\n * // file size is added to the memoized value, then returned\n * function getFileSizeInBytes(memo, file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, memo + stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // 6000\n * // which is the sum of the file sizes of the three files\n * }\n * });\n *\n * // Error Handling\n * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(result);\n * }\n * });\n *\n * // Using Promises\n * async.reduce(fileList, 0, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * // 6000\n * // which is the sum of the file sizes of the three files\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.reduce(withMissingFileList, 0, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.reduce(fileList, 0, getFileSizeInBytes);\n * console.log(result);\n * // 6000\n * // which is the sum of the file sizes of the three files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes);\n * console.log(result);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction reduce(coll, memo, iteratee, callback) {\n callback = once(callback);\n var _iteratee = wrapAsync(iteratee);\n return eachOfSeries$1(coll, (x, i, iterCb) => {\n _iteratee(memo, x, (err, v) => {\n memo = v;\n iterCb(err);\n });\n }, err => callback(err, memo));\n}\nvar reduce$1 = awaitify(reduce, 4);\n\n/**\n * Version of the compose function that is more natural to read. Each function\n * consumes the return value of the previous function. It is the equivalent of\n * [compose]{@link module:ControlFlow.compose} with the arguments reversed.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name seq\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.compose]{@link module:ControlFlow.compose}\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} a function that composes the `functions` in order\n * @example\n *\n * // Requires lodash (or underscore), express3 and dresende's orm2.\n * // Part of an app, that fetches cats of the logged user.\n * // This example uses `seq` function to avoid overnesting and error\n * // handling clutter.\n * app.get('/cats', function(request, response) {\n * var User = request.models.User;\n * async.seq(\n * User.get.bind(User), // 'User.get' has signature (id, callback(err, data))\n * function(user, fn) {\n * user.getCats(fn); // 'getCats' has signature (callback(err, data))\n * }\n * )(req.session.user_id, function (err, cats) {\n * if (err) {\n * console.error(err);\n * response.json({ status: 'error', message: err.message });\n * } else {\n * response.json({ status: 'ok', message: 'Cats found', data: cats });\n * }\n * });\n * });\n */\nfunction seq(...functions) {\n var _functions = functions.map(wrapAsync);\n return function (...args) {\n var that = this;\n\n var cb = args[args.length - 1];\n if (typeof cb == 'function') {\n args.pop();\n } else {\n cb = promiseCallback();\n }\n\n reduce$1(_functions, args, (newargs, fn, iterCb) => {\n fn.apply(that, newargs.concat((err, ...nextargs) => {\n iterCb(err, nextargs);\n }));\n },\n (err, results) => cb(err, ...results));\n\n return cb[PROMISE_SYMBOL]\n };\n}\n\n/**\n * Creates a function which is a composition of the passed asynchronous\n * functions. Each function consumes the return value of the function that\n * follows. Composing functions `f()`, `g()`, and `h()` would produce the result\n * of `f(g(h()))`, only this version uses callbacks to obtain the return values.\n *\n * If the last argument to the composed function is not a function, a promise\n * is returned when you call it.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name compose\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} an asynchronous function that is the composed\n * asynchronous `functions`\n * @example\n *\n * function add1(n, callback) {\n * setTimeout(function () {\n * callback(null, n + 1);\n * }, 10);\n * }\n *\n * function mul3(n, callback) {\n * setTimeout(function () {\n * callback(null, n * 3);\n * }, 10);\n * }\n *\n * var add1mul3 = async.compose(mul3, add1);\n * add1mul3(4, function (err, result) {\n * // result now equals 15\n * });\n */\nfunction compose(...args) {\n return seq(...args.reverse());\n}\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapLimit (coll, limit, iteratee, callback) {\n return _asyncMap(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar mapLimit$1 = awaitify(mapLimit, 4);\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.\n *\n * @name concatLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapLimit\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatLimit(coll, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(coll, limit, (val, iterCb) => {\n _iteratee(val, (err, ...args) => {\n if (err) return iterCb(err);\n return iterCb(err, args);\n });\n }, (err, mapResults) => {\n var result = [];\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n result = result.concat(...mapResults[i]);\n }\n }\n\n return callback(err, result);\n });\n}\nvar concatLimit$1 = awaitify(concatLimit, 4);\n\n/**\n * Applies `iteratee` to each item in `coll`, concatenating the results. Returns\n * the concatenated list. The `iteratee`s are called in parallel, and the\n * results are concatenated as they return. The results array will be returned in\n * the original order of `coll` passed to the `iteratee` function.\n *\n * @name concat\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @alias flatMap\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * let directoryList = ['dir1','dir2','dir3'];\n * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4'];\n *\n * // Using callbacks\n * async.concat(directoryList, fs.readdir, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * }\n * });\n *\n * // Error Handling\n * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * } else {\n * console.log(results);\n * }\n * });\n *\n * // Using Promises\n * async.concat(directoryList, fs.readdir)\n * .then(results => {\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.concat(withMissingDirectoryList, fs.readdir)\n * .then(results => {\n * console.log(results);\n * }).catch(err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.concat(directoryList, fs.readdir);\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * } catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let results = await async.concat(withMissingDirectoryList, fs.readdir);\n * console.log(results);\n * } catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * }\n * }\n *\n */\nfunction concat(coll, iteratee, callback) {\n return concatLimit$1(coll, Infinity, iteratee, callback)\n}\nvar concat$1 = awaitify(concat, 3);\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.\n *\n * @name concatSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapSeries\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.\n * The iteratee should complete with an array an array of results.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatSeries(coll, iteratee, callback) {\n return concatLimit$1(coll, 1, iteratee, callback)\n}\nvar concatSeries$1 = awaitify(concatSeries, 3);\n\n/**\n * Returns a function that when called, calls-back with the values provided.\n * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to\n * [`auto`]{@link module:ControlFlow.auto}.\n *\n * @name constant\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {...*} arguments... - Any number of arguments to automatically invoke\n * callback with.\n * @returns {AsyncFunction} Returns a function that when invoked, automatically\n * invokes the callback with the previous given arguments.\n * @example\n *\n * async.waterfall([\n * async.constant(42),\n * function (value, next) {\n * // value === 42\n * },\n * //...\n * ], callback);\n *\n * async.waterfall([\n * async.constant(filename, \"utf8\"),\n * fs.readFile,\n * function (fileData, next) {\n * //...\n * }\n * //...\n * ], callback);\n *\n * async.auto({\n * hostname: async.constant(\"https://server.net/\"),\n * port: findFreePort,\n * launchServer: [\"hostname\", \"port\", function (options, cb) {\n * startServer(options, cb);\n * }],\n * //...\n * }, callback);\n */\nfunction constant(...args) {\n return function (...ignoredArgs/*, callback*/) {\n var callback = ignoredArgs.pop();\n return callback(null, ...args);\n };\n}\n\nfunction _createTester(check, getResult) {\n return (eachfn, arr, _iteratee, cb) => {\n var testPassed = false;\n var testResult;\n const iteratee = wrapAsync(_iteratee);\n eachfn(arr, (value, _, callback) => {\n iteratee(value, (err, result) => {\n if (err || err === false) return callback(err);\n\n if (check(result) && !testResult) {\n testPassed = true;\n testResult = getResult(true, value);\n return callback(null, breakLoop);\n }\n callback();\n });\n }, err => {\n if (err) return cb(err);\n cb(null, testPassed ? testResult : getResult(false));\n });\n };\n}\n\n/**\n * Returns the first value in `coll` that passes an async truth test. The\n * `iteratee` is applied in parallel, meaning the first iteratee to return\n * `true` will fire the detect `callback` with that result. That means the\n * result might not be the first item in the original `coll` (in terms of order)\n * that passes the test.\n\n * If order within the original `coll` is important, then look at\n * [`detectSeries`]{@link module:Collections.detectSeries}.\n *\n * @name detect\n * @static\n * @memberOf module:Collections\n * @method\n * @alias find\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the first file in the list that exists\n * }\n *);\n *\n * // Using Promises\n * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists)\n * .then(result => {\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the first file in the list that exists\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists);\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the file in the list that exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction detect(coll, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback)\n}\nvar detect$1 = awaitify(detect, 3);\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name detectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findLimit\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction detectLimit(coll, limit, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar detectLimit$1 = awaitify(detectLimit, 4);\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.\n *\n * @name detectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findSeries\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction detectSeries(coll, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback)\n}\n\nvar detectSeries$1 = awaitify(detectSeries, 3);\n\nfunction consoleFunc(name) {\n return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {\n /* istanbul ignore else */\n if (typeof console === 'object') {\n /* istanbul ignore else */\n if (err) {\n /* istanbul ignore else */\n if (console.error) {\n console.error(err);\n }\n } else if (console[name]) { /* istanbul ignore else */\n resultArgs.forEach(x => console[name](x));\n }\n }\n })\n}\n\n/**\n * Logs the result of an [`async` function]{@link AsyncFunction} to the\n * `console` using `console.dir` to display the properties of the resulting object.\n * Only works in Node.js or in browsers that support `console.dir` and\n * `console.error` (such as FF and Chrome).\n * If multiple arguments are returned from the async function,\n * `console.dir` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, {hello: name});\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nvar dir = consoleFunc('dir');\n\n/**\n * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments `test` and `iteratee` are switched.\n *\n * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time `test`\n * passes. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped.\n * `callback` will be passed an error and any arguments passed to the final\n * `iteratee`'s callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doWhilst(iteratee, test, callback) {\n callback = onlyOnce(callback);\n var _fn = wrapAsync(iteratee);\n var _test = wrapAsync(test);\n var results;\n\n function next(err, ...args) {\n if (err) return callback(err);\n if (err === false) return;\n results = args;\n _test(...args, check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (err === false) return;\n if (!truth) return callback(null, ...results);\n _fn(next);\n }\n\n return check(null, true);\n}\n\nvar doWhilst$1 = awaitify(doWhilst, 3);\n\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the\n * argument ordering differs from `until`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `iteratee`\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doUntil(iteratee, test, callback) {\n const _test = wrapAsync(test);\n return doWhilst$1(iteratee, (...args) => {\n const cb = args.pop();\n _test(...args, (err, truth) => cb (err, !truth));\n }, callback);\n}\n\nfunction _withoutIndex(iteratee) {\n return (value, index, callback) => iteratee(value, callback);\n}\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt'];\n * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt'];\n *\n * // asynchronous function that deletes a file\n * const deleteFile = function(file, callback) {\n * fs.unlink(file, callback);\n * };\n *\n * // Using callbacks\n * async.each(fileList, deleteFile, function(err) {\n * if( err ) {\n * console.log(err);\n * } else {\n * console.log('All files have been deleted successfully');\n * }\n * });\n *\n * // Error Handling\n * async.each(withMissingFileList, deleteFile, function(err){\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * });\n *\n * // Using Promises\n * async.each(fileList, deleteFile)\n * .then( () => {\n * console.log('All files have been deleted successfully');\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.each(fileList, deleteFile)\n * .then( () => {\n * console.log('All files have been deleted successfully');\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * await async.each(files, deleteFile);\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * await async.each(withMissingFileList, deleteFile);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * }\n * }\n *\n */\nfunction eachLimit(coll, iteratee, callback) {\n return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\nvar each = awaitify(eachLimit, 3);\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachLimit$1(coll, limit, iteratee, callback) {\n return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\nvar eachLimit$2 = awaitify(eachLimit$1, 4);\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item\n * in series and therefore the iteratee functions will complete in order.\n\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachSeries(coll, iteratee, callback) {\n return eachLimit$2(coll, 1, iteratee, callback)\n}\nvar eachSeries$1 = awaitify(eachSeries, 3);\n\n/**\n * Wrap an async function and ensure it calls its callback on a later tick of\n * the event loop. If the function already calls its callback on a next tick,\n * no extra deferral is added. This is useful for preventing stack overflows\n * (`RangeError: Maximum call stack size exceeded`) and generally keeping\n * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)\n * contained. ES2017 `async` functions are returned as-is -- they are immune\n * to Zalgo's corrupting influences, as they always resolve on a later tick.\n *\n * @name ensureAsync\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - an async function, one that expects a node-style\n * callback as its last argument.\n * @returns {AsyncFunction} Returns a wrapped function with the exact same call\n * signature as the function passed in.\n * @example\n *\n * function sometimesAsync(arg, callback) {\n * if (cache[arg]) {\n * return callback(null, cache[arg]); // this would be synchronous!!\n * } else {\n * doSomeIO(arg, callback); // this IO would be asynchronous\n * }\n * }\n *\n * // this has a risk of stack overflows if many results are cached in a row\n * async.mapSeries(args, sometimesAsync, done);\n *\n * // this will defer sometimesAsync's callback if necessary,\n * // preventing stack overflows\n * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n */\nfunction ensureAsync(fn) {\n if (isAsync(fn)) return fn;\n return function (...args/*, callback*/) {\n var callback = args.pop();\n var sync = true;\n args.push((...innerArgs) => {\n if (sync) {\n setImmediate$1(() => callback(...innerArgs));\n } else {\n callback(...innerArgs);\n }\n });\n fn.apply(this, args);\n sync = false;\n };\n}\n\n/**\n * Returns `true` if every element in `coll` satisfies an async test. If any\n * iteratee call returns `false`, the main `callback` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt'];\n * const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.every(fileList, fileExists, function(err, result) {\n * console.log(result);\n * // true\n * // result is true since every file exists\n * });\n *\n * async.every(withMissingFileList, fileExists, function(err, result) {\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * });\n *\n * // Using Promises\n * async.every(fileList, fileExists)\n * .then( result => {\n * console.log(result);\n * // true\n * // result is true since every file exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * async.every(withMissingFileList, fileExists)\n * .then( result => {\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.every(fileList, fileExists);\n * console.log(result);\n * // true\n * // result is true since every file exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * async () => {\n * try {\n * let result = await async.every(withMissingFileList, fileExists);\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction every(coll, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback)\n}\nvar every$1 = awaitify(every, 3);\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.\n *\n * @name everyLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everyLimit(coll, limit, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar everyLimit$1 = awaitify(everyLimit, 4);\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.\n *\n * @name everySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in series.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everySeries(coll, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar everySeries$1 = awaitify(everySeries, 3);\n\nfunction filterArray(eachfn, arr, iteratee, callback) {\n var truthValues = new Array(arr.length);\n eachfn(arr, (x, index, iterCb) => {\n iteratee(x, (err, v) => {\n truthValues[index] = !!v;\n iterCb(err);\n });\n }, err => {\n if (err) return callback(err);\n var results = [];\n for (var i = 0; i < arr.length; i++) {\n if (truthValues[i]) results.push(arr[i]);\n }\n callback(null, results);\n });\n}\n\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n var results = [];\n eachfn(coll, (x, index, iterCb) => {\n iteratee(x, (err, v) => {\n if (err) return iterCb(err);\n if (v) {\n results.push({index, value: x});\n }\n iterCb(err);\n });\n }, err => {\n if (err) return callback(err);\n callback(null, results\n .sort((a, b) => a.index - b.index)\n .map(v => v.value));\n });\n}\n\nfunction _filter(eachfn, coll, iteratee, callback) {\n var filter = isArrayLike(coll) ? filterArray : filterGeneric;\n return filter(eachfn, coll, wrapAsync(iteratee), callback);\n}\n\n/**\n * Returns a new array of all the values in `coll` which pass an async truth\n * test. This operation is performed in parallel, but the results array will be\n * in the same order as the original.\n *\n * @name filter\n * @static\n * @memberOf module:Collections\n * @method\n * @alias select\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.filter(files, fileExists, function(err, results) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }\n * });\n *\n * // Using Promises\n * async.filter(files, fileExists)\n * .then(results => {\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.filter(files, fileExists);\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction filter (coll, iteratee, callback) {\n return _filter(eachOf$1, coll, iteratee, callback)\n}\nvar filter$1 = awaitify(filter, 3);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name filterLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterLimit (coll, limit, iteratee, callback) {\n return _filter(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar filterLimit$1 = awaitify(filterLimit, 4);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.\n *\n * @name filterSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results)\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterSeries (coll, iteratee, callback) {\n return _filter(eachOfSeries$1, coll, iteratee, callback)\n}\nvar filterSeries$1 = awaitify(filterSeries, 3);\n\n/**\n * Calls the asynchronous function `fn` with a callback parameter that allows it\n * to call itself again, in series, indefinitely.\n\n * If an error is passed to the callback then `errback` is called with the\n * error, and execution stops, otherwise it will never be called.\n *\n * @name forever\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} fn - an async function to call repeatedly.\n * Invoked with (next).\n * @param {Function} [errback] - when `fn` passes an error to it's callback,\n * this function will be called, and execution stops. Invoked with (err).\n * @returns {Promise} a promise that rejects if an error occurs and an errback\n * is not passed\n * @example\n *\n * async.forever(\n * function(next) {\n * // next is suitable for passing to things that need a callback(err [, whatever]);\n * // it will result in this function being called again.\n * },\n * function(err) {\n * // if next is called with a value in its first parameter, it will appear\n * // in here as 'err', and execution will stop.\n * }\n * );\n */\nfunction forever(fn, errback) {\n var done = onlyOnce(errback);\n var task = wrapAsync(ensureAsync(fn));\n\n function next(err) {\n if (err) return done(err);\n if (err === false) return;\n task(next);\n }\n return next();\n}\nvar forever$1 = awaitify(forever, 2);\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.\n *\n * @name groupByLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupByLimit(coll, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(coll, limit, (val, iterCb) => {\n _iteratee(val, (err, key) => {\n if (err) return iterCb(err);\n return iterCb(err, {key, val});\n });\n }, (err, mapResults) => {\n var result = {};\n // from MDN, handle object having an `hasOwnProperty` prop\n var {hasOwnProperty} = Object.prototype;\n\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n var {key} = mapResults[i];\n var {val} = mapResults[i];\n\n if (hasOwnProperty.call(result, key)) {\n result[key].push(val);\n } else {\n result[key] = [val];\n }\n }\n }\n\n return callback(err, result);\n });\n}\n\nvar groupByLimit$1 = awaitify(groupByLimit, 4);\n\n/**\n * Returns a new object, where each value corresponds to an array of items, from\n * `coll`, that returned the corresponding key. That is, the keys of the object\n * correspond to the values passed to the `iteratee` callback.\n *\n * Note: Since this function applies the `iteratee` to each item in parallel,\n * there is no guarantee that the `iteratee` functions will complete in order.\n * However, the values for each key in the `result` will be in the same order as\n * the original `coll`. For Objects, the values will roughly be in the order of\n * the original Objects' keys (but this can vary across JavaScript engines).\n *\n * @name groupBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const files = ['dir1/file1.txt','dir2','dir4']\n *\n * // asynchronous function that detects file type as none, file, or directory\n * function detectFile(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(null, 'none');\n * }\n * callback(null, stat.isDirectory() ? 'directory' : 'file');\n * });\n * }\n *\n * //Using callbacks\n * async.groupBy(files, detectFile, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n *\t console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }\n * });\n *\n * // Using Promises\n * async.groupBy(files, detectFile)\n * .then( result => {\n * console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.groupBy(files, detectFile);\n * console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction groupBy (coll, iteratee, callback) {\n return groupByLimit$1(coll, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.\n *\n * @name groupBySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whose\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupBySeries (coll, iteratee, callback) {\n return groupByLimit$1(coll, 1, iteratee, callback)\n}\n\n/**\n * Logs the result of an `async` function to the `console`. Only works in\n * Node.js or in browsers that support `console.log` and `console.error` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, `console.log` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, 'hello ' + name);\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nvar log = consoleFunc('log');\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name mapValuesLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesLimit(obj, limit, iteratee, callback) {\n callback = once(callback);\n var newObj = {};\n var _iteratee = wrapAsync(iteratee);\n return eachOfLimit(limit)(obj, (val, key, next) => {\n _iteratee(val, key, (err, result) => {\n if (err) return next(err);\n newObj[key] = result;\n next(err);\n });\n }, err => callback(err, newObj));\n}\n\nvar mapValuesLimit$1 = awaitify(mapValuesLimit, 4);\n\n/**\n * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.\n *\n * Produces a new Object by mapping each value of `obj` through the `iteratee`\n * function. The `iteratee` is called each `value` and `key` from `obj` and a\n * callback for when it has finished processing. Each of these callbacks takes\n * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`\n * passes an error to its callback, the main `callback` (for the `mapValues`\n * function) is immediately called with the error.\n *\n * Note, the order of the keys in the result is not guaranteed. The keys will\n * be roughly in the order they complete, (but this is very engine-specific)\n *\n * @name mapValues\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n * // file4.txt does not exist\n *\n * const fileMap = {\n * f1: 'file1.txt',\n * f2: 'file2.txt',\n * f3: 'file3.txt'\n * };\n *\n * const withMissingFileMap = {\n * f1: 'file1.txt',\n * f2: 'file2.txt',\n * f3: 'file4.txt'\n * };\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, key, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }\n * });\n *\n * // Error handling\n * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(result);\n * }\n * });\n *\n * // Using Promises\n * async.mapValues(fileMap, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }).catch (err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.mapValues(withMissingFileMap, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * }).catch (err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.mapValues(fileMap, getFileSizeInBytes);\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes);\n * console.log(result);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction mapValues(obj, iteratee, callback) {\n return mapValuesLimit$1(obj, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n *\n * @name mapValuesSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesSeries(obj, iteratee, callback) {\n return mapValuesLimit$1(obj, 1, iteratee, callback)\n}\n\n/**\n * Caches the results of an async function. When creating a hash to store\n * function results against, the callback is omitted from the hash and an\n * optional hash function can be used.\n *\n * **Note: if the async function errs, the result will not be cached and\n * subsequent calls will call the wrapped function.**\n *\n * If no hash function is specified, the first argument is used as a hash key,\n * which may work reasonably if it is a string or a data type that converts to a\n * distinct string. Note that objects and arrays will not behave reasonably.\n * Neither will cases where the other arguments are significant. In such cases,\n * specify your own hash function.\n *\n * The cache of results is exposed as the `memo` property of the function\n * returned by `memoize`.\n *\n * @name memoize\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function to proxy and cache results from.\n * @param {Function} hasher - An optional function for generating a custom hash\n * for storing results. It has all the arguments applied to it apart from the\n * callback, and must be synchronous.\n * @returns {AsyncFunction} a memoized version of `fn`\n * @example\n *\n * var slow_fn = function(name, callback) {\n * // do something\n * callback(null, result);\n * };\n * var fn = async.memoize(slow_fn);\n *\n * // fn can now be used as if it were slow_fn\n * fn('some name', function() {\n * // callback\n * });\n */\nfunction memoize(fn, hasher = v => v) {\n var memo = Object.create(null);\n var queues = Object.create(null);\n var _fn = wrapAsync(fn);\n var memoized = initialParams((args, callback) => {\n var key = hasher(...args);\n if (key in memo) {\n setImmediate$1(() => callback(null, ...memo[key]));\n } else if (key in queues) {\n queues[key].push(callback);\n } else {\n queues[key] = [callback];\n _fn(...args, (err, ...resultArgs) => {\n // #1465 don't memoize if an error occurred\n if (!err) {\n memo[key] = resultArgs;\n }\n var q = queues[key];\n delete queues[key];\n for (var i = 0, l = q.length; i < l; i++) {\n q[i](err, ...resultArgs);\n }\n });\n }\n });\n memoized.memo = memo;\n memoized.unmemoized = fn;\n return memoized;\n}\n\n/* istanbul ignore file */\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `process.nextTick`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer$1;\n\nif (hasNextTick) {\n _defer$1 = process.nextTick;\n} else if (hasSetImmediate) {\n _defer$1 = setImmediate;\n} else {\n _defer$1 = fallback;\n}\n\nvar nextTick = wrap(_defer$1);\n\nvar parallel = awaitify((eachfn, tasks, callback) => {\n var results = isArrayLike(tasks) ? [] : {};\n\n eachfn(tasks, (task, key, taskCb) => {\n wrapAsync(task)((err, ...result) => {\n if (result.length < 2) {\n [result] = result;\n }\n results[key] = result;\n taskCb(err);\n });\n }, err => callback(err, results));\n}, 3);\n\n/**\n * Run the `tasks` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main `callback` is immediately called with the value of the\n * error. Once the `tasks` have completed, the results are passed to the final\n * `callback` as an array.\n *\n * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code. If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series. Any synchronous setup\n * sections for each task will happen one after the other. JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n *\n * //Using Callbacks\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ], function(err, results) {\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * });\n *\n * //Using Promises\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]).then(results => {\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }).then(results => {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]);\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // an example using an object instead of an array\n * async () => {\n * try {\n * let results = await async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * });\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction parallel$1(tasks, callback) {\n return parallel(eachOf$1, tasks, callback);\n}\n\n/**\n * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name parallelLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.parallel]{@link module:ControlFlow.parallel}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n */\nfunction parallelLimit(tasks, limit, callback) {\n return parallel(eachOfLimit(limit), tasks, callback);\n}\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Iterable} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {number} payload - an integer that specifies how many items are\n * passed to the worker function at a time. only applies if this is a\n * [cargo]{@link module:ControlFlow.cargo} object\n * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {AsyncFunction} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns\n * a promise that rejects if an error occurs.\n * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns\n * a promise that rejects if an error occurs.\n * @property {Function} remove - remove items from the queue that match a test\n * function. The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a function that sets a callback that is\n * called when the number of running workers hits the `concurrency` limit, and\n * further tasks will be queued. If the callback is omitted, `q.saturated()`\n * returns a promise for the next occurrence.\n * @property {Function} unsaturated - a function that sets a callback that is\n * called when the number of running workers is less than the `concurrency` &\n * `buffer` limits, and further tasks will not be queued. If the callback is\n * omitted, `q.unsaturated()` returns a promise for the next occurrence.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a function that sets a callback that is called\n * when the last item from the `queue` is given to a `worker`. If the callback\n * is omitted, `q.empty()` returns a promise for the next occurrence.\n * @property {Function} drain - a function that sets a callback that is called\n * when the last item from the `queue` has returned from the `worker`. If the\n * callback is omitted, `q.drain()` returns a promise for the next occurrence.\n * @property {Function} error - a function that sets a callback that is called\n * when a task errors. Has the signature `function(error, task)`. If the\n * callback is omitted, `error()` returns a promise that rejects on the next\n * error.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n *\n * @example\n * const q = async.queue(worker, 2)\n * q.push(item1)\n * q.push(item2)\n * q.push(item3)\n * // queues are iterable, spread into an array to inspect\n * const items = [...q] // [item1, item2, item3]\n * // or use for of\n * for (let item of q) {\n * console.log(item)\n * }\n *\n * q.drain(() => {\n * console.log('all done')\n * })\n * // or\n * await q.drain()\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel. If omitted, the concurrency\n * defaults to `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n * console.log('hello ' + task.name);\n * callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain(function() {\n * console.log('all items have been processed');\n * });\n * // or await the end\n * await q.drain()\n *\n * // assign an error callback\n * q.error(function(err, task) {\n * console.error('task experienced an error');\n * });\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * // callback is optional\n * q.push({name: 'bar'});\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n * console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n */\nfunction queue$1 (worker, concurrency) {\n var _worker = wrapAsync(worker);\n return queue((items, cb) => {\n _worker(items[0], cb);\n }, concurrency, 1);\n}\n\n// Binary min-heap implementation used for priority queue.\n// Implementation is stable, i.e. push time is considered for equal priorities\nclass Heap {\n constructor() {\n this.heap = [];\n this.pushCount = Number.MIN_SAFE_INTEGER;\n }\n\n get length() {\n return this.heap.length;\n }\n\n empty () {\n this.heap = [];\n return this;\n }\n\n percUp(index) {\n let p;\n\n while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) {\n let t = this.heap[index];\n this.heap[index] = this.heap[p];\n this.heap[p] = t;\n\n index = p;\n }\n }\n\n percDown(index) {\n let l;\n\n while ((l=leftChi(index)) < this.heap.length) {\n if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) {\n l = l+1;\n }\n\n if (smaller(this.heap[index], this.heap[l])) {\n break;\n }\n\n let t = this.heap[index];\n this.heap[index] = this.heap[l];\n this.heap[l] = t;\n\n index = l;\n }\n }\n\n push(node) {\n node.pushCount = ++this.pushCount;\n this.heap.push(node);\n this.percUp(this.heap.length-1);\n }\n\n unshift(node) {\n return this.heap.push(node);\n }\n\n shift() {\n let [top] = this.heap;\n\n this.heap[0] = this.heap[this.heap.length-1];\n this.heap.pop();\n this.percDown(0);\n\n return top;\n }\n\n toArray() {\n return [...this];\n }\n\n *[Symbol.iterator] () {\n for (let i = 0; i < this.heap.length; i++) {\n yield this.heap[i].data;\n }\n }\n\n remove (testFn) {\n let j = 0;\n for (let i = 0; i < this.heap.length; i++) {\n if (!testFn(this.heap[i])) {\n this.heap[j] = this.heap[i];\n j++;\n }\n }\n\n this.heap.splice(j);\n\n for (let i = parent(this.heap.length-1); i >= 0; i--) {\n this.percDown(i);\n }\n\n return this;\n }\n}\n\nfunction leftChi(i) {\n return (i<<1)+1;\n}\n\nfunction parent(i) {\n return ((i+1)>>1)-1;\n}\n\nfunction smaller(x, y) {\n if (x.priority !== y.priority) {\n return x.priority < y.priority;\n }\n else {\n return x.pushCount < y.pushCount;\n }\n}\n\n/**\n * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`.\n * Invoked with (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`,\n * except this returns a promise that rejects if an error occurs.\n * * The `unshift` and `unshiftAsync` methods were removed.\n */\nfunction priorityQueue(worker, concurrency) {\n // Start with a normal queue\n var q = queue$1(worker, concurrency);\n\n var {\n push,\n pushAsync\n } = q;\n\n q._tasks = new Heap();\n q._createTaskItem = ({data, priority}, callback) => {\n return {\n data,\n priority,\n callback\n };\n };\n\n function createDataItems(tasks, priority) {\n if (!Array.isArray(tasks)) {\n return {data: tasks, priority};\n }\n return tasks.map(data => { return {data, priority}; });\n }\n\n // Override push to accept second parameter representing priority\n q.push = function(data, priority = 0, callback) {\n return push(createDataItems(data, priority), callback);\n };\n\n q.pushAsync = function(data, priority = 0, callback) {\n return pushAsync(createDataItems(data, priority), callback);\n };\n\n // Remove unshift functions\n delete q.unshift;\n delete q.unshiftAsync;\n\n return q;\n}\n\n/**\n * Runs the `tasks` array of functions in parallel, without waiting until the\n * previous function has completed. Once any of the `tasks` complete or pass an\n * error to its callback, the main `callback` is immediately called. It's\n * equivalent to `Promise.race()`.\n *\n * @name race\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}\n * to run. Each function can complete with an optional `result` value.\n * @param {Function} callback - A callback to run once any of the functions have\n * completed. This function gets an error or result from the first function that\n * completed. Invoked with (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * async.race([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ],\n * // main callback\n * function(err, result) {\n * // the result will be equal to 'two' as it finishes earlier\n * });\n */\nfunction race(tasks, callback) {\n callback = once(callback);\n if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));\n if (!tasks.length) return callback();\n for (var i = 0, l = tasks.length; i < l; i++) {\n wrapAsync(tasks[i])(callback);\n }\n}\n\nvar race$1 = awaitify(race, 2);\n\n/**\n * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.\n *\n * @name reduceRight\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reduce]{@link module:Collections.reduce}\n * @alias foldr\n * @category Collection\n * @param {Array} array - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee completes with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction reduceRight (array, memo, iteratee, callback) {\n var reversed = [...array].reverse();\n return reduce$1(reversed, memo, iteratee, callback);\n}\n\n/**\n * Wraps the async function in another function that always completes with a\n * result object, even when it errors.\n *\n * The result object has either the property `error` or `value`.\n *\n * @name reflect\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function you want to wrap\n * @returns {Function} - A function that always passes null to it's callback as\n * the error. The second argument to the callback will be an `object` with\n * either an `error` or a `value` property.\n * @example\n *\n * async.parallel([\n * async.reflect(function(callback) {\n * // do some stuff ...\n * callback(null, 'one');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff but error ...\n * callback('bad stuff happened');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff ...\n * callback(null, 'two');\n * })\n * ],\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = 'bad stuff happened'\n * // results[2].value = 'two'\n * });\n */\nfunction reflect(fn) {\n var _fn = wrapAsync(fn);\n return initialParams(function reflectOn(args, reflectCallback) {\n args.push((error, ...cbArgs) => {\n let retVal = {};\n if (error) {\n retVal.error = error;\n }\n if (cbArgs.length > 0){\n var value = cbArgs;\n if (cbArgs.length <= 1) {\n [value] = cbArgs;\n }\n retVal.value = value;\n }\n reflectCallback(null, retVal);\n });\n\n return _fn.apply(this, args);\n });\n}\n\n/**\n * A helper function that wraps an array or an object of functions with `reflect`.\n *\n * @name reflectAll\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.reflect]{@link module:Utils.reflect}\n * @category Util\n * @param {Array|Object|Iterable} tasks - The collection of\n * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.\n * @returns {Array} Returns an array of async functions, each wrapped in\n * `async.reflect`\n * @example\n *\n * let tasks = [\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * // do some more stuff but error ...\n * callback(new Error('bad stuff happened'));\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ];\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = Error('bad stuff happened')\n * // results[2].value = 'two'\n * });\n *\n * // an example using an object instead of an array\n * let tasks = {\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * two: function(callback) {\n * callback('two');\n * },\n * three: function(callback) {\n * setTimeout(function() {\n * callback(null, 'three');\n * }, 100);\n * }\n * };\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results.one.value = 'one'\n * // results.two.error = 'two'\n * // results.three.value = 'three'\n * });\n */\nfunction reflectAll(tasks) {\n var results;\n if (Array.isArray(tasks)) {\n results = tasks.map(reflect);\n } else {\n results = {};\n Object.keys(tasks).forEach(key => {\n results[key] = reflect.call(this, tasks[key]);\n });\n }\n return results;\n}\n\nfunction reject(eachfn, arr, _iteratee, callback) {\n const iteratee = wrapAsync(_iteratee);\n return _filter(eachfn, arr, (value, cb) => {\n iteratee(value, (err, v) => {\n cb(err, !v);\n });\n }, callback);\n}\n\n/**\n * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.reject(fileList, fileExists, function(err, results) {\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * });\n *\n * // Using Promises\n * async.reject(fileList, fileExists)\n * .then( results => {\n * console.log(results);\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.reject(fileList, fileExists);\n * console.log(results);\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction reject$1 (coll, iteratee, callback) {\n return reject(eachOf$1, coll, iteratee, callback)\n}\nvar reject$2 = awaitify(reject$1, 3);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name rejectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectLimit (coll, limit, iteratee, callback) {\n return reject(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar rejectLimit$1 = awaitify(rejectLimit, 4);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.\n *\n * @name rejectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectSeries (coll, iteratee, callback) {\n return reject(eachOfSeries$1, coll, iteratee, callback)\n}\nvar rejectSeries$1 = awaitify(rejectSeries, 3);\n\nfunction constant$1(value) {\n return function () {\n return value;\n }\n}\n\n/**\n * Attempts to get a successful response from `task` no more than `times` times\n * before returning an error. If the task is successful, the `callback` will be\n * passed the result of the successful task. If all attempts fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name retry\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @see [async.retryable]{@link module:ControlFlow.retryable}\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an\n * object with `times` and `interval` or a number.\n * * `times` - The number of attempts to make before giving up. The default\n * is `5`.\n * * `interval` - The time to wait between retries, in milliseconds. The\n * default is `0`. The interval may also be specified as a function of the\n * retry count (see example).\n * * `errorFilter` - An optional synchronous function that is invoked on\n * erroneous result. If it returns `true` the retry attempts will continue;\n * if the function returns `false` the retry flow is aborted with the current\n * attempt's error and result being returned to the final callback.\n * Invoked with (err).\n * * If `opts` is a number, the number specifies the number of times to retry,\n * with the default interval of `0`.\n * @param {AsyncFunction} task - An async function to retry.\n * Invoked with (callback).\n * @param {Function} [callback] - An optional callback which is called when the\n * task has succeeded, or after the final failed attempt. It receives the `err`\n * and `result` arguments of the last attempt at completing the `task`. Invoked\n * with (err, results).\n * @returns {Promise} a promise if no callback provided\n *\n * @example\n *\n * // The `retry` function can be used as a stand-alone control flow by passing\n * // a callback, as shown below:\n *\n * // try calling apiMethod 3 times\n * async.retry(3, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 3 times, waiting 200 ms between each retry\n * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 10 times with exponential backoff\n * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)\n * async.retry({\n * times: 10,\n * interval: function(retryCount) {\n * return 50 * Math.pow(2, retryCount);\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod the default 5 times no delay between each retry\n * async.retry(apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod only when error condition satisfies, all other\n * // errors will abort the retry control flow and return to final callback\n * async.retry({\n * errorFilter: function(err) {\n * return err.message === 'Temporary error'; // only retry on a specific error\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // to retry individual methods that are not as reliable within other\n * // control flow functions, use the `retryable` wrapper:\n * async.auto({\n * users: api.getUsers.bind(api),\n * payments: async.retryable(3, api.getPayments.bind(api))\n * }, function(err, results) {\n * // do something with the results\n * });\n *\n */\nconst DEFAULT_TIMES = 5;\nconst DEFAULT_INTERVAL = 0;\n\nfunction retry(opts, task, callback) {\n var options = {\n times: DEFAULT_TIMES,\n intervalFunc: constant$1(DEFAULT_INTERVAL)\n };\n\n if (arguments.length < 3 && typeof opts === 'function') {\n callback = task || promiseCallback();\n task = opts;\n } else {\n parseTimes(options, opts);\n callback = callback || promiseCallback();\n }\n\n if (typeof task !== 'function') {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n\n var _task = wrapAsync(task);\n\n var attempt = 1;\n function retryAttempt() {\n _task((err, ...args) => {\n if (err === false) return\n if (err && attempt++ < options.times &&\n (typeof options.errorFilter != 'function' ||\n options.errorFilter(err))) {\n setTimeout(retryAttempt, options.intervalFunc(attempt - 1));\n } else {\n callback(err, ...args);\n }\n });\n }\n\n retryAttempt();\n return callback[PROMISE_SYMBOL]\n}\n\nfunction parseTimes(acc, t) {\n if (typeof t === 'object') {\n acc.times = +t.times || DEFAULT_TIMES;\n\n acc.intervalFunc = typeof t.interval === 'function' ?\n t.interval :\n constant$1(+t.interval || DEFAULT_INTERVAL);\n\n acc.errorFilter = t.errorFilter;\n } else if (typeof t === 'number' || typeof t === 'string') {\n acc.times = +t || DEFAULT_TIMES;\n } else {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n}\n\n/**\n * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method\n * wraps a task and makes it retryable, rather than immediately calling it\n * with retries.\n *\n * @name retryable\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.retry]{@link module:ControlFlow.retry}\n * @category Control Flow\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n * options, exactly the same as from `retry`, except for a `opts.arity` that\n * is the arity of the `task` function, defaulting to `task.length`\n * @param {AsyncFunction} task - the asynchronous function to wrap.\n * This function will be passed any arguments passed to the returned wrapper.\n * Invoked with (...args, callback).\n * @returns {AsyncFunction} The wrapped function, which when invoked, will\n * retry on an error, based on the parameters specified in `opts`.\n * This function will accept the same parameters as `task`.\n * @example\n *\n * async.auto({\n * dep1: async.retryable(3, getFromFlakyService),\n * process: [\"dep1\", async.retryable(3, function (results, cb) {\n * maybeProcessData(results.dep1, cb);\n * })]\n * }, callback);\n */\nfunction retryable (opts, task) {\n if (!task) {\n task = opts;\n opts = null;\n }\n let arity = (opts && opts.arity) || task.length;\n if (isAsync(task)) {\n arity += 1;\n }\n var _task = wrapAsync(task);\n return initialParams((args, callback) => {\n if (args.length < arity - 1 || callback == null) {\n args.push(callback);\n callback = promiseCallback();\n }\n function taskFn(cb) {\n _task(...args, cb);\n }\n\n if (opts) retry(opts, taskFn, callback);\n else retry(taskFn, callback);\n\n return callback[PROMISE_SYMBOL]\n });\n}\n\n/**\n * Run the functions in the `tasks` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and `callback` is\n * immediately called with the value of the error. Otherwise, `callback`\n * receives an array of results when `tasks` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the `task` callbacks. Invoked\n * with (err, result).\n * @return {Promise} a promise, if no callback is passed\n * @example\n *\n * //Using Callbacks\n * async.series([\n * function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 'two');\n * }, 100);\n * }\n * ], function(err, results) {\n * console.log(results);\n * // results is equal to ['one','two']\n * });\n *\n * // an example using objects instead of arrays\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * });\n *\n * //Using Promises\n * async.series([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]).then(results => {\n * console.log(results);\n * // results is equal to ['one','two']\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // an example using an object instead of an array\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * }).then(results => {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.series([\n * function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 'two');\n * }, 100);\n * }\n * ]);\n * console.log(results);\n * // results is equal to ['one','two']\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // an example using an object instead of an array\n * async () => {\n * try {\n * let results = await async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * });\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction series(tasks, callback) {\n return parallel(eachOfSeries$1, tasks, callback);\n}\n\n/**\n * Returns `true` if at least one element in the `coll` satisfies an async test.\n * If any iteratee call returns `true`, the main `callback` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }\n *);\n *\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }\n *);\n *\n * // Using Promises\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists)\n * .then( result => {\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists)\n * .then( result => {\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists);\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * async () => {\n * try {\n * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists);\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction some(coll, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback)\n}\nvar some$1 = awaitify(some, 3);\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.\n *\n * @name someLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anyLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someLimit(coll, limit, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar someLimit$1 = awaitify(someLimit, 4);\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.\n *\n * @name someSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anySeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in series.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someSeries(coll, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar someSeries$1 = awaitify(someSeries, 3);\n\n/**\n * Sorts a list by the results of running each `coll` value through an async\n * `iteratee`.\n *\n * @name sortBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a value to use as the sort criteria as\n * its `result`.\n * Invoked with (item, callback).\n * @param {Function} callback - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is the items\n * from the original `coll` sorted by the values returned by the `iteratee`\n * calls. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback passed\n * @example\n *\n * // bigfile.txt is a file that is 251100 bytes in size\n * // mediumfile.txt is a file that is 11000 bytes in size\n * // smallfile.txt is a file that is 121 bytes in size\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes,\n * function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * }\n * );\n *\n * // By modifying the callback parameter the\n * // sorting order can be influenced:\n *\n * // ascending order\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) {\n * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) {\n * if (getFileSizeErr) return callback(getFileSizeErr);\n * callback(null, fileSize);\n * });\n * }, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * }\n * );\n *\n * // descending order\n * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) {\n * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) {\n * if (getFileSizeErr) {\n * return callback(getFileSizeErr);\n * }\n * callback(null, fileSize * -1);\n * });\n * }, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt']\n * }\n * }\n * );\n *\n * // Error handling\n * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes,\n * function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(results);\n * }\n * }\n * );\n *\n * // Using Promises\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error handling\n * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * (async () => {\n * try {\n * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes);\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * catch (err) {\n * console.log(err);\n * }\n * })();\n *\n * // Error handling\n * async () => {\n * try {\n * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes);\n * console.log(results);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction sortBy (coll, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return map$1(coll, (x, iterCb) => {\n _iteratee(x, (err, criteria) => {\n if (err) return iterCb(err);\n iterCb(err, {value: x, criteria});\n });\n }, (err, results) => {\n if (err) return callback(err);\n callback(null, results.sort(comparator).map(v => v.value));\n });\n\n function comparator(left, right) {\n var a = left.criteria, b = right.criteria;\n return a < b ? -1 : a > b ? 1 : 0;\n }\n}\nvar sortBy$1 = awaitify(sortBy, 3);\n\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be `'ETIMEDOUT'`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would `asyncFunc`.\n * @example\n *\n * function myFunction(foo, callback) {\n * doAsyncTask(foo, function(err, data) {\n * // handle errors\n * if (err) return callback(err);\n *\n * // do some stuff ...\n *\n * // return processed data\n * return callback(null, data);\n * });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call `wrapped` as you would `myFunction`\n * wrapped({ bar: 'bar' }, function(err, data) {\n * // if `myFunction` takes < 1000 ms to execute, `err`\n * // and `data` will have their expected values\n *\n * // else `err` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n var fn = wrapAsync(asyncFn);\n\n return initialParams((args, callback) => {\n var timedOut = false;\n var timer;\n\n function timeoutCallback() {\n var name = asyncFn.name || 'anonymous';\n var error = new Error('Callback function \"' + name + '\" timed out.');\n error.code = 'ETIMEDOUT';\n if (info) {\n error.info = info;\n }\n timedOut = true;\n callback(error);\n }\n\n args.push((...cbArgs) => {\n if (!timedOut) {\n callback(...cbArgs);\n clearTimeout(timer);\n }\n });\n\n // setup timer and call original function\n timer = setTimeout(timeoutCallback, milliseconds);\n fn(...args);\n });\n}\n\nfunction range(size) {\n var result = Array(size);\n while (size--) {\n result[size] = size;\n }\n return result;\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name timesLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} count - The number of times to run the function.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see [async.map]{@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesLimit(count, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(range(count), limit, _iteratee, callback);\n}\n\n/**\n * Calls the `iteratee` function `n` times, and accumulates results in the same\n * manner you would use with [map]{@link module:Collections.map}.\n *\n * @name times\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n * @example\n *\n * // Pretend this is some complicated async factory\n * var createUser = function(id, callback) {\n * callback(null, {\n * id: 'user' + id\n * });\n * };\n *\n * // generate 5 users\n * async.times(5, function(n, next) {\n * createUser(n, function(err, user) {\n * next(err, user);\n * });\n * }, function(err, users) {\n * // we should now have 5 users\n * });\n */\nfunction times (n, iteratee, callback) {\n return timesLimit(n, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n *\n * @name timesSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesSeries (n, iteratee, callback) {\n return timesLimit(n, 1, iteratee, callback)\n}\n\n/**\n * A relative of `reduce`. Takes an Object or Array, and iterates over each\n * element in parallel, each step potentially mutating an `accumulator` value.\n * The type of the accumulator defaults to the type of collection passed in.\n *\n * @name transform\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {*} [accumulator] - The initial state of the transform. If omitted,\n * it will default to an empty Object or Array, depending on the type of `coll`\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * collection that potentially modifies the accumulator.\n * Invoked with (accumulator, item, key, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the transformed accumulator.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n *\n * // helper function that returns human-readable size format from bytes\n * function formatBytes(bytes, decimals = 2) {\n * // implementation not included for brevity\n * return humanReadbleFilesize;\n * }\n *\n * const fileList = ['file1.txt','file2.txt','file3.txt'];\n *\n * // asynchronous function that returns the file size, transformed to human-readable format\n * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.\n * function transformFileSize(acc, value, key, callback) {\n * fs.stat(value, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * acc[key] = formatBytes(stat.size);\n * callback(null);\n * });\n * }\n *\n * // Using callbacks\n * async.transform(fileList, transformFileSize, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }\n * });\n *\n * // Using Promises\n * async.transform(fileList, transformFileSize)\n * .then(result => {\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * (async () => {\n * try {\n * let result = await async.transform(fileList, transformFileSize);\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }\n * catch (err) {\n * console.log(err);\n * }\n * })();\n *\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n *\n * // helper function that returns human-readable size format from bytes\n * function formatBytes(bytes, decimals = 2) {\n * // implementation not included for brevity\n * return humanReadbleFilesize;\n * }\n *\n * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' };\n *\n * // asynchronous function that returns the file size, transformed to human-readable format\n * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.\n * function transformFileSize(acc, value, key, callback) {\n * fs.stat(value, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * acc[key] = formatBytes(stat.size);\n * callback(null);\n * });\n * }\n *\n * // Using callbacks\n * async.transform(fileMap, transformFileSize, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }\n * });\n *\n * // Using Promises\n * async.transform(fileMap, transformFileSize)\n * .then(result => {\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.transform(fileMap, transformFileSize);\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction transform (coll, accumulator, iteratee, callback) {\n if (arguments.length <= 3 && typeof accumulator === 'function') {\n callback = iteratee;\n iteratee = accumulator;\n accumulator = Array.isArray(coll) ? [] : {};\n }\n callback = once(callback || promiseCallback());\n var _iteratee = wrapAsync(iteratee);\n\n eachOf$1(coll, (v, k, cb) => {\n _iteratee(accumulator, v, k, cb);\n }, err => callback(err, accumulator));\n return callback[PROMISE_SYMBOL]\n}\n\n/**\n * It runs each task in series but stops whenever any of the functions were\n * successful. If one of the tasks were successful, the `callback` will be\n * passed the result of the successful task. If all tasks fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name tryEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to\n * run, each function is passed a `callback(err, result)` it must call on\n * completion with an error `err` (which can be `null`) and an optional `result`\n * value.\n * @param {Function} [callback] - An optional callback which is called when one\n * of the tasks has succeeded, or all have failed. It receives the `err` and\n * `result` arguments of the last attempt at completing the `task`. Invoked with\n * (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n * async.tryEach([\n * function getDataFromFirstWebsite(callback) {\n * // Try getting the data from the first website\n * callback(err, data);\n * },\n * function getDataFromSecondWebsite(callback) {\n * // First website failed,\n * // Try getting the data from the backup website\n * callback(err, data);\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * Now do something with the data.\n * });\n *\n */\nfunction tryEach(tasks, callback) {\n var error = null;\n var result;\n return eachSeries$1(tasks, (task, taskCb) => {\n wrapAsync(task)((err, ...args) => {\n if (err === false) return taskCb(err);\n\n if (args.length < 2) {\n [result] = args;\n } else {\n result = args;\n }\n error = err;\n taskCb(err ? null : {});\n });\n }, () => callback(error, result));\n}\n\nvar tryEach$1 = awaitify(tryEach);\n\n/**\n * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n * unmemoized form. Handy for testing.\n *\n * @name unmemoize\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.memoize]{@link module:Utils.memoize}\n * @category Util\n * @param {AsyncFunction} fn - the memoized function\n * @returns {AsyncFunction} a function that calls the original unmemoized function\n */\nfunction unmemoize(fn) {\n return (...args) => {\n return (fn.unmemoized || fn)(...args);\n };\n}\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * var count = 0;\n * async.whilst(\n * function test(cb) { cb(null, count < 5); },\n * function iter(callback) {\n * count++;\n * setTimeout(function() {\n * callback(null, count);\n * }, 1000);\n * },\n * function (err, n) {\n * // 5 seconds have passed, n = 5\n * }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n callback = onlyOnce(callback);\n var _fn = wrapAsync(iteratee);\n var _test = wrapAsync(test);\n var results = [];\n\n function next(err, ...rest) {\n if (err) return callback(err);\n results = rest;\n if (err === false) return;\n _test(check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (err === false) return;\n if (!truth) return callback(null, ...results);\n _fn(next);\n }\n\n return _test(check);\n}\nvar whilst$1 = awaitify(whilst, 3);\n\n/**\n * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs. `callback` will be passed an error and any\n * arguments passed to the final `iteratee`'s callback.\n *\n * The inverse of [whilst]{@link module:ControlFlow.whilst}.\n *\n * @name until\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `iteratee`. Invoked with (callback).\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n * const results = []\n * let finished = false\n * async.until(function test(cb) {\n * cb(null, finished)\n * }, function iter(next) {\n * fetchPage(url, (err, body) => {\n * if (err) return next(err)\n * results = results.concat(body.objects)\n * finished = !!body.next\n * next(err)\n * })\n * }, function done (err) {\n * // all pages have been fetched\n * })\n */\nfunction until(test, iteratee, callback) {\n const _test = wrapAsync(test);\n return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback);\n}\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * async.waterfall([\n * function(callback) {\n * callback(null, 'one', 'two');\n * },\n * function(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * },\n * function(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n * myFirstFunction,\n * mySecondFunction,\n * myLastFunction,\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n * callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n */\nfunction waterfall (tasks, callback) {\n callback = once(callback);\n if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n if (!tasks.length) return callback();\n var taskIndex = 0;\n\n function nextTask(args) {\n var task = wrapAsync(tasks[taskIndex++]);\n task(...args, onlyOnce(next));\n }\n\n function next(err, ...args) {\n if (err === false) return\n if (err || taskIndex === tasks.length) {\n return callback(err, ...args);\n }\n nextTask(args);\n }\n\n nextTask([]);\n}\n\nvar waterfall$1 = awaitify(waterfall);\n\n/**\n * An \"async function\" in the context of Async is an asynchronous function with\n * a variable number of parameters, with the final parameter being a callback.\n * (`function (arg1, arg2, ..., callback) {}`)\n * The final callback is of the form `callback(err, results...)`, which must be\n * called once the function is completed. The callback should be called with a\n * Error as its first argument to signal that an error occurred.\n * Otherwise, if no error occurred, it should be called with `null` as the first\n * argument, and any additional `result` arguments that may apply, to signal\n * successful completion.\n * The callback must be called exactly once, ideally on a later tick of the\n * JavaScript event loop.\n *\n * This type of function is also referred to as a \"Node-style async function\",\n * or a \"continuation passing-style function\" (CPS). Most of the methods of this\n * library are themselves CPS/Node-style async functions, or functions that\n * return CPS/Node-style async functions.\n *\n * Wherever we accept a Node-style async function, we also directly accept an\n * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.\n * In this case, the `async` function will not be passed a final callback\n * argument, and any thrown error will be used as the `err` argument of the\n * implicit callback, and the return value will be used as the `result` value.\n * (i.e. a `rejected` of the returned Promise becomes the `err` callback\n * argument, and a `resolved` value becomes the `result`.)\n *\n * Note, due to JavaScript limitations, we can only detect native `async`\n * functions and not transpilied implementations.\n * Your environment must have `async`/`await` support for this to work.\n * (e.g. Node > v7.6, or a recent version of a modern browser).\n * If you are using `async` functions through a transpiler (e.g. Babel), you\n * must still wrap the function with [asyncify]{@link module:Utils.asyncify},\n * because the `async function` will be compiled to an ordinary function that\n * returns a promise.\n *\n * @typedef {Function} AsyncFunction\n * @static\n */\n\nvar index = {\n apply,\n applyEach: applyEach$1,\n applyEachSeries,\n asyncify,\n auto,\n autoInject,\n cargo,\n cargoQueue: cargo$1,\n compose,\n concat: concat$1,\n concatLimit: concatLimit$1,\n concatSeries: concatSeries$1,\n constant,\n detect: detect$1,\n detectLimit: detectLimit$1,\n detectSeries: detectSeries$1,\n dir,\n doUntil,\n doWhilst: doWhilst$1,\n each,\n eachLimit: eachLimit$2,\n eachOf: eachOf$1,\n eachOfLimit: eachOfLimit$2,\n eachOfSeries: eachOfSeries$1,\n eachSeries: eachSeries$1,\n ensureAsync,\n every: every$1,\n everyLimit: everyLimit$1,\n everySeries: everySeries$1,\n filter: filter$1,\n filterLimit: filterLimit$1,\n filterSeries: filterSeries$1,\n forever: forever$1,\n groupBy,\n groupByLimit: groupByLimit$1,\n groupBySeries,\n log,\n map: map$1,\n mapLimit: mapLimit$1,\n mapSeries: mapSeries$1,\n mapValues,\n mapValuesLimit: mapValuesLimit$1,\n mapValuesSeries,\n memoize,\n nextTick,\n parallel: parallel$1,\n parallelLimit,\n priorityQueue,\n queue: queue$1,\n race: race$1,\n reduce: reduce$1,\n reduceRight,\n reflect,\n reflectAll,\n reject: reject$2,\n rejectLimit: rejectLimit$1,\n rejectSeries: rejectSeries$1,\n retry,\n retryable,\n seq,\n series,\n setImmediate: setImmediate$1,\n some: some$1,\n someLimit: someLimit$1,\n someSeries: someSeries$1,\n sortBy: sortBy$1,\n timeout,\n times,\n timesLimit,\n timesSeries,\n transform,\n tryEach: tryEach$1,\n unmemoize,\n until,\n waterfall: waterfall$1,\n whilst: whilst$1,\n\n // aliases\n all: every$1,\n allLimit: everyLimit$1,\n allSeries: everySeries$1,\n any: some$1,\n anyLimit: someLimit$1,\n anySeries: someSeries$1,\n find: detect$1,\n findLimit: detectLimit$1,\n findSeries: detectSeries$1,\n flatMap: concat$1,\n flatMapLimit: concatLimit$1,\n flatMapSeries: concatSeries$1,\n forEach: each,\n forEachSeries: eachSeries$1,\n forEachLimit: eachLimit$2,\n forEachOf: eachOf$1,\n forEachOfSeries: eachOfSeries$1,\n forEachOfLimit: eachOfLimit$2,\n inject: reduce$1,\n foldl: reduce$1,\n foldr: reduceRight,\n select: filter$1,\n selectLimit: filterLimit$1,\n selectSeries: filterSeries$1,\n wrapSync: asyncify,\n during: whilst$1,\n doDuring: doWhilst$1\n};\n\nexport default index;\nexport { apply, applyEach$1 as applyEach, applyEachSeries, asyncify, auto, autoInject, cargo, cargo$1 as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doUntil, doWhilst$1 as doWhilst, each, eachLimit$2 as eachLimit, eachOf$1 as eachOf, eachOfLimit$2 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel$1 as parallel, parallelLimit, priorityQueue, queue$1 as queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$2 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, each as forEach, eachSeries$1 as forEachSeries, eachLimit$2 as forEachLimit, eachOf$1 as forEachOf, eachOfSeries$1 as forEachOfSeries, eachOfLimit$2 as forEachOfLimit, reduce$1 as inject, reduce$1 as foldl, reduceRight as foldr, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, asyncify as wrapSync, whilst$1 as during, doWhilst$1 as doDuring };\n",";(function () { // closure for web browsers\n\nif (typeof module === 'object' && module.exports) {\n module.exports = LRUCache\n} else {\n // just set the global for non-node platforms.\n this.LRUCache = LRUCache\n}\n\nfunction hOP (obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key)\n}\n\nfunction naiveLength () { return 1 }\n\nfunction LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n var max\n if (typeof options === 'number') {\n max = options\n options = { max: max }\n }\n\n if (!options) options = {}\n\n max = options.max\n\n var lengthCalculator = options.length || naiveLength\n\n if (typeof lengthCalculator !== \"function\") {\n lengthCalculator = naiveLength\n }\n\n if (!max || !(typeof max === \"number\") || max <= 0 ) {\n // a little bit silly. maybe this should throw?\n max = Infinity\n }\n\n var allowStale = options.stale || false\n\n var maxAge = options.maxAge || null\n\n var dispose = options.dispose\n\n var cache = Object.create(null) // hash of items by key\n , lruList = Object.create(null) // list of items in order of use recency\n , mru = 0 // most recently used\n , lru = 0 // least recently used\n , length = 0 // number of items in the list\n , itemCount = 0\n\n\n // resize the cache when the max changes.\n Object.defineProperty(this, \"max\",\n { set : function (mL) {\n if (!mL || !(typeof mL === \"number\") || mL <= 0 ) mL = Infinity\n max = mL\n // if it gets above double max, trim right away.\n // otherwise, do it whenever it's convenient.\n if (length > max) trim()\n }\n , get : function () { return max }\n , enumerable : true\n })\n\n // resize the cache when the lengthCalculator changes.\n Object.defineProperty(this, \"lengthCalculator\",\n { set : function (lC) {\n if (typeof lC !== \"function\") {\n lengthCalculator = naiveLength\n length = itemCount\n for (var key in cache) {\n cache[key].length = 1\n }\n } else {\n lengthCalculator = lC\n length = 0\n for (var key in cache) {\n cache[key].length = lengthCalculator(cache[key].value)\n length += cache[key].length\n }\n }\n\n if (length > max) trim()\n }\n , get : function () { return lengthCalculator }\n , enumerable : true\n })\n\n Object.defineProperty(this, \"length\",\n { get : function () { return length }\n , enumerable : true\n })\n\n\n Object.defineProperty(this, \"itemCount\",\n { get : function () { return itemCount }\n , enumerable : true\n })\n\n this.forEach = function (fn, thisp) {\n thisp = thisp || this\n var i = 0;\n for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) {\n i++\n var hit = lruList[k]\n fn.call(thisp, hit.value, hit.key, this)\n }\n }\n\n this.keys = function () {\n var keys = new Array(itemCount)\n var i = 0\n for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) {\n var hit = lruList[k]\n keys[i++] = hit.key\n }\n return keys\n }\n\n this.values = function () {\n var values = new Array(itemCount)\n var i = 0\n for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) {\n var hit = lruList[k]\n values[i++] = hit.value\n }\n return values\n }\n\n this.reset = function () {\n if (dispose) {\n for (var k in cache) {\n dispose(k, cache[k].value)\n }\n }\n cache = {}\n lruList = {}\n lru = 0\n mru = 0\n length = 0\n itemCount = 0\n }\n\n // Provided for debugging/dev purposes only. No promises whatsoever that\n // this API stays stable.\n this.dump = function () {\n return cache\n }\n\n this.dumpLru = function () {\n return lruList\n }\n\n this.set = function (key, value) {\n if (hOP(cache, key)) {\n // dispose of the old one before overwriting\n if (dispose) dispose(key, cache[key].value)\n if (maxAge) cache[key].now = Date.now()\n cache[key].value = value\n this.get(key)\n return true\n }\n\n var len = lengthCalculator(value)\n var age = maxAge ? Date.now() : 0\n var hit = new Entry(key, value, mru++, len, age)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > max) {\n if (dispose) dispose(key, value)\n return false\n }\n\n length += hit.length\n lruList[hit.lu] = cache[key] = hit\n itemCount ++\n\n if (length > max) trim()\n return true\n }\n\n this.has = function (key) {\n if (!hOP(cache, key)) return false\n var hit = cache[key]\n if (maxAge && (Date.now() - hit.now > maxAge)) {\n return false\n }\n return true\n }\n\n this.get = function (key) {\n if (!hOP(cache, key)) return\n var hit = cache[key]\n if (maxAge && (Date.now() - hit.now > maxAge)) {\n this.del(key)\n return allowStale ? hit.value : undefined\n }\n shiftLU(hit)\n hit.lu = mru ++\n lruList[hit.lu] = hit\n return hit.value\n }\n\n this.del = function (key) {\n del(cache[key])\n }\n\n function trim () {\n while (lru < mru && length > max)\n del(lruList[lru])\n }\n\n function shiftLU(hit) {\n delete lruList[ hit.lu ]\n while (lru < mru && !lruList[lru]) lru ++\n }\n\n function del(hit) {\n if (hit) {\n if (dispose) dispose(hit.key, hit.value)\n length -= hit.length\n itemCount --\n delete cache[ hit.key ]\n shiftLU(hit)\n }\n }\n}\n\n// classy, since V8 prefers predictable objects.\nfunction Entry (key, value, mru, len, age) {\n this.key = key\n this.value = value\n this.lu = mru\n this.length = len\n this.now = age\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\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/**\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 '<dir>/..' 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\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\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 = hasNativeMap ? new Map() : 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 hasNativeMap ? this._set.size : 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 = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : 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 if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\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 if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\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 if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\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 2014 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');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\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 base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\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\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","/* -*- 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 SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex];\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex];\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","var SourceMapConsumer = require('source-map').SourceMapConsumer;\nvar path = require('path');\nvar fs = require('fs');\n\n/**\n * Uses Node source-map to map transpiled JS stack locations to original\n * source file locations.\n *\n * The default behavior uses source map comments in the transpiled files\n * to identify the path of source maps. A later enhancement can allow\n * source map paths to be passed in by the caller.\n *\n * These functions are based on https://github.com/evanw/node-source-map-support/blob/master/source-map-support.js\n * simplified to target Node only, and optimized for Rollbar configuration scenarios.\n */\n\n// Maps a file path to a string containing the file contents\nvar fileContentsCache = {};\n\n// Maps a file path to a source map for that file\nvar sourceMapCache = {};\n\n// Maps a file path to sourcesContent string\nvar sourcesContentCache = {};\n\n// Regex for detecting source maps\nvar reSourceMap = /^data:application\\/json[^,]+base64,/;\n\nfunction retrieveFile(path) {\n // Trim the path to make sure there is no extra whitespace.\n path = path.trim();\n if (/^file:/.test(path)) {\n // existsSync/readFileSync can't handle file protocol, but once stripped, it works\n path = path.replace(/file:\\/\\/\\/(\\w:)?/, function(_protocol, drive) {\n return drive ?\n '' : // file:///C:/dir/file -> C:/dir/file\n '/'; // file:///root-dir/file -> /root-dir/file\n });\n }\n if (path in fileContentsCache) {\n return fileContentsCache[path];\n }\n\n var contents = '';\n try {\n if (fs.existsSync(path)) {\n contents = fs.readFileSync(path, 'utf8');\n }\n } catch (er) {\n /* ignore any errors */\n }\n\n return fileContentsCache[path] = contents;\n}\n\n// Support URLs relative to a directory, but be careful about a protocol prefix\n// in case we are in the browser (i.e. directories may start with \"http://\" or \"file:///\")\nfunction supportRelativeURL(file, url) {\n if (!file) return url;\n var dir = path.dirname(file);\n var match = /^\\w+:\\/\\/[^\\/]*/.exec(dir);\n var protocol = match ? match[0] : '';\n var startPath = dir.slice(protocol.length);\n if (protocol && /^\\/\\w\\:/.test(startPath)) {\n // handle file:///C:/ paths\n protocol += '/';\n return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\\\/g, '/');\n }\n return protocol + path.resolve(dir.slice(protocol.length), url);\n}\n\nfunction retrieveSourceMapURL(source) {\n var fileData;\n\n // Get the URL of the source map\n fileData = retrieveFile(source);\n var re = /(?:\\/\\/[@#][ \\t]+sourceMappingURL=([^\\s'\"]+?)[ \\t]*$)|(?:\\/\\*[@#][ \\t]+sourceMappingURL=([^\\*]+?)[ \\t]*(?:\\*\\/)[ \\t]*$)/mg;\n // Keep executing the search to find the *last* sourceMappingURL to avoid\n // picking up sourceMappingURLs from comments, strings, etc.\n var lastMatch, match;\n while ((match = re.exec(fileData))) lastMatch = match;\n if (!lastMatch) return null;\n return lastMatch[1];\n}\n\n// Takes a generated source filename; returns a {map, optional url} object, or null if\n// there is no source map. The map field may be either a string or the parsed\n// JSON object (ie, it must be a valid argument to the SourceMapConsumer\n// constructor).\nfunction retrieveSourceMap(source) {\n var sourceMappingURL = retrieveSourceMapURL(source);\n if (!sourceMappingURL) return null;\n\n // Read the contents of the source map\n var sourceMapData;\n if (reSourceMap.test(sourceMappingURL)) {\n // Support source map URL as a data url\n var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1);\n sourceMapData = Buffer.from(rawData, 'base64').toString();\n sourceMappingURL = source;\n } else {\n // Support source map URLs relative to the source URL\n sourceMappingURL = supportRelativeURL(source, sourceMappingURL);\n sourceMapData = retrieveFile(sourceMappingURL);\n }\n\n if (!sourceMapData) {\n return null;\n }\n\n return {\n url: sourceMappingURL,\n map: sourceMapData\n };\n}\n\nfunction cacheSourceContent(sourceMap, originalSource, newSource) {\n if (sourcesContentCache[newSource]) {\n return;\n }\n\n // The sourceContentFor lookup needs the original source url as found in the\n // map file. However the client lookup in sourcesContentCache will use\n // a rewritten form of the url, hence originalSource and newSource.\n sourcesContentCache[newSource] = sourceMap.map.sourceContentFor(originalSource, true);\n}\n\nexports.mapSourcePosition = function mapSourcePosition(position, diagnostic) {\n var sourceMap = sourceMapCache[position.source];\n if (!sourceMap) {\n // Call the (overrideable) retrieveSourceMap function to get the source map.\n var urlAndMap = retrieveSourceMap(position.source);\n if (urlAndMap) {\n sourceMap = sourceMapCache[position.source] = {\n url: urlAndMap.url,\n map: new SourceMapConsumer(urlAndMap.map)\n };\n diagnostic.node_source_maps.source_mapping_urls[position.source] = urlAndMap.url;\n\n // Load all sources stored inline with the source map into the file cache\n // to pretend like they are already loaded. They may not exist on disk.\n if (sourceMap.map.sourcesContent) {\n sourceMap.map.sources.forEach(function(source, i) {\n var contents = sourceMap.map.sourcesContent[i];\n if (contents) {\n var url = supportRelativeURL(sourceMap.url, source);\n fileContentsCache[url] = contents;\n }\n });\n }\n } else {\n sourceMap = sourceMapCache[position.source] = {\n url: null,\n map: null\n };\n diagnostic.node_source_maps.source_mapping_urls[position.source] = 'not found';\n }\n }\n\n // Resolve the source URL relative to the URL of the source map\n if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') {\n var originalPosition = sourceMap.map.originalPositionFor(position);\n\n // Only return the original position if a matching line was found. If no\n // matching line is found then we return position instead, which will cause\n // the stack trace to print the path and line for the compiled file. It is\n // better to give a precise location in the compiled file than a vague\n // location in the original file.\n if (originalPosition.source !== null) {\n var originalSource = originalPosition.source;\n originalPosition.source = supportRelativeURL(\n sourceMap.url, originalPosition.source);\n cacheSourceContent(sourceMap, originalSource, originalPosition.source);\n return originalPosition;\n }\n }\n\n return position;\n}\n\nexports.sourceContent = function sourceContent(source) {\n return sourcesContentCache[source];\n}\n","'use strict';\n\nvar logger = require('./logger');\nvar async = require('async');\nvar fs = require('fs');\nvar lru = require('lru-cache');\nvar util = require('util');\nvar stackTrace = require('./sourceMap/stackTrace');\n\nvar linesOfContext = 3;\nvar tracePattern =\n /^\\s*at (?:([^(]+(?: \\[\\w\\s+\\])?(?:.*\\)*)) )?\\(?(.+?)(?::(\\d+):(\\d+)(?:, <js>:(\\d+):(\\d+))?)?\\)?$/;\n\nvar jadeTracePattern = /^\\s*at .+ \\(.+ (at[^)]+\\))\\)$/;\nvar jadeFramePattern = /^\\s*(>?) [0-9]+\\|(\\s*.+)$/m;\n\n\nvar cache = new lru({max: 100});\nvar pendingReads = {};\n\nexports.cache = cache;\nexports.pendingReads = pendingReads;\n\n\n/*\n * Internal\n */\n\n\nfunction getMultipleErrors(errors) {\n var errArray, key;\n\n if (errors === null || errors === undefined) {\n return null;\n }\n\n if (typeof errors !== 'object') {\n return null;\n }\n\n if (util.isArray(errors)) {\n return errors;\n }\n\n errArray = [];\n\n for (key in errors) {\n if (Object.prototype.hasOwnProperty.call(errors, key)) {\n errArray.push(errors[key]);\n }\n }\n return errArray;\n}\n\n\nfunction parseJadeDebugFrame(body) {\n var lines, lineNumSep, filename, lineno, numLines, msg, i,\n contextLine, preContext, postContext, line, jadeMatch;\n\n // Given a Jade exception body, return a frame object\n lines = body.split('\\n');\n lineNumSep = lines[0].indexOf(':');\n filename = lines[0].slice(0, lineNumSep);\n lineno = parseInt(lines[0].slice(lineNumSep + 1), 10);\n numLines = lines.length;\n msg = lines[numLines - 1];\n\n lines = lines.slice(1, numLines - 1);\n\n preContext = [];\n postContext = [];\n for (i = 0; i < numLines - 2; ++i) {\n line = lines[i];\n jadeMatch = line.match(jadeFramePattern);\n if (jadeMatch) {\n if (jadeMatch[1] === '>') {\n contextLine = jadeMatch[2];\n } else {\n if (!contextLine) {\n if (jadeMatch[2]) {\n preContext.push(jadeMatch[2]);\n }\n } else {\n if (jadeMatch[2]) {\n postContext.push(jadeMatch[2]);\n }\n }\n }\n }\n }\n\n preContext = preContext.slice(0, Math.min(preContext.length, linesOfContext));\n postContext = postContext.slice(0, Math.min(postContext.length, linesOfContext));\n\n return {\n frame: {\n method: '<jade>',\n filename: filename,\n lineno: lineno,\n code: contextLine,\n context: {\n pre: preContext,\n post: postContext\n }\n },\n message: msg\n };\n}\n\n\nfunction extractContextLines(frame, fileLines) {\n frame.code = fileLines[frame.lineno - 1];\n frame.context = {\n pre: fileLines.slice(Math.max(0, frame.lineno - (linesOfContext + 1)), frame.lineno - 1),\n post: fileLines.slice(frame.lineno, frame.lineno + linesOfContext)\n };\n}\n\nfunction mapPosition(position, diagnostic) {\n return stackTrace.mapSourcePosition({\n source: position.source,\n line: position.line,\n column: position.column\n },\n diagnostic\n );\n}\n\nfunction parseFrameLine(line, callback) {\n var matched, curLine, data, frame, position;\n\n curLine = line;\n matched = curLine.match(jadeTracePattern);\n if (matched) {\n curLine = matched[1];\n }\n\n matched = curLine.match(tracePattern);\n if (!matched) {\n return callback(null, null);\n }\n\n data = matched.slice(1);\n var runtimePosition = {\n source: data[1],\n line: Math.floor(data[2]),\n column: Math.floor(data[3]) - 1\n };\n if (this.useSourceMaps) {\n position = mapPosition(runtimePosition, this.diagnostic);\n } else {\n position = runtimePosition;\n }\n\n frame = {\n method: data[0] || '<unknown>',\n filename: position.source,\n lineno: position.line,\n colno: position.column,\n runtimePosition: runtimePosition // Used to match frames for locals\n };\n\n // For coffeescript, lineno and colno refer to the .coffee positions\n // The .js lineno and colno will be stored in compiled_*\n if (data[4]) {\n frame.compiled_lineno = Math.floor(data[4]);\n }\n\n if (data[5]) {\n frame.compiled_colno = Math.floor(data[5]);\n }\n\n callback(null, frame);\n}\n\n\nfunction shouldReadFrameFile(frameFilename, callback) {\n var isValidFilename, isCached, isPending;\n\n isValidFilename = frameFilename[0] === '/' || frameFilename[0] === '.';\n isCached = !!cache.get(frameFilename);\n isPending = !!pendingReads[frameFilename];\n\n callback(null, isValidFilename && !isCached && !isPending);\n}\n\n\nfunction readFileLines(filename, callback) {\n try {\n fs.readFile(filename, function (err, fileData) {\n var fileLines;\n if (err) {\n return callback(err);\n }\n\n fileLines = fileData.toString('utf8').split('\\n');\n return callback(null, fileLines);\n });\n } catch (e) {\n logger.log(e);\n }\n}\n\nfunction checkFileExists(filename, callback) {\n if (stackTrace.sourceContent(filename)) {\n return callback(null, true);\n }\n fs.stat(filename, function (err) {\n callback(null, !err);\n });\n}\n\n\nfunction gatherContexts(frames, callback) {\n var frameFilenames = [];\n\n frames.forEach(function (frame) {\n if (frameFilenames.indexOf(frame.filename) === -1) {\n frameFilenames.push(frame.filename);\n }\n });\n\n async.filter(frameFilenames, shouldReadFrameFile, function (err, results) {\n if (err) return callback(err);\n\n var tempFileCache;\n\n tempFileCache = {};\n\n function cacheLines(filename, lines) {\n // Cache this in a temp cache as well as the LRU cache so that\n // we know we will have all of the necessary file contents for\n // each filename in tempFileCache.\n tempFileCache[filename] = lines;\n cache.set(filename, lines);\n }\n\n function gatherFileData(filename, callback) {\n var sourceContent = stackTrace.sourceContent(filename);\n if (sourceContent) {\n try {\n var lines = sourceContent.split('\\n');\n cacheLines(filename, lines);\n return callback(null);\n } catch (err) {\n return callback(err);\n }\n }\n readFileLines(filename, function (err, lines) {\n if (err) {\n return callback(err);\n }\n\n cacheLines(filename, lines);\n\n return callback(null);\n });\n }\n\n function gatherContextLines(frame, callback) {\n var lines = tempFileCache[frame.filename] || cache.get(frame.filename);\n\n if (lines) {\n extractContextLines(frame, lines);\n }\n callback(null);\n }\n\n async.filter(results, checkFileExists, function (err, filenames) {\n if (err) return callback(err);\n async.each(filenames, gatherFileData, function (err) {\n if (err) {\n return callback(err);\n }\n async.eachSeries(frames, gatherContextLines, function (err) {\n if (err) {\n return callback(err);\n }\n callback(null, frames);\n });\n });\n });\n\n });\n}\n\n/*\n * Public API\n */\n\n\nexports.parseException = function (exc, options, item, callback) {\n var multipleErrs = getMultipleErrors(exc.errors);\n\n return exports.parseStack(exc.stack, options, item, function (err, stack) {\n var message, clss, ret, firstErr, jadeMatch, jadeData;\n\n if (err) {\n logger.error('could not parse exception, err: ' + err);\n return callback(err);\n }\n message = String(exc.message || '<no message>') ;\n clss = String(exc.name || '<unknown>');\n\n ret = {\n class: clss,\n message: message,\n frames: stack\n };\n\n if (multipleErrs && multipleErrs.length) {\n firstErr = multipleErrs[0];\n ret = {\n class: clss,\n message: String(firstErr.message || '<no message>'),\n frames: stack\n };\n }\n\n jadeMatch = message.match(jadeFramePattern);\n if (jadeMatch) {\n jadeData = parseJadeDebugFrame(message);\n ret.message = jadeData.message;\n ret.frames.push(jadeData.frame);\n }\n\n if (item.localsMap) {\n item.notifier.locals.mergeLocals(item.localsMap, stack, exc.stack, function (err) {\n if (err) {\n logger.error('could not parse locals, err: ' + err);\n\n // Don't reject the occurrence, record the error instead.\n item.diagnostic['error parsing locals'] = err;\n }\n\n return callback(null, ret);\n });\n } else {\n return callback(null, ret);\n }\n });\n};\n\n\nexports.parseStack = function (stack, options, item, callback) {\n var lines, _stack = stack;\n\n // Some JS frameworks (e.g. Meteor) might bury the stack property\n while (typeof _stack === 'object') {\n _stack = _stack && _stack.stack;\n }\n\n // grab all lines except the first\n lines = (_stack || '').split('\\n').slice(1);\n\n if (options.nodeSourceMaps) {\n item.diagnostic.node_source_maps = {};\n item.diagnostic.node_source_maps.source_mapping_urls = {};\n }\n\n // Parse out all of the frame and filename info\n async.map(lines, parseFrameLine.bind({ useSourceMaps: options.nodeSourceMaps, diagnostic: item.diagnostic }), function (err, frames) {\n if (err) {\n return callback(err);\n }\n frames.reverse();\n async.filter(frames, function (frame, callback) { callback(null, !!frame); }, function (err, results) {\n if (err) return callback(err);\n gatherContexts(results, callback);\n });\n });\n};\n","\"use strict\";\n\nvar regexes = {\n ipv4: /^(?:(?:\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])$/,\n ipv6: /^((?=.*::)(?!.*::.+::)(::)?([\\dA-F]{1,4}:(:|\\b)|){5}|([\\dA-F]{1,4}:){6})((([\\dA-F]{1,4}((?!\\3)::|:\\b|$))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})$/i\n};\n\nfunction not(func) {\n return function () {\n return !func.apply(null, Array.prototype.slice.call(arguments));\n };\n}\n\nfunction existy(value) {\n return value != null;\n}\n\nfunction ip(value) {\n return existy(value) && regexes.ipv4.test(value) || regexes.ipv6.test(value);\n}\n\nfunction object(value) {\n return Object(value) === value;\n}\n\nfunction string(value) {\n return Object.prototype.toString.call(value) === '[object String]';\n}\n\nvar is = {\n existy: existy,\n ip: ip,\n object: object,\n string: string,\n not: {\n existy: not(existy),\n ip: not(ip),\n object: not(object),\n string: not(string)\n }\n};\nmodule.exports = is;","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar is = require('./is');\n\nfunction getClientIpFromXForwardedFor(value) {\n if (!is.existy(value)) {\n return null;\n }\n\n if (is.not.string(value)) {\n throw new TypeError(\"Expected a string, got \\\"\".concat(_typeof(value), \"\\\"\"));\n }\n\n var forwardedIps = value.split(',').map(function (e) {\n var ip = e.trim();\n\n if (ip.includes(':')) {\n var splitted = ip.split(':');\n\n if (splitted.length === 2) {\n return splitted[0];\n }\n }\n\n return ip;\n });\n\n for (var i = 0; i < forwardedIps.length; i++) {\n if (is.ip(forwardedIps[i])) {\n return forwardedIps[i];\n }\n }\n\n return null;\n}\n\nfunction getClientIp(req) {\n if (req.headers) {\n if (is.ip(req.headers['x-client-ip'])) {\n return req.headers['x-client-ip'];\n }\n\n var xForwardedFor = getClientIpFromXForwardedFor(req.headers['x-forwarded-for']);\n\n if (is.ip(xForwardedFor)) {\n return xForwardedFor;\n }\n\n if (is.ip(req.headers['cf-connecting-ip'])) {\n return req.headers['cf-connecting-ip'];\n }\n\n if (is.ip(req.headers['fastly-client-ip'])) {\n return req.headers['fastly-client-ip'];\n }\n\n if (is.ip(req.headers['true-client-ip'])) {\n return req.headers['true-client-ip'];\n }\n\n if (is.ip(req.headers['x-real-ip'])) {\n return req.headers['x-real-ip'];\n }\n\n if (is.ip(req.headers['x-cluster-client-ip'])) {\n return req.headers['x-cluster-client-ip'];\n }\n\n if (is.ip(req.headers['x-forwarded'])) {\n return req.headers['x-forwarded'];\n }\n\n if (is.ip(req.headers['forwarded-for'])) {\n return req.headers['forwarded-for'];\n }\n\n if (is.ip(req.headers.forwarded)) {\n return req.headers.forwarded;\n }\n\n if (is.ip(req.headers['x-appengine-user-ip'])) {\n return req.headers['x-appengine-user-ip'];\n }\n }\n\n if (is.existy(req.connection)) {\n if (is.ip(req.connection.remoteAddress)) {\n return req.connection.remoteAddress;\n }\n\n if (is.existy(req.connection.socket) && is.ip(req.connection.socket.remoteAddress)) {\n return req.connection.socket.remoteAddress;\n }\n }\n\n if (is.existy(req.socket) && is.ip(req.socket.remoteAddress)) {\n return req.socket.remoteAddress;\n }\n\n if (is.existy(req.info) && is.ip(req.info.remoteAddress)) {\n return req.info.remoteAddress;\n }\n\n if (is.existy(req.requestContext) && is.existy(req.requestContext.identity) && is.ip(req.requestContext.identity.sourceIp)) {\n return req.requestContext.identity.sourceIp;\n }\n\n if (req.headers) {\n if (is.ip(req.headers['Cf-Pseudo-IPv4'])) {\n return req.headers['Cf-Pseudo-IPv4'];\n }\n }\n\n if (is.existy(req.raw)) {\n return getClientIp(req.raw);\n }\n\n return null;\n}\n\nfunction mw(options) {\n var configuration = is.not.existy(options) ? {} : options;\n\n if (is.not.object(configuration)) {\n throw new TypeError('Options must be an object!');\n }\n\n var attributeName = configuration.attributeName || 'clientIp';\n return function (req, res, next) {\n var ip = getClientIp(req);\n Object.defineProperty(req, attributeName, {\n get: function get() {\n return ip;\n },\n configurable: true\n });\n next();\n };\n}\n\nmodule.exports = {\n getClientIpFromXForwardedFor: getClientIpFromXForwardedFor,\n getClientIp: getClientIp,\n mw: mw\n};","var _ = require('./utility');\nvar traverse = require('./utility/traverse');\n\nfunction scrub(data, scrubFields, scrubPaths) {\n scrubFields = scrubFields || [];\n\n if (scrubPaths) {\n for (var i = 0; i < scrubPaths.length; ++i) {\n scrubPath(data, scrubPaths[i]);\n }\n }\n\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + _.redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (_.isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = _.redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (_.isType(v, 'object') || _.isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber);\n}\n\nfunction scrubPath(obj, path) {\n var keys = path.split('.');\n var last = keys.length - 1;\n try {\n for (var i = 0; i <= last; ++i) {\n if (i < last) {\n obj = obj[keys[i]];\n } else {\n obj[keys[i]] = _.redact();\n }\n }\n } catch (e) {\n // Missing key is OK;\n }\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nmodule.exports = scrub;\n","var async = require('async');\nvar parser = require('./parser');\nvar requestIp = require('request-ip');\nvar url = require('url');\nvar _ = require('../utility');\nvar scrub = require('../scrub');\n\nfunction baseData(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n var data = {\n timestamp: Math.round(item.timestamp / 1000),\n environment: item.environment || environment,\n level: item.level || 'error',\n language: 'javascript',\n framework: item.framework || options.framework,\n uuid: item.uuid,\n notifier: JSON.parse(JSON.stringify(options.notifier)),\n custom: item.custom\n };\n\n if (options.codeVersion) {\n data.code_version = options.codeVersion;\n } else if (options.code_version) {\n data.code_version = options.code_version;\n }\n\n var props = Object.getOwnPropertyNames(item.custom || {});\n props.forEach(function (name) {\n if (!data.hasOwnProperty(name)) {\n data[name] = item.custom[name];\n }\n });\n\n data.server = {\n host: options.host,\n argv: process.argv.concat(),\n pid: process.pid\n };\n\n if (options.branch) {\n data.server.branch = options.branch;\n }\n if (options.root) {\n data.server.root = options.root;\n }\n\n item.data = data;\n callback(null, item);\n}\n\nfunction addMessageData(item, options, callback) {\n item.data = item.data || {};\n item.data.body = item.data.body || {};\n var message = item.message || 'Item sent with null or missing arguments.';\n item.data.body.message = {\n body: message\n };\n callback(null, item);\n}\n\nfunction addErrorData(item, options, callback) {\n if (item.stackInfo) {\n item.data = item.data || {};\n item.data.body = item.data.body || {};\n item.data.body.trace_chain = item.stackInfo;\n }\n callback(null, item);\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n addErrorData(item, options, callback);\n } else {\n addMessageData(item, options, callback);\n }\n}\n\nfunction handleItemWithError(item, options, callback) {\n if (!item.err) {\n return callback(null, item);\n }\n\n var err = item.err;\n var errors = [];\n var chain = [];\n do {\n errors.push(err);\n err = err.nested || err.cause;\n } while (err);\n item.stackInfo = chain;\n\n if (options.addErrorContext) {\n _.addErrorContext(item, errors);\n }\n\n var cb = function(e) {\n if (e) {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n item.diagnostic.buildTraceData = e.message;\n delete item.stackInfo;\n }\n callback(null, item);\n };\n async.eachSeries(errors, _buildTraceData(chain, options, item), cb);\n}\n\nfunction addRequestData(item, options, callback) {\n item.data = item.data || {};\n\n var req = item.request;\n if (!req) {\n callback(null, item);\n return;\n }\n\n var baseUrl = req.baseUrl || '';\n\n if (options.addRequestData && _.isFunction(options.addRequestData)) {\n options.addRequestData(item.data, req);\n callback(null, item);\n return;\n }\n\n var requestData = _buildRequestData(req);\n _.filterIp(requestData, options.captureIp);\n item.data.request = requestData;\n\n var routePath;\n\n if (req.route) {\n routePath = req.route.path;\n item.data.context = baseUrl && baseUrl.length ? baseUrl + routePath : routePath;\n } else {\n try {\n routePath = req.app._router.matchRequest(req).path;\n item.data.context = baseUrl && baseUrl.length ? baseUrl + routePath : routePath;\n } catch (ignore) {\n // Ignored\n }\n }\n\n var captureEmail = options.captureEmail;\n var captureUsername = options.captureUsername;\n if (req.rollbar_person) {\n var person = req.rollbar_person;\n if (!captureEmail && person.email) {\n person.email = null;\n }\n if (!captureUsername && person.username) {\n person.username = null;\n }\n item.data.person = person;\n } else if (req.user) {\n item.data.person = {id: req.user.id};\n if (req.user.username && captureUsername) {\n item.data.person.username = req.user.username;\n }\n if (req.user.email && captureEmail) {\n item.data.person.email = req.user.email;\n }\n } else if (req.user_id || req.userId) {\n var userId = req.user_id || req.userId;\n if (_.isFunction(userId)) {\n userId = userId();\n }\n item.data.person = {id: userId};\n }\n\n callback(null, item);\n}\n\nfunction addLambdaData(item, options, callback) {\n var c = item.lambdaContext;\n if (!c) {\n callback(null, item);\n return;\n }\n\n var data = {\n remainingTimeInMillis: c.getRemainingTimeInMillis(),\n callbackWaitsForEmptyEventLoop: c.callbackWaitsForEmptyEventLoop,\n functionName: c.functionName,\n functionVersion: c.functionVersion,\n arn: c.invokedFunctionArn,\n requestId: c.awsRequestId\n };\n\n item.data = item.data || {};\n item.data.custom = item.data.custom || {};\n item.data.custom.lambda = data;\n\n callback(null, item);\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubHeaders = options.scrubHeaders || [];\n var scrubFields = options.scrubFields || [];\n var scrubPaths = options.scrubPaths || [];\n scrubFields = scrubHeaders.concat(scrubFields);\n\n parseRequestBody(item.data.request, options);\n item.data = scrub(item.data, scrubFields, scrubPaths);\n serializeRequestBody(item.data.request, options);\n\n callback(null, item);\n}\n\nfunction parseRequestBody(req, options) {\n if (!req || !options.scrubRequestBody) { return }\n\n try {\n if (_.isString(req.body) && _isJsonContentType(req)) {\n req.body = JSON.parse(req.body);\n }\n } catch (e) {\n req.body = null;\n req.error = 'request.body parse failed: ' + e.message;\n }\n}\n\nfunction serializeRequestBody(req, options) {\n if (!req || !options.scrubRequestBody) { return }\n\n try {\n if (_.isObject(req.body) && _isJsonContentType(req)) {\n req.body = JSON.stringify(req.body);\n }\n } catch (e) {\n req.body = null;\n req.error = 'request.body serialization failed: ' + e.message;\n }\n}\n\n/** Helpers **/\n\nfunction _isJsonContentType(req) {\n return req.headers && req.headers['content-type'] && req.headers['content-type'].includes('json');\n}\n\nfunction _buildTraceData(chain, options, item) {\n return function(ex, cb) {\n parser.parseException(ex, options, item, function (err, errData) {\n if (err) {\n return cb(err);\n }\n\n chain.push({\n frames: errData.frames,\n exception: {\n class: errData['class'],\n message: errData.message\n }\n });\n\n return cb(null);\n });\n };\n}\n\nfunction _extractIp(req) {\n var ip = req.ip;\n if (!ip) {\n ip = requestIp.getClientIp(req);\n }\n return ip;\n}\n\nfunction _buildRequestData(req) {\n var headers = req.headers || {};\n var host = headers.host || '<no host>';\n var proto = req.protocol || ((req.socket && req.socket.encrypted) ? 'https' : 'http' );\n var parsedUrl;\n var baseUrl = req.baseUrl || '';\n if (_.isType(req.url, 'string')) {\n var fullUrl = baseUrl && baseUrl.length ? baseUrl + req.url : req.url\n parsedUrl = url.parse(fullUrl, true);\n } else {\n parsedUrl = req.url || {};\n }\n parsedUrl.protocol = parsedUrl.protocol || proto;\n parsedUrl.host = parsedUrl.host || host;\n var reqUrl = url.format(parsedUrl);\n var data = {\n url: reqUrl,\n user_ip: _extractIp(req),\n headers: headers,\n method: req.method\n };\n if (parsedUrl.search && parsedUrl.search.length > 0) {\n data.GET = parsedUrl.query;\n }\n\n var body = req.body || req.payload;\n if (body) {\n var bodyParams = {};\n if (_.isIterable(body)) {\n for (var k in body) {\n if (Object.prototype.hasOwnProperty.call(body, k)) {\n bodyParams[k] = body[k];\n }\n }\n data[req.method] = bodyParams;\n } else {\n data.body = body;\n }\n }\n return data;\n}\n\nmodule.exports = {\n baseData: baseData,\n handleItemWithError: handleItemWithError,\n addBody: addBody,\n addMessageData: addMessageData,\n addErrorData: addErrorData,\n addRequestData: addRequestData,\n addLambdaData: addLambdaData,\n scrubPayload: scrubPayload\n};\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var data = item.data;\n\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addPayloadOptions(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n item.data = _.merge(item.data, payloadOptions);\n callback(null, item);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n var response = null;\n try {\n if (_.isFunction(options.transform)) {\n response = options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n if(_.isPromise(response)) {\n response.then(function (promisedItem) {\n if(promisedItem) {\n newItem.data = promisedItem;\n }\n callback(null, newItem);\n }, function (error) {\n callback(error, item);\n });\n } else {\n callback(null, newItem);\n }\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addFunctionOption(options, name) {\n if(_.isFunction(options[name])) {\n options[name] = options[name].toString();\n }\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n var configuredOptions = options._configuredOptions;\n\n // These must be stringified or they'll get dropped during serialization.\n addFunctionOption(configuredOptions, 'transform');\n addFunctionOption(configuredOptions, 'checkIgnore');\n addFunctionOption(configuredOptions, 'onSendCallback');\n\n delete configuredOptions.accessToken;\n item.data.notifier.configured_options = configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = _.merge(item.notifier.client.notifier.diagnostic, item.diagnostic);\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item._isUncaught) {\n diagnostic.is_uncaught = item._isUncaught;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addPayloadOptions: addPayloadOptions,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlockListed(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blocklist', logger);\n }\n}\n\nfunction urlIsSafeListed(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'safelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, block) {\n if (!trace) { return !block }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !block; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !block; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, safeOrBlock, logger) {\n // safelist is the default\n var block = false;\n if (safeOrBlock === 'blocklist') {\n block = true;\n }\n\n var list, traces;\n try {\n list = block ? settings.hostBlockList : settings.hostSafeList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !block;\n }\n if (traces.length === 0 || !traces[0]) {\n return !block;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, block)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (block) {\n settings.hostBlockList = null;\n } else {\n settings.hostSafeList = null;\n }\n var listName = block ? 'hostBlockList' : 'hostSafeList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !block;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var i, j, ignoredMessages, len, messageIsIgnored, rIgnoredMessage, messages;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n messages = messagesFromItem(item);\n\n if (messages.length === 0){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n\n for (j = 0; j < messages.length; j++) {\n messageIsIgnored = rIgnoredMessage.test(messages[j]);\n\n if (messageIsIgnored) {\n return false;\n }\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return true;\n }\n}\n\nfunction messagesFromItem(item) {\n var body = item.body;\n var messages = [];\n\n // The payload schema only allows one of trace_chain, message, or trace.\n // However, existing test cases are based on having both trace and message present.\n // So here we preserve the ability to collect strings from any combination of these keys.\n if (body.trace_chain) {\n var traceChain = body.trace_chain;\n for (var i = 0; i < traceChain.length; i++) {\n var trace = traceChain[i];\n messages.push(_.get(trace, 'exception.message'));\n }\n }\n if (body.trace) {\n messages.push(_.get(body, 'trace.exception.message'));\n }\n if (body.message) {\n messages.push(_.get(body, 'message.body'));\n }\n return messages;\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlockListed: urlIsNotBlockListed,\n urlIsSafeListed: urlIsSafeListed,\n messageIsIgnored: messageIsIgnored\n};\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var util = require('util');\nvar os = require('os');\n\nvar packageJson = require('../../package.json');\nvar Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\n\nvar Transport = require('./transport');\nvar urllib = require('url');\nvar jsonBackup = require('json-stringify-safe');\n\nvar Telemeter = require('../telemetry');\nvar Instrumenter = require('./telemetry');\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar sharedPredicates = require('../predicates');\nvar truncation = require('../truncation');\nvar polyfillJSON = require('../../vendor/JSON-js/json3');\n\nfunction Rollbar(options, client) {\n if (_.isType(options, 'string')) {\n var accessToken = options;\n options = {};\n options.accessToken = accessToken;\n }\n if (options.minimumLevel !== undefined) {\n options.reportLevel = options.minimumLevel;\n delete options.minimumLevel;\n }\n this.options = _.handleOptions(Rollbar.defaultOptions, options, null, logger);\n this.options._configuredOptions = options;\n // On the server we want to ignore any maxItems setting\n delete this.options.maxItems;\n this.options.environment = this.options.environment || 'unspecified';\n logger.setVerbose(this.options.verbose);\n this.lambdaContext = null;\n this.lambdaTimeoutHandle = null;\n var transport = new Transport();\n var api = new API(this.options, transport, urllib, truncation, jsonBackup);\n var telemeter = new Telemeter(this.options)\n this.client = client || new Client(this.options, api, logger, telemeter, 'server');\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this);\n this.instrumenter.instrument();\n if (this.options.locals) {\n this.locals = initLocals(this.options.locals, logger);\n }\n addTransformsToNotifier(this.client.notifier);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n _.setupJSON(polyfillJSON);\n}\n\nfunction initLocals(localsOptions, logger) {\n // Capturing stack local variables is only supported in Node 10 and higher.\n var nodeMajorVersion = process.versions.node.split('.')[0];\n if (nodeMajorVersion < 10) { return null; }\n\n var Locals;\n if (typeof localsOptions === 'function') {\n Locals = localsOptions;\n localsOptions = null; // use defaults\n } else if (_.isType(localsOptions, 'object')) {\n Locals = localsOptions.module;\n delete localsOptions.module;\n } else {\n logger.error('options.locals or options.locals.module must be a Locals module');\n return null;\n }\n return new Locals(localsOptions, logger);\n}\n\nvar _instance = null;\nRollbar.init = function (options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function (options) {\n options = _.handleOptions(options);\n // On the server we want to ignore any maxItems setting\n delete options.maxItems;\n this.client.global(options);\n return this;\n};\nRollbar.global = function (options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function (options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = { payload: payloadData };\n }\n this.options = _.handleOptions(oldOptions, options, payload, logger);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n // On the server we want to ignore any maxItems setting\n delete this.options.maxItems;\n logger.setVerbose(this.options.verbose);\n this.client.configure(options, payloadData);\n this.setupUnhandledCapture();\n\n if (this.options.locals) {\n if (this.locals) {\n this.locals.updateOptions(this.options.locals);\n } else {\n this.locals = initLocals(this.options.locals, logger)\n }\n }\n return this;\n};\nRollbar.configure = function (options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function () {\n return this.client.lastError;\n};\nRollbar.lastError = function () {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function () {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return { uuid: uuid };\n};\nRollbar.log = function () {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function () {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return { uuid: uuid };\n};\nRollbar.debug = function () {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function () {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return { uuid: uuid };\n};\nRollbar.info = function () {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function () {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return { uuid: uuid };\n};\nRollbar.warn = function () {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\n\nRollbar.prototype.warning = function () {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return { uuid: uuid };\n};\nRollbar.warning = function () {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\n\nRollbar.prototype.error = function () {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return { uuid: uuid };\n};\nRollbar.error = function () {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\nRollbar.prototype._uncaughtError = function () {\n var item = this._createItem(arguments);\n item._isUncaught = true;\n var uuid = item.uuid;\n this.client.error(item);\n return { uuid: uuid };\n};\n\nRollbar.prototype.critical = function () {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return { uuid: uuid };\n};\nRollbar.critical = function () {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function (item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function () {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function (jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function () {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.wait = function (callback) {\n this.client.wait(callback);\n};\nRollbar.wait = function (callback) {\n if (_instance) {\n return _instance.wait(callback)\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.errorHandler = function () {\n return function (err, request, response, next) {\n var cb = function (rollbarError) {\n if (rollbarError) {\n logger.error('Error reporting to rollbar, ignoring: ' + rollbarError);\n }\n return next(err, request, response);\n };\n if (!err) {\n return next(err, request, response);\n }\n\n if (err instanceof Error) {\n return this.error(err, request, cb);\n }\n return this.error('Error: ' + err, request, cb);\n }.bind(this);\n};\nRollbar.errorHandler = function () {\n if (_instance) {\n return _instance.errorHandler()\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lambdaHandler = function (handler, timeoutHandler) {\n if (handler.length <= 2) {\n return this.asyncLambdaHandler(handler, timeoutHandler);\n }\n return this.syncLambdaHandler(handler, timeoutHandler);\n};\n\nRollbar.prototype.asyncLambdaHandler = function (handler, timeoutHandler) {\n var self = this;\n var _timeoutHandler = function (event, context) {\n var message = 'Function timed out';\n var custom = {\n originalEvent: event,\n originalRequestId: context.awsRequestId,\n };\n self.error(message, custom);\n };\n var shouldReportTimeouts = self.options.captureLambdaTimeouts;\n return function rollbarAsyncLambdaHandler(event, context) {\n return new Promise(function (resolve, reject) {\n self.lambdaContext = context;\n if (shouldReportTimeouts) {\n var timeoutCb = (timeoutHandler || _timeoutHandler).bind(null, event, context);\n self.lambdaTimeoutHandle = setTimeout(timeoutCb, context.getRemainingTimeInMillis() - 1000);\n }\n handler(event, context)\n .then(function (resp) {\n self.wait(function () {\n clearTimeout(self.lambdaTimeoutHandle);\n resolve(resp);\n });\n })\n .catch(function (err) {\n self.error(err);\n self.wait(function () {\n clearTimeout(self.lambdaTimeoutHandle);\n reject(err);\n });\n });\n });\n };\n};\nRollbar.prototype.syncLambdaHandler = function (handler, timeoutHandler) {\n var self = this;\n var _timeoutHandler = function (event, context, _cb) {\n var message = 'Function timed out';\n var custom = {\n originalEvent: event,\n originalRequestId: context.awsRequestId,\n };\n self.error(message, custom);\n };\n var shouldReportTimeouts = self.options.captureLambdaTimeouts;\n return function (event, context, callback) {\n self.lambdaContext = context;\n if (shouldReportTimeouts) {\n var timeoutCb = (timeoutHandler || _timeoutHandler).bind(null, event, context, callback);\n self.lambdaTimeoutHandle = setTimeout(timeoutCb, context.getRemainingTimeInMillis() - 1000);\n }\n try {\n handler(event, context, function (err, resp) {\n if (err) {\n self.error(err);\n }\n self.wait(function () {\n clearTimeout(self.lambdaTimeoutHandle);\n callback(err, resp);\n });\n });\n } catch (err) {\n self.error(err);\n self.wait(function () {\n clearTimeout(self.lambdaTimeoutHandle);\n throw err;\n });\n }\n };\n};\nRollbar.lambdaHandler = function (handler) {\n if (_instance) {\n return _instance.lambdaHandler(handler);\n } else {\n handleUninitialized();\n }\n};\n\nfunction wrapCallback(r, f) {\n return function () {\n var err = arguments[0];\n if (err) {\n r.error(err);\n }\n return f.apply(this, arguments);\n };\n}\n\nRollbar.prototype.wrapCallback = function (f) {\n return wrapCallback(this, f);\n};\nRollbar.wrapCallback = function (f) {\n if (_instance) {\n return _instance.wrapCallback(f);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function () {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function () {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n/** DEPRECATED **/\n\nRollbar.prototype.reportMessage = function (message, level, request, callback) {\n logger.log('reportMessage is deprecated');\n if (_.isFunction(this[level])) {\n return this[level](message, request, callback);\n } else {\n return this.error(message, request, callback);\n }\n};\nRollbar.reportMessage = function (message, level, request, callback) {\n if (_instance) {\n return _instance.reportMessage(message, level, request, callback);\n } else {\n handleUninitialized(callback);\n }\n};\n\nRollbar.prototype.reportMessageWithPayloadData = function (message, payloadData, request, callback) {\n logger.log('reportMessageWithPayloadData is deprecated');\n return this.error(message, request, payloadData, callback);\n};\nRollbar.reportMessageWithPayloadData = function (message, payloadData, request, callback) {\n if (_instance) {\n return _instance.reportMessageWithPayloadData(message, payloadData, request, callback);\n } else {\n handleUninitialized(callback);\n }\n};\n\n\nRollbar.prototype.handleError = function (err, request, callback) {\n logger.log('handleError is deprecated');\n return this.error(err, request, callback);\n};\nRollbar.handleError = function (err, request, callback) {\n if (_instance) {\n return _instance.handleError(err, request, callback);\n } else {\n handleUninitialized(callback);\n }\n};\n\n\nRollbar.prototype.handleErrorWithPayloadData = function (err, payloadData, request, callback) {\n logger.log('handleErrorWithPayloadData is deprecated');\n return this.error(err, request, payloadData, callback);\n};\nRollbar.handleErrorWithPayloadData = function (err, payloadData, request, callback) {\n if (_instance) {\n return _instance.handleErrorWithPayloadData(err, payloadData, request, callback);\n } else {\n handleUninitialized(callback);\n }\n};\n\nRollbar.handleUncaughtExceptions = function (accessToken, options) {\n if (_instance) {\n options = options || {};\n options.accessToken = accessToken;\n return _instance.configure(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.handleUnhandledRejections = function (accessToken, options) {\n if (_instance) {\n options = options || {};\n options.accessToken = accessToken;\n return _instance.configure(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.handleUncaughtExceptionsAndRejections = function (accessToken, options) {\n if (_instance) {\n options = options || {};\n options.accessToken = accessToken;\n return _instance.configure(options);\n } else {\n handleUninitialized();\n }\n};\n\n/** Internal **/\n\nfunction addTransformsToNotifier(notifier) {\n notifier\n .addTransform(transforms.baseData)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(transforms.addRequestData)\n .addTransform(transforms.addLambdaData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.addPayloadOptions)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlockListed(logger))\n .addPredicate(sharedPredicates.urlIsSafeListed(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function (args) {\n var requestKeys = ['headers', 'protocol', 'url', 'method', 'body', 'route'];\n var item = _.createItem(args, logger, this, requestKeys, this.lambdaContext);\n\n if (item.err && item.notifier.locals) {\n item.localsMap = item.notifier.locals.currentLocalsMap();\n }\n\n return item;\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nRollbar.prototype.setupUnhandledCapture = function () {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n this.handleUncaughtExceptions();\n }\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n this.handleUnhandledRejections();\n }\n};\n\nRollbar.prototype.handleUncaughtExceptions = function () {\n var exitOnUncaught = !!this.options.exitOnUncaughtException;\n delete this.options.exitOnUncaughtException;\n\n addOrReplaceRollbarHandler('uncaughtException', function (err) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n this._uncaughtError(err, function (err) {\n if (err) {\n logger.error('Encountered error while handling an uncaught exception.');\n logger.error(err);\n }\n });\n if (exitOnUncaught) {\n setImmediate(function () {\n this.wait(function () {\n process.exit(1);\n });\n }.bind(this));\n }\n }.bind(this));\n};\n\nRollbar.prototype.handleUnhandledRejections = function () {\n addOrReplaceRollbarHandler('unhandledRejection', function (reason) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n this._uncaughtError(reason, function (err) {\n if (err) {\n logger.error('Encountered error while handling an uncaught exception.');\n logger.error(err);\n }\n });\n }.bind(this));\n};\n\nfunction addOrReplaceRollbarHandler(event, action) {\n // We only support up to two arguments which is enough for how this is used\n // rather than dealing with `arguments` and `apply`\n var fn = function (a, b) {\n action(a, b);\n };\n fn._rollbarHandler = true;\n\n var listeners = process.listeners(event);\n var len = listeners.length;\n for (var i = 0; i < len; ++i) {\n if (listeners[i]._rollbarHandler) {\n process.removeListener(event, listeners[i]);\n }\n }\n process.on(event, fn);\n}\n\nfunction RollbarError(message, nested) {\n Error.call(this);\n Error.captureStackTrace(this, this.constructor);\n\n this.message = message;\n this.nested = nested;\n this.name = this.constructor.name;\n}\nutil.inherits(RollbarError, Error);\nRollbar.Error = RollbarError;\n\nRollbar.defaultOptions = {\n host: os.hostname(),\n environment: process.env.NODE_ENV || 'development',\n framework: 'node-js',\n showReportedMessageTraces: false,\n notifier: {\n name: 'node_rollbar',\n version: packageJson.version\n },\n scrubHeaders: packageJson.defaults.server.scrubHeaders,\n scrubFields: packageJson.defaults.server.scrubFields,\n addRequestData: null,\n reportLevel: packageJson.defaults.reportLevel,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: false,\n captureEmail: false,\n captureUsername: false,\n captureIp: true,\n captureLambdaTimeouts: true,\n ignoreDuplicateErrors: true,\n scrubRequestBody: true,\n autoInstrument: false\n};\n\nmodule.exports = Rollbar;\n","import Rollbar from 'rollbar'\n\nexport interface LogConfig {\n commitHash?: string\n devMode?: boolean\n payload?: Record<string, unknown>\n rollbarToken?: string\n}\n\nexport class Log {\n private devMode?: boolean\n private rollbar?: Rollbar\n\n constructor(config: LogConfig) {\n this.devMode = config.devMode ?? false\n\n if (config.rollbarToken) {\n this.rollbar = new Rollbar({\n accessToken: config.rollbarToken,\n captureUncaught: true,\n captureUnhandledRejections: true,\n codeVersion: config.commitHash,\n code_version: config.commitHash,\n payload: {\n client: {\n javascript: {\n code_version: config.commitHash,\n guess_uncaught_frames: true,\n source_map_enabled: true,\n },\n },\n codeVersion: config.commitHash,\n code_version: config.commitHash,\n environment: this.devMode ? 'development' : 'production',\n ...config.payload,\n },\n sendConfig: true,\n })\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n debug(...params: any[]) {\n if (this.devMode) {\n console.debug(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error(...params: any[]) {\n console.error(params)\n if (!this.devMode) {\n this.rollbar?.error(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n info(...params: any[]) {\n if (this.devMode) {\n console.info(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n log(...params: any[]) {\n if (this.devMode) {\n console.log(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n warn(...params: any[]) {\n console.warn(params)\n if (!this.devMode) {\n this.rollbar?.warn(params)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAI,SAAS,OAAO,UAAU;AAC9B,QAAI,QAAQ,OAAO,UAAU;AAE7B,QAAI,gBAAgB,SAASA,eAAc,KAAK;AAC/C,UAAI,CAAC,OAAO,MAAM,KAAK,GAAG,MAAM,mBAAmB;AAClD,eAAO;AAAA,MACR;AAEA,UAAI,oBAAoB,OAAO,KAAK,KAAK,aAAa;AACtD,UAAI,mBAAmB,IAAI,eAAe,IAAI,YAAY,aAAa,OAAO,KAAK,IAAI,YAAY,WAAW,eAAe;AAE7H,UAAI,IAAI,eAAe,CAAC,qBAAqB,CAAC,kBAAkB;AAC/D,eAAO;AAAA,MACR;AAIA,UAAI;AACJ,WAAK,OAAO,KAAK;AAAA,MAAK;AAEtB,a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AO;AAAA,cACrB,uBAAuB;AAAA,cACvB,oBAAoB;AAAA,YACtB;AAAA,UACF;AAAA,UACA,aAAa,OAAO;AAAA,UACpB,cAAc,OAAO;AAAA,UACrB,aAAa,KAAK,UAAU,gBAAgB;AAAA,UAC5C,GAAG,OAAO;AAAA,QACZ;AAAA,QACA,YAAY;AAAA,MACd,CAAC;AAAA,IACH;AAAA,EACF;AAAA;AAAA,EAGA,SAAS,QAAe;AACtB,QAAI,KAAK,SAAS;AAChB,cAAQ,MAAM,MAAM;AAAA,IACtB;AAAA,EACF;AAAA;AAAA,EAGA,SAAS,QAAe;AACtB,YAAQ,MAAM,MAAM;AACpB,QAAI,CAAC,KAAK,SAAS;AACjB,WAAK,SAAS,MAAM,MAAM;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA,EAGA,QAAQ,QAAe;AACrB,QAAI,KAAK,SAAS;AAChB,cAAQ,KAAK,MAAM;AAAA,IACrB;AAAA,EACF;AAAA;AAAA,EAGA,OAAO,QAAe;AACpB,QAAI,KAAK,SAAS;AAChB,cAAQ,IAAI,MAAM;AAAA,IACpB;AAAA,EACF;AAAA;AAAA,EAGA,QAAQ,QAAe;AACrB,YAAQ,KAAK,MAAM;AACnB,QAAI,CAAC,KAAK,SAAS;AACjB,WAAK,SAAS,KAAK,MAAM;AAAA,IAC3B;AAAA,EACF;AACF;","names":["isPlainObject","obj","seen","queue","transform","Rollbar","timeout","self","range","url","require_telemetry","self","reject","applyEach","index","once","promiseCallback","filter","index","sourceFile","map","index","index","needle","section","map","path","dir","callback","err","lines","obj","i","require_transforms","messageIsIgnored","JSON","key","require_rollbar","Rollbar","logger","self","reject","queue","err","Rollbar"]}
|