/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 71873: /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "DEFAULT_USER_INCLUDES": () => (/* reexport */ requestdata_DEFAULT_USER_INCLUDES), "Handlers": () => (/* reexport */ handlers_namespaceObject), "Hub": () => (/* reexport */ Hub), "Integrations": () => (/* binding */ INTEGRATIONS), "NodeClient": () => (/* reexport */ NodeClient), "SDK_VERSION": () => (/* reexport */ SDK_VERSION), "Scope": () => (/* reexport */ Scope), "addBreadcrumb": () => (/* reexport */ addBreadcrumb), "addGlobalEventProcessor": () => (/* reexport */ addGlobalEventProcessor), "addRequestDataToEvent": () => (/* reexport */ requestdata_addRequestDataToEvent), "captureEvent": () => (/* reexport */ captureEvent), "captureException": () => (/* reexport */ captureException), "captureMessage": () => (/* reexport */ captureMessage), "close": () => (/* reexport */ sdk_close), "configureScope": () => (/* reexport */ configureScope), "createTransport": () => (/* reexport */ createTransport), "deepReadDirSync": () => (/* reexport */ deepReadDirSync), "defaultIntegrations": () => (/* reexport */ defaultIntegrations), "defaultStackParser": () => (/* reexport */ defaultStackParser), "extractRequestData": () => (/* reexport */ requestdata_extractRequestData), "flush": () => (/* reexport */ flush), "getCurrentHub": () => (/* reexport */ getCurrentHub), "getHubFromCarrier": () => (/* reexport */ getHubFromCarrier), "getSentryRelease": () => (/* reexport */ getSentryRelease), "init": () => (/* reexport */ init), "lastEventId": () => (/* reexport */ lastEventId), "makeMain": () => (/* reexport */ makeMain), "makeNodeTransport": () => (/* reexport */ makeNodeTransport), "setContext": () => (/* reexport */ setContext), "setExtra": () => (/* reexport */ setExtra), "setExtras": () => (/* reexport */ setExtras), "setTag": () => (/* reexport */ setTag), "setTags": () => (/* reexport */ setTags), "setUser": () => (/* reexport */ setUser), "startTransaction": () => (/* reexport */ startTransaction), "withScope": () => (/* reexport */ withScope) }); // NAMESPACE OBJECT: ./node_modules/@sentry/core/esm/integrations/index.js var integrations_namespaceObject = {}; __webpack_require__.r(integrations_namespaceObject); __webpack_require__.d(integrations_namespaceObject, { "FunctionToString": () => (FunctionToString), "InboundFilters": () => (InboundFilters) }); // NAMESPACE OBJECT: ./node_modules/@sentry/node/esm/handlers.js var handlers_namespaceObject = {}; __webpack_require__.r(handlers_namespaceObject); __webpack_require__.d(handlers_namespaceObject, { "errorHandler": () => (errorHandler), "extractRequestData": () => (requestDataDeprecated_extractRequestData), "parseRequest": () => (parseRequest), "requestHandler": () => (requestHandler), "tracingHandler": () => (tracingHandler) }); // NAMESPACE OBJECT: ./node_modules/@sentry/node/esm/integrations/index.js var esm_integrations_namespaceObject = {}; __webpack_require__.r(esm_integrations_namespaceObject); __webpack_require__.d(esm_integrations_namespaceObject, { "Console": () => (Console), "Context": () => (Context), "ContextLines": () => (ContextLines), "Http": () => (Http), "LinkedErrors": () => (LinkedErrors), "LocalVariables": () => (LocalVariables), "Modules": () => (Modules), "OnUncaughtException": () => (OnUncaughtException), "OnUnhandledRejection": () => (OnUnhandledRejection), "RequestData": () => (RequestData) }); ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/is.js // eslint-disable-next-line @typescript-eslint/unbound-method const objectToString = Object.prototype.toString; /** * Checks whether given value's type is one of a few Error or Error-like * {@link isError}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isError(wat) { switch (objectToString.call(wat)) { case '[object Error]': case '[object Exception]': case '[object DOMException]': return true; default: return isInstanceOf(wat, Error); } } /** * Checks whether given value is an instance of the given built-in class. * * @param wat The value to be checked * @param className * @returns A boolean representing the result. */ function isBuiltin(wat, className) { return objectToString.call(wat) === `[object ${className}]`; } /** * Checks whether given value's type is ErrorEvent * {@link isErrorEvent}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isErrorEvent(wat) { return isBuiltin(wat, 'ErrorEvent'); } /** * Checks whether given value's type is DOMError * {@link isDOMError}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isDOMError(wat) { return isBuiltin(wat, 'DOMError'); } /** * Checks whether given value's type is DOMException * {@link isDOMException}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isDOMException(wat) { return isBuiltin(wat, 'DOMException'); } /** * Checks whether given value's type is a string * {@link isString}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function is_isString(wat) { return isBuiltin(wat, 'String'); } /** * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) * {@link isPrimitive}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function is_isPrimitive(wat) { return wat === null || (typeof wat !== 'object' && typeof wat !== 'function'); } /** * Checks whether given value's type is an object literal * {@link isPlainObject}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function is_isPlainObject(wat) { return isBuiltin(wat, 'Object'); } /** * Checks whether given value's type is an Event instance * {@link isEvent}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isEvent(wat) { return typeof Event !== 'undefined' && isInstanceOf(wat, Event); } /** * Checks whether given value's type is an Element instance * {@link isElement}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isElement(wat) { return typeof Element !== 'undefined' && isInstanceOf(wat, Element); } /** * Checks whether given value's type is an regexp * {@link isRegExp}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isRegExp(wat) { return isBuiltin(wat, 'RegExp'); } /** * Checks whether given value has a then function. * @param wat A value to be checked. */ function isThenable(wat) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return Boolean(wat && wat.then && typeof wat.then === 'function'); } /** * Checks whether given value's type is a SyntheticEvent * {@link isSyntheticEvent}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function isSyntheticEvent(wat) { return is_isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; } /** * Checks whether given value is NaN * {@link isNaN}. * * @param wat A value to be checked. * @returns A boolean representing the result. */ function is_isNaN(wat) { return typeof wat === 'number' && wat !== wat; } /** * Checks whether given value's type is an instance of provided constructor. * {@link isInstanceOf}. * * @param wat A value to be checked. * @param base A constructor to be used in a check. * @returns A boolean representing the result. */ function isInstanceOf(wat, base) { try { return wat instanceof base; } catch (_e) { return false; } } //# sourceMappingURL=is.js.map // EXTERNAL MODULE: ./node_modules/@sentry/utils/esm/worldwide.js var worldwide = __webpack_require__(71235); ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/browser.js // eslint-disable-next-line deprecation/deprecation const WINDOW = (0,worldwide/* getGlobalObject */.Rf)(); const DEFAULT_MAX_STRING_LENGTH = 80; /** * Given a child DOM element, returns a query-selector statement describing that * and its ancestors * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] * @returns generated DOM path */ function htmlTreeAsString( elem, options = {}, ) { // try/catch both: // - accessing event.target (see getsentry/raven-js#838, #768) // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly // - can throw an exception in some circumstances. try { let currentElem = elem ; const MAX_TRAVERSE_HEIGHT = 5; const out = []; let height = 0; let len = 0; const separator = ' > '; const sepLength = separator.length; let nextStr; const keyAttrs = Array.isArray(options) ? options : options.keyAttrs; const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH; while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { nextStr = _htmlElementAsString(currentElem, keyAttrs); // bail out if // - nextStr is the 'html' element // - the length of the string that would be created exceeds maxStringLength // (ignore this limit if we are on the first iteration) if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) { break; } out.push(nextStr); len += nextStr.length; currentElem = currentElem.parentNode; } return out.reverse().join(separator); } catch (_oO) { return ''; } } /** * Returns a simple, query-selector representation of a DOM element * e.g. [HTMLElement] => input#foo.btn[name=baz] * @returns generated DOM path */ function _htmlElementAsString(el, keyAttrs) { const elem = el ; const out = []; let className; let classes; let key; let attr; let i; if (!elem || !elem.tagName) { return ''; } out.push(elem.tagName.toLowerCase()); // Pairs of attribute keys defined in `serializeAttribute` and their values on element. const keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)]) : null; if (keyAttrPairs && keyAttrPairs.length) { keyAttrPairs.forEach(keyAttrPair => { out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); }); } else { if (elem.id) { out.push(`#${elem.id}`); } // eslint-disable-next-line prefer-const className = elem.className; if (className && is_isString(className)) { classes = className.split(/\s+/); for (i = 0; i < classes.length; i++) { out.push(`.${classes[i]}`); } } } const allowedAttrs = ['type', 'name', 'title', 'alt']; for (i = 0; i < allowedAttrs.length; i++) { key = allowedAttrs[i]; attr = elem.getAttribute(key); if (attr) { out.push(`[${key}="${attr}"]`); } } return out.join(''); } /** * A safe form of location.href */ function getLocationHref() { try { return WINDOW.document.location.href; } catch (oO) { return ''; } } /** * Gets a DOM element by using document.querySelector. * * This wrapper will first check for the existance of the function before * actually calling it so that we don't have to take care of this check, * every time we want to access the DOM. * * Reason: DOM/querySelector is not available in all environments. * * We have to cast to any because utils can be consumed by a variety of environments, * and we don't want to break TS users. If you know what element will be selected by * `document.querySelector`, specify it as part of the generic call. For example, * `const element = getDomElement('selector');` * * @param selector the selector string passed on to document.querySelector */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function getDomElement(selector) { if (WINDOW.document && WINDOW.document.querySelector) { return WINDOW.document.querySelector(selector) ; } return null; } //# sourceMappingURL=browser.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/string.js /** * Truncates given string to the maximum characters count * * @param str An object that contains serializable values * @param max Maximum number of characters in truncated string (0 = unlimited) * @returns string Encoded */ function truncate(str, max = 0) { if (typeof str !== 'string' || max === 0) { return str; } return str.length <= max ? str : `${str.slice(0, max)}...`; } /** * This is basically just `trim_line` from * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 * * @param str An object that contains serializable values * @param max Maximum number of characters in truncated string * @returns string Encoded */ function snipLine(line, colno) { let newLine = line; const lineLength = newLine.length; if (lineLength <= 150) { return newLine; } if (colno > lineLength) { // eslint-disable-next-line no-param-reassign colno = lineLength; } let start = Math.max(colno - 60, 0); if (start < 5) { start = 0; } let end = Math.min(start + 140, lineLength); if (end > lineLength - 5) { end = lineLength; } if (end === lineLength) { start = Math.max(end - 140, 0); } newLine = newLine.slice(start, end); if (start > 0) { newLine = `'{snip} ${newLine}`; } if (end < lineLength) { newLine += ' {snip}'; } return newLine; } /** * Join values in array * @param input array of values to be joined together * @param delimiter string to be placed in-between values * @returns Joined values */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function safeJoin(input, delimiter) { if (!Array.isArray(input)) { return ''; } const output = []; // eslint-disable-next-line @typescript-eslint/prefer-for-of for (let i = 0; i < input.length; i++) { const value = input[i]; try { output.push(String(value)); } catch (e) { output.push('[value cannot be serialized]'); } } return output.join(delimiter); } /** * Checks if the given value matches a regex or string * * @param value The string to test * @param pattern Either a regex or a string against which `value` will be matched * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match * `pattern` if it contains `pattern`. Only applies to string-type patterns. */ function isMatchingPattern( value, pattern, requireExactStringMatch = false, ) { if (!is_isString(value)) { return false; } if (isRegExp(pattern)) { return pattern.test(value); } if (is_isString(pattern)) { return requireExactStringMatch ? value === pattern : value.includes(pattern); } return false; } /** * Test the given string against an array of strings and regexes. By default, string matching is done on a * substring-inclusion basis rather than a strict equality basis * * @param testString The string to test * @param patterns The patterns against which to test the string * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to * count. If false, `testString` will match a string pattern if it contains that pattern. * @returns */ function stringMatchesSomePattern( testString, patterns = [], requireExactStringMatch = false, ) { return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch)); } /** * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to * `new RegExp()`. * * Based on https://github.com/sindresorhus/escape-string-regexp. Vendored to a) reduce the size by skipping the runtime * type-checking, and b) ensure it gets down-compiled for old versions of Node (the published package only supports Node * 12+). * * @param regexString The string to escape * @returns An version of the string with all special regex characters escaped */ function escapeStringForRegex(regexString) { // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20. return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); } //# sourceMappingURL=string.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/object.js /** * Replace a method in an object with a wrapped version of itself. * * @param source An object that contains a method to be wrapped. * @param name The name of the method to be wrapped. * @param replacementFactory A higher-order function that takes the original version of the given method and returns a * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`. * @returns void */ function fill(source, name, replacementFactory) { if (!(name in source)) { return; } const original = source[name] ; const wrapped = replacementFactory(original) ; // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" if (typeof wrapped === 'function') { try { markFunctionWrapped(wrapped, original); } catch (_Oo) { // This can throw if multiple fill happens on a global object like XMLHttpRequest // Fixes https://github.com/getsentry/sentry-javascript/issues/2043 } } source[name] = wrapped; } /** * Defines a non-enumerable property on the given object. * * @param obj The object on which to set the property * @param name The name of the property to be set * @param value The value to which to set the property */ function addNonEnumerableProperty(obj, name, value) { Object.defineProperty(obj, name, { // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it value: value, writable: true, configurable: true, }); } /** * Remembers the original function on the wrapped function and * patches up the prototype. * * @param wrapped the wrapper function * @param original the original function that gets wrapped */ function markFunctionWrapped(wrapped, original) { const proto = original.prototype || {}; wrapped.prototype = original.prototype = proto; addNonEnumerableProperty(wrapped, '__sentry_original__', original); } /** * This extracts the original function if available. See * `markFunctionWrapped` for more information. * * @param func the function to unwrap * @returns the unwrapped version of the function if available. */ function getOriginalFunction(func) { return func.__sentry_original__; } /** * Encodes given object into url-friendly format * * @param object An object that contains serializable values * @returns string Encoded */ function urlEncode(object) { return Object.keys(object) .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`) .join('&'); } /** * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their * non-enumerable properties attached. * * @param value Initial source that we have to transform in order for it to be usable by the serializer * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor * an Error. */ function convertToPlainObject(value) { if (isError(value)) { return { message: value.message, name: value.name, stack: value.stack, ...getOwnProperties(value), }; } else if (isEvent(value)) { const newObj = { type: value.type, target: serializeEventTarget(value.target), currentTarget: serializeEventTarget(value.currentTarget), ...getOwnProperties(value), }; if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) { newObj.detail = value.detail; } return newObj; } else { return value; } } /** Creates a string representation of the target of an `Event` object */ function serializeEventTarget(target) { try { return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target); } catch (_oO) { return ''; } } /** Filters out all but an object's own properties */ function getOwnProperties(obj) { if (typeof obj === 'object' && obj !== null) { const extractedProps = {}; for (const property in obj) { if (Object.prototype.hasOwnProperty.call(obj, property)) { extractedProps[property] = (obj )[property]; } } return extractedProps; } else { return {}; } } /** * Given any captured exception, extract its keys and create a sorted * and truncated list that will be used inside the event message. * eg. `Non-error exception captured with keys: foo, bar, baz` */ function extractExceptionKeysForMessage(exception, maxLength = 40) { const keys = Object.keys(convertToPlainObject(exception)); keys.sort(); if (!keys.length) { return '[object has no keys]'; } if (keys[0].length >= maxLength) { return truncate(keys[0], maxLength); } for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { const serialized = keys.slice(0, includedKeys).join(', '); if (serialized.length > maxLength) { continue; } if (includedKeys === keys.length) { return serialized; } return truncate(serialized, maxLength); } return ''; } /** * Given any object, return a new object having removed all fields whose value was `undefined`. * Works recursively on objects and arrays. * * Attention: This function keeps circular references in the returned object. */ function dropUndefinedKeys(inputValue) { // This map keeps track of what already visited nodes map to. // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular // references as the input object. const memoizationMap = new Map(); // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API return _dropUndefinedKeys(inputValue, memoizationMap); } function _dropUndefinedKeys(inputValue, memoizationMap) { if (is_isPlainObject(inputValue)) { // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object const memoVal = memoizationMap.get(inputValue); if (memoVal !== undefined) { return memoVal ; } const returnValue = {}; // Store the mapping of this value in case we visit it again, in case of circular data memoizationMap.set(inputValue, returnValue); for (const key of Object.keys(inputValue)) { if (typeof inputValue[key] !== 'undefined') { returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); } } return returnValue ; } if (Array.isArray(inputValue)) { // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object const memoVal = memoizationMap.get(inputValue); if (memoVal !== undefined) { return memoVal ; } const returnValue = []; // Store the mapping of this value in case we visit it again, in case of circular data memoizationMap.set(inputValue, returnValue); inputValue.forEach((item) => { returnValue.push(_dropUndefinedKeys(item, memoizationMap)); }); return returnValue ; } return inputValue; } /** * Ensure that something is an object. * * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives. * * @param wat The subject of the objectification * @returns A version of `wat` which can safely be used with `Object` class methods */ function objectify(wat) { let objectified; switch (true) { case wat === undefined || wat === null: objectified = new String(wat); break; // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as // an object in order to wrap it. case typeof wat === 'symbol' || typeof wat === 'bigint': objectified = Object(wat); break; // this will catch the remaining primitives: `String`, `Number`, and `Boolean` case isPrimitive(wat): // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access objectified = new (wat ).constructor(wat); break; // by process of elimination, at this point we know that `wat` must already be an object default: objectified = wat; break; } return objectified; } //# sourceMappingURL=object.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/integrations/functiontostring.js let originalFunctionToString; /** Patch toString calls to return proper name for wrapped functions */ class FunctionToString {constructor() { FunctionToString.prototype.__init.call(this); } /** * @inheritDoc */ static __initStatic() {this.id = 'FunctionToString';} /** * @inheritDoc */ __init() {this.name = FunctionToString.id;} /** * @inheritDoc */ setupOnce() { // eslint-disable-next-line @typescript-eslint/unbound-method originalFunctionToString = Function.prototype.toString; // eslint-disable-next-line @typescript-eslint/no-explicit-any Function.prototype.toString = function ( ...args) { const context = getOriginalFunction(this) || this; return originalFunctionToString.apply(context, args); }; } } FunctionToString.__initStatic(); //# sourceMappingURL=functiontostring.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/logger.js /** Prefix for logging strings */ const PREFIX = 'Sentry Logger '; const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ; /** * Temporarily disable sentry console instrumentations. * * @param callback The function to run against the original `console` messages * @returns The results of the callback */ function consoleSandbox(callback) { if (!('console' in worldwide/* GLOBAL_OBJ */.n2)) { return callback(); } const originalConsole = worldwide/* GLOBAL_OBJ.console */.n2.console ; const wrappedLevels = {}; // Restore all wrapped console methods CONSOLE_LEVELS.forEach(level => { // TODO(v7): Remove this check as it's only needed for Node 6 const originalWrappedFunc = originalConsole[level] && (originalConsole[level] ).__sentry_original__; if (level in originalConsole && originalWrappedFunc) { wrappedLevels[level] = originalConsole[level] ; originalConsole[level] = originalWrappedFunc ; } }); try { return callback(); } finally { // Revert restoration to wrapped state Object.keys(wrappedLevels).forEach(level => { originalConsole[level] = wrappedLevels[level ]; }); } } function makeLogger() { let enabled = false; const logger = { enable: () => { enabled = true; }, disable: () => { enabled = false; }, }; if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { CONSOLE_LEVELS.forEach(name => { // eslint-disable-next-line @typescript-eslint/no-explicit-any logger[name] = (...args) => { if (enabled) { consoleSandbox(() => { worldwide/* GLOBAL_OBJ.console */.n2.console[name](`${PREFIX}[${name}]:`, ...args); }); } }; }); } else { CONSOLE_LEVELS.forEach(name => { logger[name] = () => undefined; }); } return logger ; } // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used let logger; if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { logger = (0,worldwide/* getGlobalSingleton */.YO)('logger', makeLogger); } else { logger = makeLogger(); } //# sourceMappingURL=logger.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/misc.js /** * UUID4 generator * * @returns string Generated UUID4. */ function uuid4() { const gbl = worldwide/* GLOBAL_OBJ */.n2 ; const crypto = gbl.crypto || gbl.msCrypto; if (crypto && crypto.randomUUID) { return crypto.randomUUID().replace(/-/g, ''); } const getRandomByte = crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16; // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 // Concatenating the following numbers as strings results in '10000000100040008000100000000000' return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c => // eslint-disable-next-line no-bitwise ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16), ); } function getFirstException(event) { return event.exception && event.exception.values ? event.exception.values[0] : undefined; } /** * Extracts either message or type+value from an event that can be used for user-facing logs * @returns event's description */ function getEventDescription(event) { const { message, event_id: eventId } = event; if (message) { return message; } const firstException = getFirstException(event); if (firstException) { if (firstException.type && firstException.value) { return `${firstException.type}: ${firstException.value}`; } return firstException.type || firstException.value || eventId || ''; } return eventId || ''; } /** * Adds exception values, type and value to an synthetic Exception. * @param event The event to modify. * @param value Value of the exception. * @param type Type of the exception. * @hidden */ function addExceptionTypeValue(event, value, type) { const exception = (event.exception = event.exception || {}); const values = (exception.values = exception.values || []); const firstException = (values[0] = values[0] || {}); if (!firstException.value) { firstException.value = value || ''; } if (!firstException.type) { firstException.type = type || 'Error'; } } /** * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. * * @param event The event to modify. * @param newMechanism Mechanism data to add to the event. * @hidden */ function addExceptionMechanism(event, newMechanism) { const firstException = getFirstException(event); if (!firstException) { return; } const defaultMechanism = { type: 'generic', handled: true }; const currentMechanism = firstException.mechanism; firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; if (newMechanism && 'data' in newMechanism) { const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data }; firstException.mechanism.data = mergedData; } } // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string const SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; /** * Represents Semantic Versioning object */ /** * Parses input into a SemVer interface * @param input string representation of a semver version */ function parseSemver(input) { const match = input.match(SEMVER_REGEXP) || []; const major = parseInt(match[1], 10); const minor = parseInt(match[2], 10); const patch = parseInt(match[3], 10); return { buildmetadata: match[5], major: isNaN(major) ? undefined : major, minor: isNaN(minor) ? undefined : minor, patch: isNaN(patch) ? undefined : patch, prerelease: match[4], }; } /** * This function adds context (pre/post/line) lines to the provided frame * * @param lines string[] containing all lines * @param frame StackFrame that will be mutated * @param linesOfContext number of context lines we want to add pre/post */ function addContextToFrame(lines, frame, linesOfContext = 5) { // When there is no line number in the frame, attaching context is nonsensical and will even break grouping if (frame.lineno === undefined) { return; } const maxLines = lines.length; const sourceLine = Math.max(Math.min(maxLines, frame.lineno - 1), 0); frame.pre_context = lines .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) .map((line) => snipLine(line, 0)); frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0); frame.post_context = lines .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) .map((line) => snipLine(line, 0)); } /** * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object * in question), and marks it captured if not. * * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we * see it. * * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent * object wrapper forms so that this check will always work. However, because we need to flag the exact object which * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification * must be done before the exception captured. * * @param A thrown exception to check or flag as having been seen * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) */ function checkOrSetAlreadyCaught(exception) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (exception && (exception ).__sentry_captured__) { return true; } try { // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the // `ExtraErrorData` integration addNonEnumerableProperty(exception , '__sentry_captured__', true); } catch (err) { // `exception` is a primitive, so we can't mark it seen } return false; } /** * Checks whether the given input is already an array, and if it isn't, wraps it in one. * * @param maybeArray Input to turn into an array, if necessary * @returns The input, if already an array, or an array with the input as the only element, if not */ function arrayify(maybeArray) { return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; } //# sourceMappingURL=misc.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/integrations/inboundfilters.js // "Script error." is hard coded into browsers for errors that it can't read. // this is the result of a script being pulled in from an external domain and CORS. const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/]; /** Options for the InboundFilters integration */ /** Inbound filters configurable by the user */ class InboundFilters { /** * @inheritDoc */ static __initStatic() {this.id = 'InboundFilters';} /** * @inheritDoc */ __init() {this.name = InboundFilters.id;} constructor( _options = {}) {this._options = _options;InboundFilters.prototype.__init.call(this);} /** * @inheritDoc */ setupOnce(addGlobalEventProcessor, getCurrentHub) { const eventProcess = (event) => { const hub = getCurrentHub(); if (hub) { const self = hub.getIntegration(InboundFilters); if (self) { const client = hub.getClient(); const clientOptions = client ? client.getOptions() : {}; const options = _mergeOptions(self._options, clientOptions); return _shouldDropEvent(event, options) ? null : event; } } return event; }; eventProcess.id = this.name; addGlobalEventProcessor(eventProcess); } } InboundFilters.__initStatic(); /** JSDoc */ function _mergeOptions( internalOptions = {}, clientOptions = {}, ) { return { allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])], denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])], ignoreErrors: [ ...(internalOptions.ignoreErrors || []), ...(clientOptions.ignoreErrors || []), ...DEFAULT_IGNORE_ERRORS, ], ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, }; } /** JSDoc */ function _shouldDropEvent(event, options) { if (options.ignoreInternal && _isSentryError(event)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${getEventDescription(event)}`); return true; } if (_isIgnoredError(event, options.ignoreErrors)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn( `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(event)}`, ); return true; } if (_isDeniedUrl(event, options.denyUrls)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn( `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${getEventDescription( event, )}.\nUrl: ${_getEventFilterUrl(event)}`, ); return true; } if (!_isAllowedUrl(event, options.allowUrls)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn( `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${getEventDescription( event, )}.\nUrl: ${_getEventFilterUrl(event)}`, ); return true; } return false; } function _isIgnoredError(event, ignoreErrors) { if (!ignoreErrors || !ignoreErrors.length) { return false; } return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors)); } function _isDeniedUrl(event, denyUrls) { // TODO: Use Glob instead? if (!denyUrls || !denyUrls.length) { return false; } const url = _getEventFilterUrl(event); return !url ? false : stringMatchesSomePattern(url, denyUrls); } function _isAllowedUrl(event, allowUrls) { // TODO: Use Glob instead? if (!allowUrls || !allowUrls.length) { return true; } const url = _getEventFilterUrl(event); return !url ? true : stringMatchesSomePattern(url, allowUrls); } function _getPossibleEventMessages(event) { if (event.message) { return [event.message]; } if (event.exception) { try { const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {}; return [`${value}`, `${type}: ${value}`]; } catch (oO) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(`Cannot extract message for event ${getEventDescription(event)}`); return []; } } return []; } function _isSentryError(event) { try { // @ts-ignore can't be a sentry error if undefined // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return event.exception.values[0].type === 'SentryError'; } catch (e) { // ignore } return false; } function _getLastValidUrl(frames = []) { for (let i = frames.length - 1; i >= 0; i--) { const frame = frames[i]; if (frame && frame.filename !== '' && frame.filename !== '[native code]') { return frame.filename || null; } } return null; } function _getEventFilterUrl(event) { try { let frames; try { // @ts-ignore we only care about frames if the whole thing here is defined frames = event.exception.values[0].stacktrace.frames; } catch (e) { // ignore } return frames ? _getLastValidUrl(frames) : null; } catch (oO) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(`Cannot extract url for event ${getEventDescription(event)}`); return null; } } //# sourceMappingURL=inboundfilters.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/integrations/index.js //# sourceMappingURL=index.js.map // EXTERNAL MODULE: ./node_modules/@sentry/utils/esm/time.js var time = __webpack_require__(21170); // EXTERNAL MODULE: ./node_modules/@sentry/utils/esm/node.js + 1 modules var node = __webpack_require__(63511); ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/syncpromise.js /* eslint-disable @typescript-eslint/explicit-function-return-type */ /** SyncPromise internal states */ var States; (function (States) { /** Pending */ const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING"; /** Resolved / OK */ const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED"; /** Rejected / Error */ const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED"; })(States || (States = {})); // Overloads so we can call resolvedSyncPromise without arguments and generic argument /** * Creates a resolved sync promise. * * @param value the value to resolve the promise with * @returns the resolved sync promise */ function resolvedSyncPromise(value) { return new SyncPromise(resolve => { resolve(value); }); } /** * Creates a rejected sync promise. * * @param value the value to reject the promise with * @returns the rejected sync promise */ function rejectedSyncPromise(reason) { return new SyncPromise((_, reject) => { reject(reason); }); } /** * Thenable class that behaves like a Promise and follows it's interface * but is not async internally */ class SyncPromise { __init() {this._state = States.PENDING;} __init2() {this._handlers = [];} constructor( executor, ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);SyncPromise.prototype.__init5.call(this);SyncPromise.prototype.__init6.call(this); try { executor(this._resolve, this._reject); } catch (e) { this._reject(e); } } /** JSDoc */ then( onfulfilled, onrejected, ) { return new SyncPromise((resolve, reject) => { this._handlers.push([ false, result => { if (!onfulfilled) { // TODO: ¯\_(ツ)_/¯ // TODO: FIXME resolve(result ); } else { try { resolve(onfulfilled(result)); } catch (e) { reject(e); } } }, reason => { if (!onrejected) { reject(reason); } else { try { resolve(onrejected(reason)); } catch (e) { reject(e); } } }, ]); this._executeHandlers(); }); } /** JSDoc */ catch( onrejected, ) { return this.then(val => val, onrejected); } /** JSDoc */ finally(onfinally) { return new SyncPromise((resolve, reject) => { let val; let isRejected; return this.then( value => { isRejected = false; val = value; if (onfinally) { onfinally(); } }, reason => { isRejected = true; val = reason; if (onfinally) { onfinally(); } }, ).then(() => { if (isRejected) { reject(val); return; } resolve(val ); }); }); } /** JSDoc */ __init3() {this._resolve = (value) => { this._setResult(States.RESOLVED, value); };} /** JSDoc */ __init4() {this._reject = (reason) => { this._setResult(States.REJECTED, reason); };} /** JSDoc */ __init5() {this._setResult = (state, value) => { if (this._state !== States.PENDING) { return; } if (isThenable(value)) { void (value ).then(this._resolve, this._reject); return; } this._state = state; this._value = value; this._executeHandlers(); };} /** JSDoc */ __init6() {this._executeHandlers = () => { if (this._state === States.PENDING) { return; } const cachedHandlers = this._handlers.slice(); this._handlers = []; cachedHandlers.forEach(handler => { if (handler[0]) { return; } if (this._state === States.RESOLVED) { // eslint-disable-next-line @typescript-eslint/no-floating-promises handler[1](this._value ); } if (this._state === States.REJECTED) { handler[2](this._value); } handler[0] = true; }); };} } //# sourceMappingURL=syncpromise.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/session.js /** * Creates a new `Session` object by setting certain default parameters. If optional @param context * is passed, the passed properties are applied to the session object. * * @param context (optional) additional properties to be applied to the returned session object * * @returns a new `Session` object */ function makeSession(context) { // Both timestamp and started are in seconds since the UNIX epoch. const startingTime = (0,time/* timestampInSeconds */.ph)(); const session = { sid: uuid4(), init: true, timestamp: startingTime, started: startingTime, duration: 0, status: 'ok', errors: 0, ignoreDuration: false, toJSON: () => sessionToJSON(session), }; if (context) { updateSession(session, context); } return session; } /** * Updates a session object with the properties passed in the context. * * Note that this function mutates the passed object and returns void. * (Had to do this instead of returning a new and updated session because closing and sending a session * makes an update to the session after it was passed to the sending logic. * @see BaseClient.captureSession ) * * @param session the `Session` to update * @param context the `SessionContext` holding the properties that should be updated in @param session */ // eslint-disable-next-line complexity function updateSession(session, context = {}) { if (context.user) { if (!session.ipAddress && context.user.ip_address) { session.ipAddress = context.user.ip_address; } if (!session.did && !context.did) { session.did = context.user.id || context.user.email || context.user.username; } } session.timestamp = context.timestamp || (0,time/* timestampInSeconds */.ph)(); if (context.ignoreDuration) { session.ignoreDuration = context.ignoreDuration; } if (context.sid) { // Good enough uuid validation. — Kamil session.sid = context.sid.length === 32 ? context.sid : uuid4(); } if (context.init !== undefined) { session.init = context.init; } if (!session.did && context.did) { session.did = `${context.did}`; } if (typeof context.started === 'number') { session.started = context.started; } if (session.ignoreDuration) { session.duration = undefined; } else if (typeof context.duration === 'number') { session.duration = context.duration; } else { const duration = session.timestamp - session.started; session.duration = duration >= 0 ? duration : 0; } if (context.release) { session.release = context.release; } if (context.environment) { session.environment = context.environment; } if (!session.ipAddress && context.ipAddress) { session.ipAddress = context.ipAddress; } if (!session.userAgent && context.userAgent) { session.userAgent = context.userAgent; } if (typeof context.errors === 'number') { session.errors = context.errors; } if (context.status) { session.status = context.status; } } /** * Closes a session by setting its status and updating the session object with it. * Internally calls `updateSession` to update the passed session object. * * Note that this function mutates the passed session (@see updateSession for explanation). * * @param session the `Session` object to be closed * @param status the `SessionStatus` with which the session was closed. If you don't pass a status, * this function will keep the previously set status, unless it was `'ok'` in which case * it is changed to `'exited'`. */ function closeSession(session, status) { let context = {}; if (status) { context = { status }; } else if (session.status === 'ok') { context = { status: 'exited' }; } updateSession(session, context); } /** * Serializes a passed session object to a JSON object with a slightly different structure. * This is necessary because the Sentry backend requires a slightly different schema of a session * than the one the JS SDKs use internally. * * @param session the session to be converted * * @returns a JSON object of the passed session */ function sessionToJSON(session) { return dropUndefinedKeys({ sid: `${session.sid}`, init: session.init, // Make sure that sec is converted to ms for date constructor started: new Date(session.started * 1000).toISOString(), timestamp: new Date(session.timestamp * 1000).toISOString(), status: session.status, errors: session.errors, did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined, duration: session.duration, attrs: { release: session.release, environment: session.environment, ip_address: session.ipAddress, user_agent: session.userAgent, }, }); } //# sourceMappingURL=session.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/scope.js /** * Default value for maximum number of breadcrumbs added to an event. */ const DEFAULT_MAX_BREADCRUMBS = 100; /** * Holds additional event information. {@link Scope.applyToEvent} will be * called by the client before an event will be sent. */ class Scope { /** Flag if notifying is happening. */ /** Callback for client to receive scope changes. */ /** Callback list that will be called after {@link applyToEvent}. */ /** Array of breadcrumbs. */ /** User */ /** Tags */ /** Extra */ /** Contexts */ /** Attachments */ /** * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get * sent to Sentry */ /** Fingerprint */ /** Severity */ // eslint-disable-next-line deprecation/deprecation /** Transaction Name */ /** Span */ /** Session */ /** Request Mode Session Status */ // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. constructor() { this._notifyingListeners = false; this._scopeListeners = []; this._eventProcessors = []; this._breadcrumbs = []; this._attachments = []; this._user = {}; this._tags = {}; this._extra = {}; this._contexts = {}; this._sdkProcessingMetadata = {}; } /** * Inherit values from the parent scope. * @param scope to clone. */ static clone(scope) { const newScope = new Scope(); if (scope) { newScope._breadcrumbs = [...scope._breadcrumbs]; newScope._tags = { ...scope._tags }; newScope._extra = { ...scope._extra }; newScope._contexts = { ...scope._contexts }; newScope._user = scope._user; newScope._level = scope._level; newScope._span = scope._span; newScope._session = scope._session; newScope._transactionName = scope._transactionName; newScope._fingerprint = scope._fingerprint; newScope._eventProcessors = [...scope._eventProcessors]; newScope._requestSession = scope._requestSession; newScope._attachments = [...scope._attachments]; newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata }; } return newScope; } /** * Add internal on change listener. Used for sub SDKs that need to store the scope. * @hidden */ addScopeListener(callback) { this._scopeListeners.push(callback); } /** * @inheritDoc */ addEventProcessor(callback) { this._eventProcessors.push(callback); return this; } /** * @inheritDoc */ setUser(user) { this._user = user || {}; if (this._session) { updateSession(this._session, { user }); } this._notifyScopeListeners(); return this; } /** * @inheritDoc */ getUser() { return this._user; } /** * @inheritDoc */ getRequestSession() { return this._requestSession; } /** * @inheritDoc */ setRequestSession(requestSession) { this._requestSession = requestSession; return this; } /** * @inheritDoc */ setTags(tags) { this._tags = { ...this._tags, ...tags, }; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setTag(key, value) { this._tags = { ...this._tags, [key]: value }; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setExtras(extras) { this._extra = { ...this._extra, ...extras, }; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setExtra(key, extra) { this._extra = { ...this._extra, [key]: extra }; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setFingerprint(fingerprint) { this._fingerprint = fingerprint; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setLevel( // eslint-disable-next-line deprecation/deprecation level, ) { this._level = level; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setTransactionName(name) { this._transactionName = name; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setContext(key, context) { if (context === null) { // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete this._contexts[key]; } else { this._contexts[key] = context; } this._notifyScopeListeners(); return this; } /** * @inheritDoc */ setSpan(span) { this._span = span; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ getSpan() { return this._span; } /** * @inheritDoc */ getTransaction() { // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will // have a pointer to the currently-active transaction. const span = this.getSpan(); return span && span.transaction; } /** * @inheritDoc */ setSession(session) { if (!session) { delete this._session; } else { this._session = session; } this._notifyScopeListeners(); return this; } /** * @inheritDoc */ getSession() { return this._session; } /** * @inheritDoc */ update(captureContext) { if (!captureContext) { return this; } if (typeof captureContext === 'function') { const updatedScope = (captureContext )(this); return updatedScope instanceof Scope ? updatedScope : this; } if (captureContext instanceof Scope) { this._tags = { ...this._tags, ...captureContext._tags }; this._extra = { ...this._extra, ...captureContext._extra }; this._contexts = { ...this._contexts, ...captureContext._contexts }; if (captureContext._user && Object.keys(captureContext._user).length) { this._user = captureContext._user; } if (captureContext._level) { this._level = captureContext._level; } if (captureContext._fingerprint) { this._fingerprint = captureContext._fingerprint; } if (captureContext._requestSession) { this._requestSession = captureContext._requestSession; } } else if (is_isPlainObject(captureContext)) { // eslint-disable-next-line no-param-reassign captureContext = captureContext ; this._tags = { ...this._tags, ...captureContext.tags }; this._extra = { ...this._extra, ...captureContext.extra }; this._contexts = { ...this._contexts, ...captureContext.contexts }; if (captureContext.user) { this._user = captureContext.user; } if (captureContext.level) { this._level = captureContext.level; } if (captureContext.fingerprint) { this._fingerprint = captureContext.fingerprint; } if (captureContext.requestSession) { this._requestSession = captureContext.requestSession; } } return this; } /** * @inheritDoc */ clear() { this._breadcrumbs = []; this._tags = {}; this._extra = {}; this._user = {}; this._contexts = {}; this._level = undefined; this._transactionName = undefined; this._fingerprint = undefined; this._requestSession = undefined; this._span = undefined; this._session = undefined; this._notifyScopeListeners(); this._attachments = []; return this; } /** * @inheritDoc */ addBreadcrumb(breadcrumb, maxBreadcrumbs) { const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; // No data has been changed, so don't notify scope listeners if (maxCrumbs <= 0) { return this; } const mergedBreadcrumb = { timestamp: (0,time/* dateTimestampInSeconds */.yW)(), ...breadcrumb, }; this._breadcrumbs = [...this._breadcrumbs, mergedBreadcrumb].slice(-maxCrumbs); this._notifyScopeListeners(); return this; } /** * @inheritDoc */ getLastBreadcrumb() { return this._breadcrumbs[this._breadcrumbs.length - 1]; } /** * @inheritDoc */ clearBreadcrumbs() { this._breadcrumbs = []; this._notifyScopeListeners(); return this; } /** * @inheritDoc */ addAttachment(attachment) { this._attachments.push(attachment); return this; } /** * @inheritDoc */ getAttachments() { return this._attachments; } /** * @inheritDoc */ clearAttachments() { this._attachments = []; return this; } /** * Applies data from the scope to the event and runs all event processors on it. * * @param event Event * @param hint Object containing additional information about the original exception, for use by the event processors. * @hidden */ applyToEvent(event, hint = {}) { if (this._extra && Object.keys(this._extra).length) { event.extra = { ...this._extra, ...event.extra }; } if (this._tags && Object.keys(this._tags).length) { event.tags = { ...this._tags, ...event.tags }; } if (this._user && Object.keys(this._user).length) { event.user = { ...this._user, ...event.user }; } if (this._contexts && Object.keys(this._contexts).length) { event.contexts = { ...this._contexts, ...event.contexts }; } if (this._level) { event.level = this._level; } if (this._transactionName) { event.transaction = this._transactionName; } // We want to set the trace context for normal events only if there isn't already // a trace context on the event. There is a product feature in place where we link // errors with transaction and it relies on that. if (this._span) { event.contexts = { trace: this._span.getTraceContext(), ...event.contexts }; const transactionName = this._span.transaction && this._span.transaction.name; if (transactionName) { event.tags = { transaction: transactionName, ...event.tags }; } } this._applyFingerprint(event); event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs]; event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined; event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, ...this._sdkProcessingMetadata }; return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint); } /** * Add data which will be accessible during event processing but won't get sent to Sentry */ setSDKProcessingMetadata(newData) { this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData }; return this; } /** * This will be called after {@link applyToEvent} is finished. */ _notifyEventProcessors( processors, event, hint, index = 0, ) { return new SyncPromise((resolve, reject) => { const processor = processors[index]; if (event === null || typeof processor !== 'function') { resolve(event); } else { const result = processor({ ...event }, hint) ; (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && processor.id && result === null && logger.log(`Event processor "${processor.id}" dropped event`); if (isThenable(result)) { void result .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve)) .then(null, reject); } else { void this._notifyEventProcessors(processors, result, hint, index + 1) .then(resolve) .then(null, reject); } } }); } /** * This will be called on every set call. */ _notifyScopeListeners() { // We need this check for this._notifyingListeners to be able to work on scope during updates // If this check is not here we'll produce endless recursion when something is done with the scope // during the callback. if (!this._notifyingListeners) { this._notifyingListeners = true; this._scopeListeners.forEach(callback => { callback(this); }); this._notifyingListeners = false; } } /** * Applies fingerprint from the scope to the event if there's one, * uses message if there's one instead or get rid of empty fingerprint */ _applyFingerprint(event) { // Make sure it's an array first and we actually have something in place event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : []; // If we have something on the scope, then merge it with event if (this._fingerprint) { event.fingerprint = event.fingerprint.concat(this._fingerprint); } // If we have no data at all, remove empty array default if (event.fingerprint && !event.fingerprint.length) { delete event.fingerprint; } } } /** * Returns the global event processors. */ function getGlobalEventProcessors() { return (0,worldwide/* getGlobalSingleton */.YO)('globalEventProcessors', () => []); } /** * Add a EventProcessor to be kept globally. * @param callback EventProcessor to add */ function addGlobalEventProcessor(callback) { getGlobalEventProcessors().push(callback); } //# sourceMappingURL=scope.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/hub.js /** * API compatibility version of this hub. * * WARNING: This number should only be increased when the global interface * changes and new methods are introduced. * * @hidden */ const API_VERSION = 4; /** * Default maximum number of breadcrumbs added to an event. Can be overwritten * with {@link Options.maxBreadcrumbs}. */ const DEFAULT_BREADCRUMBS = 100; /** * A layer in the process stack. * @hidden */ /** * @inheritDoc */ class Hub { /** Is a {@link Layer}[] containing the client and scope */ __init() {this._stack = [{}];} /** Contains the last event id of a captured event. */ /** * Creates a new instance of the hub, will push one {@link Layer} into the * internal stack on creation. * * @param client bound to the hub. * @param scope bound to the hub. * @param version number, higher number means higher priority. */ constructor(client, scope = new Scope(), _version = API_VERSION) {this._version = _version;Hub.prototype.__init.call(this); this.getStackTop().scope = scope; if (client) { this.bindClient(client); } } /** * @inheritDoc */ isOlderThan(version) { return this._version < version; } /** * @inheritDoc */ bindClient(client) { const top = this.getStackTop(); top.client = client; if (client && client.setupIntegrations) { client.setupIntegrations(); } } /** * @inheritDoc */ pushScope() { // We want to clone the content of prev scope const scope = Scope.clone(this.getScope()); this.getStack().push({ client: this.getClient(), scope, }); return scope; } /** * @inheritDoc */ popScope() { if (this.getStack().length <= 1) return false; return !!this.getStack().pop(); } /** * @inheritDoc */ withScope(callback) { const scope = this.pushScope(); try { callback(scope); } finally { this.popScope(); } } /** * @inheritDoc */ getClient() { return this.getStackTop().client ; } /** Returns the scope of the top stack. */ getScope() { return this.getStackTop().scope; } /** Returns the scope stack for domains or the process. */ getStack() { return this._stack; } /** Returns the topmost scope layer in the order domain > local > process. */ getStackTop() { return this._stack[this._stack.length - 1]; } /** * @inheritDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types captureException(exception, hint) { const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4()); const syntheticException = new Error('Sentry syntheticException'); this._withClient((client, scope) => { client.captureException( exception, { originalException: exception, syntheticException, ...hint, event_id: eventId, }, scope, ); }); return eventId; } /** * @inheritDoc */ captureMessage( message, // eslint-disable-next-line deprecation/deprecation level, hint, ) { const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4()); const syntheticException = new Error(message); this._withClient((client, scope) => { client.captureMessage( message, level, { originalException: message, syntheticException, ...hint, event_id: eventId, }, scope, ); }); return eventId; } /** * @inheritDoc */ captureEvent(event, hint) { const eventId = hint && hint.event_id ? hint.event_id : uuid4(); if (!event.type) { this._lastEventId = eventId; } this._withClient((client, scope) => { client.captureEvent(event, { ...hint, event_id: eventId }, scope); }); return eventId; } /** * @inheritDoc */ lastEventId() { return this._lastEventId; } /** * @inheritDoc */ addBreadcrumb(breadcrumb, hint) { const { scope, client } = this.getStackTop(); if (!scope || !client) return; const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = (client.getOptions && client.getOptions()) || {}; if (maxBreadcrumbs <= 0) return; const timestamp = (0,time/* dateTimestampInSeconds */.yW)(); const mergedBreadcrumb = { timestamp, ...breadcrumb }; const finalBreadcrumb = beforeBreadcrumb ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) ) : mergedBreadcrumb; if (finalBreadcrumb === null) return; scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); } /** * @inheritDoc */ setUser(user) { const scope = this.getScope(); if (scope) scope.setUser(user); } /** * @inheritDoc */ setTags(tags) { const scope = this.getScope(); if (scope) scope.setTags(tags); } /** * @inheritDoc */ setExtras(extras) { const scope = this.getScope(); if (scope) scope.setExtras(extras); } /** * @inheritDoc */ setTag(key, value) { const scope = this.getScope(); if (scope) scope.setTag(key, value); } /** * @inheritDoc */ setExtra(key, extra) { const scope = this.getScope(); if (scope) scope.setExtra(key, extra); } /** * @inheritDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any setContext(name, context) { const scope = this.getScope(); if (scope) scope.setContext(name, context); } /** * @inheritDoc */ configureScope(callback) { const { scope, client } = this.getStackTop(); if (scope && client) { callback(scope); } } /** * @inheritDoc */ run(callback) { const oldHub = makeMain(this); try { callback(this); } finally { makeMain(oldHub); } } /** * @inheritDoc */ getIntegration(integration) { const client = this.getClient(); if (!client) return null; try { return client.getIntegration(integration); } catch (_oO) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`); return null; } } /** * @inheritDoc */ startTransaction(context, customSamplingContext) { return this._callExtensionMethod('startTransaction', context, customSamplingContext); } /** * @inheritDoc */ traceHeaders() { return this._callExtensionMethod('traceHeaders'); } /** * @inheritDoc */ captureSession(endSession = false) { // both send the update and pull the session from the scope if (endSession) { return this.endSession(); } // only send the update this._sendSessionUpdate(); } /** * @inheritDoc */ endSession() { const layer = this.getStackTop(); const scope = layer && layer.scope; const session = scope && scope.getSession(); if (session) { closeSession(session); } this._sendSessionUpdate(); // the session is over; take it off of the scope if (scope) { scope.setSession(); } } /** * @inheritDoc */ startSession(context) { const { scope, client } = this.getStackTop(); const { release, environment } = (client && client.getOptions()) || {}; // Will fetch userAgent if called from browser sdk const { userAgent } = worldwide/* GLOBAL_OBJ.navigator */.n2.navigator || {}; const session = makeSession({ release, environment, ...(scope && { user: scope.getUser() }), ...(userAgent && { userAgent }), ...context, }); if (scope) { // End existing session if there's one const currentSession = scope.getSession && scope.getSession(); if (currentSession && currentSession.status === 'ok') { updateSession(currentSession, { status: 'exited' }); } this.endSession(); // Afterwards we set the new session on the scope scope.setSession(session); } return session; } /** * Returns if default PII should be sent to Sentry and propagated in ourgoing requests * when Tracing is used. */ shouldSendDefaultPii() { const client = this.getClient(); const options = client && client.getOptions(); return Boolean(options && options.sendDefaultPii); } /** * Sends the current Session on the scope */ _sendSessionUpdate() { const { scope, client } = this.getStackTop(); if (!scope) return; const session = scope.getSession(); if (session) { if (client && client.captureSession) { client.captureSession(session); } } } /** * Internal helper function to call a method on the top client if it exists. * * @param method The method to call on the client. * @param args Arguments to pass to the client function. */ _withClient(callback) { const { scope, client } = this.getStackTop(); if (client) { callback(client, scope); } } /** * Calls global extension method and binding current instance to the function call */ // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366) // eslint-disable-next-line @typescript-eslint/no-explicit-any _callExtensionMethod(method, ...args) { const carrier = getMainCarrier(); const sentry = carrier.__SENTRY__; if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') { return sentry.extensions[method].apply(this, args); } (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`); } } /** * Returns the global shim registry. * * FIXME: This function is problematic, because despite always returning a valid Carrier, * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there. **/ function getMainCarrier() { worldwide/* GLOBAL_OBJ.__SENTRY__ */.n2.__SENTRY__ = worldwide/* GLOBAL_OBJ.__SENTRY__ */.n2.__SENTRY__ || { extensions: {}, hub: undefined, }; return worldwide/* GLOBAL_OBJ */.n2; } /** * Replaces the current main hub with the passed one on the global object * * @returns The old replaced hub */ function makeMain(hub) { const registry = getMainCarrier(); const oldHub = getHubFromCarrier(registry); setHubOnCarrier(registry, hub); return oldHub; } /** * Returns the default hub instance. * * If a hub is already registered in the global carrier but this module * contains a more recent version, it replaces the registered version. * Otherwise, the currently registered hub will be returned. */ function getCurrentHub() { // Get main carrier (global for every environment) const registry = getMainCarrier(); // If there's no hub, or its an old API, assign a new one if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) { setHubOnCarrier(registry, new Hub()); } // Prefer domains over global if they are there (applicable only to Node environment) if ((0,node/* isNodeEnv */.KV)()) { return getHubFromActiveDomain(registry); } // Return hub that lives on a global object return getHubFromCarrier(registry); } /** * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist * @returns discovered hub */ function getHubFromActiveDomain(registry) { try { const sentry = getMainCarrier().__SENTRY__; const activeDomain = sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active; // If there's no active domain, just return global hub if (!activeDomain) { return getHubFromCarrier(registry); } // If there's no hub on current domain, or it's an old API, assign a new one if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) { const registryHubTopStack = getHubFromCarrier(registry).getStackTop(); setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope))); } // Return hub that lives on a domain return getHubFromCarrier(activeDomain); } catch (_Oo) { // Return hub that lives on a global object return getHubFromCarrier(registry); } } /** * This will tell whether a carrier has a hub on it or not * @param carrier object */ function hasHubOnCarrier(carrier) { return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub); } /** * This will create a new {@link Hub} and add to the passed object on * __SENTRY__.hub. * @param carrier object * @hidden */ function getHubFromCarrier(carrier) { return (0,worldwide/* getGlobalSingleton */.YO)('hub', () => new Hub(), carrier); } /** * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute * @param carrier object * @param hub Hub * @returns A boolean indicating success or failure */ function setHubOnCarrier(carrier, hub) { if (!carrier) return false; const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {}); __SENTRY__.hub = hub; return true; } //# sourceMappingURL=hub.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/version.js const SDK_VERSION = '7.34.0'; //# sourceMappingURL=version.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/exports.js // Note: All functions in this file are typed with a return value of `ReturnType`, // where HUB_FUNCTION is some method on the Hub class. // // This is done to make sure the top level SDK methods stay in sync with the hub methods. // Although every method here has an explicit return type, some of them (that map to void returns) do not // contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable. /** * Captures an exception event and sends it to Sentry. * * @param exception An exception-like object. * @param captureContext Additional scope data to apply to exception event. * @returns The generated eventId. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types function captureException(exception, captureContext) { return getCurrentHub().captureException(exception, { captureContext }); } /** * Captures a message event and sends it to Sentry. * * @param message The message to send to Sentry. * @param Severity Define the level of the message. * @returns The generated eventId. */ function captureMessage( message, // eslint-disable-next-line deprecation/deprecation captureContext, ) { // This is necessary to provide explicit scopes upgrade, without changing the original // arity of the `captureMessage(message, level)` method. const level = typeof captureContext === 'string' ? captureContext : undefined; const context = typeof captureContext !== 'string' ? { captureContext } : undefined; return getCurrentHub().captureMessage(message, level, context); } /** * Captures a manually created event and sends it to Sentry. * * @param event The event to send to Sentry. * @returns The generated eventId. */ function captureEvent(event, hint) { return getCurrentHub().captureEvent(event, hint); } /** * Callback to set context information onto the scope. * @param callback Callback function that receives Scope. */ function configureScope(callback) { getCurrentHub().configureScope(callback); } /** * Records a new breadcrumb which will be attached to future events. * * Breadcrumbs will be added to subsequent events to provide more context on * user's actions prior to an error or crash. * * @param breadcrumb The breadcrumb to record. */ function addBreadcrumb(breadcrumb) { getCurrentHub().addBreadcrumb(breadcrumb); } /** * Sets context data with the given name. * @param name of the context * @param context Any kind of data. This data will be normalized. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setContext(name, context) { getCurrentHub().setContext(name, context); } /** * Set an object that will be merged sent as extra data with the event. * @param extras Extras object to merge into current context. */ function setExtras(extras) { getCurrentHub().setExtras(extras); } /** * Set key:value that will be sent as extra data with the event. * @param key String of extra * @param extra Any kind of data. This data will be normalized. */ function setExtra(key, extra) { getCurrentHub().setExtra(key, extra); } /** * Set an object that will be merged sent as tags data with the event. * @param tags Tags context object to merge into current context. */ function setTags(tags) { getCurrentHub().setTags(tags); } /** * Set key:value that will be sent as tags data with the event. * * Can also be used to unset a tag, by passing `undefined`. * * @param key String key of tag * @param value Value of tag */ function setTag(key, value) { getCurrentHub().setTag(key, value); } /** * Updates user context information for future events. * * @param user User context object to be set in the current context. Pass `null` to unset the user. */ function setUser(user) { getCurrentHub().setUser(user); } /** * Creates a new scope with and executes the given operation within. * The scope is automatically removed once the operation * finishes or throws. * * This is essentially a convenience function for: * * pushScope(); * callback(); * popScope(); * * @param callback that will be enclosed into push/popScope. */ function withScope(callback) { getCurrentHub().withScope(callback); } /** * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation. * * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a * new child span within the transaction or any span, call the respective `.startChild()` method. * * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded. * * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its * finished child spans will be sent to Sentry. * * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call * `startTransaction` directly on the hub. * * @param context Properties of the new `Transaction`. * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent * default values). See {@link Options.tracesSampler}. * * @returns The transaction which was just started */ function startTransaction( context, customSamplingContext, ) { return getCurrentHub().startTransaction({ ...context }, customSamplingContext); } //# sourceMappingURL=exports.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/error.js /** An error emitted by Sentry SDKs and related utilities. */ class SentryError extends Error { /** Display name of this error instance. */ constructor( message, logLevel = 'warn') { super(message);this.message = message; this.name = new.target.prototype.constructor.name; // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes // instances of `SentryError` fail `obj instanceof SentryError` checks. Object.setPrototypeOf(this, new.target.prototype); this.logLevel = logLevel; } } //# sourceMappingURL=error.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/promisebuffer.js /** * Creates an new PromiseBuffer object with the specified limit * @param limit max number of promises that can be stored in the buffer */ function makePromiseBuffer(limit) { const buffer = []; function isReady() { return limit === undefined || buffer.length < limit; } /** * Remove a promise from the queue. * * @param task Can be any PromiseLike * @returns Removed promise. */ function remove(task) { return buffer.splice(buffer.indexOf(task), 1)[0]; } /** * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. * * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task: * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer * limit check. * @returns The original promise. */ function add(taskProducer) { if (!isReady()) { return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.')); } // start the task and add its promise to the queue const task = taskProducer(); if (buffer.indexOf(task) === -1) { buffer.push(task); } void task .then(() => remove(task)) // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't // have promises, so TS has to polyfill when down-compiling.) .then(null, () => remove(task).then(null, () => { // We have to add another catch here because `remove()` starts a new promise chain. }), ); return task; } /** * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. * * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to * `true`. * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and * `false` otherwise */ function drain(timeout) { return new SyncPromise((resolve, reject) => { let counter = buffer.length; if (!counter) { return resolve(true); } // wait for `timeout` ms and then resolve to `false` (if not cancelled first) const capturedSetTimeout = setTimeout(() => { if (timeout && timeout > 0) { resolve(false); } }, timeout); // if all promises resolve in time, cancel the timer and resolve to `true` buffer.forEach(item => { void resolvedSyncPromise(item).then(() => { if (!--counter) { clearTimeout(capturedSetTimeout); resolve(true); } }, reject); }); }); } return { $: buffer, add, drain, }; } //# sourceMappingURL=promisebuffer.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/dsn.js /** Regular expression used to parse a Dsn. */ const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; function isValidProtocol(protocol) { return protocol === 'http' || protocol === 'https'; } /** * Renders the string representation of this Dsn. * * By default, this will render the public representation without the password * component. To get the deprecated private representation, set `withPassword` * to true. * * @param withPassword When set to true, the password will be included. */ function dsn_dsnToString(dsn, withPassword = false) { const { host, path, pass, port, projectId, protocol, publicKey } = dsn; return ( `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` + `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}` ); } /** * Parses a Dsn from a given string. * * @param str A Dsn as string * @returns Dsn as DsnComponents */ function dsnFromString(str) { const match = DSN_REGEX.exec(str); if (!match) { throw new SentryError(`Invalid Sentry Dsn: ${str}`); } const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1); let path = ''; let projectId = lastPath; const split = projectId.split('/'); if (split.length > 1) { path = split.slice(0, -1).join('/'); projectId = split.pop() ; } if (projectId) { const projectMatch = projectId.match(/^\d+/); if (projectMatch) { projectId = projectMatch[0]; } } return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey }); } function dsnFromComponents(components) { return { protocol: components.protocol, publicKey: components.publicKey || '', pass: components.pass || '', host: components.host, port: components.port || '', path: components.path || '', projectId: components.projectId, }; } function validateDsn(dsn) { if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { return; } const { port, projectId, protocol } = dsn; const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; requiredComponents.forEach(component => { if (!dsn[component]) { throw new SentryError(`Invalid Sentry Dsn: ${component} missing`); } }); if (!projectId.match(/^\d+$/)) { throw new SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); } if (!isValidProtocol(protocol)) { throw new SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); } if (port && isNaN(parseInt(port, 10))) { throw new SentryError(`Invalid Sentry Dsn: Invalid port ${port}`); } return true; } /** The Sentry Dsn, identifying a Sentry instance and project. */ function dsn_makeDsn(from) { const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); validateDsn(components); return components; } //# sourceMappingURL=dsn.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/memo.js /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-explicit-any */ /** * Helper to decycle json objects */ function memoBuilder() { const hasWeakSet = typeof WeakSet === 'function'; const inner = hasWeakSet ? new WeakSet() : []; function memoize(obj) { if (hasWeakSet) { if (inner.has(obj)) { return true; } inner.add(obj); return false; } // eslint-disable-next-line @typescript-eslint/prefer-for-of for (let i = 0; i < inner.length; i++) { const value = inner[i]; if (value === obj) { return true; } } inner.push(obj); return false; } function unmemoize(obj) { if (hasWeakSet) { inner.delete(obj); } else { for (let i = 0; i < inner.length; i++) { if (inner[i] === obj) { inner.splice(i, 1); break; } } } } return [memoize, unmemoize]; } //# sourceMappingURL=memo.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/stacktrace.js const STACKTRACE_LIMIT = 50; /** * Creates a stack parser with the supplied line parsers * * StackFrames are returned in the correct order for Sentry Exception * frames and with Sentry SDK internal frames removed from the top and bottom * */ function createStackParser(...parsers) { const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]); return (stack, skipFirst = 0) => { const frames = []; for (const line of stack.split('\n').slice(skipFirst)) { // Ignore lines over 1kb as they are unlikely to be stack frames. // Many of the regular expressions use backtracking which results in run time that increases exponentially with // input size. Huge strings can result in hangs/Denial of Service: // https://github.com/getsentry/sentry-javascript/issues/2286 if (line.length > 1024) { continue; } // https://github.com/getsentry/sentry-javascript/issues/5459 // Remove webpack (error: *) wrappers const cleanedLine = line.replace(/\(error: (.*)\)/, '$1'); for (const parser of sortedParsers) { const frame = parser(cleanedLine); if (frame) { frames.push(frame); break; } } } return stripSentryFramesAndReverse(frames); }; } /** * Gets a stack parser implementation from Options.stackParser * @see Options * * If options contains an array of line parsers, it is converted into a parser */ function stackParserFromStackParserOptions(stackParser) { if (Array.isArray(stackParser)) { return createStackParser(...stackParser); } return stackParser; } /** * @hidden */ function stripSentryFramesAndReverse(stack) { if (!stack.length) { return []; } let localStack = stack; const firstFrameFunction = localStack[0].function || ''; const lastFrameFunction = localStack[localStack.length - 1].function || ''; // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) { localStack = localStack.slice(1); } // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call) if (lastFrameFunction.indexOf('sentryWrapped') !== -1) { localStack = localStack.slice(0, -1); } // The frame where the crash happened, should be the last entry in the array return localStack .slice(0, STACKTRACE_LIMIT) .map(frame => ({ ...frame, filename: frame.filename || localStack[0].filename, function: frame.function || '?', })) .reverse(); } const defaultFunctionName = ''; /** * Safely extract function name from itself */ function getFunctionName(fn) { try { if (!fn || typeof fn !== 'function') { return defaultFunctionName; } return fn.name || defaultFunctionName; } catch (e) { // Just accessing custom props in some Selenium environments // can cause a "Permission denied" exception (see raven-js#495). return defaultFunctionName; } } // eslint-disable-next-line complexity function stacktrace_node(getModule) { const FILENAME_MATCH = /^\s*[-]{4,}$/; const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; // eslint-disable-next-line complexity return (line) => { if (line.match(FILENAME_MATCH)) { return { filename: line, }; } const lineMatch = line.match(FULL_MATCH); if (!lineMatch) { return undefined; } let object; let method; let functionName; let typeName; let methodName; if (lineMatch[1]) { functionName = lineMatch[1]; let methodStart = functionName.lastIndexOf('.'); if (functionName[methodStart - 1] === '.') { methodStart--; } if (methodStart > 0) { object = functionName.slice(0, methodStart); method = functionName.slice(methodStart + 1); const objectEnd = object.indexOf('.Module'); if (objectEnd > 0) { functionName = functionName.slice(objectEnd + 1); object = object.slice(0, objectEnd); } } typeName = undefined; } if (method) { typeName = object; methodName = method; } if (method === '') { methodName = undefined; functionName = undefined; } if (functionName === undefined) { methodName = methodName || ''; functionName = typeName ? `${typeName}.${methodName}` : methodName; } const filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2]; const isNative = lineMatch[5] === 'native'; const isInternal = isNative || (filename && !filename.startsWith('/') && !filename.startsWith('.') && filename.indexOf(':\\') !== 1); // in_app is all that's not an internal Node function or a module within node_modules // note that isNative appears to return true even for node core libraries // see https://github.com/getsentry/raven-node/issues/176 const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/'); return { filename, module: getModule ? getModule(filename) : undefined, function: functionName, lineno: parseInt(lineMatch[3], 10) || undefined, colno: parseInt(lineMatch[4], 10) || undefined, in_app, }; }; } /** * Node.js stack line parser * * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain */ function nodeStackLineParser(getModule) { return [90, stacktrace_node(getModule)]; } //# sourceMappingURL=stacktrace.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/normalize.js /** * Recursively normalizes the given object. * * - Creates a copy to prevent original input mutation * - Skips non-enumerable properties * - When stringifying, calls `toJSON` if implemented * - Removes circular references * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format * - Translates known global objects/classes to a string representations * - Takes care of `Error` object serialization * - Optionally limits depth of final output * - Optionally limits number of properties/elements included in any single object/array * * @param input The object to be normalized. * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) * @param maxProperties The max number of elements or properties to be included in any single array or * object in the normallized output. * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function normalize_normalize(input, depth = +Infinity, maxProperties = +Infinity) { try { // since we're at the outermost level, we don't provide a key return visit('', input, depth, maxProperties); } catch (err) { return { ERROR: `**non-serializable** (${err})` }; } } /** JSDoc */ function normalizeToSize( // eslint-disable-next-line @typescript-eslint/no-explicit-any object, // Default Node.js REPL depth depth = 3, // 100kB, as 200kB is max payload size, so half sounds reasonable maxSize = 100 * 1024, ) { const normalized = normalize_normalize(object, depth); if (jsonSize(normalized) > maxSize) { return normalizeToSize(object, depth - 1, maxSize); } return normalized ; } /** * Visits a node to perform normalization on it * * @param key The key corresponding to the given node * @param value The node to be visited * @param depth Optional number indicating the maximum recursion depth * @param maxProperties Optional maximum number of properties/elements included in any single object/array * @param memo Optional Memo class handling decycling */ function visit( key, value, depth = +Infinity, maxProperties = +Infinity, memo = memoBuilder(), ) { const [memoize, unmemoize] = memo; // Get the simple cases out of the way first if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !is_isNaN(value))) { return value ; } const stringified = stringifyValue(key, value); // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. // Everything else will have already been serialized, so if we don't see that pattern, we're done. if (!stringified.startsWith('[object ')) { return stringified; } // From here on, we can assert that `value` is either an object or an array. // Do not normalize objects that we know have already been normalized. As a general rule, the // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that // have already been normalized. if ((value )['__sentry_skip_normalization__']) { return value ; } // We're also done if we've reached the max depth if (depth === 0) { // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. return stringified.replace('object ', ''); } // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. if (memoize(value)) { return '[Circular ~]'; } // If the value has a `toJSON` method, we call it to extract more information const valueWithToJSON = value ; if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { try { const jsonValue = valueWithToJSON.toJSON(); // We need to normalize the return value of `.toJSON()` in case it has circular references return visit('', jsonValue, depth - 1, maxProperties, memo); } catch (err) { // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) } } // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each // property/entry, and keep track of the number of items we add to it. const normalized = (Array.isArray(value) ? [] : {}) ; let numAdded = 0; // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant // properties are non-enumerable and otherwise would get missed. const visitable = convertToPlainObject(value ); for (const visitKey in visitable) { // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { continue; } if (numAdded >= maxProperties) { normalized[visitKey] = '[MaxProperties ~]'; break; } // Recursively visit all the child nodes const visitValue = visitable[visitKey]; normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo); numAdded++; } // Once we've visited all the branches, remove the parent from memo storage unmemoize(value); // Return accumulated values return normalized; } /** * Stringify the given value. Handles various known special values and types. * * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn * the number 1231 into "[Object Number]", nor on `null`, as it will throw. * * @param value The value to stringify * @returns A stringified representation of the given value */ function stringifyValue( key, // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for // our internal use, it'll do value, ) { try { if (key === 'domain' && value && typeof value === 'object' && (value )._events) { return '[Domain]'; } if (key === 'domainEmitter') { return '[DomainEmitter]'; } // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first // which won't throw if they are not present. if (typeof global !== 'undefined' && value === global) { return '[Global]'; } // eslint-disable-next-line no-restricted-globals if (typeof window !== 'undefined' && value === window) { return '[Window]'; } // eslint-disable-next-line no-restricted-globals if (typeof document !== 'undefined' && value === document) { return '[Document]'; } // React's SyntheticEvent thingy if (isSyntheticEvent(value)) { return '[SyntheticEvent]'; } if (typeof value === 'number' && value !== value) { return '[NaN]'; } // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own) if (value === void 0) { return '[undefined]'; } if (typeof value === 'function') { return `[Function: ${getFunctionName(value)}]`; } if (typeof value === 'symbol') { return `[${String(value)}]`; } // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion if (typeof value === 'bigint') { return `[BigInt: ${String(value)}]`; } // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), // we can make sure that only plain objects come out that way. return `[object ${(Object.getPrototypeOf(value) ).constructor.name}]`; } catch (err) { return `**non-serializable** (${err})`; } } /** Calculates bytes size of input string */ function utf8Length(value) { // eslint-disable-next-line no-bitwise return ~-encodeURI(value).split(/%..|./).length; } /** Calculates bytes size of input object */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function jsonSize(value) { return utf8Length(JSON.stringify(value)); } //# sourceMappingURL=normalize.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/envelope.js /** * Creates an envelope. * Make sure to always explicitly provide the generic to this function * so that the envelope types resolve correctly. */ function createEnvelope(headers, items = []) { return [headers, items] ; } /** * Add an item to an envelope. * Make sure to always explicitly provide the generic to this function * so that the envelope types resolve correctly. */ function addItemToEnvelope(envelope, newItem) { const [headers, items] = envelope; return [headers, [...items, newItem]] ; } /** * Convenience function to loop through the items and item types of an envelope. * (This function was mostly created because working with envelope types is painful at the moment) */ function forEachEnvelopeItem( envelope, callback, ) { const envelopeItems = envelope[1]; envelopeItems.forEach((envelopeItem) => { const envelopeItemType = envelopeItem[0].type; callback(envelopeItem, envelopeItemType); }); } /** * Encode a string to UTF8. */ function encodeUTF8(input, textEncoder) { const utf8 = textEncoder || new TextEncoder(); return utf8.encode(input); } /** * Serializes an envelope. */ function serializeEnvelope(envelope, textEncoder) { const [envHeaders, items] = envelope; // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data let parts = JSON.stringify(envHeaders); function append(next) { if (typeof parts === 'string') { parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next]; } else { parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next); } } for (const item of items) { const [itemHeaders, payload] = item; append(`\n${JSON.stringify(itemHeaders)}\n`); if (typeof payload === 'string' || payload instanceof Uint8Array) { append(payload); } else { let stringifiedPayload; try { stringifiedPayload = JSON.stringify(payload); } catch (e) { // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still // fails, we try again after normalizing it again with infinite normalization depth. This of course has a // performance impact but in this case a performance hit is better than throwing. stringifiedPayload = JSON.stringify(normalize_normalize(payload)); } append(stringifiedPayload); } } return typeof parts === 'string' ? parts : concatBuffers(parts); } function concatBuffers(buffers) { const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); const merged = new Uint8Array(totalLength); let offset = 0; for (const buffer of buffers) { merged.set(buffer, offset); offset += buffer.length; } return merged; } /** * Parses an envelope */ function parseEnvelope( env, textEncoder, textDecoder, ) { let buffer = typeof env === 'string' ? textEncoder.encode(env) : env; function readBinary(length) { const bin = buffer.subarray(0, length); // Replace the buffer with the remaining data excluding trailing newline buffer = buffer.subarray(length + 1); return bin; } function readJson() { let i = buffer.indexOf(0xa); // If we couldn't find a newline, we must have found the end of the buffer if (i < 0) { i = buffer.length; } return JSON.parse(textDecoder.decode(readBinary(i))) ; } const envelopeHeader = readJson(); // eslint-disable-next-line @typescript-eslint/no-explicit-any const items = []; while (buffer.length) { const itemHeader = readJson(); const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined; items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]); } return [envelopeHeader, items]; } /** * Creates attachment envelope items */ function createAttachmentEnvelopeItem( attachment, textEncoder, ) { const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data; return [ dropUndefinedKeys({ type: 'attachment', length: buffer.length, filename: attachment.filename, content_type: attachment.contentType, attachment_type: attachment.attachmentType, }), buffer, ]; } const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { session: 'session', sessions: 'session', attachment: 'attachment', transaction: 'transaction', event: 'error', client_report: 'internal', user_report: 'default', profile: 'profile', replay_event: 'replay', replay_recording: 'replay', }; /** * Maps the type of an envelope item to a data category. */ function envelopeItemTypeToDataCategory(type) { return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; } /** Extracts the minimal SDK info from from the metadata or an events */ function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { if (!metadataOrEvent || !metadataOrEvent.sdk) { return; } const { name, version } = metadataOrEvent.sdk; return { name, version }; } /** * Creates event envelope headers, based on event, sdk info and tunnel * Note: This function was extracted from the core package to make it available in Replay */ function createEventEnvelopeHeaders( event, sdkInfo, tunnel, dsn, ) { const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; return { event_id: event.event_id , sent_at: new Date().toISOString(), ...(sdkInfo && { sdk: sdkInfo }), ...(!!tunnel && { dsn: dsn_dsnToString(dsn) }), ...(event.type === 'transaction' && dynamicSamplingContext && { trace: dropUndefinedKeys({ ...dynamicSamplingContext }), }), }; } //# sourceMappingURL=envelope.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/ratelimit.js // Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds /** * Extracts Retry-After value from the request header or returns default value * @param header string representation of 'Retry-After' header * @param now current unix timestamp * */ function parseRetryAfterHeader(header, now = Date.now()) { const headerDelay = parseInt(`${header}`, 10); if (!isNaN(headerDelay)) { return headerDelay * 1000; } const headerDate = Date.parse(`${header}`); if (!isNaN(headerDate)) { return headerDate - now; } return DEFAULT_RETRY_AFTER; } /** * Gets the time that the given category is disabled until for rate limiting. * In case no category-specific limit is set but a general rate limit across all categories is active, * that time is returned. * * @return the time in ms that the category is disabled until or 0 if there's no active rate limit. */ function disabledUntil(limits, category) { return limits[category] || limits.all || 0; } /** * Checks if a category is rate limited */ function isRateLimited(limits, category, now = Date.now()) { return disabledUntil(limits, category) > now; } /** * Update ratelimits from incoming headers. * * @return the updated RateLimits object. */ function updateRateLimits( limits, { statusCode, headers }, now = Date.now(), ) { const updatedRateLimits = { ...limits, }; // "The name is case-insensitive." // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get const rateLimitHeader = headers && headers['x-sentry-rate-limits']; const retryAfterHeader = headers && headers['retry-after']; if (rateLimitHeader) { /** * rate limit headers are of the form *
,
,.. * where each
is of the form * : : : * where * is a delay in seconds * is the event type(s) (error, transaction, etc) being rate limited and is of the form * ;;... * is what's being limited (org, project, or key) - ignored by SDK * is an arbitrary string like "org_quota" - ignored by SDK */ for (const limit of rateLimitHeader.trim().split(',')) { const [retryAfter, categories] = limit.split(':', 2); const headerDelay = parseInt(retryAfter, 10); const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default if (!categories) { updatedRateLimits.all = now + delay; } else { for (const category of categories.split(';')) { updatedRateLimits[category] = now + delay; } } } } else if (retryAfterHeader) { updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); } else if (statusCode === 429) { updatedRateLimits.all = now + 60 * 1000; } return updatedRateLimits; } //# sourceMappingURL=ratelimit.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/transports/base.js const DEFAULT_TRANSPORT_BUFFER_SIZE = 30; /** * Creates an instance of a Sentry `Transport` * * @param options * @param makeRequest */ function createTransport( options, makeRequest, buffer = makePromiseBuffer( options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE, ), ) { let rateLimits = {}; const flush = (timeout) => buffer.drain(timeout); function send(envelope) { const filteredEnvelopeItems = []; // Drop rate limited items from envelope forEachEnvelopeItem(envelope, (item, type) => { const envelopeItemDataCategory = envelopeItemTypeToDataCategory(type); if (isRateLimited(rateLimits, envelopeItemDataCategory)) { const event = getEventForEnvelopeItem(item, type); options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event); } else { filteredEnvelopeItems.push(item); } }); // Skip sending if envelope is empty after filtering out rate limited events if (filteredEnvelopeItems.length === 0) { return resolvedSyncPromise(); } // eslint-disable-next-line @typescript-eslint/no-explicit-any const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems ); // Creates client report for each item in an envelope const recordEnvelopeLoss = (reason) => { forEachEnvelopeItem(filteredEnvelope, (item, type) => { const event = getEventForEnvelopeItem(item, type); options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event); }); }; const requestTask = () => makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then( response => { // We don't want to throw on NOK responses, but we want to at least log them if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); } rateLimits = updateRateLimits(rateLimits, response); return response; }, error => { recordEnvelopeLoss('network_error'); throw error; }, ); return buffer.add(requestTask).then( result => result, error => { if (error instanceof SentryError) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Skipped sending event because buffer is full.'); recordEnvelopeLoss('queue_overflow'); return resolvedSyncPromise(); } else { throw error; } }, ); } return { send, flush, }; } function getEventForEnvelopeItem(item, type) { if (type !== 'event' && type !== 'transaction') { return undefined; } return Array.isArray(item) ? (item )[1] : undefined; } //# sourceMappingURL=base.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js /** * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, * descriptors, and functions. * * Adapted from Sucrase (https://github.com/alangpierce/sucrase) * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 * * @param ops Array result of expression conversion * @returns The value of the expression */ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i] ; const fn = ops[i + 1] ; i += 2; // by checking for loose equality to `null`, we catch both `null` and `undefined` if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it return; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => (value ).call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } // Sucrase version // function _optionalChain(ops) { // let lastAccessLHS = undefined; // let value = ops[0]; // let i = 1; // while (i < ops.length) { // const op = ops[i]; // const fn = ops[i + 1]; // i += 2; // if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { // return undefined; // } // if (op === 'access' || op === 'optionalAccess') { // lastAccessLHS = value; // value = fn(value); // } else if (op === 'call' || op === 'optionalCall') { // value = fn((...args) => value.call(lastAccessLHS, ...args)); // lastAccessLHS = undefined; // } // } // return value; // } //# sourceMappingURL=_optionalChain.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/api.js const SENTRY_API_VERSION = '7'; /** Returns the prefix to construct Sentry ingestion API endpoints. */ function getBaseApiEndpoint(dsn) { const protocol = dsn.protocol ? `${dsn.protocol}:` : ''; const port = dsn.port ? `:${dsn.port}` : ''; return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`; } /** Returns the ingest API endpoint for target. */ function _getIngestEndpoint(dsn) { return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; } /** Returns a URL-encoded string with auth config suitable for a query string. */ function _encodedAuth(dsn, sdkInfo) { return urlEncode({ // We send only the minimum set of required information. See // https://github.com/getsentry/sentry-javascript/issues/2572. sentry_key: dsn.publicKey, sentry_version: SENTRY_API_VERSION, ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }), }); } /** * Returns the envelope endpoint URL with auth in the query string. * * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. */ function getEnvelopeEndpointWithUrlEncodedAuth( dsn, // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below // options: ClientOptions = {} as ClientOptions, tunnelOrOptions = {} , ) { // TODO (v8): Use this code instead // const { tunnel, _metadata = {} } = options; // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`; const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel; const sdkInfo = typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk; return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; } /** Returns the url to the report dialog endpoint. */ function getReportDialogEndpoint( dsnLike, dialogOptions , ) { const dsn = makeDsn(dsnLike); const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`; let encodedOptions = `dsn=${dsnToString(dsn)}`; for (const key in dialogOptions) { if (key === 'dsn') { continue; } if (key === 'user') { const user = dialogOptions.user; if (!user) { continue; } if (user.name) { encodedOptions += `&name=${encodeURIComponent(user.name)}`; } if (user.email) { encodedOptions += `&email=${encodeURIComponent(user.email)}`; } } else { encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`; } } return `${endpoint}?${encodedOptions}`; } //# sourceMappingURL=api.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/envelope.js /** * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. * Merge with existing data if any. **/ function enhanceEventWithSdkInfo(event, sdkInfo) { if (!sdkInfo) { return event; } event.sdk = event.sdk || {}; event.sdk.name = event.sdk.name || sdkInfo.name; event.sdk.version = event.sdk.version || sdkInfo.version; event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])]; event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])]; return event; } /** Creates an envelope from a Session */ function createSessionEnvelope( session, dsn, metadata, tunnel, ) { const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); const envelopeHeaders = { sent_at: new Date().toISOString(), ...(sdkInfo && { sdk: sdkInfo }), ...(!!tunnel && { dsn: dsn_dsnToString(dsn) }), }; const envelopeItem = 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session]; return createEnvelope(envelopeHeaders, [envelopeItem]); } /** * Create an Envelope from an event. */ function createEventEnvelope( event, dsn, metadata, tunnel, ) { const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); /* Note: Due to TS, event.type may be `replay_event`, theoretically. In practice, we never call `createEventEnvelope` with `replay_event` type, and we'd have to adjut a looot of types to make this work properly. We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type) So the safe choice is to really guard against the replay_event type here. */ const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event'; enhanceEventWithSdkInfo(event, metadata && metadata.sdk); const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid // of this `delete`, lest we miss putting it back in the next time the property is in use.) delete event.sdkProcessingMetadata; const eventItem = [{ type: eventType }, event]; return createEnvelope(envelopeHeaders, [eventItem]); } //# sourceMappingURL=envelope.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/integration.js const installedIntegrations = []; /** Map of integrations assigned to a client */ /** * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to * preseve the order of integrations in the array. * * @private */ function filterDuplicates(integrations) { const integrationsByName = {}; integrations.forEach(currentInstance => { const { name } = currentInstance; const existingInstance = integrationsByName[name]; // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a // default instance to overwrite an existing user instance if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { return; } integrationsByName[name] = currentInstance; }); return Object.values(integrationsByName); } /** Gets integrations to install */ function getIntegrationsToSetup(options) { const defaultIntegrations = options.defaultIntegrations || []; const userIntegrations = options.integrations; // We flag default instances, so that later we can tell them apart from any user-created instances of the same class defaultIntegrations.forEach(integration => { integration.isDefaultInstance = true; }); let integrations; if (Array.isArray(userIntegrations)) { integrations = [...defaultIntegrations, ...userIntegrations]; } else if (typeof userIntegrations === 'function') { integrations = arrayify(userIntegrations(defaultIntegrations)); } else { integrations = defaultIntegrations; } const finalIntegrations = filterDuplicates(integrations); // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array. const debugIndex = finalIntegrations.findIndex(integration => integration.name === 'Debug'); if (debugIndex !== -1) { const [debugInstance] = finalIntegrations.splice(debugIndex, 1); finalIntegrations.push(debugInstance); } return finalIntegrations; } /** * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default * integrations are added unless they were already provided before. * @param integrations array of integration instances * @param withDefault should enable default integrations */ function setupIntegrations(integrations) { const integrationIndex = {}; integrations.forEach(integration => { setupIntegration(integration, integrationIndex); }); return integrationIndex; } /** Setup a single integration. */ function setupIntegration(integration, integrationIndex) { integrationIndex[integration.name] = integration; if (installedIntegrations.indexOf(integration.name) === -1) { integration.setupOnce(addGlobalEventProcessor, getCurrentHub); installedIntegrations.push(integration.name); (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Integration installed: ${integration.name}`); } } //# sourceMappingURL=integration.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/utils/prepareEvent.js /** * Adds common information to events. * * The information includes release and environment from `options`, * breadcrumbs and context (extra, tags and user) from the scope. * * Information that is already present in the event is never overwritten. For * nested objects, such as the context, keys are merged. * * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`. * * @param event The original event. * @param hint May contain additional information about the original exception. * @param scope A scope containing event metadata. * @returns A new event with more information. * @hidden */ function prepareEvent( options, event, hint, scope, ) { const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options; const prepared = { ...event, event_id: event.event_id || hint.event_id || uuid4(), timestamp: event.timestamp || (0,time/* dateTimestampInSeconds */.yW)(), }; applyClientOptions(prepared, options); applyIntegrationsMetadata( prepared, options.integrations.map(i => i.name), ); // If we have scope given to us, use it as the base for further modifications. // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. let finalScope = scope; if (hint.captureContext) { finalScope = Scope.clone(finalScope).update(hint.captureContext); } // We prepare the result here with a resolved Event. let result = resolvedSyncPromise(prepared); // This should be the last thing called, since we want that // {@link Hub.addEventProcessor} gets the finished prepared event. // // We need to check for the existence of `finalScope.getAttachments` // because `getAttachments` can be undefined if users are using an older version // of `@sentry/core` that does not have the `getAttachments` method. // See: https://github.com/getsentry/sentry-javascript/issues/5229 if (finalScope) { // Collect attachments from the hint and scope if (finalScope.getAttachments) { const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()]; if (attachments.length) { hint.attachments = attachments; } } // In case we have a hub we reassign it. result = finalScope.applyToEvent(prepared, hint); } return result.then(evt => { if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); } return evt; }); } /** * Enhances event using the client configuration. * It takes care of all "static" values like environment, release and `dist`, * as well as truncating overly long values. * @param event event instance to be enhanced */ function applyClientOptions(event, options) { const { environment, release, dist, maxValueLength = 250 } = options; if (!('environment' in event)) { event.environment = 'environment' in options ? environment : 'production'; } if (event.release === undefined && release !== undefined) { event.release = release; } if (event.dist === undefined && dist !== undefined) { event.dist = dist; } if (event.message) { event.message = truncate(event.message, maxValueLength); } const exception = event.exception && event.exception.values && event.exception.values[0]; if (exception && exception.value) { exception.value = truncate(exception.value, maxValueLength); } const request = event.request; if (request && request.url) { request.url = truncate(request.url, maxValueLength); } } /** * This function adds all used integrations to the SDK info in the event. * @param event The event that will be filled with all integrations. */ function applyIntegrationsMetadata(event, integrationNames) { if (integrationNames.length > 0) { event.sdk = event.sdk || {}; event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames]; } } /** * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. * Normalized keys: * - `breadcrumbs.data` * - `user` * - `contexts` * - `extra` * @param event Event * @returns Normalized event */ function normalizeEvent(event, depth, maxBreadth) { if (!event) { return null; } const normalized = { ...event, ...(event.breadcrumbs && { breadcrumbs: event.breadcrumbs.map(b => ({ ...b, ...(b.data && { data: normalize_normalize(b.data, depth, maxBreadth), }), })), }), ...(event.user && { user: normalize_normalize(event.user, depth, maxBreadth), }), ...(event.contexts && { contexts: normalize_normalize(event.contexts, depth, maxBreadth), }), ...(event.extra && { extra: normalize_normalize(event.extra, depth, maxBreadth), }), }; // event.contexts.trace stores information about a Transaction. Similarly, // event.spans[] stores information about child Spans. Given that a // Transaction is conceptually a Span, normalization should apply to both // Transactions and Spans consistently. // For now the decision is to skip normalization of Transactions and Spans, // so this block overwrites the normalized event to add back the original // Transaction information prior to normalization. if (event.contexts && event.contexts.trace && normalized.contexts) { normalized.contexts.trace = event.contexts.trace; // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it if (event.contexts.trace.data) { normalized.contexts.trace.data = normalize_normalize(event.contexts.trace.data, depth, maxBreadth); } } // event.spans[].data may contain circular/dangerous data so we need to normalize it if (event.spans) { normalized.spans = event.spans.map(span => { // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable if (span.data) { span.data = normalize_normalize(span.data, depth, maxBreadth); } return span; }); } return normalized; } //# sourceMappingURL=prepareEvent.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/baseclient.js const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; /** * Base implementation for all JavaScript SDK clients. * * Call the constructor with the corresponding options * specific to the client subclass. To access these options later, use * {@link Client.getOptions}. * * If a Dsn is specified in the options, it will be parsed and stored. Use * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is * invalid, the constructor will throw a {@link SentryException}. Note that * without a valid Dsn, the SDK will not send any events to Sentry. * * Before sending an event, it is passed through * {@link BaseClient._prepareEvent} to add SDK information and scope data * (breadcrumbs and context). To add more custom information, override this * method and extend the resulting prepared event. * * To issue automatically created events (e.g. via instrumentation), use * {@link Client.captureEvent}. It will prepare the event and pass it through * the callback lifecycle. To issue auto-breadcrumbs, use * {@link Client.addBreadcrumb}. * * @example * class NodeClient extends BaseClient { * public constructor(options: NodeOptions) { * super(options); * } * * // ... * } */ class BaseClient { /** Options passed to the SDK. */ /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ /** Array of set up integrations. */ __init() {this._integrations = {};} /** Indicates whether this client's integrations have been set up. */ __init2() {this._integrationsInitialized = false;} /** Number of calls being processed */ __init3() {this._numProcessing = 0;} /** Holds flushable */ __init4() {this._outcomes = {};} /** * Initializes this client instance. * * @param options Options for the client. */ constructor(options) {BaseClient.prototype.__init.call(this);BaseClient.prototype.__init2.call(this);BaseClient.prototype.__init3.call(this);BaseClient.prototype.__init4.call(this); this._options = options; if (options.dsn) { this._dsn = dsn_makeDsn(options.dsn); const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options); this._transport = options.transport({ recordDroppedEvent: this.recordDroppedEvent.bind(this), ...options.transportOptions, url, }); } else { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No DSN provided, client will not do anything.'); } } /** * @inheritDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types captureException(exception, hint, scope) { // ensure we haven't captured this very object before if (checkOrSetAlreadyCaught(exception)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(ALREADY_SEEN_ERROR); return; } let eventId = hint && hint.event_id; this._process( this.eventFromException(exception, hint) .then(event => this._captureEvent(event, hint, scope)) .then(result => { eventId = result; }), ); return eventId; } /** * @inheritDoc */ captureMessage( message, // eslint-disable-next-line deprecation/deprecation level, hint, scope, ) { let eventId = hint && hint.event_id; const promisedEvent = is_isPrimitive(message) ? this.eventFromMessage(String(message), level, hint) : this.eventFromException(message, hint); this._process( promisedEvent .then(event => this._captureEvent(event, hint, scope)) .then(result => { eventId = result; }), ); return eventId; } /** * @inheritDoc */ captureEvent(event, hint, scope) { // ensure we haven't captured this very object before if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(ALREADY_SEEN_ERROR); return; } let eventId = hint && hint.event_id; this._process( this._captureEvent(event, hint, scope).then(result => { eventId = result; }), ); return eventId; } /** * @inheritDoc */ captureSession(session) { if (!this._isEnabled()) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('SDK not enabled, will not capture session.'); return; } if (!(typeof session.release === 'string')) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Discarded session because of missing or non-string release'); } else { this.sendSession(session); // After sending, we set init false to indicate it's not the first occurrence updateSession(session, { init: false }); } } /** * @inheritDoc */ getDsn() { return this._dsn; } /** * @inheritDoc */ getOptions() { return this._options; } /** * @see SdkMetadata in @sentry/types * * @return The metadata of the SDK */ getSdkMetadata() { return this._options._metadata; } /** * @inheritDoc */ getTransport() { return this._transport; } /** * @inheritDoc */ flush(timeout) { const transport = this._transport; if (transport) { return this._isClientDoneProcessing(timeout).then(clientFinished => { return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed); }); } else { return resolvedSyncPromise(true); } } /** * @inheritDoc */ close(timeout) { return this.flush(timeout).then(result => { this.getOptions().enabled = false; return result; }); } /** * Sets up the integrations */ setupIntegrations() { if (this._isEnabled() && !this._integrationsInitialized) { this._integrations = setupIntegrations(this._options.integrations); this._integrationsInitialized = true; } } /** * Gets an installed integration by its `id`. * * @returns The installed integration or `undefined` if no integration with that `id` was installed. */ getIntegrationById(integrationId) { return this._integrations[integrationId]; } /** * @inheritDoc */ getIntegration(integration) { try { return (this._integrations[integration.id] ) || null; } catch (_oO) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`); return null; } } /** * @inheritDoc */ addIntegration(integration) { setupIntegration(integration, this._integrations); } /** * @inheritDoc */ sendEvent(event, hint = {}) { if (this._dsn) { let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel); for (const attachment of hint.attachments || []) { env = addItemToEnvelope( env, createAttachmentEnvelopeItem( attachment, this._options.transportOptions && this._options.transportOptions.textEncoder, ), ); } this._sendEnvelope(env); } } /** * @inheritDoc */ sendSession(session) { if (this._dsn) { const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel); this._sendEnvelope(env); } } /** * @inheritDoc */ recordDroppedEvent(reason, category, _event) { // Note: we use `event` in replay, where we overwrite this hook. if (this._options.sendClientReports) { // We want to track each category (error, transaction, session, replay_event) separately // but still keep the distinction between different type of outcomes. // We could use nested maps, but it's much easier to read and type this way. // A correct type for map-based implementation if we want to go that route // would be `Partial>>>` // With typescript 4.1 we could even use template literal types const key = `${reason}:${category}`; (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Adding outcome: "${key}"`); // The following works because undefined + 1 === NaN and NaN is falsy this._outcomes[key] = this._outcomes[key] + 1 || 1; } } /** Updates existing session based on the provided event */ _updateSessionFromEvent(session, event) { let crashed = false; let errored = false; const exceptions = event.exception && event.exception.values; if (exceptions) { errored = true; for (const ex of exceptions) { const mechanism = ex.mechanism; if (mechanism && mechanism.handled === false) { crashed = true; break; } } } // A session is updated and that session update is sent in only one of the two following scenarios: // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update const sessionNonTerminal = session.status === 'ok'; const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed); if (shouldUpdateAndSend) { updateSession(session, { ...(crashed && { status: 'crashed' }), errors: session.errors || Number(errored || crashed), }); this.captureSession(session); } } /** * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. * * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to * `true`. * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and * `false` otherwise */ _isClientDoneProcessing(timeout) { return new SyncPromise(resolve => { let ticked = 0; const tick = 1; const interval = setInterval(() => { if (this._numProcessing == 0) { clearInterval(interval); resolve(true); } else { ticked += tick; if (timeout && ticked >= timeout) { clearInterval(interval); resolve(false); } } }, tick); }); } /** Determines whether this SDK is enabled and a valid Dsn is present. */ _isEnabled() { return this.getOptions().enabled !== false && this._dsn !== undefined; } /** * Adds common information to events. * * The information includes release and environment from `options`, * breadcrumbs and context (extra, tags and user) from the scope. * * Information that is already present in the event is never overwritten. For * nested objects, such as the context, keys are merged. * * @param event The original event. * @param hint May contain additional information about the original exception. * @param scope A scope containing event metadata. * @returns A new event with more information. */ _prepareEvent(event, hint, scope) { const options = this.getOptions(); return prepareEvent(options, event, hint, scope); } /** * Processes the event and logs an error in case of rejection * @param event * @param hint * @param scope */ _captureEvent(event, hint = {}, scope) { return this._processEvent(event, hint, scope).then( finalEvent => { return finalEvent.event_id; }, reason => { if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for // control flow, log just the message (no stack) as a log-level log. const sentryError = reason ; if (sentryError.logLevel === 'log') { logger.log(sentryError.message); } else { logger.warn(sentryError); } } return undefined; }, ); } /** * Processes an event (either error or message) and sends it to Sentry. * * This also adds breadcrumbs and context information to the event. However, * platform specific meta data (such as the User's IP address) must be added * by the SDK implementor. * * * @param event The event to send to Sentry. * @param hint May contain additional information about the original exception. * @param scope A scope containing event metadata. * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. */ _processEvent(event, hint, scope) { const options = this.getOptions(); const { sampleRate } = options; if (!this._isEnabled()) { return rejectedSyncPromise(new SentryError('SDK not enabled, will not capture event.', 'log')); } const isTransaction = isTransactionEvent(event); const isError = baseclient_isErrorEvent(event); const eventType = event.type || 'error'; const beforeSendLabel = `before send for type \`${eventType}\``; // 1.0 === 100% events are sent // 0.0 === 0% events are sent // Sampling for transaction happens somewhere else if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) { this.recordDroppedEvent('sample_rate', 'error', event); return rejectedSyncPromise( new SentryError( `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, 'log', ), ); } const dataCategory = eventType === 'replay_event' ? 'replay' : eventType; return this._prepareEvent(event, hint, scope) .then(prepared => { if (prepared === null) { this.recordDroppedEvent('event_processor', dataCategory, event); throw new SentryError('An event processor returned `null`, will not send event.', 'log'); } const isInternalException = hint.data && (hint.data ).__sentry__ === true; if (isInternalException) { return prepared; } const result = processBeforeSend(options, prepared, hint); return _validateBeforeSendResult(result, beforeSendLabel); }) .then(processedEvent => { if (processedEvent === null) { this.recordDroppedEvent('before_send', dataCategory, event); throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log'); } const session = scope && scope.getSession(); if (!isTransaction && session) { this._updateSessionFromEvent(session, processedEvent); } // None of the Sentry built event processor will update transaction name, // so if the transaction name has been changed by an event processor, we know // it has to come from custom event processor added by a user const transactionInfo = processedEvent.transaction_info; if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { const source = 'custom'; processedEvent.transaction_info = { ...transactionInfo, source, changes: [ ...transactionInfo.changes, { source, // use the same timestamp as the processed event. timestamp: processedEvent.timestamp , propagations: transactionInfo.propagations, }, ], }; } this.sendEvent(processedEvent, hint); return processedEvent; }) .then(null, reason => { if (reason instanceof SentryError) { throw reason; } this.captureException(reason, { data: { __sentry__: true, }, originalException: reason , }); throw new SentryError( `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`, ); }); } /** * Occupies the client with processing and event */ _process(promise) { this._numProcessing++; void promise.then( value => { this._numProcessing--; return value; }, reason => { this._numProcessing--; return reason; }, ); } /** * @inheritdoc */ _sendEnvelope(envelope) { if (this._transport && this._dsn) { this._transport.send(envelope).then(null, reason => { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Error while sending event:', reason); }); } else { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Transport disabled'); } } /** * Clears outcomes on this client and returns them. */ _clearOutcomes() { const outcomes = this._outcomes; this._outcomes = {}; return Object.keys(outcomes).map(key => { const [reason, category] = key.split(':') ; return { reason, category, quantity: outcomes[key], }; }); } /** * @inheritDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types } /** * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so. */ function _validateBeforeSendResult( beforeSendResult, beforeSendLabel, ) { const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; if (isThenable(beforeSendResult)) { return beforeSendResult.then( event => { if (!is_isPlainObject(event) && event !== null) { throw new SentryError(invalidValueError); } return event; }, e => { throw new SentryError(`${beforeSendLabel} rejected with ${e}`); }, ); } else if (!is_isPlainObject(beforeSendResult) && beforeSendResult !== null) { throw new SentryError(invalidValueError); } return beforeSendResult; } /** * Process the matching `beforeSendXXX` callback. */ function processBeforeSend( options, event, hint, ) { const { beforeSend, beforeSendTransaction } = options; if (baseclient_isErrorEvent(event) && beforeSend) { return beforeSend(event, hint); } if (isTransactionEvent(event) && beforeSendTransaction) { return beforeSendTransaction(event, hint); } return event; } function baseclient_isErrorEvent(event) { return event.type === undefined; } function isTransactionEvent(event) { return event.type === 'transaction'; } //# sourceMappingURL=baseclient.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/sessionflusher.js /** * @inheritdoc */ class SessionFlusher { __init() {this.flushTimeout = 60;} __init2() {this._pendingAggregates = {};} __init3() {this._isEnabled = true;} constructor(client, attrs) {SessionFlusher.prototype.__init.call(this);SessionFlusher.prototype.__init2.call(this);SessionFlusher.prototype.__init3.call(this); this._client = client; // Call to setInterval, so that flush is called every 60 seconds this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000); this._sessionAttrs = attrs; } /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */ flush() { const sessionAggregates = this.getSessionAggregates(); if (sessionAggregates.aggregates.length === 0) { return; } this._pendingAggregates = {}; this._client.sendSession(sessionAggregates); } /** Massages the entries in `pendingAggregates` and returns aggregated sessions */ getSessionAggregates() { const aggregates = Object.keys(this._pendingAggregates).map((key) => { return this._pendingAggregates[parseInt(key)]; }); const sessionAggregates = { attrs: this._sessionAttrs, aggregates, }; return dropUndefinedKeys(sessionAggregates); } /** JSDoc */ close() { clearInterval(this._intervalId); this._isEnabled = false; this.flush(); } /** * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to * `_incrementSessionStatusCount` along with the start date */ incrementSessionStatusCount() { if (!this._isEnabled) { return; } const scope = getCurrentHub().getScope(); const requestSession = scope && scope.getRequestSession(); if (requestSession && requestSession.status) { this._incrementSessionStatusCount(requestSession.status, new Date()); // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in // case captureRequestSession is called more than once to prevent double count if (scope) { scope.setRequestSession(undefined); } /* eslint-enable @typescript-eslint/no-unsafe-member-access */ } } /** * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of * the session received */ _incrementSessionStatusCount(status, date) { // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys const sessionStartedTrunc = new Date(date).setSeconds(0, 0); this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {}; // corresponds to aggregated sessions in one specific minute bucket // for example, {"started":"2021-03-16T08:00:00.000Z","exited":4, "errored": 1} const aggregationCounts = this._pendingAggregates[sessionStartedTrunc]; if (!aggregationCounts.started) { aggregationCounts.started = new Date(sessionStartedTrunc).toISOString(); } switch (status) { case 'errored': aggregationCounts.errored = (aggregationCounts.errored || 0) + 1; return aggregationCounts.errored; case 'ok': aggregationCounts.exited = (aggregationCounts.exited || 0) + 1; return aggregationCounts.exited; default: aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1; return aggregationCounts.crashed; } } } //# sourceMappingURL=sessionflusher.js.map // EXTERNAL MODULE: external "os" var external_os_ = __webpack_require__(22037); // EXTERNAL MODULE: external "util" var external_util_ = __webpack_require__(73837); ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/eventbuilder.js /** * Extracts stack frames from the error.stack string */ function parseStackFrames(stackParser, error) { return stackParser(error.stack || '', 1); } /** * Extracts stack frames from the error and builds a Sentry Exception */ function exceptionFromError(stackParser, error) { const exception = { type: error.name || error.constructor.name, value: error.message, }; const frames = parseStackFrames(stackParser, error); if (frames.length) { exception.stacktrace = { frames }; } return exception; } /** * Builds and Event from a Exception * @hidden */ function eventFromUnknownInput(stackParser, exception, hint) { // eslint-disable-next-line @typescript-eslint/no-explicit-any let ex = exception; const providedMechanism = hint && hint.data && (hint.data ).mechanism; const mechanism = providedMechanism || { handled: true, type: 'generic', }; if (!isError(exception)) { if (is_isPlainObject(exception)) { // This will allow us to group events based on top-level keys // which is much better than creating new group when any key/value change const message = `Non-Error exception captured with keys: ${extractExceptionKeysForMessage(exception)}`; const hub = getCurrentHub(); const client = hub.getClient(); const normalizeDepth = client && client.getOptions().normalizeDepth; hub.configureScope(scope => { scope.setExtra('__serialized__', normalizeToSize(exception, normalizeDepth)); }); ex = (hint && hint.syntheticException) || new Error(message); (ex ).message = message; } else { // This handles when someone does: `throw "something awesome";` // We use synthesized Error here so we can extract a (rough) stack trace. ex = (hint && hint.syntheticException) || new Error(exception ); (ex ).message = exception ; } mechanism.synthetic = true; } const event = { exception: { values: [exceptionFromError(stackParser, ex )], }, }; addExceptionTypeValue(event, undefined, undefined); addExceptionMechanism(event, mechanism); return { ...event, event_id: hint && hint.event_id, }; } /** * Builds and Event from a Message * @hidden */ function eventFromMessage( stackParser, message, // eslint-disable-next-line deprecation/deprecation level = 'info', hint, attachStacktrace, ) { const event = { event_id: hint && hint.event_id, level, message, }; if (attachStacktrace && hint && hint.syntheticException) { const frames = parseStackFrames(stackParser, hint.syntheticException); if (frames.length) { event.exception = { values: [ { value: message, stacktrace: { frames }, }, ], }; } } return event; } //# sourceMappingURL=eventbuilder.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/client.js /** * The Sentry Node SDK Client. * * @see NodeClientOptions for documentation on configuration options. * @see SentryClient for usage documentation. */ class NodeClient extends BaseClient { /** * Creates a new Node SDK instance. * @param options Configuration options for this SDK. */ constructor(options) { options._metadata = options._metadata || {}; options._metadata.sdk = options._metadata.sdk || { name: 'sentry.javascript.node', packages: [ { name: 'npm:@sentry/node', version: SDK_VERSION, }, ], version: SDK_VERSION, }; // Until node supports global TextEncoder in all versions we support, we are forced to pass it from util options.transportOptions = { textEncoder: new external_util_.TextEncoder(), ...options.transportOptions, }; super(options); } /** * @inheritDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types captureException(exception, hint, scope) { // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload // sent to the Server only when the `requestHandler` middleware is used if (this._options.autoSessionTracking && this._sessionFlusher && scope) { const requestSession = scope.getRequestSession(); // Necessary checks to ensure this is code block is executed only within a request // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage if (requestSession && requestSession.status === 'ok') { requestSession.status = 'errored'; } } return super.captureException(exception, hint, scope); } /** * @inheritDoc */ captureEvent(event, hint, scope) { // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload // sent to the Server only when the `requestHandler` middleware is used if (this._options.autoSessionTracking && this._sessionFlusher && scope) { const eventType = event.type || 'exception'; const isException = eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0; // If the event is of type Exception, then a request session should be captured if (isException) { const requestSession = scope.getRequestSession(); // Ensure that this is happening within the bounds of a request, and make sure not to override // Session Status if Errored / Crashed if (requestSession && requestSession.status === 'ok') { requestSession.status = 'errored'; } } } return super.captureEvent(event, hint, scope); } /** * * @inheritdoc */ close(timeout) { _optionalChain([this, 'access', _ => _._sessionFlusher, 'optionalAccess', _2 => _2.close, 'call', _3 => _3()]); return super.close(timeout); } /** Method that initialises an instance of SessionFlusher on Client */ initSessionFlusher() { const { release, environment } = this._options; if (!release) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!'); } else { this._sessionFlusher = new SessionFlusher(this, { release, environment, }); } } /** * @inheritDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types eventFromException(exception, hint) { return resolvedSyncPromise(eventFromUnknownInput(this._options.stackParser, exception, hint)); } /** * @inheritDoc */ eventFromMessage( message, // eslint-disable-next-line deprecation/deprecation level = 'info', hint, ) { return resolvedSyncPromise( eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace), ); } /** * @inheritDoc */ _prepareEvent(event, hint, scope) { event.platform = event.platform || 'node'; event.contexts = { ...event.contexts, runtime: _optionalChain([event, 'access', _4 => _4.contexts, 'optionalAccess', _5 => _5.runtime]) || { name: 'node', version: global.process.version, }, }; event.server_name = event.server_name || this.getOptions().serverName || global.process.env.SENTRY_NAME || external_os_.hostname(); return super._prepareEvent(event, hint, scope); } /** * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment * appropriate session aggregates bucket */ _captureRequestSession() { if (!this._sessionFlusher) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Discarded request mode session because autoSessionTracking option was disabled'); } else { this._sessionFlusher.incrementSessionStatusCount(); } } } //# sourceMappingURL=client.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js /** * Polyfill for the nullish coalescing operator (`??`). * * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. * * Adapted from Sucrase (https://github.com/alangpierce/sucrase) * * @param lhs The value of the expression to the left of the `??` * @param rhsFn A function returning the value of the expression to the right of the `??` * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value */ function _nullishCoalesce(lhs, rhsFn) { // by checking for loose equality to `null`, we catch both `null` and `undefined` return lhs != null ? lhs : rhsFn(); } // Sucrase version: // function _nullishCoalesce(lhs, rhsFn) { // if (lhs != null) { // return lhs; // } else { // return rhsFn(); // } // } //# sourceMappingURL=_nullishCoalesce.js.map // EXTERNAL MODULE: external "http" var external_http_ = __webpack_require__(13685); // EXTERNAL MODULE: external "https" var external_https_ = __webpack_require__(95687); // EXTERNAL MODULE: external "stream" var external_stream_ = __webpack_require__(12781); // EXTERNAL MODULE: external "url" var external_url_ = __webpack_require__(57310); // EXTERNAL MODULE: external "zlib" var external_zlib_ = __webpack_require__(59796); ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/transports/http.js // Estimated maximum size for reasonable standalone event const GZIP_THRESHOLD = 1024 * 32; /** * Gets a stream from a Uint8Array or string * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0 */ function streamFromBody(body) { return new external_stream_.Readable({ read() { this.push(body); this.push(null); }, }); } /** * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry. */ function makeNodeTransport(options) { let urlSegments; try { urlSegments = new external_url_.URL(options.url); } catch (e) { // eslint-disable-next-line no-console console.warn( '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.', ); return createTransport(options, () => Promise.resolve({})); } const isHttps = urlSegments.protocol === 'https:'; // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy` // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy` const proxy = applyNoProxyOption( urlSegments, options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy, ); const nativeHttpModule = isHttps ? external_https_ : external_http_; const keepAlive = options.keepAlive === undefined ? false : options.keepAlive; // TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node // versions(>= 8) as they had memory leaks when using it: #2555 const agent = proxy ? // eslint-disable-next-line @typescript-eslint/no-var-requires (new (__webpack_require__(76035))(proxy) ) : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 }); const requestExecutor = createRequestExecutor(options, _nullishCoalesce(options.httpModule, () => ( nativeHttpModule)), agent); return createTransport(options, requestExecutor); } /** * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion. * * @param transportUrl The URL the transport intends to send events to. * @param proxy The client configured proxy. * @returns A proxy the transport should use. */ function applyNoProxyOption(transportUrlSegments, proxy) { const { no_proxy } = process.env; const urlIsExemptFromProxy = no_proxy && no_proxy .split(',') .some( exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption), ); if (urlIsExemptFromProxy) { return undefined; } else { return proxy; } } /** * Creates a RequestExecutor to be used with `createTransport`. */ function createRequestExecutor( options, httpModule, agent, ) { const { hostname, pathname, port, protocol, search } = new external_url_.URL(options.url); return function makeRequest(request) { return new Promise((resolve, reject) => { let body = streamFromBody(request.body); const headers = { ...options.headers }; if (request.body.length > GZIP_THRESHOLD) { headers['content-encoding'] = 'gzip'; body = body.pipe((0,external_zlib_.createGzip)()); } const req = httpModule.request( { method: 'POST', agent, headers, hostname, path: `${pathname}${search}`, port, protocol, ca: options.caCerts, }, res => { res.on('data', () => { // Drain socket }); res.on('end', () => { // Drain socket }); res.setEncoding('utf8'); // "Key-value pairs of header names and values. Header names are lower-cased." // https://nodejs.org/api/http.html#http_message_headers const retryAfterHeader = _nullishCoalesce(res.headers['retry-after'], () => ( null)); const rateLimitsHeader = _nullishCoalesce(res.headers['x-sentry-rate-limits'], () => ( null)); resolve({ statusCode: res.statusCode, headers: { 'retry-after': retryAfterHeader, 'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader, }, }); }, ); req.on('error', reject); body.pipe(req); }); }; } //# sourceMappingURL=http.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/sdk.js /** A class object that can instantiate Client objects. */ /** * Internal function to create a new SDK client instance. The client is * installed and then bound to the current scope. * * @param clientClass The client class to instantiate. * @param options Options to pass to the client. */ function initAndBind( clientClass, options, ) { if (options.debug === true) { if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { logger.enable(); } else { // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped // eslint-disable-next-line no-console console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); } } const hub = getCurrentHub(); const scope = hub.getScope(); if (scope) { scope.update(options.initialScope); } const client = new clientClass(options); hub.bindClient(client); } //# sourceMappingURL=sdk.js.map // EXTERNAL MODULE: external "domain" var external_domain_ = __webpack_require__(13639); ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/severity.js // Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either // // a) moving `validSeverityLevels` to `@sentry/types`, // b) moving the`SeverityLevel` type here, or // c) importing `validSeverityLevels` from here into `@sentry/types`. // // Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would // create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the // type, reminding anyone who changes it to change this list also, will have to do. const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug']; /** * Converts a string-based level into a member of the deprecated {@link Severity} enum. * * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead. * * @param level String representation of Severity * @returns Severity */ function severityFromString(level) { return severityLevelFromString(level) ; } /** * Converts a string-based level into a `SeverityLevel`, normalizing it along the way. * * @param level String representation of desired `SeverityLevel`. * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level. */ function severityLevelFromString(level) { return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ; } //# sourceMappingURL=severity.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/console.js /** Console module integration */ class Console {constructor() { Console.prototype.__init.call(this); } /** * @inheritDoc */ static __initStatic() {this.id = 'Console';} /** * @inheritDoc */ __init() {this.name = Console.id;} /** * @inheritDoc */ setupOnce() { for (const level of ['debug', 'info', 'warn', 'error', 'log']) { fill(console, level, createConsoleWrapper(level)); } } } Console.__initStatic(); /** * Wrapper function that'll be used for every console level */ function createConsoleWrapper(level) { return function consoleWrapper(originalConsoleMethod) { const sentryLevel = severityLevelFromString(level); /* eslint-disable prefer-rest-params */ return function () { if (getCurrentHub().getIntegration(Console)) { getCurrentHub().addBreadcrumb( { category: 'console', level: sentryLevel, message: external_util_.format.apply(undefined, arguments), }, { input: [...arguments], level, }, ); } originalConsoleMethod.apply(this, arguments); }; /* eslint-enable prefer-rest-params */ }; } //# sourceMappingURL=console.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/baggage.js const BAGGAGE_HEADER_NAME = 'baggage'; const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-'; const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; /** * Max length of a serialized baggage string * * https://www.w3.org/TR/baggage/#limits */ const MAX_BAGGAGE_STRING_LENGTH = 8192; /** * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values * from it. * * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks. * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise. */ function baggageHeaderToDynamicSamplingContext( // Very liberal definition of what any incoming header might look like baggageHeader, ) { if (!is_isString(baggageHeader) && !Array.isArray(baggageHeader)) { return undefined; } // Intermediary object to store baggage key value pairs of incoming baggage headers on. // It is later used to read Sentry-DSC-values from. let baggageObject = {}; if (Array.isArray(baggageHeader)) { // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it baggageObject = baggageHeader.reduce((acc, curr) => { const currBaggageObject = baggageHeaderToObject(curr); return { ...acc, ...currBaggageObject, }; }, {}); } else { // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but // this is how we choose to handle it) if (!baggageHeader) { return undefined; } baggageObject = baggageHeaderToObject(baggageHeader); } // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object. const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); acc[nonPrefixedKey] = value; } return acc; }, {}); // Only return a dynamic sampling context object if there are keys in it. // A keyless object means there were no sentry values on the header, which means that there is no DSC. if (Object.keys(dynamicSamplingContext).length > 0) { return dynamicSamplingContext ; } else { return undefined; } } /** * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-". * * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is * `undefined` the function will return `undefined`. * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext` * was `undefined`, or if `dynamicSamplingContext` didn't contain any values. */ function dynamicSamplingContextToSentryBaggageHeader( // this also takes undefined for convenience and bundle size in other places dynamicSamplingContext, ) { // Prefix all DSC keys with "sentry-" and put them into a new object const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( (acc, [dscKey, dscValue]) => { if (dscValue) { acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; } return acc; }, {}, ); return objectToBaggageHeader(sentryPrefixedDSC); } /** * Will parse a baggage header, which is a simple key-value map, into a flat object. * * @param baggageHeader The baggage header to parse. * @returns a flat object containing all the key-value pairs from `baggageHeader`. */ function baggageHeaderToObject(baggageHeader) { return baggageHeader .split(',') .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim()))) .reduce((acc, [key, value]) => { acc[key] = value; return acc; }, {}); } /** * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs. * * @param object The object to turn into a baggage header. * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header * is not spec compliant. */ function objectToBaggageHeader(object) { if (Object.keys(object).length === 0) { // An empty baggage header is not spec compliant: We return undefined. return undefined; } return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn( `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`, ); return baggageHeader; } else { return newBaggageHeader; } }, ''); } //# sourceMappingURL=baggage.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/utils/http.js const NODE_VERSION = parseSemver(process.versions.node); /** * Checks whether given url points to Sentry server * @param url url to verify */ function isSentryRequest(url) { const dsn = _optionalChain([getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getDsn, 'call', _5 => _5()]); return dsn ? url.includes(dsn.host) : false; } /** * Assemble a URL to be used for breadcrumbs and spans. * * @param requestOptions RequestOptions object containing the component parts for a URL * @returns Fully-formed URL */ function extractUrl(requestOptions) { const protocol = requestOptions.protocol || ''; const hostname = requestOptions.hostname || requestOptions.host || ''; // Don't log standard :80 (http) and :443 (https) ports to reduce the noise const port = !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`; const path = requestOptions.path ? requestOptions.path : '/'; return `${protocol}//${hostname}${port}${path}`; } /** * Handle various edge cases in the span description (for spans representing http(s) requests). * * @param description current `description` property of the span representing the request * @param requestOptions Configuration data for the request * @param Request Request object * * @returns The cleaned description */ function cleanSpanDescription( description, requestOptions, request, ) { // nothing to clean if (!description) { return description; } // eslint-disable-next-line prefer-const let [method, requestUrl] = description.split(' '); // superagent sticks the protocol in a weird place (we check for host because if both host *and* protocol are missing, // we're likely dealing with an internal route and this doesn't apply) if (requestOptions.host && !requestOptions.protocol) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any requestOptions.protocol = _optionalChain([(request ), 'optionalAccess', _6 => _6.agent, 'optionalAccess', _7 => _7.protocol]); // worst comes to worst, this is undefined and nothing changes requestUrl = extractUrl(requestOptions); } // internal routes can end up starting with a triple slash rather than a single one if (_optionalChain([requestUrl, 'optionalAccess', _8 => _8.startsWith, 'call', _9 => _9('///')])) { requestUrl = requestUrl.slice(2); } return `${method} ${requestUrl}`; } // the node types are missing a few properties which node's `urlToOptions` function spits out /** * Convert a URL object into a RequestOptions object. * * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the * RequestOptions type above. * * See https://github.com/nodejs/node/blob/master/lib/internal/url.js. */ function urlToOptions(url) { const options = { protocol: url.protocol, hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, hash: url.hash, search: url.search, pathname: url.pathname, path: `${url.pathname || ''}${url.search || ''}`, href: url.href, }; if (url.port !== '') { options.port = Number(url.port); } if (url.username || url.password) { options.auth = `${url.username}:${url.password}`; } return options; } /** * Normalize inputs to `http(s).request()` and `http(s).get()`. * * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms: * [ RequestOptions | string | URL ], * [ RequestOptions | string | URL, RequestCallback ], * [ string | URL, RequestOptions ], and * [ string | URL, RequestOptions, RequestCallback ]. * * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact * with the args in a standard way. * * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array. * * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ]. */ function normalizeRequestArgs( httpModule, requestArgs, ) { let callback, requestOptions; // pop off the callback, if there is one if (typeof requestArgs[requestArgs.length - 1] === 'function') { callback = requestArgs.pop() ; } // create a RequestOptions object of whatever's at index 0 if (typeof requestArgs[0] === 'string') { requestOptions = urlToOptions(new external_url_.URL(requestArgs[0])); } else if (requestArgs[0] instanceof external_url_.URL) { requestOptions = urlToOptions(requestArgs[0]); } else { requestOptions = requestArgs[0]; } // if the options were given separately from the URL, fold them in if (requestArgs.length === 2) { requestOptions = { ...requestOptions, ...requestArgs[1] }; } // Figure out the protocol if it's currently missing if (requestOptions.protocol === undefined) { // Worst case we end up populating protocol with undefined, which it already is /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */ // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it. // Because of that, we cannot rely on `httpModule` to provide us with valid protocol, // as it will always return `http`, even when using `https` module. // // See test/integrations/http.test.ts for more details on Node <=v8 protocol issue. if (NODE_VERSION.major && NODE_VERSION.major > 8) { requestOptions.protocol = _optionalChain([(_optionalChain([httpModule, 'optionalAccess', _10 => _10.globalAgent]) ), 'optionalAccess', _11 => _11.protocol]) || _optionalChain([(requestOptions.agent ), 'optionalAccess', _12 => _12.protocol]) || _optionalChain([(requestOptions._defaultAgent ), 'optionalAccess', _13 => _13.protocol]); } else { requestOptions.protocol = _optionalChain([(requestOptions.agent ), 'optionalAccess', _14 => _14.protocol]) || _optionalChain([(requestOptions._defaultAgent ), 'optionalAccess', _15 => _15.protocol]) || _optionalChain([(_optionalChain([httpModule, 'optionalAccess', _16 => _16.globalAgent]) ), 'optionalAccess', _17 => _17.protocol]); } /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */ } // return args in standardized form if (callback) { return [requestOptions, callback]; } else { return [requestOptions]; } } //# sourceMappingURL=http.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/http.js const http_NODE_VERSION = parseSemver(process.versions.node); /** * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing * http requests and attaches trace data when tracing is enabled via its `tracing` option. */ class Http { /** * @inheritDoc */ static __initStatic() {this.id = 'Http';} /** * @inheritDoc */ __init() {this.name = Http.id;} /** * @inheritDoc */ constructor(options = {}) {Http.prototype.__init.call(this); this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs; this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing; } /** * @inheritDoc */ setupOnce( _addGlobalEventProcessor, setupOnceGetCurrentHub, ) { // No need to instrument if we don't want to track anything if (!this._breadcrumbs && !this._tracing) { return; } const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]); // Do not auto-instrument for other instrumenter if (clientOptions && clientOptions.instrumenter !== 'sentry') { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('HTTP Integration is skipped because of instrumenter configuration.'); return; } // TODO (v8): `tracePropagationTargets` and `shouldCreateSpanForRequest` will be removed from clientOptions // and we will no longer have to do this optional merge, we can just pass `this._tracing` directly. const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined; const wrappedHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions); // eslint-disable-next-line @typescript-eslint/no-var-requires const httpModule = __webpack_require__(13685); fill(httpModule, 'get', wrappedHandlerMaker); fill(httpModule, 'request', wrappedHandlerMaker); // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it. // If we do, we'd get double breadcrumbs and double spans for `https` calls. // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately. if (http_NODE_VERSION.major && http_NODE_VERSION.major > 8) { // eslint-disable-next-line @typescript-eslint/no-var-requires const httpsModule = __webpack_require__(95687); fill(httpsModule, 'get', wrappedHandlerMaker); fill(httpsModule, 'request', wrappedHandlerMaker); } } }Http.__initStatic(); // for ease of reading below /** * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http` * and `https` modules. (NB: Not a typo - this is a creator^2!) * * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs * @param tracingEnabled Whether or not to record outgoing requests as tracing spans * * @returns A function which accepts the exiting handler and returns a wrapped handler */ function _createWrappedRequestMethodFactory( breadcrumbsEnabled, tracingOptions, ) { // We're caching results so we don't have to recompute regexp every time we create a request. const createSpanUrlMap = {}; const headersUrlMap = {}; const shouldCreateSpan = (url) => { if (_optionalChain([tracingOptions, 'optionalAccess', _6 => _6.shouldCreateSpanForRequest]) === undefined) { return true; } if (createSpanUrlMap[url]) { return createSpanUrlMap[url]; } createSpanUrlMap[url] = tracingOptions.shouldCreateSpanForRequest(url); return createSpanUrlMap[url]; }; const shouldAttachTraceData = (url) => { if (_optionalChain([tracingOptions, 'optionalAccess', _7 => _7.tracePropagationTargets]) === undefined) { return true; } if (headersUrlMap[url]) { return headersUrlMap[url]; } headersUrlMap[url] = stringMatchesSomePattern(url, tracingOptions.tracePropagationTargets); return headersUrlMap[url]; }; return function wrappedRequestMethodFactory(originalRequestMethod) { return function wrappedMethod( ...args) { // eslint-disable-next-line @typescript-eslint/no-this-alias const httpModule = this; const requestArgs = normalizeRequestArgs(this, args); const requestOptions = requestArgs[0]; const requestUrl = extractUrl(requestOptions); // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method if (isSentryRequest(requestUrl)) { return originalRequestMethod.apply(httpModule, requestArgs); } let requestSpan; let parentSpan; const scope = getCurrentHub().getScope(); if (scope && tracingOptions && shouldCreateSpan(requestUrl)) { parentSpan = scope.getSpan(); if (parentSpan) { requestSpan = parentSpan.startChild({ description: `${requestOptions.method || 'GET'} ${requestUrl}`, op: 'http.client', }); if (shouldAttachTraceData(requestUrl)) { const sentryTraceHeader = requestSpan.toTraceparent(); (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log( `[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to "${requestUrl}": `, ); requestOptions.headers = { ...requestOptions.headers, 'sentry-trace': sentryTraceHeader, }; if (parentSpan.transaction) { const dynamicSamplingContext = parentSpan.transaction.getDynamicSamplingContext(); const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); let newBaggageHeaderField; if (!requestOptions.headers || !requestOptions.headers.baggage) { newBaggageHeaderField = sentryBaggageHeader; } else if (!sentryBaggageHeader) { newBaggageHeaderField = requestOptions.headers.baggage; } else if (Array.isArray(requestOptions.headers.baggage)) { newBaggageHeaderField = [...requestOptions.headers.baggage, sentryBaggageHeader]; } else { // Type-cast explanation: // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this. newBaggageHeaderField = [requestOptions.headers.baggage, sentryBaggageHeader] ; } requestOptions.headers = { ...requestOptions.headers, // Setting a hader to `undefined` will crash in node so we only set the baggage header when it's defined ...(newBaggageHeaderField && { baggage: newBaggageHeaderField }), }; } } else { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log( `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`, ); } const transaction = parentSpan.transaction; if (transaction) { transaction.metadata.propagations++; } } } // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return originalRequestMethod .apply(httpModule, requestArgs) .once('response', function ( res) { // eslint-disable-next-line @typescript-eslint/no-this-alias const req = this; if (breadcrumbsEnabled) { addRequestBreadcrumb('response', requestUrl, req, res); } if (requestSpan) { if (res.statusCode) { requestSpan.setHttpStatus(res.statusCode); } requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req); requestSpan.finish(); } }) .once('error', function () { // eslint-disable-next-line @typescript-eslint/no-this-alias const req = this; if (breadcrumbsEnabled) { addRequestBreadcrumb('error', requestUrl, req); } if (requestSpan) { requestSpan.setHttpStatus(500); requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req); requestSpan.finish(); } }); }; }; } /** * Captures Breadcrumb based on provided request/response pair */ function addRequestBreadcrumb(event, url, req, res) { if (!getCurrentHub().getIntegration(Http)) { return; } getCurrentHub().addBreadcrumb( { category: 'http', data: { method: req.method, status_code: res && res.statusCode, url, }, type: 'http', }, { event, request: req, response: res, }, ); } //# sourceMappingURL=http.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/utils/errorhandling.js const DEFAULT_SHUTDOWN_TIMEOUT = 2000; /** * @hidden */ function logAndExitProcess(error) { // eslint-disable-next-line no-console console.error(error && error.stack ? error.stack : error); const client = getCurrentHub().getClient(); if (client === undefined) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No NodeClient was defined, we are exiting the process now.'); global.process.exit(1); } const options = client.getOptions(); const timeout = (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) || DEFAULT_SHUTDOWN_TIMEOUT; client.close(timeout).then( (result) => { if (!result) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!'); } global.process.exit(1); }, error => { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(error); }, ); } //# sourceMappingURL=errorhandling.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/onuncaughtexception.js /** Global Exception handler */ class OnUncaughtException { /** * @inheritDoc */ static __initStatic() {this.id = 'OnUncaughtException';} /** * @inheritDoc */ __init() {this.name = OnUncaughtException.id;} /** * @inheritDoc */ __init2() {this.handler = this._makeErrorHandler();} // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts` /** * @inheritDoc */ constructor(options = {}) {OnUncaughtException.prototype.__init.call(this);OnUncaughtException.prototype.__init2.call(this); this._options = { exitEvenIfOtherHandlersAreRegistered: true, ...options, }; } /** * @inheritDoc */ setupOnce() { global.process.on('uncaughtException', this.handler); } /** * @hidden */ _makeErrorHandler() { const timeout = 2000; let caughtFirstError = false; let caughtSecondError = false; let calledFatalError = false; let firstError; return (error) => { let onFatalError = logAndExitProcess; const client = getCurrentHub().getClient(); if (this._options.onFatalError) { onFatalError = this._options.onFatalError; } else if (client && client.getOptions().onFatalError) { onFatalError = client.getOptions().onFatalError ; } // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust // exit behaviour of the SDK accordingly: // - If other listeners are attached, do not exit. // - If the only listener attached is ours, exit. const userProvidedListenersCount = global.process .listeners('uncaughtException') .reduce((acc, listener) => { if ( listener.name === 'domainUncaughtExceptionClear' || // as soon as we're using domains this listener is attached by node itself listener === this.handler // filter the handler we registered ourselves) ) { return acc; } else { return acc + 1; } }, 0); const processWouldExit = userProvidedListenersCount === 0; const shouldApplyFatalHandlingLogic = this._options.exitEvenIfOtherHandlersAreRegistered || processWouldExit; if (!caughtFirstError) { const hub = getCurrentHub(); // this is the first uncaught error and the ultimate reason for shutting down // we want to do absolutely everything possible to ensure it gets captured // also we want to make sure we don't go recursion crazy if more errors happen after this one firstError = error; caughtFirstError = true; if (hub.getIntegration(OnUncaughtException)) { hub.withScope((scope) => { scope.setLevel('fatal'); hub.captureException(error, { originalException: error, data: { mechanism: { handled: false, type: 'onuncaughtexception' } }, }); if (!calledFatalError && shouldApplyFatalHandlingLogic) { calledFatalError = true; onFatalError(error); } }); } else { if (!calledFatalError && shouldApplyFatalHandlingLogic) { calledFatalError = true; onFatalError(error); } } } else { if (shouldApplyFatalHandlingLogic) { if (calledFatalError) { // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn( 'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown', ); logAndExitProcess(error); } else if (!caughtSecondError) { // two cases for how we can hit this branch: // - capturing of first error blew up and we just caught the exception from that // - quit trying to capture, proceed with shutdown // - a second independent error happened while waiting for first error to capture // - want to avoid causing premature shutdown before first error capture finishes // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff // so let's instead just delay a bit before we proceed with our action here // in case 1, we just wait a bit unnecessarily but ultimately do the same thing // in case 2, the delay hopefully made us wait long enough for the capture to finish // two potential nonideal outcomes: // nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError // nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError) // we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish caughtSecondError = true; setTimeout(() => { if (!calledFatalError) { // it was probably case 1, let's treat err as the sendErr and call onFatalError calledFatalError = true; onFatalError(firstError, error); } }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc } } } }; } } OnUncaughtException.__initStatic(); //# sourceMappingURL=onuncaughtexception.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/onunhandledrejection.js /** Global Promise Rejection handler */ class OnUnhandledRejection { /** * @inheritDoc */ static __initStatic() {this.id = 'OnUnhandledRejection';} /** * @inheritDoc */ __init() {this.name = OnUnhandledRejection.id;} /** * @inheritDoc */ constructor( _options = { mode: 'warn' }, ) {this._options = _options;OnUnhandledRejection.prototype.__init.call(this);} /** * @inheritDoc */ setupOnce() { global.process.on('unhandledRejection', this.sendUnhandledPromise.bind(this)); } /** * Send an exception with reason * @param reason string * @param promise promise */ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any sendUnhandledPromise(reason, promise) { const hub = getCurrentHub(); if (hub.getIntegration(OnUnhandledRejection)) { hub.withScope((scope) => { scope.setExtra('unhandledPromiseRejection', true); hub.captureException(reason, { originalException: promise, data: { mechanism: { handled: false, type: 'onunhandledrejection' } }, }); }); } this._handleRejection(reason); } /** * Handler for `mode` option */ // eslint-disable-next-line @typescript-eslint/no-explicit-any _handleRejection(reason) { // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240 const rejectionWarning = 'This error originated either by ' + 'throwing inside of an async function without a catch block, ' + 'or by rejecting a promise which was not handled with .catch().' + ' The promise rejected with the reason:'; /* eslint-disable no-console */ if (this._options.mode === 'warn') { consoleSandbox(() => { console.warn(rejectionWarning); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access console.error(reason && reason.stack ? reason.stack : reason); }); } else if (this._options.mode === 'strict') { consoleSandbox(() => { console.warn(rejectionWarning); }); logAndExitProcess(reason); } /* eslint-enable no-console */ } } OnUnhandledRejection.__initStatic(); //# sourceMappingURL=onunhandledrejection.js.map // EXTERNAL MODULE: external "fs" var external_fs_ = __webpack_require__(57147); // EXTERNAL MODULE: ./node_modules/lru_map/lru.js var lru = __webpack_require__(27612); ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/contextlines.js const FILE_CONTENT_CACHE = new lru.LRUMap(100); const DEFAULT_LINES_OF_CONTEXT = 7; // TODO: Replace with promisify when minimum supported node >= v8 function readTextFileAsync(path) { return new Promise((resolve, reject) => { (0,external_fs_.readFile)(path, 'utf8', (err, data) => { if (err) reject(err); else resolve(data); }); }); } /** Add node modules / packages to the event */ class ContextLines { /** * @inheritDoc */ static __initStatic() {this.id = 'ContextLines';} /** * @inheritDoc */ __init() {this.name = ContextLines.id;} constructor( _options = {}) {this._options = _options;ContextLines.prototype.__init.call(this);} /** Get's the number of context lines to add */ get _contextLines() { return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT; } /** * @inheritDoc */ setupOnce(addGlobalEventProcessor) { addGlobalEventProcessor(event => this.addSourceContext(event)); } /** Processes an event and adds context lines */ async addSourceContext(event) { if (this._contextLines > 0 && _optionalChain([event, 'access', _2 => _2.exception, 'optionalAccess', _3 => _3.values])) { for (const exception of event.exception.values) { if (_optionalChain([exception, 'access', _4 => _4.stacktrace, 'optionalAccess', _5 => _5.frames])) { await this.addSourceContextToFrames(exception.stacktrace.frames); } } } return event; } /** Adds context lines to frames */ async addSourceContextToFrames(frames) { const contextLines = this._contextLines; for (const frame of frames) { // Only add context if we have a filename and it hasn't already been added if (frame.filename && frame.context_line === undefined) { const sourceFile = await _readSourceFile(frame.filename); if (sourceFile) { try { const lines = sourceFile.split('\n'); addContextToFrame(lines, frame, contextLines); } catch (e) { // anomaly, being defensive in case // unlikely to ever happen in practice but can definitely happen in theory } } } } } }ContextLines.__initStatic(); /** * Reads file contents and caches them in a global LRU cache. * * @param filename filepath to read content from. */ async function _readSourceFile(filename) { const cachedFile = FILE_CONTENT_CACHE.get(filename); // We have a cache hit if (cachedFile !== undefined) { return cachedFile; } let content = null; try { content = await readTextFileAsync(filename); } catch (_) { // } FILE_CONTENT_CACHE.set(filename, content); return content; } //# sourceMappingURL=contextlines.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/linkederrors.js const DEFAULT_KEY = 'cause'; const DEFAULT_LIMIT = 5; /** Adds SDK info to an event. */ class LinkedErrors { /** * @inheritDoc */ static __initStatic() {this.id = 'LinkedErrors';} /** * @inheritDoc */ __init() {this.name = LinkedErrors.id;} /** * @inheritDoc */ /** * @inheritDoc */ /** * @inheritDoc */ constructor(options = {}) {LinkedErrors.prototype.__init.call(this); this._key = options.key || DEFAULT_KEY; this._limit = options.limit || DEFAULT_LIMIT; } /** * @inheritDoc */ setupOnce() { addGlobalEventProcessor(async (event, hint) => { const hub = getCurrentHub(); const self = hub.getIntegration(LinkedErrors); const client = hub.getClient(); if (client && self && self._handler && typeof self._handler === 'function') { await self._handler(client.getOptions().stackParser, event, hint); } return event; }); } /** * @inheritDoc */ _handler(stackParser, event, hint) { if (!event.exception || !event.exception.values || !isInstanceOf(hint.originalException, Error)) { return resolvedSyncPromise(event); } return new SyncPromise(resolve => { void this._walkErrorTree(stackParser, hint.originalException , this._key) .then((linkedErrors) => { if (event && event.exception && event.exception.values) { event.exception.values = [...linkedErrors, ...event.exception.values]; } resolve(event); }) .then(null, () => { resolve(event); }); }); } /** * @inheritDoc */ async _walkErrorTree( stackParser, error, key, stack = [], ) { if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) { return Promise.resolve(stack); } const exception = exceptionFromError(stackParser, error[key]); // If the ContextLines integration is enabled, we add source code context to linked errors // because we can't guarantee the order that integrations are run. const contextLines = getCurrentHub().getIntegration(ContextLines); if (contextLines && _optionalChain([exception, 'access', _ => _.stacktrace, 'optionalAccess', _2 => _2.frames])) { await contextLines.addSourceContextToFrames(exception.stacktrace.frames); } return new Promise((resolve, reject) => { void this._walkErrorTree(stackParser, error[key], key, [exception, ...stack]) .then(resolve) .then(null, () => { reject(); }); }); } }LinkedErrors.__initStatic(); //# sourceMappingURL=linkederrors.js.map // EXTERNAL MODULE: external "path" var external_path_ = __webpack_require__(71017); ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/modules.js let moduleCache; /** Extract information about paths */ function getPaths() { try { return __webpack_require__.c ? Object.keys(__webpack_require__.c ) : []; } catch (e) { return []; } } /** Extract information about package.json modules */ function collectModules() { const mainPaths = (__webpack_require__.c[__webpack_require__.s] && __webpack_require__.c[__webpack_require__.s].paths) || []; const paths = getPaths(); const infos = {}; const seen = {}; paths.forEach(path => { let dir = path; /** Traverse directories upward in the search of package.json file */ const updir = () => { const orig = dir; dir = (0,external_path_.dirname)(orig); if (!dir || orig === dir || seen[orig]) { return undefined; } if (mainPaths.indexOf(dir) < 0) { return updir(); } const pkgfile = (0,external_path_.join)(orig, 'package.json'); seen[orig] = true; if (!(0,external_fs_.existsSync)(pkgfile)) { return updir(); } try { const info = JSON.parse((0,external_fs_.readFileSync)(pkgfile, 'utf8')) ; infos[info.name] = info.version; } catch (_oO) { // no-empty } }; updir(); }); return infos; } /** Add node modules / packages to the event */ class Modules {constructor() { Modules.prototype.__init.call(this); } /** * @inheritDoc */ static __initStatic() {this.id = 'Modules';} /** * @inheritDoc */ __init() {this.name = Modules.id;} /** * @inheritDoc */ setupOnce(addGlobalEventProcessor, getCurrentHub) { addGlobalEventProcessor(event => { if (!getCurrentHub().getIntegration(Modules)) { return event; } return { ...event, modules: { ...event.modules, ...this._getModules(), }, }; }); } /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */ _getModules() { if (!moduleCache) { moduleCache = collectModules(); } return moduleCache; } } Modules.__initStatic(); //# sourceMappingURL=modules.js.map // EXTERNAL MODULE: external "child_process" var external_child_process_ = __webpack_require__(32081); ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/context.js // TODO: Required until we drop support for Node v8 const readFileAsync = (0,external_util_.promisify)(external_fs_.readFile); const readDirAsync = (0,external_util_.promisify)(external_fs_.readdir); /** Add node modules / packages to the event */ class Context { /** * @inheritDoc */ static __initStatic() {this.id = 'Context';} /** * @inheritDoc */ __init() {this.name = Context.id;} /** * Caches context so it's only evaluated once */ constructor( _options = { app: true, os: true, device: true, culture: true }) {this._options = _options;Context.prototype.__init.call(this); // } /** * @inheritDoc */ setupOnce(addGlobalEventProcessor) { addGlobalEventProcessor(event => this.addContext(event)); } /** Processes an event and adds context */ async addContext(event) { if (this._cachedContext === undefined) { this._cachedContext = this._getContexts(); } const updatedContext = this._updateContext(await this._cachedContext); event.contexts = { ...event.contexts, app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) }, os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) }, device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) }, culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) }, }; return event; } /** * Updates the context with dynamic values that can change */ _updateContext(contexts) { // Only update properties if they exist if (_optionalChain([contexts, 'optionalAccess', _9 => _9.app, 'optionalAccess', _10 => _10.app_memory])) { contexts.app.app_memory = process.memoryUsage().rss; } if (_optionalChain([contexts, 'optionalAccess', _11 => _11.device, 'optionalAccess', _12 => _12.free_memory])) { contexts.device.free_memory = external_os_.freemem(); } return contexts; } /** * Gets the contexts for the current environment */ async _getContexts() { const contexts = {}; if (this._options.os) { contexts.os = await getOsContext(); } if (this._options.app) { contexts.app = getAppContext(); } if (this._options.device) { contexts.device = getDeviceContext(this._options.device); } if (this._options.culture) { const culture = getCultureContext(); if (culture) { contexts.culture = culture; } } return contexts; } }Context.__initStatic(); /** * Returns the operating system context. * * Based on the current platform, this uses a different strategy to provide the * most accurate OS information. Since this might involve spawning subprocesses * or accessing the file system, this should only be executed lazily and cached. * * - On macOS (Darwin), this will execute the `sw_vers` utility. The context * has a `name`, `version`, `build` and `kernel_version` set. * - On Linux, this will try to load a distribution release from `/etc` and set * the `name`, `version` and `kernel_version` fields. * - On all other platforms, only a `name` and `version` will be returned. Note * that `version` might actually be the kernel version. */ async function getOsContext() { const platformId = external_os_.platform(); switch (platformId) { case 'darwin': return getDarwinInfo(); case 'linux': return getLinuxInfo(); default: return { name: PLATFORM_NAMES[platformId] || platformId, version: external_os_.release(), }; } } function getCultureContext() { try { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any if (typeof (process.versions ).icu !== 'string') { // Node was built without ICU support return; } // Check that node was built with full Intl support. Its possible it was built without support for non-English // locales which will make resolvedOptions inaccurate // // https://nodejs.org/api/intl.html#detecting-internationalization-support const january = new Date(9e8); const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); if (spanish.format(january) === 'enero') { const options = Intl.DateTimeFormat().resolvedOptions(); return { locale: options.locale, timezone: options.timeZone, }; } } catch (err) { // } return; } function getAppContext() { const app_memory = process.memoryUsage().rss; const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString(); return { app_start_time, app_memory }; } /** * Gets device information from os */ function getDeviceContext(deviceOpt) { const device = {}; // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions). // Hence, we only set boot time, if we get a valid uptime value. // @see https://github.com/getsentry/sentry-javascript/issues/5856 const uptime = external_os_.uptime && external_os_.uptime(); if (typeof uptime === 'number') { device.boot_time = new Date(Date.now() - uptime * 1000).toISOString(); } device.arch = external_os_.arch(); if (deviceOpt === true || deviceOpt.memory) { device.memory_size = external_os_.totalmem(); device.free_memory = external_os_.freemem(); } if (deviceOpt === true || deviceOpt.cpu) { const cpuInfo = external_os_.cpus(); if (cpuInfo && cpuInfo.length) { const firstCpu = cpuInfo[0]; device.processor_count = cpuInfo.length; device.cpu_description = firstCpu.model; device.processor_frequency = firstCpu.speed; } } return device; } /** Mapping of Node's platform names to actual OS names. */ const PLATFORM_NAMES = { aix: 'IBM AIX', freebsd: 'FreeBSD', openbsd: 'OpenBSD', sunos: 'SunOS', win32: 'Windows', }; /** Linux version file to check for a distribution. */ /** Mapping of linux release files located in /etc to distributions. */ const LINUX_DISTROS = [ { name: 'fedora-release', distros: ['Fedora'] }, { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] }, { name: 'redhat_version', distros: ['Red Hat Linux'] }, { name: 'SuSE-release', distros: ['SUSE Linux'] }, { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] }, { name: 'debian_version', distros: ['Debian'] }, { name: 'debian_release', distros: ['Debian'] }, { name: 'arch-release', distros: ['Arch Linux'] }, { name: 'gentoo-release', distros: ['Gentoo Linux'] }, { name: 'novell-release', distros: ['SUSE Linux'] }, { name: 'alpine-release', distros: ['Alpine Linux'] }, ]; /** Functions to extract the OS version from Linux release files. */ const LINUX_VERSIONS = { alpine: content => content, arch: content => matchFirst(/distrib_release=(.*)/, content), centos: content => matchFirst(/release ([^ ]+)/, content), debian: content => content, fedora: content => matchFirst(/release (..)/, content), mint: content => matchFirst(/distrib_release=(.*)/, content), red: content => matchFirst(/release ([^ ]+)/, content), suse: content => matchFirst(/VERSION = (.*)\n/, content), ubuntu: content => matchFirst(/distrib_release=(.*)/, content), }; /** * Executes a regular expression with one capture group. * * @param regex A regular expression to execute. * @param text Content to execute the RegEx on. * @returns The captured string if matched; otherwise undefined. */ function matchFirst(regex, text) { const match = regex.exec(text); return match ? match[1] : undefined; } /** Loads the macOS operating system context. */ async function getDarwinInfo() { // Default values that will be used in case no operating system information // can be loaded. The default version is computed via heuristics from the // kernel version, but the build ID is missing. const darwinInfo = { kernel_version: external_os_.release(), name: 'Mac OS X', version: `10.${Number(external_os_.release().split('.')[0]) - 4}`, }; try { // We try to load the actual macOS version by executing the `sw_vers` tool. // This tool should be available on every standard macOS installation. In // case this fails, we stick with the values computed above. const output = await new Promise((resolve, reject) => { (0,external_child_process_.execFile)('/usr/bin/sw_vers', (error, stdout) => { if (error) { reject(error); return; } resolve(stdout); }); }); darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output); darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output); darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output); } catch (e) { // ignore } return darwinInfo; } /** Returns a distribution identifier to look up version callbacks. */ function getLinuxDistroId(name) { return name.split(' ')[0].toLowerCase(); } /** Loads the Linux operating system context. */ async function getLinuxInfo() { // By default, we cannot assume anything about the distribution or Linux // version. `os.release()` returns the kernel version and we assume a generic // "Linux" name, which will be replaced down below. const linuxInfo = { kernel_version: external_os_.release(), name: 'Linux', }; try { // We start guessing the distribution by listing files in the /etc // directory. This is were most Linux distributions (except Knoppix) store // release files with certain distribution-dependent meta data. We search // for exactly one known file defined in `LINUX_DISTROS` and exit if none // are found. In case there are more than one file, we just stick with the // first one. const etcFiles = await readDirAsync('/etc'); const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name)); if (!distroFile) { return linuxInfo; } // Once that file is known, load its contents. To make searching in those // files easier, we lowercase the file contents. Since these files are // usually quite small, this should not allocate too much memory and we only // hold on to it for a very short amount of time. const distroPath = (0,external_path_.join)('/etc', distroFile.name); const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase(); // Some Linux distributions store their release information in the same file // (e.g. RHEL and Centos). In those cases, we scan the file for an // identifier, that basically consists of the first word of the linux // distribution name (e.g. "red" for Red Hat). In case there is no match, we // just assume the first distribution in our list. const { distros } = distroFile; linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0]; // Based on the found distribution, we can now compute the actual version // number. This is different for every distribution, so several strategies // are computed in `LINUX_VERSIONS`. const id = getLinuxDistroId(linuxInfo.name); linuxInfo.version = LINUX_VERSIONS[id](contents); } catch (e) { // ignore } return linuxInfo; } //# sourceMappingURL=context.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/url.js /** * Parses string form of URL into an object * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B * // intentionally using regex and not href parsing trick because React Native and other * // environments where DOM might not be available * @returns parsed URL object */ function parseUrl(url) { if (!url) { return {}; } const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); if (!match) { return {}; } // coerce to undefined values to empty string so we don't get 'undefined' const query = match[6] || ''; const fragment = match[8] || ''; return { host: match[4], path: match[5], protocol: match[2], relative: match[5] + query + fragment, // everything minus origin }; } /** * Strip the query string and fragment off of a given URL or path (if present) * * @param urlPath Full URL or path, including possible query string and/or fragment * @returns URL or path without query string or fragment */ function stripUrlQueryAndFragment(urlPath) { // eslint-disable-next-line no-useless-escape return urlPath.split(/[\?#]/, 1)[0]; } /** * Returns number of URL segments of a passed string URL. */ function getNumberOfUrlSegments(url) { // split at '/' or at '\/' to split regex urls correctly return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length; } //# sourceMappingURL=url.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/requestdata.js const DEFAULT_INCLUDES = { ip: false, request: true, transaction: true, user: true, }; const DEFAULT_REQUEST_INCLUDES = (/* unused pure expression or super */ null && (['cookies', 'data', 'headers', 'method', 'query_string', 'url'])); const DEFAULT_USER_INCLUDES = (/* unused pure expression or super */ null && (['id', 'username', 'email'])); /** * Sets parameterized route as transaction name e.g.: `GET /users/:id` * Also adds more context data on the transaction from the request */ function addRequestDataToTransaction( transaction, req, deps, ) { if (!transaction) return; if (!transaction.metadata.source || transaction.metadata.source === 'url') { // Attempt to grab a parameterized route off of the request transaction.setName(...extractPathForTransaction(req, { path: true, method: true })); } transaction.setData('url', req.originalUrl || req.url); if (req.baseUrl) { transaction.setData('baseUrl', req.baseUrl); } transaction.setData('query', extractQueryParams(req, deps)); } /** * Extracts a complete and parameterized path from the request object and uses it to construct transaction name. * If the parameterized transaction name cannot be extracted, we fall back to the raw URL. * * Additionally, this function determines and returns the transaction name source * * eg. GET /mountpoint/user/:id * * @param req A request object * @param options What to include in the transaction name (method, path, or a custom route name to be * used instead of the request's route) * * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url') */ function extractPathForTransaction( req, options = {}, ) { const method = req.method && req.method.toUpperCase(); let path = ''; let source = 'url'; // Check to see if there's a parameterized route we can use (as there is in Express) if (options.customRoute || req.route) { path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`; source = 'route'; } // Otherwise, just take the original URL else if (req.originalUrl || req.url) { path = stripUrlQueryAndFragment(req.originalUrl || req.url || ''); } let name = ''; if (options.method && method) { name += method; } if (options.method && options.path) { name += ' '; } if (options.path && path) { name += path; } return [name, source]; } /** JSDoc */ function extractTransaction(req, type) { switch (type) { case 'path': { return extractPathForTransaction(req, { path: true })[0]; } case 'handler': { return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || ''; } case 'methodPath': default: { return extractPathForTransaction(req, { path: true, method: true })[0]; } } } /** JSDoc */ function extractUserData( user , keys, ) { const extractedUser = {}; const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES; attributes.forEach(key => { if (user && key in user) { extractedUser[key] = user[key]; } }); return extractedUser; } /** * Normalize data from the request object, accounting for framework differences. * * @param req The request object from which to extract data * @param options.include An optional array of keys to include in the normalized data. Defaults to * DEFAULT_REQUEST_INCLUDES if not provided. * @param options.deps Injected, platform-specific dependencies * @returns An object containing normalized request data */ function extractRequestData( req, options , ) { const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {}; const requestData = {}; // headers: // node, express, koa, nextjs: req.headers const headers = (req.headers || {}) ; // method: // node, express, koa, nextjs: req.method const method = req.method; // host: // express: req.hostname in > 4 and req.host in < 4 // koa: req.host // node, nextjs: req.headers.host const host = req.hostname || req.host || headers.host || ''; // protocol: // node, nextjs: // express, koa: req.protocol const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http'; // url (including path and query string): // node, express: req.originalUrl // koa, nextjs: req.url const originalUrl = req.originalUrl || req.url || ''; // absolute url const absoluteUrl = `${protocol}://${host}${originalUrl}`; include.forEach(key => { switch (key) { case 'headers': { requestData.headers = headers; break; } case 'method': { requestData.method = method; break; } case 'url': { requestData.url = absoluteUrl; break; } case 'cookies': { // cookies: // node, express, koa: req.headers.cookie // vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access requestData.cookies = // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can // come off in v8 req.cookies || (headers.cookie && deps && deps.cookie && deps.cookie.parse(headers.cookie)) || {}; break; } case 'query_string': { // query string: // node: req.url (raw) // express, koa, nextjs: req.query // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access requestData.query_string = extractQueryParams(req, deps); break; } case 'data': { if (method === 'GET' || method === 'HEAD') { break; } // body data: // express, koa, nextjs: req.body // // when using node by itself, you have to read the incoming stream(see // https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know // where they're going to store the final result, so they'll have to capture this data themselves if (req.body !== undefined) { requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body)); } break; } default: { if ({}.hasOwnProperty.call(req, key)) { requestData[key] = (req )[key]; } } } }); return requestData; } /** * Options deciding what parts of the request to use when enhancing an event */ /** * Add data from the given request to the given event * * @param event The event to which the request data will be added * @param req Request object * @param options.include Flags to control what data is included * @param options.deps Injected platform-specific dependencies * @hidden */ function addRequestDataToEvent( event, req, options, ) { const include = { ...DEFAULT_INCLUDES, ...(options && options.include), }; if (include.request) { const extractedRequestData = Array.isArray(include.request) ? extractRequestData(req, { include: include.request, deps: options && options.deps }) : extractRequestData(req, { deps: options && options.deps }); event.request = { ...event.request, ...extractedRequestData, }; } if (include.user) { const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {}; if (Object.keys(extractedUser).length) { event.user = { ...event.user, ...extractedUser, }; } } // client ip: // node, nextjs: req.socket.remoteAddress // express, koa: req.ip if (include.ip) { const ip = req.ip || (req.socket && req.socket.remoteAddress); if (ip) { event.user = { ...event.user, ip_address: ip, }; } } if (include.transaction && !event.transaction) { // TODO do we even need this anymore? // TODO make this work for nextjs event.transaction = extractTransaction(req, include.transaction); } return event; } function extractQueryParams( req, deps, ) { // url (including path and query string): // node, express: req.originalUrl // koa, nextjs: req.url let originalUrl = req.originalUrl || req.url || ''; if (!originalUrl) { return; } // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use. if (originalUrl.startsWith('/')) { originalUrl = `http://dogs.are.great${originalUrl}`; } return ( req.query || (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) || // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node (deps && deps.url && deps.url.parse(originalUrl).query) || undefined ); } //# sourceMappingURL=requestdata.js.map // EXTERNAL MODULE: ./node_modules/@sentry/node/node_modules/cookie/index.js var cookie = __webpack_require__(97112); ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/requestdata.js const requestdata_DEFAULT_INCLUDES = { ip: false, request: true, transaction: true, user: true, }; const requestdata_DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url']; const requestdata_DEFAULT_USER_INCLUDES = ['id', 'username', 'email']; /** * Extracts a complete and parameterized path from the request object and uses it to construct transaction name. * If the parameterized transaction name cannot be extracted, we fall back to the raw URL. * * Additionally, this function determines and returns the transaction name source * * eg. GET /mountpoint/user/:id * * @param req A request object * @param options What to include in the transaction name (method, path, or a custom route name to be * used instead of the request's route) * * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url') */ function requestdata_extractPathForTransaction( req, options = {}, ) { const method = req.method && req.method.toUpperCase(); let path = ''; let source = 'url'; // Check to see if there's a parameterized route we can use (as there is in Express) if (options.customRoute || req.route) { path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`; source = 'route'; } // Otherwise, just take the original URL else if (req.originalUrl || req.url) { path = stripUrlQueryAndFragment(req.originalUrl || req.url || ''); } let name = ''; if (options.method && method) { name += method; } if (options.method && options.path) { name += ' '; } if (options.path && path) { name += path; } return [name, source]; } /** JSDoc */ function requestdata_extractTransaction(req, type) { switch (type) { case 'path': { return requestdata_extractPathForTransaction(req, { path: true })[0]; } case 'handler': { return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || ''; } case 'methodPath': default: { return requestdata_extractPathForTransaction(req, { path: true, method: true })[0]; } } } /** JSDoc */ function requestdata_extractUserData( user , keys, ) { const extractedUser = {}; const attributes = Array.isArray(keys) ? keys : requestdata_DEFAULT_USER_INCLUDES; attributes.forEach(key => { if (user && key in user) { extractedUser[key] = user[key]; } }); return extractedUser; } /** * Normalize data from the request object * * @param req The request object from which to extract data * @param options.include An optional array of keys to include in the normalized data. Defaults to * DEFAULT_REQUEST_INCLUDES if not provided. * @param options.deps Injected, platform-specific dependencies * * @returns An object containing normalized request data */ function requestdata_extractRequestData( req, options , ) { const { include = requestdata_DEFAULT_REQUEST_INCLUDES } = options || {}; const requestData = {}; // headers: // node, express, koa, nextjs: req.headers const headers = (req.headers || {}) ; // method: // node, express, koa, nextjs: req.method const method = req.method; // host: // express: req.hostname in > 4 and req.host in < 4 // koa: req.host // node, nextjs: req.headers.host const host = req.hostname || req.host || headers.host || ''; // protocol: // node, nextjs: // express, koa: req.protocol const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http'; // url (including path and query string): // node, express: req.originalUrl // koa, nextjs: req.url const originalUrl = req.originalUrl || req.url || ''; // absolute url const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`; include.forEach(key => { switch (key) { case 'headers': { requestData.headers = headers; // Remove the Cookie header in case cookie data should not be included in the event if (!include.includes('cookies')) { delete (requestData.headers ).cookie; } break; } case 'method': { requestData.method = method; break; } case 'url': { requestData.url = absoluteUrl; break; } case 'cookies': { // cookies: // node, express, koa: req.headers.cookie // vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access requestData.cookies = // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can // come off in v8 req.cookies || (headers.cookie && cookie/* parse */.Q(headers.cookie)) || {}; break; } case 'query_string': { // query string: // node: req.url (raw) // express, koa, nextjs: req.query // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access requestData.query_string = requestdata_extractQueryParams(req); break; } case 'data': { if (method === 'GET' || method === 'HEAD') { break; } // body data: // express, koa, nextjs: req.body // // when using node by itself, you have to read the incoming stream(see // https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know // where they're going to store the final result, so they'll have to capture this data themselves if (req.body !== undefined) { requestData.data = is_isString(req.body) ? req.body : JSON.stringify(normalize_normalize(req.body)); } break; } default: { if ({}.hasOwnProperty.call(req, key)) { requestData[key] = (req )[key]; } } } }); return requestData; } /** * Add data from the given request to the given event * * @param event The event to which the request data will be added * @param req Request object * @param options.include Flags to control what data is included * * @returns The mutated `Event` object */ function requestdata_addRequestDataToEvent( event, req, options, ) { const include = { ...requestdata_DEFAULT_INCLUDES, ..._optionalChain([options, 'optionalAccess', _ => _.include]), }; if (include.request) { const extractedRequestData = Array.isArray(include.request) ? requestdata_extractRequestData(req, { include: include.request }) : requestdata_extractRequestData(req); event.request = { ...event.request, ...extractedRequestData, }; } if (include.user) { const extractedUser = req.user && is_isPlainObject(req.user) ? requestdata_extractUserData(req.user, include.user) : {}; if (Object.keys(extractedUser).length) { event.user = { ...event.user, ...extractedUser, }; } } // client ip: // node, nextjs: req.socket.remoteAddress // express, koa: req.ip if (include.ip) { const ip = req.ip || (req.socket && req.socket.remoteAddress); if (ip) { event.user = { ...event.user, ip_address: ip, }; } } if (include.transaction && !event.transaction) { // TODO do we even need this anymore? // TODO make this work for nextjs event.transaction = requestdata_extractTransaction(req, include.transaction); } return event; } function requestdata_extractQueryParams(req) { // url (including path and query string): // node, express: req.originalUrl // koa, nextjs: req.url let originalUrl = req.originalUrl || req.url || ''; if (!originalUrl) { return; } // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use. if (originalUrl.startsWith('/')) { originalUrl = `http://dogs.are.great${originalUrl}`; } return ( req.query || (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) || // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node external_url_.parse(originalUrl).query || undefined ); } //# sourceMappingURL=requestdata.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/requestdata.js const DEFAULT_OPTIONS = { include: { cookies: true, data: true, headers: true, ip: false, query_string: true, url: true, user: { id: true, username: true, email: true, }, }, transactionNamingScheme: 'methodPath', }; /** Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations` * so it can be used in cross-platform SDKs like `@sentry/nextjs`. */ class RequestData { /** * @inheritDoc */ static __initStatic() {this.id = 'RequestData';} /** * @inheritDoc */ __init() {this.name = RequestData.id;} /** * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use * something similar in browser-based SDKs in the future. */ /** * @inheritDoc */ constructor(options = {}) {RequestData.prototype.__init.call(this); this._addRequestData = requestdata_addRequestDataToEvent; this._options = { ...DEFAULT_OPTIONS, ...options, include: { // @ts-ignore It's mad because `method` isn't a known `include` key. (It's only here and not set by default in // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.) method: true, ...DEFAULT_OPTIONS.include, ...options.include, user: options.include && typeof options.include.user === 'boolean' ? options.include.user : { ...DEFAULT_OPTIONS.include.user, // Unclear why TS still thinks `options.include.user` could be a boolean at this point ...((options.include || {}).user ), }, }, }; } /** * @inheritDoc */ setupOnce(addGlobalEventProcessor, getCurrentHub) { // Note: In the long run, most of the logic here should probably move into the request data utility functions. For // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed. // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.) const { transactionNamingScheme } = this._options; addGlobalEventProcessor(event => { const hub = getCurrentHub(); const self = hub.getIntegration(RequestData); const { sdkProcessingMetadata = {} } = event; const req = sdkProcessingMetadata.request; // If the globally installed instance of this integration isn't associated with the current hub, `self` will be // undefined if (!self || !req) { return event; } // The Express request handler takes a similar `include` option to that which can be passed to this integration. // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this // integration, so that all of this passing and conversion isn't necessary const addRequestDataOptions = sdkProcessingMetadata.requestDataOptionsFromExpressHandler || sdkProcessingMetadata.requestDataOptionsFromGCPWrapper || convertReqDataIntegrationOptsToAddReqDataOpts(this._options); const processedEvent = this._addRequestData(event, req, addRequestDataOptions); // Transaction events already have the right `transaction` value if (event.type === 'transaction' || transactionNamingScheme === 'handler') { return processedEvent; } // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction` // value with a high-quality one const reqWithTransaction = req ; const transaction = reqWithTransaction._sentryTransaction; if (transaction) { // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential // to break things like alert rules.) const shouldIncludeMethodInTransactionName = getSDKName(hub) === 'sentry.javascript.nextjs' ? transaction.name.startsWith('/api') : transactionNamingScheme !== 'path'; const [transactionValue] = extractPathForTransaction(req, { path: true, method: shouldIncludeMethodInTransactionName, customRoute: transaction.name, }); processedEvent.transaction = transactionValue; } return processedEvent; }); } } RequestData.__initStatic(); /** Convert this integration's options to match what `addRequestDataToEvent` expects */ /** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */ function convertReqDataIntegrationOptsToAddReqDataOpts( integrationOptions, ) { const { transactionNamingScheme, include: { ip, user, ...requestOptions }, } = integrationOptions; const requestIncludeKeys = []; for (const [key, value] of Object.entries(requestOptions)) { if (value) { requestIncludeKeys.push(key); } } let addReqDataUserOpt; if (user === undefined) { addReqDataUserOpt = true; } else if (typeof user === 'boolean') { addReqDataUserOpt = user; } else { const userIncludeKeys = []; for (const [key, value] of Object.entries(user)) { if (value) { userIncludeKeys.push(key); } } addReqDataUserOpt = userIncludeKeys; } return { include: { ip, user: addReqDataUserOpt, request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined, transaction: transactionNamingScheme, }, }; } function getSDKName(hub) { try { // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to // write out a long chain of `a && a.b && a.b.c && ...` // eslint-disable-next-line @typescript-eslint/no-non-null-assertion return hub.getClient().getOptions()._metadata.sdk.name; } catch (err) { // In theory we should never get here return undefined; } } //# sourceMappingURL=requestdata.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/localvariables.js /** * Promise API is available as `Experimental` and in Node 19 only. * * Callback-based API is `Stable` since v14 and `Experimental` since v8. * Because of that, we are creating our own `AsyncSession` class. * * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api * https://nodejs.org/docs/latest-v14.x/api/inspector.html */ class AsyncSession { /** Throws is inspector API is not available */ constructor() { // Node can be build without inspector support so this can throw // eslint-disable-next-line @typescript-eslint/no-var-requires const { Session } = __webpack_require__(31405); this._session = new Session(); } /** @inheritdoc */ configureAndConnect( onPause, captureAll, ) { this._session.connect(); this._session.on('Debugger.paused', onPause); this._session.post('Debugger.enable'); // We only want to pause on uncaught exceptions this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' }); } /** @inheritdoc */ async getLocalVariables(objectId) { const props = await this._getProperties(objectId); const unrolled = {}; for (const prop of props) { if (_optionalChain([prop, 'optionalAccess', _ => _.value, 'optionalAccess', _2 => _2.objectId]) && _optionalChain([prop, 'optionalAccess', _3 => _3.value, 'access', _4 => _4.className]) === 'Array') { unrolled[prop.name] = await this._unrollArray(prop.value.objectId); } else if (_optionalChain([prop, 'optionalAccess', _5 => _5.value, 'optionalAccess', _6 => _6.objectId]) && _optionalChain([prop, 'optionalAccess', _7 => _7.value, 'optionalAccess', _8 => _8.className]) === 'Object') { unrolled[prop.name] = await this._unrollObject(prop.value.objectId); } else if (_optionalChain([prop, 'optionalAccess', _9 => _9.value, 'optionalAccess', _10 => _10.value]) || _optionalChain([prop, 'optionalAccess', _11 => _11.value, 'optionalAccess', _12 => _12.description])) { unrolled[prop.name] = prop.value.value || `<${prop.value.description}>`; } } return unrolled; } /** * Gets all the PropertyDescriptors of an object */ _getProperties(objectId) { return new Promise((resolve, reject) => { this._session.post( 'Runtime.getProperties', { objectId, ownProperties: true, }, (err, params) => { if (err) { reject(err); } else { resolve(params.result); } }, ); }); } /** * Unrolls an array property */ async _unrollArray(objectId) { const props = await this._getProperties(objectId); return props .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10))) .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10)) .map(v => _optionalChain([v, 'optionalAccess', _13 => _13.value, 'optionalAccess', _14 => _14.value])); } /** * Unrolls an object property */ async _unrollObject(objectId) { const props = await this._getProperties(objectId); return props .map(v => [v.name, _optionalChain([v, 'optionalAccess', _15 => _15.value, 'optionalAccess', _16 => _16.value])]) .reduce((obj, [key, val]) => { obj[key] = val; return obj; }, {} ); } } /** * When using Vercel pkg, the inspector module is not available. * https://github.com/getsentry/sentry-javascript/issues/6769 */ function tryNewAsyncSession() { try { return new AsyncSession(); } catch (e) { return undefined; } } // Add types for the exception event data /** Could this be an anonymous function? */ function isAnonymous(name) { return name !== undefined && ['', '?', ''].includes(name); } /** Do the function names appear to match? */ function functionNamesMatch(a, b) { return a === b || (isAnonymous(a) && isAnonymous(b)); } /** Creates a unique hash from stack frames */ function hashFrames(frames) { if (frames === undefined) { return; } // Only hash the 10 most recent frames (ie. the last 10) return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, ''); } /** * We use the stack parser to create a unique hash from the exception stack trace * This is used to lookup vars when the exception passes through the event processor */ function hashFromStack(stackParser, stack) { if (stack === undefined) { return undefined; } return hashFrames(stackParser(stack, 1)); } /** * Adds local variables to exception frames */ class LocalVariables { static __initStatic() {this.id = 'LocalVariables';} __init() {this.name = LocalVariables.id;} __init2() {this._cachedFrames = new lru.LRUMap(20);} constructor( _options = {}, _session = tryNewAsyncSession(), ) {this._options = _options;this._session = _session;LocalVariables.prototype.__init.call(this);LocalVariables.prototype.__init2.call(this);} /** * @inheritDoc */ setupOnce(addGlobalEventProcessor, getCurrentHub) { this._setup(addGlobalEventProcessor, _optionalChain([getCurrentHub, 'call', _17 => _17(), 'access', _18 => _18.getClient, 'call', _19 => _19(), 'optionalAccess', _20 => _20.getOptions, 'call', _21 => _21()])); } /** Setup in a way that's easier to call from tests */ _setup( addGlobalEventProcessor, clientOptions, ) { if (this._session && _optionalChain([clientOptions, 'optionalAccess', _22 => _22.includeLocalVariables])) { this._session.configureAndConnect( ev => this._handlePaused(clientOptions.stackParser, ev ), !!this._options.captureAllExceptions, ); addGlobalEventProcessor(async event => this._addLocalVariables(event)); } } /** * Handle the pause event */ async _handlePaused( stackParser, { params: { reason, data, callFrames } }, ) { if (reason !== 'exception' && reason !== 'promiseRejection') { return; } // data.description contains the original error.stack const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _23 => _23.description])); if (exceptionHash == undefined) { return; } const framePromises = callFrames.map(async ({ scopeChain, functionName, this: obj }) => { const localScope = scopeChain.find(scope => scope.type === 'local'); const fn = obj.className === 'global' ? functionName : `${obj.className}.${functionName}`; if (_optionalChain([localScope, 'optionalAccess', _24 => _24.object, 'access', _25 => _25.objectId]) === undefined) { return { function: fn }; } const vars = await _optionalChain([this, 'access', _26 => _26._session, 'optionalAccess', _27 => _27.getLocalVariables, 'call', _28 => _28(localScope.object.objectId)]); return { function: fn, vars }; }); // We add the un-awaited promise to the cache rather than await here otherwise the event processor // can be called before we're finished getting all the vars this._cachedFrames.set(exceptionHash, Promise.all(framePromises)); } /** * Adds local variables event stack frames. */ async _addLocalVariables(event) { for (const exception of _optionalChain([event, 'optionalAccess', _29 => _29.exception, 'optionalAccess', _30 => _30.values]) || []) { await this._addLocalVariablesToException(exception); } return event; } /** * Adds local variables to the exception stack frames. */ async _addLocalVariablesToException(exception) { const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _31 => _31.stacktrace, 'optionalAccess', _32 => _32.frames])); if (hash === undefined) { return; } // Check if we have local variables for an exception that matches the hash // delete is identical to get but also removes the entry from the cache const cachedFrames = await this._cachedFrames.delete(hash); if (cachedFrames === undefined) { return; } const frameCount = _optionalChain([exception, 'access', _33 => _33.stacktrace, 'optionalAccess', _34 => _34.frames, 'optionalAccess', _35 => _35.length]) || 0; for (let i = 0; i < frameCount; i++) { // Sentry frames are in reverse order const frameIndex = frameCount - i - 1; // Drop out if we run out of frames to match up if (!_optionalChain([exception, 'optionalAccess', _36 => _36.stacktrace, 'optionalAccess', _37 => _37.frames, 'optionalAccess', _38 => _38[frameIndex]]) || !cachedFrames[i]) { break; } if ( // We need to have vars to add cachedFrames[i].vars === undefined || // We're not interested in frames that are not in_app because the vars are not relevant exception.stacktrace.frames[frameIndex].in_app === false || // The function names need to match !functionNamesMatch(exception.stacktrace.frames[frameIndex].function, cachedFrames[i].function) ) { continue; } exception.stacktrace.frames[frameIndex].vars = cachedFrames[i].vars; } } }LocalVariables.__initStatic(); //# sourceMappingURL=localvariables.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/path.js // Slightly modified (no IE8 support, ES6) and transcribed to TypeScript // https://raw.githubusercontent.com/calvinmetcalf/rollup-plugin-node-builtins/master/src/es6/path.js /** JSDoc */ function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 let up = 0; for (let i = parts.length - 1; i >= 0; i--) { const last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; } // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. const splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/; /** JSDoc */ function splitPath(filename) { const parts = splitPathRe.exec(filename); return parts ? parts.slice(1) : []; } // path.resolve([from ...], to) // posix version /** JSDoc */ function resolve(...args) { let resolvedPath = ''; let resolvedAbsolute = false; for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { const path = i >= 0 ? args[i] : '/'; // Skip empty entries if (!path) { continue; } resolvedPath = `${path}/${resolvedPath}`; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray( resolvedPath.split('/').filter(p => !!p), !resolvedAbsolute, ).join('/'); return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; } /** JSDoc */ function trim(arr) { let start = 0; for (; start < arr.length; start++) { if (arr[start] !== '') { break; } } let end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== '') { break; } } if (start > end) { return []; } return arr.slice(start, end - start + 1); } // path.relative(from, to) // posix version /** JSDoc */ function relative(from, to) { /* eslint-disable no-param-reassign */ from = resolve(from).slice(1); to = resolve(to).slice(1); /* eslint-enable no-param-reassign */ const fromParts = trim(from.split('/')); const toParts = trim(to.split('/')); const length = Math.min(fromParts.length, toParts.length); let samePartsLength = length; for (let i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } let outputParts = []; for (let i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); } // path.normalize(path) // posix version /** JSDoc */ function normalizePath(path) { const isPathAbsolute = isAbsolute(path); const trailingSlash = path.slice(-1) === '/'; // Normalize the path let normalizedPath = normalizeArray( path.split('/').filter(p => !!p), !isPathAbsolute, ).join('/'); if (!normalizedPath && !isPathAbsolute) { normalizedPath = '.'; } if (normalizedPath && trailingSlash) { normalizedPath += '/'; } return (isPathAbsolute ? '/' : '') + normalizedPath; } // posix version /** JSDoc */ function isAbsolute(path) { return path.charAt(0) === '/'; } // posix version /** JSDoc */ function join(...args) { return normalizePath(args.join('/')); } /** JSDoc */ function dirname(path) { const result = splitPath(path); const root = result[0]; let dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.slice(0, dir.length - 1); } return root + dir; } /** JSDoc */ function basename(path, ext) { let f = splitPath(path)[2]; if (ext && f.slice(ext.length * -1) === ext) { f = f.slice(0, f.length - ext.length); } return f; } //# sourceMappingURL=path.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/module.js /** normalizes Windows paths */ function module_normalizePath(path) { return path .replace(/^[A-Z]:/, '') // remove Windows-style prefix .replace(/\\/g, '/'); // replace all `\` instances with `/` } /** Gets the module from a filename */ function getModule(filename) { if (!filename) { return; } const normalizedFilename = module_normalizePath(filename); // We could use optional chaining here but webpack does like that mixed with require const base = module_normalizePath( `${( true && __webpack_require__.c[__webpack_require__.s] && __webpack_require__.c[__webpack_require__.s].filename && dirname(__webpack_require__.c[__webpack_require__.s].filename)) || global.process.cwd()}/`, ); // It's specifically a module const file = basename(normalizedFilename, '.js'); const path = dirname(normalizedFilename); let n = path.lastIndexOf('/node_modules/'); if (n > -1) { // /node_modules/ is 14 chars return `${path.slice(n + 14).replace(/\//g, '.')}:${file}`; } // Let's see if it's a part of the main module // To be a part of main module, it has to share the same base n = `${path}/`.lastIndexOf(base, 0); if (n === 0) { let moduleName = path.slice(base.length).replace(/\//g, '.'); if (moduleName) { moduleName += ':'; } moduleName += file; return moduleName; } return file; } //# sourceMappingURL=module.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/sdk.js /* eslint-disable max-lines */ const defaultIntegrations = [ // Common new InboundFilters(), new FunctionToString(), // Native Wrappers new Console(), new Http(), // Global Handlers new OnUncaughtException(), new OnUnhandledRejection(), // Event Info new ContextLines(), new LocalVariables(), new Context(), new Modules(), new RequestData(), // Misc new LinkedErrors(), ]; /** * The Sentry Node SDK Client. * * To use this SDK, call the {@link init} function as early as possible in the * main entry module. To set context information or send manual events, use the * provided methods. * * @example * ``` * * const { init } = require('@sentry/node'); * * init({ * dsn: '__DSN__', * // ... * }); * ``` * * @example * ``` * * const { configureScope } = require('@sentry/node'); * configureScope((scope: Scope) => { * scope.setExtra({ battery: 0.7 }); * scope.setTag({ user_mode: 'admin' }); * scope.setUser({ id: '4711' }); * }); * ``` * * @example * ``` * * const { addBreadcrumb } = require('@sentry/node'); * addBreadcrumb({ * message: 'My Breadcrumb', * // ... * }); * ``` * * @example * ``` * * const Sentry = require('@sentry/node'); * Sentry.captureMessage('Hello, world!'); * Sentry.captureException(new Error('Good bye')); * Sentry.captureEvent({ * message: 'Manual', * stacktrace: [ * // ... * ], * }); * ``` * * @see {@link NodeOptions} for documentation on configuration options. */ function init(options = {}) { const carrier = getMainCarrier(); const autoloadedIntegrations = _optionalChain([carrier, 'access', _ => _.__SENTRY__, 'optionalAccess', _2 => _2.integrations]) || []; options.defaultIntegrations = options.defaultIntegrations === false ? [] : [ ...(Array.isArray(options.defaultIntegrations) ? options.defaultIntegrations : defaultIntegrations), ...autoloadedIntegrations, ]; if (options.dsn === undefined && process.env.SENTRY_DSN) { options.dsn = process.env.SENTRY_DSN; } if (options.tracesSampleRate === undefined && process.env.SENTRY_TRACES_SAMPLE_RATE) { const tracesSampleRate = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE); if (isFinite(tracesSampleRate)) { options.tracesSampleRate = tracesSampleRate; } } if (options.release === undefined) { const detectedRelease = getSentryRelease(); if (detectedRelease !== undefined) { options.release = detectedRelease; } else { // If release is not provided, then we should disable autoSessionTracking options.autoSessionTracking = false; } } if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) { options.environment = process.env.SENTRY_ENVIRONMENT; } if (options.autoSessionTracking === undefined && options.dsn !== undefined) { options.autoSessionTracking = true; } if (options.instrumenter === undefined) { options.instrumenter = 'sentry'; } // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any if (external_domain_.active) { setHubOnCarrier(carrier, getCurrentHub()); } // TODO(v7): Refactor this to reduce the logic above const clientOptions = { ...options, stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser), integrations: getIntegrationsToSetup(options), transport: options.transport || makeNodeTransport, }; initAndBind(NodeClient, clientOptions); if (options.autoSessionTracking) { startSessionTracking(); } } /** * This is the getter for lastEventId. * * @returns The last event id of a captured event. */ function lastEventId() { return getCurrentHub().lastEventId(); } /** * Call `flush()` on the current client, if there is one. See {@link Client.flush}. * * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause * the client to wait until all events are sent before resolving the promise. * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it * doesn't (or if there's no client defined). */ async function flush(timeout) { const client = getCurrentHub().getClient(); if (client) { return client.flush(timeout); } (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot flush events. No client defined.'); return Promise.resolve(false); } /** * Call `close()` on the current client, if there is one. See {@link Client.close}. * * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this * parameter will cause the client to wait until all events are sent before disabling itself. * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it * doesn't (or if there's no client defined). */ async function sdk_close(timeout) { const client = getCurrentHub().getClient(); if (client) { return client.close(timeout); } (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot flush events and disable SDK. No client defined.'); return Promise.resolve(false); } /** * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client */ function isAutoSessionTrackingEnabled(client) { if (client === undefined) { return false; } const clientOptions = client && client.getOptions(); if (clientOptions && clientOptions.autoSessionTracking !== undefined) { return clientOptions.autoSessionTracking; } return false; } /** * Returns a release dynamically from environment variables. */ function getSentryRelease(fallback) { // Always read first as Sentry takes this as precedence if (process.env.SENTRY_RELEASE) { return process.env.SENTRY_RELEASE; } // This supports the variable that sentry-webpack-plugin injects if (worldwide/* GLOBAL_OBJ.SENTRY_RELEASE */.n2.SENTRY_RELEASE && worldwide/* GLOBAL_OBJ.SENTRY_RELEASE.id */.n2.SENTRY_RELEASE.id) { return worldwide/* GLOBAL_OBJ.SENTRY_RELEASE.id */.n2.SENTRY_RELEASE.id; } return ( // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables process.env.GITHUB_SHA || // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata process.env.COMMIT_REF || // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables process.env.VERCEL_GIT_COMMIT_SHA || process.env.VERCEL_GITHUB_COMMIT_SHA || process.env.VERCEL_GITLAB_COMMIT_SHA || process.env.VERCEL_BITBUCKET_COMMIT_SHA || // Zeit (now known as Vercel) process.env.ZEIT_GITHUB_COMMIT_SHA || process.env.ZEIT_GITLAB_COMMIT_SHA || process.env.ZEIT_BITBUCKET_COMMIT_SHA || fallback ); } /** Node.js stack parser */ const defaultStackParser = createStackParser(nodeStackLineParser(getModule)); /** * Enable automatic Session Tracking for the node process. */ function startSessionTracking() { const hub = getCurrentHub(); hub.startSession(); // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because // The 'beforeExit' event is not emitted for conditions causing explicit termination, // such as calling process.exit() or uncaught exceptions. // Ref: https://nodejs.org/api/process.html#process_event_beforeexit process.on('beforeExit', () => { const session = _optionalChain([hub, 'access', _3 => _3.getScope, 'call', _4 => _4(), 'optionalAccess', _5 => _5.getSession, 'call', _6 => _6()]); const terminalStates = ['exited', 'crashed']; // Only call endSession, if the Session exists on Scope and SessionStatus is not a // Terminal Status i.e. Exited or Crashed because // "When a session is moved away from ok it must not be updated anymore." // Ref: https://develop.sentry.dev/sdk/sessions/ if (session && !terminalStates.includes(session.status)) hub.endSession(); }); } //# sourceMappingURL=sdk.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/utils.js /** * Recursively read the contents of a directory. * * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this * directory. * @returns Array holding all relative paths */ function deepReadDirSync(targetDir) { const targetDirAbsPath = external_path_.resolve(targetDir); if (!external_fs_.existsSync(targetDirAbsPath)) { throw new Error(`Cannot read contents of ${targetDirAbsPath}. Directory does not exist.`); } if (!external_fs_.statSync(targetDirAbsPath).isDirectory()) { throw new Error(`Cannot read contents of ${targetDirAbsPath}, because it is not a directory.`); } // This does the same thing as its containing function, `deepReadDirSync` (except that - purely for convenience - it // deals in absolute paths rather than relative ones). We need this to be separate from the outer function to preserve // the difference between `targetDirAbsPath` and `currentDirAbsPath`. const deepReadCurrentDir = (currentDirAbsPath) => { return external_fs_.readdirSync(currentDirAbsPath).reduce((absPaths, itemName) => { const itemAbsPath = external_path_.join(currentDirAbsPath, itemName); if (external_fs_.statSync(itemAbsPath).isDirectory()) { return [...absPaths, ...deepReadCurrentDir(itemAbsPath)]; } return [...absPaths, itemAbsPath]; }, []); }; return deepReadCurrentDir(targetDirAbsPath).map(absPath => external_path_.relative(targetDirAbsPath, absPath)); } //# sourceMappingURL=utils.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/tracing.js const TRACEPARENT_REGEXP = new RegExp( '^[ \\t]*' + // whitespace '([0-9a-f]{32})?' + // trace_id '-?([0-9a-f]{16})?' + // span_id '-?([01])?' + // sampled '[ \\t]*$', // whitespace ); /** * Extract transaction context data from a `sentry-trace` header. * * @param traceparent Traceparent string * * @returns Object containing data from the header, or undefined if traceparent string is malformed */ function extractTraceparentData(traceparent) { const matches = traceparent.match(TRACEPARENT_REGEXP); if (!traceparent || !matches) { // empty string or no matches is invalid traceparent data return undefined; } let parentSampled; if (matches[3] === '1') { parentSampled = true; } else if (matches[3] === '0') { parentSampled = false; } return { traceId: matches[1], parentSampled, parentSpanId: matches[2], }; } //# sourceMappingURL=tracing.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/requestDataDeprecated.js /** * @deprecated `Handlers.ExpressRequest` is deprecated and will be removed in v8. Use `PolymorphicRequest` instead. */ /** * Normalizes data from the request object, accounting for framework differences. * * @deprecated `Handlers.extractRequestData` is deprecated and will be removed in v8. Use `extractRequestData` instead. * * @param req The request object from which to extract data * @param keys An optional array of keys to include in the normalized data. * @returns An object containing normalized request data */ function requestDataDeprecated_extractRequestData(req, keys) { return requestdata_extractRequestData(req, { include: keys }); } /** * Options deciding what parts of the request to use when enhancing an event * * @deprecated `Handlers.ParseRequestOptions` is deprecated and will be removed in v8. Use * `AddRequestDataToEventOptions` in `@sentry/utils` instead. */ /** * Enriches passed event with request data. * * @deprecated `Handlers.parseRequest` is deprecated and will be removed in v8. Use `addRequestDataToEvent` instead. * * @param event Will be mutated and enriched with req data * @param req Request object * @param options object containing flags to enable functionality * @hidden */ function parseRequest(event, req, options = {}) { return requestdata_addRequestDataToEvent(event, req, { include: options }); } //# sourceMappingURL=requestDataDeprecated.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/handlers.js /* eslint-disable @typescript-eslint/no-explicit-any */ /** * Express-compatible tracing handler. * @see Exposed as `Handlers.tracingHandler` */ function tracingHandler() { return function sentryTracingMiddleware( req, res, next, ) { const hub = getCurrentHub(); const options = _optionalChain([hub, 'access', _ => _.getClient, 'call', _2 => _2(), 'optionalAccess', _3 => _3.getOptions, 'call', _4 => _4()]); if ( !options || options.instrumenter !== 'sentry' || _optionalChain([req, 'access', _5 => _5.method, 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]) === 'OPTIONS' || _optionalChain([req, 'access', _8 => _8.method, 'optionalAccess', _9 => _9.toUpperCase, 'call', _10 => _10()]) === 'HEAD' ) { return next(); } // TODO: This is the `hasTracingEnabled` check, but we're doing it manually since `@sentry/tracing` isn't a // dependency of `@sentry/node`. Long term, that function should probably move to `@sentry/hub. if (!('tracesSampleRate' in options) && !('tracesSampler' in options)) { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn( 'Sentry `tracingHandler` is being used, but tracing is disabled. Please enable tracing by setting ' + 'either `tracesSampleRate` or `tracesSampler` in your `Sentry.init()` options.', ); return next(); } // If there is a trace header set, we extract the data from it (parentSpanId, traceId, and sampling decision) const traceparentData = req.headers && is_isString(req.headers['sentry-trace']) && extractTraceparentData(req.headers['sentry-trace']); const incomingBaggageHeaders = _optionalChain([req, 'access', _11 => _11.headers, 'optionalAccess', _12 => _12.baggage]); const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(incomingBaggageHeaders); const [name, source] = extractPathForTransaction(req, { path: true, method: true }); const transaction = startTransaction( { name, op: 'http.server', ...traceparentData, metadata: { dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext, // The request should already have been stored in `scope.sdkProcessingMetadata` (which will become // `event.sdkProcessingMetadata` the same way the metadata here will) by `sentryRequestMiddleware`, but on the // off chance someone is using `sentryTracingMiddleware` without `sentryRequestMiddleware`, it doesn't hurt to // be sure request: req, source, }, }, // extra context passed to the tracesSampler { request: requestdata_extractRequestData(req) }, ); // We put the transaction on the scope so users can attach children to it hub.configureScope(scope => { scope.setSpan(transaction); }); // We also set __sentry_transaction on the response so people can grab the transaction there to add // spans to it later. // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access (res ).__sentry_transaction = transaction; res.once('finish', () => { // Push `transaction.finish` to the next event loop so open spans have a chance to finish before the transaction // closes setImmediate(() => { addRequestDataToTransaction(transaction, req); transaction.setHttpStatus(res.statusCode); transaction.finish(); }); }); next(); }; } /** * Backwards compatibility shim which can be removed in v8. Forces the given options to follow the * `AddRequestDataToEventOptions` interface. * * TODO (v8): Get rid of this, and stop passing `requestDataOptionsFromExpressHandler` to `setSDKProcessingMetadata`. */ function convertReqHandlerOptsToAddReqDataOpts( reqHandlerOptions = {}, ) { let addRequestDataOptions; if ('include' in reqHandlerOptions) { addRequestDataOptions = { include: reqHandlerOptions.include }; } else { // eslint-disable-next-line deprecation/deprecation const { ip, request, transaction, user } = reqHandlerOptions ; if (ip || request || transaction || user) { addRequestDataOptions = { include: dropUndefinedKeys({ ip, request, transaction, user }) }; } } return addRequestDataOptions; } /** * Express compatible request handler. * @see Exposed as `Handlers.requestHandler` */ function requestHandler( options, ) { // TODO (v8): Get rid of this const requestDataOptions = convertReqHandlerOptsToAddReqDataOpts(options); const currentHub = getCurrentHub(); const client = currentHub.getClient(); // Initialise an instance of SessionFlusher on the client when `autoSessionTracking` is enabled and the // `requestHandler` middleware is used indicating that we are running in SessionAggregates mode if (client && isAutoSessionTrackingEnabled(client)) { client.initSessionFlusher(); // If Scope contains a Single mode Session, it is removed in favor of using Session Aggregates mode const scope = currentHub.getScope(); if (scope && scope.getSession()) { scope.setSession(); } } return function sentryRequestMiddleware( req, res, next, ) { if (options && options.flushTimeout && options.flushTimeout > 0) { // eslint-disable-next-line @typescript-eslint/unbound-method const _end = res.end; res.end = function (chunk, encoding, cb) { void flush(options.flushTimeout) .then(() => { _end.call(this, chunk, encoding, cb); }) .then(null, e => { (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(e); _end.call(this, chunk, encoding, cb); }); }; } const local = external_domain_.create(); local.add(req); local.add(res); local.run(() => { const currentHub = getCurrentHub(); currentHub.configureScope(scope => { scope.setSDKProcessingMetadata({ request: req, // TODO (v8): Stop passing this requestDataOptionsFromExpressHandler: requestDataOptions, }); const client = currentHub.getClient(); if (isAutoSessionTrackingEnabled(client)) { const scope = currentHub.getScope(); if (scope) { // Set `status` of `RequestSession` to Ok, at the beginning of the request scope.setRequestSession({ status: 'ok' }); } } }); res.once('finish', () => { const client = currentHub.getClient(); if (isAutoSessionTrackingEnabled(client)) { setImmediate(() => { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (client && (client )._captureRequestSession) { // Calling _captureRequestSession to capture request session at the end of the request by incrementing // the correct SessionAggregates bucket i.e. crashed, errored or exited // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access (client )._captureRequestSession(); } }); } }); next(); }); }; } /** JSDoc */ /** JSDoc */ function getStatusCodeFromResponse(error) { const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode); return statusCode ? parseInt(statusCode , 10) : 500; } /** Returns true if response code is internal server error */ function defaultShouldHandleError(error) { const status = getStatusCodeFromResponse(error); return status >= 500; } /** * Express compatible error handler. * @see Exposed as `Handlers.errorHandler` */ function errorHandler(options ) { return function sentryErrorMiddleware( error, _req, res, next, ) { const shouldHandleError = (options && options.shouldHandleError) || defaultShouldHandleError; if (shouldHandleError(error)) { withScope(_scope => { // The request should already have been stored in `scope.sdkProcessingMetadata` by `sentryRequestMiddleware`, // but on the off chance someone is using `sentryErrorMiddleware` without `sentryRequestMiddleware`, it doesn't // hurt to be sure _scope.setSDKProcessingMetadata({ request: _req }); // For some reason we need to set the transaction on the scope again // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access const transaction = (res ).__sentry_transaction ; if (transaction && _scope.getSpan() === undefined) { _scope.setSpan(transaction); } const client = getCurrentHub().getClient(); if (client && isAutoSessionTrackingEnabled(client)) { // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be // running in SessionAggregates mode // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access const isSessionAggregatesMode = (client )._sessionFlusher !== undefined; if (isSessionAggregatesMode) { const requestSession = _scope.getRequestSession(); // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within // the bounds of a request, and if so the status is updated if (requestSession && requestSession.status !== undefined) { requestSession.status = 'crashed'; } } } const eventId = captureException(error); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access (res ).sentry = eventId; next(error); }); return; } next(error); }; } //# sourceMappingURL=handlers.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/integrations/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/node/esm/index.js const INTEGRATIONS = { ...integrations_namespaceObject, ...esm_integrations_namespaceObject, }; // We need to patch domain on the global __SENTRY__ object to make it work for node in cross-platform packages like // @sentry/core. If we don't do this, browser bundlers will have troubles resolving `require('domain')`. const carrier = getMainCarrier(); if (carrier.__SENTRY__) { carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {}; carrier.__SENTRY__.extensions.domain = carrier.__SENTRY__.extensions.domain || external_domain_; } //# sourceMappingURL=index.js.map /***/ }), /***/ 34428: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const events_1 = __webpack_require__(82361); const debug_1 = __importDefault(__webpack_require__(15158)); const promisify_1 = __importDefault(__webpack_require__(69233)); const debug = debug_1.default('agent-base'); function isAgent(v) { return Boolean(v) && typeof v.addRequest === 'function'; } function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== 'string') return false; return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); } function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } (function (createAgent) { /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === 'function') { this.callback = callback; } else if (callback) { opts = callback; } // Timeout for the socket to be returned from the callback this.timeout = null; if (opts && typeof opts.timeout === 'number') { this.timeout = opts.timeout; } // These aren't actually used by `agent-base`, but are required // for the TypeScript definition files in `@types/node` :/ this.maxFreeSockets = 1; this.maxSockets = 1; this.maxTotalSockets = Infinity; this.sockets = {}; this.freeSockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === 'number') { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v) { this.explicitDefaultPort = v; } get protocol() { if (typeof this.explicitProtocol === 'string') { return this.explicitProtocol; } return isSecureEndpoint() ? 'https:' : 'http:'; } set protocol(v) { this.explicitProtocol = v; } callback(req, opts, fn) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== 'boolean') { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = 'localhost'; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; } if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most // likely the result of a `url.parse()` call... we need to // remove the `path` portion so that `net.connect()` doesn't // attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = (err) => { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; }; const ontimeout = () => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = 'ETIMEOUT'; onerror(err); }; const callbackError = (err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }; const onsocket = (socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { // `socket` is actually an `http.Agent` instance, so // relinquish responsibility for this `req` to the Agent // from here on debug('Callback returned another Agent instance %o', socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once('free', () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }; if (typeof this.callback !== 'function') { onerror(new Error('`callback` is not defined')); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug('Converting legacy callback function to promise'); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === 'number' && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ('port' in opts && typeof opts.port !== 'number') { opts.port = Number(opts.port); } try { debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug('Freeing socket %o %o', socket.constructor.name, opts); socket.destroy(); } destroy() { debug('Destroying agent %o', this.constructor.name); } } createAgent.Agent = Agent; // So that `instanceof` works correctly createAgent.prototype = createAgent.Agent.prototype; })(createAgent || (createAgent = {})); module.exports = createAgent; //# sourceMappingURL=index.js.map /***/ }), /***/ 69233: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function promisify(fn) { return function (req, opts) { return new Promise((resolve, reject) => { fn.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve(rtn); } }); }); }; } exports["default"] = promisify; //# sourceMappingURL=promisify.js.map /***/ }), /***/ 97112: /***/ ((__unused_webpack_module, exports) => { "use strict"; var __webpack_unused_export__; /*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ exports.Q = parse; __webpack_unused_export__ = serialize; /** * Module variables. * @private */ var decode = decodeURIComponent; var encode = encodeURIComponent; /** * RegExp to match field-content in RFC 7230 sec 3.2 * * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] * field-vchar = VCHAR / obs-text * obs-text = %x80-FF */ var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; /** * Parse a cookie header. * * Parse the given cookie header string into an object * The object has the various cookies as keys(names) => values * * @param {string} str * @param {object} [options] * @return {object} * @public */ function parse(str, options) { if (typeof str !== 'string') { throw new TypeError('argument str must be a string'); } var obj = {} var opt = options || {}; var pairs = str.split(';') var dec = opt.decode || decode; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i]; var index = pair.indexOf('=') // skip things that don't look like key=value if (index < 0) { continue; } var key = pair.substring(0, index).trim() // only assign once if (undefined == obj[key]) { var val = pair.substring(index + 1, pair.length).trim() // quoted values if (val[0] === '"') { val = val.slice(1, -1) } obj[key] = tryDecode(val, dec); } } return obj; } /** * Serialize data into a cookie header. * * Serialize the a name value pair into a cookie string suitable for * http headers. An optional options object specified cookie parameters. * * serialize('foo', 'bar', { httpOnly: true }) * => "foo=bar; httpOnly" * * @param {string} name * @param {string} val * @param {object} [options] * @return {string} * @public */ function serialize(name, val, options) { var opt = options || {}; var enc = opt.encode || encode; if (typeof enc !== 'function') { throw new TypeError('option encode is invalid'); } if (!fieldContentRegExp.test(name)) { throw new TypeError('argument name is invalid'); } var value = enc(val); if (value && !fieldContentRegExp.test(value)) { throw new TypeError('argument val is invalid'); } var str = name + '=' + value; if (null != opt.maxAge) { var maxAge = opt.maxAge - 0; if (isNaN(maxAge) || !isFinite(maxAge)) { throw new TypeError('option maxAge is invalid') } str += '; Max-Age=' + Math.floor(maxAge); } if (opt.domain) { if (!fieldContentRegExp.test(opt.domain)) { throw new TypeError('option domain is invalid'); } str += '; Domain=' + opt.domain; } if (opt.path) { if (!fieldContentRegExp.test(opt.path)) { throw new TypeError('option path is invalid'); } str += '; Path=' + opt.path; } if (opt.expires) { if (typeof opt.expires.toUTCString !== 'function') { throw new TypeError('option expires is invalid'); } str += '; Expires=' + opt.expires.toUTCString(); } if (opt.httpOnly) { str += '; HttpOnly'; } if (opt.secure) { str += '; Secure'; } if (opt.sameSite) { var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite; switch (sameSite) { case true: str += '; SameSite=Strict'; break; case 'lax': str += '; SameSite=Lax'; break; case 'strict': str += '; SameSite=Strict'; break; case 'none': str += '; SameSite=None'; break; default: throw new TypeError('option sameSite is invalid'); } } return str; } /** * Try decoding a string using a decoding function. * * @param {string} str * @param {function} decode * @private */ function tryDecode(str, decode) { try { return decode(str); } catch (e) { return str; } } /***/ }), /***/ 73332: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const net_1 = __importDefault(__webpack_require__(41808)); const tls_1 = __importDefault(__webpack_require__(24404)); const url_1 = __importDefault(__webpack_require__(57310)); const assert_1 = __importDefault(__webpack_require__(39491)); const debug_1 = __importDefault(__webpack_require__(15158)); const agent_base_1 = __webpack_require__(34428); const parse_proxy_response_1 = __importDefault(__webpack_require__(58601)); const debug = debug_1.default('https-proxy-agent:agent'); /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. * * Outgoing HTTP requests are first tunneled through the proxy server using the * `CONNECT` HTTP request method to establish a connection to the proxy server, * and then the proxy server connects to the destination target and issues the * HTTP request from the proxy server. * * `https:` requests have their socket connection upgraded to TLS once * the connection to the proxy server has been established. * * @api public */ class HttpsProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('creating new HttpsProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } // ALPN is supported by Node.js >= v5. // attempt to negotiate http/1.1 for proxy servers that support http/2 if (this.secureProxy && !('ALPNProtocols' in proxy)) { proxy.ALPNProtocols = ['http 1.1']; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } const headers = Object.assign({}, proxy.headers); const hostname = `${opts.host}:${opts.port}`; let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; } // The `Host` header should only include the port // number when it is not the default port. let { host, port, secureEndpoint } = opts; if (!isDefaultPort(port, secureEndpoint)) { host += `:${port}`; } headers.Host = host; headers.Connection = 'close'; for (const name of Object.keys(headers)) { payload += `${name}: ${headers[name]}\r\n`; } const proxyResponsePromise = parse_proxy_response_1.default(socket); socket.write(`${payload}\r\n`); const { statusCode, buffered } = yield proxyResponsePromise; if (statusCode === 200) { req.once('socket', resume); if (opts.secureEndpoint) { // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); const servername = opts.servername || opts.host; return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, servername })); } return socket; } // Some other status code that's not 200... need to re-play the HTTP // header "data" events onto the socket once the HTTP machinery is // attached so that the node core `http` can parse and handle the // error status code. // Close the original socket, and a new "fake" socket is returned // instead, so that the proxy doesn't get the HTTP request // written to it (which may contain `Authorization` headers or other // sensitive data). // // See: https://hackerone.com/reports/541502 socket.destroy(); const fakeSocket = new net_1.default.Socket({ writable: false }); fakeSocket.readable = true; // Need to wait for the "socket" event to re-play the "data" events. req.once('socket', (s) => { debug('replaying proxy buffer for failed request'); assert_1.default(s.listenerCount('data') > 0); // Replay the "buffered" Buffer onto the fake `socket`, since at // this point the HTTP module machinery has been hooked up for // the user. s.push(buffered); s.push(null); }); return fakeSocket; }); } } exports["default"] = HttpsProxyAgent; function resume(socket) { socket.resume(); } function isDefaultPort(port, secure) { return Boolean((!secure && port === 80) || (secure && port === 443)); } function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } //# sourceMappingURL=agent.js.map /***/ }), /***/ 76035: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(__webpack_require__(73332)); function createHttpsProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpsProxyAgent) { createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; createHttpsProxyAgent.prototype = agent_1.default.prototype; })(createHttpsProxyAgent || (createHttpsProxyAgent = {})); module.exports = createHttpsProxyAgent; //# sourceMappingURL=index.js.map /***/ }), /***/ 58601: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const debug_1 = __importDefault(__webpack_require__(15158)); const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); function parseProxyResponse(socket) { return new Promise((resolve, reject) => { // we need to buffer any HTTP traffic that happens with the proxy before we get // the CONNECT response, so that if the response is anything other than an "200" // response code, then we can re-play the "data" events on the socket once the // HTTP parser is hooked up... let buffersLength = 0; const buffers = []; function read() { const b = socket.read(); if (b) ondata(b); else socket.once('readable', read); } function cleanup() { socket.removeListener('end', onend); socket.removeListener('error', onerror); socket.removeListener('close', onclose); socket.removeListener('readable', read); } function onclose(err) { debug('onclose had error %o', err); } function onend() { debug('onend'); } function onerror(err) { cleanup(); debug('onerror %o', err); reject(err); } function ondata(b) { buffers.push(b); buffersLength += b.length; const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf('\r\n\r\n'); if (endOfHeaders === -1) { // keep buffering debug('have not received end of HTTP headers yet...'); read(); return; } const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); const statusCode = +firstLine.split(' ')[1]; debug('got proxy server response: %o', firstLine); resolve({ statusCode, buffered }); } socket.on('error', onerror); socket.on('close', onclose); socket.on('end', onend); read(); }); } exports["default"] = parseProxyResponse; //# sourceMappingURL=parse-proxy-response.js.map /***/ }), /***/ 63511: /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "l$": () => (/* binding */ dynamicRequire), "KV": () => (/* binding */ isNodeEnv) }); // UNUSED EXPORTS: loadModule ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/env.js /* * This module exists for optimizations in the build process through rollup and terser. We define some global * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to * `logger` and preventing node-related code from appearing in browser bundles. * * Attention: * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by * users. These fags should live in their respective packages, as we identified user tooling (specifically webpack) * having issues tree-shaking these constants across package boundaries. * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want * users to be able to shake away expressions that it guards. */ /** * Figures out if we're building a browser bundle. * * @returns true if this is a browser bundle build. */ function isBrowserBundle() { return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; } //# sourceMappingURL=env.js.map ;// CONCATENATED MODULE: ./node_modules/@sentry/utils/esm/node.js /* module decorator */ module = __webpack_require__.hmd(module); /** * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. */ /** * Checks whether we're in the Node.js or Browser environment * * @returns Answer to given question */ function isNodeEnv() { // explicitly check for browser bundles as those can be optimized statically // by terser/rollup. return ( !isBrowserBundle() && Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]' ); } /** * Requires a module which is protected against bundler minification. * * @param request The module path to resolve */ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any function dynamicRequire(mod, request) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return mod.require(request); } /** * Helper for dynamically loading module that should work with linked dependencies. * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during * build time. `require.resolve` is also not available in any other way, so we cannot create, * a fake helper like we do with `dynamicRequire`. * * We always prefer to use local package, thus the value is not returned early from each `try/catch` block. * That is to mimic the behavior of `require.resolve` exactly. * * @param moduleName module name to require * @returns possibly required module */ function loadModule(moduleName) { let mod; try { mod = dynamicRequire(module, moduleName); } catch (e) { // no-empty } try { const { cwd } = dynamicRequire(module, 'process'); mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ; } catch (e) { // no-empty } return mod; } //# sourceMappingURL=node.js.map /***/ }), /***/ 21170: /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "yW": () => (/* binding */ dateTimestampInSeconds), /* harmony export */ "ph": () => (/* binding */ timestampInSeconds) /* harmony export */ }); /* unused harmony exports _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, timestampWithMs, usingPerformanceAPI */ /* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(63511); /* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71235); /* module decorator */ module = __webpack_require__.hmd(module); // eslint-disable-next-line deprecation/deprecation const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalObject */ .Rf)(); /** * An object that can return the current timestamp in seconds since the UNIX epoch. */ /** * A TimestampSource implementation for environments that do not support the Performance Web API natively. * * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration". */ const dateTimestampSource = { nowSeconds: () => Date.now() / 1000, }; /** * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance} * for accessing a high-resolution monotonic clock. */ /** * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not * support the API. * * Wrapping the native API works around differences in behavior from different browsers. */ function getBrowserPerformance() { const { performance } = WINDOW; if (!performance || !performance.now) { return undefined; } // Replace performance.timeOrigin with our own timeOrigin based on Date.now(). // // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin + // performance.now() gives a date arbitrarily in the past. // // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is // undefined. // // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to // interact with data coming out of performance entries. // // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have // observed skews that can be as long as days, weeks or months. // // See https://github.com/getsentry/sentry-javascript/issues/2590. // // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation // transactions of long-lived web pages. const timeOrigin = Date.now() - performance.now(); return { now: () => performance.now(), timeOrigin, }; } /** * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't * implement the API. */ function getNodePerformance() { try { const perfHooks = (0,_node_js__WEBPACK_IMPORTED_MODULE_1__/* .dynamicRequire */ .l$)(module, 'perf_hooks') ; return perfHooks.performance; } catch (_) { return undefined; } } /** * The Performance API implementation for the current platform, if available. */ const platformPerformance = (0,_node_js__WEBPACK_IMPORTED_MODULE_1__/* .isNodeEnv */ .KV)() ? getNodePerformance() : getBrowserPerformance(); const timestampSource = platformPerformance === undefined ? dateTimestampSource : { nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000, }; /** * Returns a timestamp in seconds since the UNIX epoch using the Date API. */ const dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource); /** * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the * availability of the Performance API. * * See `usingPerformanceAPI` to test whether the Performance API is used. * * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The * skew can grow to arbitrary amounts like days, weeks or months. * See https://github.com/getsentry/sentry-javascript/issues/2590. */ const timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); // Re-exported with an old name for backwards-compatibility. const timestampWithMs = (/* unused pure expression or super */ null && (timestampInSeconds)); /** * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps. */ const usingPerformanceAPI = platformPerformance !== undefined; /** * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. */ let _browserPerformanceTimeOriginMode; /** * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the * performance API is available. */ const browserPerformanceTimeOrigin = (() => { // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin // data as reliable if they are within a reasonable threshold of the current time. const { performance } = WINDOW; if (!performance || !performance.now) { _browserPerformanceTimeOriginMode = 'none'; return undefined; } const threshold = 3600 * 1000; const performanceNow = performance.now(); const dateNow = Date.now(); // if timeOrigin isn't available set delta to threshold so it isn't used const timeOriginDelta = performance.timeOrigin ? Math.abs(performance.timeOrigin + performanceNow - dateNow) : threshold; const timeOriginIsReliable = timeOriginDelta < threshold; // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the // Date API. // eslint-disable-next-line deprecation/deprecation const navigationStart = performance.timing && performance.timing.navigationStart; const hasNavigationStart = typeof navigationStart === 'number'; // if navigationStart isn't available set delta to threshold so it isn't used const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; const navigationStartIsReliable = navigationStartDelta < threshold; if (timeOriginIsReliable || navigationStartIsReliable) { // Use the more reliable time origin if (timeOriginDelta <= navigationStartDelta) { _browserPerformanceTimeOriginMode = 'timeOrigin'; return performance.timeOrigin; } else { _browserPerformanceTimeOriginMode = 'navigationStart'; return navigationStart; } } // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. _browserPerformanceTimeOriginMode = 'dateNow'; return dateNow; })(); //# sourceMappingURL=time.js.map /***/ }), /***/ 71235: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "n2": () => (/* binding */ GLOBAL_OBJ), /* harmony export */ "Rf": () => (/* binding */ getGlobalObject), /* harmony export */ "YO": () => (/* binding */ getGlobalSingleton) /* harmony export */ }); /** Internal global with common properties and Sentry extensions */ // The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification // https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js // core-js has the following licence: // // Copyright (c) 2014-2022 Denis Pushkarev // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. /** Returns 'obj' if it's the global object, otherwise returns undefined */ function isGlobalObj(obj) { return obj && obj.Math == Math ? obj : undefined; } /** Get's the global object for the current JavaScript runtime */ const GLOBAL_OBJ = (typeof globalThis == 'object' && isGlobalObj(globalThis)) || // eslint-disable-next-line no-restricted-globals (typeof window == 'object' && isGlobalObj(window)) || (typeof self == 'object' && isGlobalObj(self)) || (typeof global == 'object' && isGlobalObj(global)) || (function () { return this; })() || {}; /** * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8 */ function getGlobalObject() { return GLOBAL_OBJ ; } /** * Returns a global singleton contained in the global `__SENTRY__` object. * * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory * function and added to the `__SENTRY__` object. * * @param name name of the global singleton on __SENTRY__ * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value * @returns the singleton */ function getGlobalSingleton(name, creator, obj) { const gbl = (obj || GLOBAL_OBJ) ; const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {}); const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator()); return singleton; } //# sourceMappingURL=worldwide.js.map /***/ }), /***/ 99989: /***/ ((module, exports) => { module.exports = exports = abbrev.abbrev = abbrev abbrev.monkeyPatch = monkeyPatch function monkeyPatch () { Object.defineProperty(Array.prototype, 'abbrev', { value: function () { return abbrev(this) }, enumerable: false, configurable: true, writable: true }) Object.defineProperty(Object.prototype, 'abbrev', { value: function () { return abbrev(Object.keys(this)) }, enumerable: false, configurable: true, writable: true }) } function abbrev (list) { if (arguments.length !== 1 || !Array.isArray(list)) { list = Array.prototype.slice.call(arguments, 0) } for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) } // sort them lexicographically, so that they're next to their nearest kin args = args.sort(lexSort) // walk through each, seeing how much it has in common with the next and previous var abbrevs = {} , prev = "" for (var i = 0, l = args.length ; i < l ; i ++) { var current = args[i] , next = args[i + 1] || "" , nextMatches = true , prevMatches = true if (current === next) continue for (var j = 0, cl = current.length ; j < cl ; j ++) { var curChar = current.charAt(j) nextMatches = nextMatches && curChar === next.charAt(j) prevMatches = prevMatches && curChar === prev.charAt(j) if (!nextMatches && !prevMatches) { j ++ break } } prev = current if (j === cl) { abbrevs[current] = current continue } for (var a = current.substr(0, j) ; j <= cl ; j ++) { abbrevs[a] = current a += current.charAt(j) } } return abbrevs } function lexSort (a, b) { return a === b ? 0 : a > b ? 1 : -1 } /***/ }), /***/ 45018: /***/ ((module) => { "use strict"; const x = module.exports; const ESC = '\u001B['; const OSC = '\u001B]'; const BEL = '\u0007'; const SEP = ';'; const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal'; x.cursorTo = (x, y) => { if (typeof x !== 'number') { throw new TypeError('The `x` argument is required'); } if (typeof y !== 'number') { return ESC + (x + 1) + 'G'; } return ESC + (y + 1) + ';' + (x + 1) + 'H'; }; x.cursorMove = (x, y) => { if (typeof x !== 'number') { throw new TypeError('The `x` argument is required'); } let ret = ''; if (x < 0) { ret += ESC + (-x) + 'D'; } else if (x > 0) { ret += ESC + x + 'C'; } if (y < 0) { ret += ESC + (-y) + 'A'; } else if (y > 0) { ret += ESC + y + 'B'; } return ret; }; x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A'; x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B'; x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C'; x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D'; x.cursorLeft = ESC + 'G'; x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's'); x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u'); x.cursorGetPosition = ESC + '6n'; x.cursorNextLine = ESC + 'E'; x.cursorPrevLine = ESC + 'F'; x.cursorHide = ESC + '?25l'; x.cursorShow = ESC + '?25h'; x.eraseLines = count => { let clear = ''; for (let i = 0; i < count; i++) { clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : ''); } if (count) { clear += x.cursorLeft; } return clear; }; x.eraseEndLine = ESC + 'K'; x.eraseStartLine = ESC + '1K'; x.eraseLine = ESC + '2K'; x.eraseDown = ESC + 'J'; x.eraseUp = ESC + '1J'; x.eraseScreen = ESC + '2J'; x.scrollUp = ESC + 'S'; x.scrollDown = ESC + 'T'; x.clearScreen = '\u001Bc'; x.clearTerminal = process.platform === 'win32' ? `${x.eraseScreen}${ESC}0f` : // 1. Erases the screen (Only done in case `2` is not supported) // 2. Erases the whole screen including scrollback buffer // 3. Moves cursor to the top-left position // More info: https://www.real-world-systems.com/docs/ANSIcode.html `${x.eraseScreen}${ESC}3J${ESC}H`; x.beep = BEL; x.link = (text, url) => { return [ OSC, '8', SEP, SEP, url, BEL, text, OSC, '8', SEP, SEP, BEL ].join(''); }; x.image = (buf, opts) => { opts = opts || {}; let ret = OSC + '1337;File=inline=1'; if (opts.width) { ret += `;width=${opts.width}`; } if (opts.height) { ret += `;height=${opts.height}`; } if (opts.preserveAspectRatio === false) { ret += ';preserveAspectRatio=0'; } return ret + ':' + buf.toString('base64') + BEL; }; x.iTerm = {}; x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL; /***/ }), /***/ 14277: /***/ ((module) => { "use strict"; module.exports = ({onlyFirst = false} = {}) => { const pattern = [ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' ].join('|'); return new RegExp(pattern, onlyFirst ? undefined : 'g'); }; /***/ }), /***/ 26434: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* module decorator */ module = __webpack_require__.nmd(module); const colorConvert = __webpack_require__(12085); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); return `\u001B[${code + offset}m`; }; const wrapAnsi256 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};5;${code}m`; }; const wrapAnsi16m = (fn, offset) => function () { const rgb = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; function assembleStyles() { const codes = new Map(); const styles = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], // Bright color redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], // Bright color bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; // Fix humans styles.color.grey = styles.color.gray; for (const groupName of Object.keys(styles)) { const group = styles[groupName]; for (const styleName of Object.keys(group)) { const style = group[styleName]; styles[styleName] = { open: `\u001B[${style[0]}m`, close: `\u001B[${style[1]}m` }; group[styleName] = styles[styleName]; codes.set(style[0], style[1]); } Object.defineProperty(styles, groupName, { value: group, enumerable: false }); Object.defineProperty(styles, 'codes', { value: codes, enumerable: false }); } const ansi2ansi = n => n; const rgb2rgb = (r, g, b) => [r, g, b]; styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; styles.color.ansi = { ansi: wrapAnsi16(ansi2ansi, 0) }; styles.color.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 0) }; styles.color.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 0) }; styles.bgColor.ansi = { ansi: wrapAnsi16(ansi2ansi, 10) }; styles.bgColor.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 10) }; styles.bgColor.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 10) }; for (let key of Object.keys(colorConvert)) { if (typeof colorConvert[key] !== 'object') { continue; } const suite = colorConvert[key]; if (key === 'ansi16') { key = 'ansi'; } if ('ansi16' in suite) { styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); } if ('ansi256' in suite) { styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); } if ('rgb' in suite) { styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); } } return styles; } // Make the export immutable Object.defineProperty(module, 'exports', { enumerable: true, get: assembleStyles }); /***/ }), /***/ 46088: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.boolean = void 0; const boolean = function (value) { switch (Object.prototype.toString.call(value)) { case '[object String]': return ['true', 't', 'yes', 'y', 'on', '1'].includes(value.trim().toLowerCase()); case '[object Number]': return value.valueOf() === 1; case '[object Boolean]': return value.valueOf(); default: return false; } }; exports.boolean = boolean; /***/ }), /***/ 32589: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const escapeStringRegexp = __webpack_require__(63150); const ansiStyles = __webpack_require__(26434); const stdoutColor = __webpack_require__(92130).stdout; const template = __webpack_require__(56864); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); // `supportsColor.level` → `ansiStyles.color[name]` mapping const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; // `color-convert` models to exclude from the Chalk API due to conflicts and such const skipModels = new Set(['gray']); const styles = Object.create(null); function applyOptions(obj, options) { options = options || {}; // Detect level if not set manually const scLevel = stdoutColor ? stdoutColor.level : 0; obj.level = options.level === undefined ? scLevel : options.level; obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; } function Chalk(options) { // We check for this.template here since calling `chalk.constructor()` // by itself will have a `this` of a previously constructed chalk object if (!this || !(this instanceof Chalk) || this.template) { const chalk = {}; applyOptions(chalk, options); chalk.template = function () { const args = [].slice.call(arguments); return chalkTag.apply(null, [chalk.template].concat(args)); }; Object.setPrototypeOf(chalk, Chalk.prototype); Object.setPrototypeOf(chalk.template, chalk); chalk.template.constructor = Chalk; return chalk.template; } applyOptions(this, options); } // Use bright blue on Windows as the normal blue color is illegible if (isSimpleWindowsTerm) { ansiStyles.blue.open = '\u001B[94m'; } for (const key of Object.keys(ansiStyles)) { ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); styles[key] = { get() { const codes = ansiStyles[key]; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); } }; } styles.visible = { get() { return build.call(this, this._styles || [], true, 'visible'); } }; ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); for (const model of Object.keys(ansiStyles.color.ansi)) { if (skipModels.has(model)) { continue; } styles[model] = { get() { const level = this.level; return function () { const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.color.close, closeRe: ansiStyles.color.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); for (const model of Object.keys(ansiStyles.bgColor.ansi)) { if (skipModels.has(model)) { continue; } const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); styles[bgModel] = { get() { const level = this.level; return function () { const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.bgColor.close, closeRe: ansiStyles.bgColor.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } const proto = Object.defineProperties(() => {}, styles); function build(_styles, _empty, key) { const builder = function () { return applyStyle.apply(builder, arguments); }; builder._styles = _styles; builder._empty = _empty; const self = this; Object.defineProperty(builder, 'level', { enumerable: true, get() { return self.level; }, set(level) { self.level = level; } }); Object.defineProperty(builder, 'enabled', { enumerable: true, get() { return self.enabled; }, set(enabled) { self.enabled = enabled; } }); // See below for fix regarding invisible grey/dim combination on Windows builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; // `__proto__` is used because we must return a function, but there is // no way to create a function with a different prototype builder.__proto__ = proto; // eslint-disable-line no-proto return builder; } function applyStyle() { // Support varags, but simply cast to string in case there's only one arg const args = arguments; const argsLen = args.length; let str = String(arguments[0]); if (argsLen === 0) { return ''; } if (argsLen > 1) { // Don't slice `arguments`, it prevents V8 optimizations for (let a = 1; a < argsLen; a++) { str += ' ' + args[a]; } } if (!this.enabled || this.level <= 0 || !str) { return this._empty ? '' : str; } // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, // see https://github.com/chalk/chalk/issues/58 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. const originalDim = ansiStyles.dim.open; if (isSimpleWindowsTerm && this.hasGrey) { ansiStyles.dim.open = ''; } for (const code of this._styles.slice().reverse()) { // Replace any instances already present with a re-opening code // otherwise only the part of the string until said closing code // will be colored, and the rest will simply be 'plain'. str = code.open + str.replace(code.closeRe, code.open) + code.close; // Close the styling before a linebreak and reopen // after next line to fix a bleed issue on macOS // https://github.com/chalk/chalk/pull/92 str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); } // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue ansiStyles.dim.open = originalDim; return str; } function chalkTag(chalk, strings) { if (!Array.isArray(strings)) { // If chalk() was called by itself or with a string, // return the string itself as a string. return [].slice.call(arguments, 1).join(' '); } const args = [].slice.call(arguments, 2); const parts = [strings.raw[0]]; for (let i = 1; i < strings.length; i++) { parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); parts.push(String(strings.raw[i])); } return template(chalk, parts.join('')); } Object.defineProperties(Chalk.prototype, styles); module.exports = Chalk(); // eslint-disable-line new-cap module.exports.supportsColor = stdoutColor; module.exports["default"] = module.exports; // For TypeScript /***/ }), /***/ 56864: /***/ ((module) => { "use strict"; const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; const ESCAPES = new Map([ ['n', '\n'], ['r', '\r'], ['t', '\t'], ['b', '\b'], ['f', '\f'], ['v', '\v'], ['0', '\0'], ['\\', '\\'], ['e', '\u001B'], ['a', '\u0007'] ]); function unescape(c) { if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) { return String.fromCharCode(parseInt(c.slice(1), 16)); } return ESCAPES.get(c) || c; } function parseArguments(name, args) { const results = []; const chunks = args.trim().split(/\s*,\s*/g); let matches; for (const chunk of chunks) { if (!isNaN(chunk)) { results.push(Number(chunk)); } else if ((matches = chunk.match(STRING_REGEX))) { results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr)); } else { throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } } return results; } function parseStyle(style) { STYLE_REGEX.lastIndex = 0; const results = []; let matches; while ((matches = STYLE_REGEX.exec(style)) !== null) { const name = matches[1]; if (matches[2]) { const args = parseArguments(name, matches[2]); results.push([name].concat(args)); } else { results.push([name]); } } return results; } function buildStyle(chalk, styles) { const enabled = {}; for (const layer of styles) { for (const style of layer.styles) { enabled[style[0]] = layer.inverse ? null : style.slice(1); } } let current = chalk; for (const styleName of Object.keys(enabled)) { if (Array.isArray(enabled[styleName])) { if (!(styleName in current)) { throw new Error(`Unknown Chalk style: ${styleName}`); } if (enabled[styleName].length > 0) { current = current[styleName].apply(current, enabled[styleName]); } else { current = current[styleName]; } } } return current; } module.exports = (chalk, tmp) => { const styles = []; const chunks = []; let chunk = []; // eslint-disable-next-line max-params tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { if (escapeChar) { chunk.push(unescape(escapeChar)); } else if (style) { const str = chunk.join(''); chunk = []; chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str)); styles.push({inverse, styles: parseStyle(style)}); } else if (close) { if (styles.length === 0) { throw new Error('Found extraneous } in Chalk template literal'); } chunks.push(buildStyle(chalk, styles)(chunk.join(''))); chunk = []; styles.pop(); } else { chunk.push(chr); } }); chunks.push(chunk.join('')); if (styles.length > 0) { const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; throw new Error(errMsg); } return chunks.join(''); }; /***/ }), /***/ 48168: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* MIT license */ var cssKeywords = __webpack_require__(8874); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) var reverseKeywords = {}; for (var key in cssKeywords) { if (cssKeywords.hasOwnProperty(key)) { reverseKeywords[cssKeywords[key]] = key; } } var convert = module.exports = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, hwb: {channels: 3, labels: 'hwb'}, cmyk: {channels: 4, labels: 'cmyk'}, xyz: {channels: 3, labels: 'xyz'}, lab: {channels: 3, labels: 'lab'}, lch: {channels: 3, labels: 'lch'}, hex: {channels: 1, labels: ['hex']}, keyword: {channels: 1, labels: ['keyword']}, ansi16: {channels: 1, labels: ['ansi16']}, ansi256: {channels: 1, labels: ['ansi256']}, hcg: {channels: 3, labels: ['h', 'c', 'g']}, apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, gray: {channels: 1, labels: ['gray']} }; // hide .channels and .labels properties for (var model in convert) { if (convert.hasOwnProperty(model)) { if (!('channels' in convert[model])) { throw new Error('missing channels property: ' + model); } if (!('labels' in convert[model])) { throw new Error('missing channel labels property: ' + model); } if (convert[model].labels.length !== convert[model].channels) { throw new Error('channel and label counts mismatch: ' + model); } var channels = convert[model].channels; var labels = convert[model].labels; delete convert[model].channels; delete convert[model].labels; Object.defineProperty(convert[model], 'channels', {value: channels}); Object.defineProperty(convert[model], 'labels', {value: labels}); } } convert.rgb.hsl = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var min = Math.min(r, g, b); var max = Math.max(r, g, b); var delta = max - min; var h; var s; var l; if (max === min) { h = 0; } else if (r === max) { h = (g - b) / delta; } else if (g === max) { h = 2 + (b - r) / delta; } else if (b === max) { h = 4 + (r - g) / delta; } h = Math.min(h * 60, 360); if (h < 0) { h += 360; } l = (min + max) / 2; if (max === min) { s = 0; } else if (l <= 0.5) { s = delta / (max + min); } else { s = delta / (2 - max - min); } return [h, s * 100, l * 100]; }; convert.rgb.hsv = function (rgb) { var rdif; var gdif; var bdif; var h; var s; var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var v = Math.max(r, g, b); var diff = v - Math.min(r, g, b); var diffc = function (c) { return (v - c) / 6 / diff + 1 / 2; }; if (diff === 0) { h = s = 0; } else { s = diff / v; rdif = diffc(r); gdif = diffc(g); bdif = diffc(b); if (r === v) { h = bdif - gdif; } else if (g === v) { h = (1 / 3) + rdif - bdif; } else if (b === v) { h = (2 / 3) + gdif - rdif; } if (h < 0) { h += 1; } else if (h > 1) { h -= 1; } } return [ h * 360, s * 100, v * 100 ]; }; convert.rgb.hwb = function (rgb) { var r = rgb[0]; var g = rgb[1]; var b = rgb[2]; var h = convert.rgb.hsl(rgb)[0]; var w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); return [h, w * 100, b * 100]; }; convert.rgb.cmyk = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var c; var m; var y; var k; k = Math.min(1 - r, 1 - g, 1 - b); c = (1 - r - k) / (1 - k) || 0; m = (1 - g - k) / (1 - k) || 0; y = (1 - b - k) / (1 - k) || 0; return [c * 100, m * 100, y * 100, k * 100]; }; /** * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance * */ function comparativeDistance(x, y) { return ( Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2) ); } convert.rgb.keyword = function (rgb) { var reversed = reverseKeywords[rgb]; if (reversed) { return reversed; } var currentClosestDistance = Infinity; var currentClosestKeyword; for (var keyword in cssKeywords) { if (cssKeywords.hasOwnProperty(keyword)) { var value = cssKeywords[keyword]; // Compute comparative distance var distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest if (distance < currentClosestDistance) { currentClosestDistance = distance; currentClosestKeyword = keyword; } } } return currentClosestKeyword; }; convert.keyword.rgb = function (keyword) { return cssKeywords[keyword]; }; convert.rgb.xyz = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; // assume sRGB r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); return [x * 100, y * 100, z * 100]; }; convert.rgb.lab = function (rgb) { var xyz = convert.rgb.xyz(rgb); var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; var l; var a; var b; x /= 95.047; y /= 100; z /= 108.883; x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); l = (116 * y) - 16; a = 500 * (x - y); b = 200 * (y - z); return [l, a, b]; }; convert.hsl.rgb = function (hsl) { var h = hsl[0] / 360; var s = hsl[1] / 100; var l = hsl[2] / 100; var t1; var t2; var t3; var rgb; var val; if (s === 0) { val = l * 255; return [val, val, val]; } if (l < 0.5) { t2 = l * (1 + s); } else { t2 = l + s - l * s; } t1 = 2 * l - t2; rgb = [0, 0, 0]; for (var i = 0; i < 3; i++) { t3 = h + 1 / 3 * -(i - 1); if (t3 < 0) { t3++; } if (t3 > 1) { t3--; } if (6 * t3 < 1) { val = t1 + (t2 - t1) * 6 * t3; } else if (2 * t3 < 1) { val = t2; } else if (3 * t3 < 2) { val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; } else { val = t1; } rgb[i] = val * 255; } return rgb; }; convert.hsl.hsv = function (hsl) { var h = hsl[0]; var s = hsl[1] / 100; var l = hsl[2] / 100; var smin = s; var lmin = Math.max(l, 0.01); var sv; var v; l *= 2; s *= (l <= 1) ? l : 2 - l; smin *= lmin <= 1 ? lmin : 2 - lmin; v = (l + s) / 2; sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); return [h, sv * 100, v * 100]; }; convert.hsv.rgb = function (hsv) { var h = hsv[0] / 60; var s = hsv[1] / 100; var v = hsv[2] / 100; var hi = Math.floor(h) % 6; var f = h - Math.floor(h); var p = 255 * v * (1 - s); var q = 255 * v * (1 - (s * f)); var t = 255 * v * (1 - (s * (1 - f))); v *= 255; switch (hi) { case 0: return [v, t, p]; case 1: return [q, v, p]; case 2: return [p, v, t]; case 3: return [p, q, v]; case 4: return [t, p, v]; case 5: return [v, p, q]; } }; convert.hsv.hsl = function (hsv) { var h = hsv[0]; var s = hsv[1] / 100; var v = hsv[2] / 100; var vmin = Math.max(v, 0.01); var lmin; var sl; var l; l = (2 - s) * v; lmin = (2 - s) * vmin; sl = s * vmin; sl /= (lmin <= 1) ? lmin : 2 - lmin; sl = sl || 0; l /= 2; return [h, sl * 100, l * 100]; }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb convert.hwb.rgb = function (hwb) { var h = hwb[0] / 360; var wh = hwb[1] / 100; var bl = hwb[2] / 100; var ratio = wh + bl; var i; var v; var f; var n; // wh + bl cant be > 1 if (ratio > 1) { wh /= ratio; bl /= ratio; } i = Math.floor(6 * h); v = 1 - bl; f = 6 * h - i; if ((i & 0x01) !== 0) { f = 1 - f; } n = wh + f * (v - wh); // linear interpolation var r; var g; var b; switch (i) { default: case 6: case 0: r = v; g = n; b = wh; break; case 1: r = n; g = v; b = wh; break; case 2: r = wh; g = v; b = n; break; case 3: r = wh; g = n; b = v; break; case 4: r = n; g = wh; b = v; break; case 5: r = v; g = wh; b = n; break; } return [r * 255, g * 255, b * 255]; }; convert.cmyk.rgb = function (cmyk) { var c = cmyk[0] / 100; var m = cmyk[1] / 100; var y = cmyk[2] / 100; var k = cmyk[3] / 100; var r; var g; var b; r = 1 - Math.min(1, c * (1 - k) + k); g = 1 - Math.min(1, m * (1 - k) + k); b = 1 - Math.min(1, y * (1 - k) + k); return [r * 255, g * 255, b * 255]; }; convert.xyz.rgb = function (xyz) { var x = xyz[0] / 100; var y = xyz[1] / 100; var z = xyz[2] / 100; var r; var g; var b; r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); // assume sRGB r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) : r * 12.92; g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) : g * 12.92; b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) : b * 12.92; r = Math.min(Math.max(0, r), 1); g = Math.min(Math.max(0, g), 1); b = Math.min(Math.max(0, b), 1); return [r * 255, g * 255, b * 255]; }; convert.xyz.lab = function (xyz) { var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; var l; var a; var b; x /= 95.047; y /= 100; z /= 108.883; x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); l = (116 * y) - 16; a = 500 * (x - y); b = 200 * (y - z); return [l, a, b]; }; convert.lab.xyz = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; var x; var y; var z; y = (l + 16) / 116; x = a / 500 + y; z = y - b / 200; var y2 = Math.pow(y, 3); var x2 = Math.pow(x, 3); var z2 = Math.pow(z, 3); y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; x *= 95.047; y *= 100; z *= 108.883; return [x, y, z]; }; convert.lab.lch = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; var hr; var h; var c; hr = Math.atan2(b, a); h = hr * 360 / 2 / Math.PI; if (h < 0) { h += 360; } c = Math.sqrt(a * a + b * b); return [l, c, h]; }; convert.lch.lab = function (lch) { var l = lch[0]; var c = lch[1]; var h = lch[2]; var a; var b; var hr; hr = h / 360 * 2 * Math.PI; a = c * Math.cos(hr); b = c * Math.sin(hr); return [l, a, b]; }; convert.rgb.ansi16 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization value = Math.round(value / 50); if (value === 0) { return 30; } var ansi = 30 + ((Math.round(b / 255) << 2) | (Math.round(g / 255) << 1) | Math.round(r / 255)); if (value === 2) { ansi += 60; } return ansi; }; convert.hsv.ansi16 = function (args) { // optimization here; we already know the value and don't need to get // it converted for us. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; convert.rgb.ansi256 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; // we use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if (r === g && g === b) { if (r < 8) { return 16; } if (r > 248) { return 231; } return Math.round(((r - 8) / 247) * 24) + 232; } var ansi = 16 + (36 * Math.round(r / 255 * 5)) + (6 * Math.round(g / 255 * 5)) + Math.round(b / 255 * 5); return ansi; }; convert.ansi16.rgb = function (args) { var color = args % 10; // handle greyscale if (color === 0 || color === 7) { if (args > 50) { color += 3.5; } color = color / 10.5 * 255; return [color, color, color]; } var mult = (~~(args > 50) + 1) * 0.5; var r = ((color & 1) * mult) * 255; var g = (((color >> 1) & 1) * mult) * 255; var b = (((color >> 2) & 1) * mult) * 255; return [r, g, b]; }; convert.ansi256.rgb = function (args) { // handle greyscale if (args >= 232) { var c = (args - 232) * 10 + 8; return [c, c, c]; } args -= 16; var rem; var r = Math.floor(args / 36) / 5 * 255; var g = Math.floor((rem = args % 36) / 6) / 5 * 255; var b = (rem % 6) / 5 * 255; return [r, g, b]; }; convert.rgb.hex = function (args) { var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.hex.rgb = function (args) { var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; } var colorString = match[0]; if (match[0].length === 3) { colorString = colorString.split('').map(function (char) { return char + char; }).join(''); } var integer = parseInt(colorString, 16); var r = (integer >> 16) & 0xFF; var g = (integer >> 8) & 0xFF; var b = integer & 0xFF; return [r, g, b]; }; convert.rgb.hcg = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var max = Math.max(Math.max(r, g), b); var min = Math.min(Math.min(r, g), b); var chroma = (max - min); var grayscale; var hue; if (chroma < 1) { grayscale = min / (1 - chroma); } else { grayscale = 0; } if (chroma <= 0) { hue = 0; } else if (max === r) { hue = ((g - b) / chroma) % 6; } else if (max === g) { hue = 2 + (b - r) / chroma; } else { hue = 4 + (r - g) / chroma + 4; } hue /= 6; hue %= 1; return [hue * 360, chroma * 100, grayscale * 100]; }; convert.hsl.hcg = function (hsl) { var s = hsl[1] / 100; var l = hsl[2] / 100; var c = 1; var f = 0; if (l < 0.5) { c = 2.0 * s * l; } else { c = 2.0 * s * (1.0 - l); } if (c < 1.0) { f = (l - 0.5 * c) / (1.0 - c); } return [hsl[0], c * 100, f * 100]; }; convert.hsv.hcg = function (hsv) { var s = hsv[1] / 100; var v = hsv[2] / 100; var c = s * v; var f = 0; if (c < 1.0) { f = (v - c) / (1 - c); } return [hsv[0], c * 100, f * 100]; }; convert.hcg.rgb = function (hcg) { var h = hcg[0] / 360; var c = hcg[1] / 100; var g = hcg[2] / 100; if (c === 0.0) { return [g * 255, g * 255, g * 255]; } var pure = [0, 0, 0]; var hi = (h % 1) * 6; var v = hi % 1; var w = 1 - v; var mg = 0; switch (Math.floor(hi)) { case 0: pure[0] = 1; pure[1] = v; pure[2] = 0; break; case 1: pure[0] = w; pure[1] = 1; pure[2] = 0; break; case 2: pure[0] = 0; pure[1] = 1; pure[2] = v; break; case 3: pure[0] = 0; pure[1] = w; pure[2] = 1; break; case 4: pure[0] = v; pure[1] = 0; pure[2] = 1; break; default: pure[0] = 1; pure[1] = 0; pure[2] = w; } mg = (1.0 - c) * g; return [ (c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255 ]; }; convert.hcg.hsv = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var v = c + g * (1.0 - c); var f = 0; if (v > 0.0) { f = c / v; } return [hcg[0], f * 100, v * 100]; }; convert.hcg.hsl = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var l = g * (1.0 - c) + 0.5 * c; var s = 0; if (l > 0.0 && l < 0.5) { s = c / (2 * l); } else if (l >= 0.5 && l < 1.0) { s = c / (2 * (1 - l)); } return [hcg[0], s * 100, l * 100]; }; convert.hcg.hwb = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; convert.hwb.hcg = function (hwb) { var w = hwb[1] / 100; var b = hwb[2] / 100; var v = 1 - b; var c = v - w; var g = 0; if (c < 1) { g = (v - c) / (1 - c); } return [hwb[0], c * 100, g * 100]; }; convert.apple.rgb = function (apple) { return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; }; convert.rgb.apple = function (rgb) { return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; }; convert.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; convert.gray.hsl = convert.gray.hsv = function (args) { return [0, 0, args[0]]; }; convert.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; convert.gray.cmyk = function (gray) { return [0, 0, 0, gray[0]]; }; convert.gray.lab = function (gray) { return [gray[0], 0, 0]; }; convert.gray.hex = function (gray) { var val = Math.round(gray[0] / 100 * 255) & 0xFF; var integer = (val << 16) + (val << 8) + val; var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.rgb.gray = function (rgb) { var val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; /***/ }), /***/ 12085: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var conversions = __webpack_require__(48168); var route = __webpack_require__(4111); var convert = {}; var models = Object.keys(conversions); function wrapRaw(fn) { var wrappedFn = function (args) { if (args === undefined || args === null) { return args; } if (arguments.length > 1) { args = Array.prototype.slice.call(arguments); } return fn(args); }; // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } return wrappedFn; } function wrapRounded(fn) { var wrappedFn = function (args) { if (args === undefined || args === null) { return args; } if (arguments.length > 1) { args = Array.prototype.slice.call(arguments); } var result = fn(args); // we're assuming the result is an array here. // see notice in conversions.js; don't use box types // in conversion functions. if (typeof result === 'object') { for (var len = result.length, i = 0; i < len; i++) { result[i] = Math.round(result[i]); } } return result; }; // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } return wrappedFn; } models.forEach(function (fromModel) { convert[fromModel] = {}; Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); var routes = route(fromModel); var routeModels = Object.keys(routes); routeModels.forEach(function (toModel) { var fn = routes[toModel]; convert[fromModel][toModel] = wrapRounded(fn); convert[fromModel][toModel].raw = wrapRaw(fn); }); }); module.exports = convert; /***/ }), /***/ 4111: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var conversions = __webpack_require__(48168); /* this function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array of strings, each with the steps in between the 'from' and 'to' color models (inclusive). conversions that are not possible simply are not included. */ function buildGraph() { var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 var models = Object.keys(conversions); for (var len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. distance: -1, parent: null }; } return graph; } // https://en.wikipedia.org/wiki/Breadth-first_search function deriveBFS(fromModel) { var graph = buildGraph(); var queue = [fromModel]; // unshift -> queue -> pop graph[fromModel].distance = 0; while (queue.length) { var current = queue.pop(); var adjacents = Object.keys(conversions[current]); for (var len = adjacents.length, i = 0; i < len; i++) { var adjacent = adjacents[i]; var node = graph[adjacent]; if (node.distance === -1) { node.distance = graph[current].distance + 1; node.parent = current; queue.unshift(adjacent); } } } return graph; } function link(from, to) { return function (args) { return to(from(args)); }; } function wrapConversion(toModel, graph) { var path = [graph[toModel].parent, toModel]; var fn = conversions[graph[toModel].parent][toModel]; var cur = graph[toModel].parent; while (graph[cur].parent) { path.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); cur = graph[cur].parent; } fn.conversion = path; return fn; } module.exports = function (fromModel) { var graph = deriveBFS(fromModel); var conversion = {}; var models = Object.keys(graph); for (var len = models.length, i = 0; i < len; i++) { var toModel = models[i]; var node = graph[toModel]; if (node.parent === null) { // no possible conversion, or this node is the source model. continue; } conversion[toModel] = wrapConversion(toModel, graph); } return conversion; }; /***/ }), /***/ 8874: /***/ ((module) => { "use strict"; module.exports = { "aliceblue": [240, 248, 255], "antiquewhite": [250, 235, 215], "aqua": [0, 255, 255], "aquamarine": [127, 255, 212], "azure": [240, 255, 255], "beige": [245, 245, 220], "bisque": [255, 228, 196], "black": [0, 0, 0], "blanchedalmond": [255, 235, 205], "blue": [0, 0, 255], "blueviolet": [138, 43, 226], "brown": [165, 42, 42], "burlywood": [222, 184, 135], "cadetblue": [95, 158, 160], "chartreuse": [127, 255, 0], "chocolate": [210, 105, 30], "coral": [255, 127, 80], "cornflowerblue": [100, 149, 237], "cornsilk": [255, 248, 220], "crimson": [220, 20, 60], "cyan": [0, 255, 255], "darkblue": [0, 0, 139], "darkcyan": [0, 139, 139], "darkgoldenrod": [184, 134, 11], "darkgray": [169, 169, 169], "darkgreen": [0, 100, 0], "darkgrey": [169, 169, 169], "darkkhaki": [189, 183, 107], "darkmagenta": [139, 0, 139], "darkolivegreen": [85, 107, 47], "darkorange": [255, 140, 0], "darkorchid": [153, 50, 204], "darkred": [139, 0, 0], "darksalmon": [233, 150, 122], "darkseagreen": [143, 188, 143], "darkslateblue": [72, 61, 139], "darkslategray": [47, 79, 79], "darkslategrey": [47, 79, 79], "darkturquoise": [0, 206, 209], "darkviolet": [148, 0, 211], "deeppink": [255, 20, 147], "deepskyblue": [0, 191, 255], "dimgray": [105, 105, 105], "dimgrey": [105, 105, 105], "dodgerblue": [30, 144, 255], "firebrick": [178, 34, 34], "floralwhite": [255, 250, 240], "forestgreen": [34, 139, 34], "fuchsia": [255, 0, 255], "gainsboro": [220, 220, 220], "ghostwhite": [248, 248, 255], "gold": [255, 215, 0], "goldenrod": [218, 165, 32], "gray": [128, 128, 128], "green": [0, 128, 0], "greenyellow": [173, 255, 47], "grey": [128, 128, 128], "honeydew": [240, 255, 240], "hotpink": [255, 105, 180], "indianred": [205, 92, 92], "indigo": [75, 0, 130], "ivory": [255, 255, 240], "khaki": [240, 230, 140], "lavender": [230, 230, 250], "lavenderblush": [255, 240, 245], "lawngreen": [124, 252, 0], "lemonchiffon": [255, 250, 205], "lightblue": [173, 216, 230], "lightcoral": [240, 128, 128], "lightcyan": [224, 255, 255], "lightgoldenrodyellow": [250, 250, 210], "lightgray": [211, 211, 211], "lightgreen": [144, 238, 144], "lightgrey": [211, 211, 211], "lightpink": [255, 182, 193], "lightsalmon": [255, 160, 122], "lightseagreen": [32, 178, 170], "lightskyblue": [135, 206, 250], "lightslategray": [119, 136, 153], "lightslategrey": [119, 136, 153], "lightsteelblue": [176, 196, 222], "lightyellow": [255, 255, 224], "lime": [0, 255, 0], "limegreen": [50, 205, 50], "linen": [250, 240, 230], "magenta": [255, 0, 255], "maroon": [128, 0, 0], "mediumaquamarine": [102, 205, 170], "mediumblue": [0, 0, 205], "mediumorchid": [186, 85, 211], "mediumpurple": [147, 112, 219], "mediumseagreen": [60, 179, 113], "mediumslateblue": [123, 104, 238], "mediumspringgreen": [0, 250, 154], "mediumturquoise": [72, 209, 204], "mediumvioletred": [199, 21, 133], "midnightblue": [25, 25, 112], "mintcream": [245, 255, 250], "mistyrose": [255, 228, 225], "moccasin": [255, 228, 181], "navajowhite": [255, 222, 173], "navy": [0, 0, 128], "oldlace": [253, 245, 230], "olive": [128, 128, 0], "olivedrab": [107, 142, 35], "orange": [255, 165, 0], "orangered": [255, 69, 0], "orchid": [218, 112, 214], "palegoldenrod": [238, 232, 170], "palegreen": [152, 251, 152], "paleturquoise": [175, 238, 238], "palevioletred": [219, 112, 147], "papayawhip": [255, 239, 213], "peachpuff": [255, 218, 185], "peru": [205, 133, 63], "pink": [255, 192, 203], "plum": [221, 160, 221], "powderblue": [176, 224, 230], "purple": [128, 0, 128], "rebeccapurple": [102, 51, 153], "red": [255, 0, 0], "rosybrown": [188, 143, 143], "royalblue": [65, 105, 225], "saddlebrown": [139, 69, 19], "salmon": [250, 128, 114], "sandybrown": [244, 164, 96], "seagreen": [46, 139, 87], "seashell": [255, 245, 238], "sienna": [160, 82, 45], "silver": [192, 192, 192], "skyblue": [135, 206, 235], "slateblue": [106, 90, 205], "slategray": [112, 128, 144], "slategrey": [112, 128, 144], "snow": [255, 250, 250], "springgreen": [0, 255, 127], "steelblue": [70, 130, 180], "tan": [210, 180, 140], "teal": [0, 128, 128], "thistle": [216, 191, 216], "tomato": [255, 99, 71], "turquoise": [64, 224, 208], "violet": [238, 130, 238], "wheat": [245, 222, 179], "white": [255, 255, 255], "whitesmoke": [245, 245, 245], "yellow": [255, 255, 0], "yellowgreen": [154, 205, 50] }; /***/ }), /***/ 70214: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(71017); const os = __webpack_require__(22037); const fs = __webpack_require__(20077); const makeDir = __webpack_require__(40789); const xdgBasedir = __webpack_require__(20071); const writeFileAtomic = __webpack_require__(70902); const dotProp = __webpack_require__(93517); const uniqueString = __webpack_require__(36277); const configDirectory = xdgBasedir.config || path.join(os.tmpdir(), uniqueString()); const permissionError = 'You don\'t have access to this file.'; const makeDirOptions = {mode: 0o0700}; const writeFileOptions = {mode: 0o0600}; class Configstore { constructor(id, defaults, options = {}) { const pathPrefix = options.globalConfigPath ? path.join(id, 'config.json') : path.join('configstore', `${id}.json`); this.path = options.configPath || path.join(configDirectory, pathPrefix); if (defaults) { this.all = { ...defaults, ...this.all }; } } get all() { try { return JSON.parse(fs.readFileSync(this.path, 'utf8')); } catch (error) { // Create directory if it doesn't exist if (error.code === 'ENOENT') { return {}; } // Improve the message of permission errors if (error.code === 'EACCES') { error.message = `${error.message}\n${permissionError}\n`; } // Empty the file if it encounters invalid JSON if (error.name === 'SyntaxError') { writeFileAtomic.sync(this.path, '', writeFileOptions); return {}; } throw error; } } set all(value) { try { // Make sure the folder exists as it could have been deleted in the meantime makeDir.sync(path.dirname(this.path), makeDirOptions); writeFileAtomic.sync(this.path, JSON.stringify(value, undefined, '\t'), writeFileOptions); } catch (error) { // Improve the message of permission errors if (error.code === 'EACCES') { error.message = `${error.message}\n${permissionError}\n`; } throw error; } } get size() { return Object.keys(this.all || {}).length; } get(key) { return dotProp.get(this.all, key); } set(key, value) { const config = this.all; if (arguments.length === 1) { for (const k of Object.keys(key)) { dotProp.set(config, k, key[k]); } } else { dotProp.set(config, key, value); } this.all = config; } has(key) { return dotProp.has(this.all, key); } delete(key) { const config = this.all; dotProp.delete(config, key); this.all = config; } clear() { this.all = {}; } } module.exports = Configstore; /***/ }), /***/ 20511: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const crypto = __webpack_require__(6113); module.exports = length => { if (!Number.isFinite(length)) { throw new TypeError('Expected a finite number'); } return crypto.randomBytes(Math.ceil(length / 2)).toString('hex').slice(0, length); }; /***/ }), /***/ 11227: /***/ ((module, exports, __webpack_require__) => { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } }; })(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = __webpack_require__(82447)(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /***/ }), /***/ 82447: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(57824); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /***/ }), /***/ 15158: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = __webpack_require__(11227); } else { module.exports = __webpack_require__(39); } /***/ }), /***/ 39: /***/ ((module, exports, __webpack_require__) => { /** * Module dependencies. */ const tty = __webpack_require__(76224); const util = __webpack_require__(73837); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.destroy = util.deprecate( () => {}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ); /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = __webpack_require__(92130); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = __webpack_require__(82447)(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n') .map(str => str.trim()) .join(' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /***/ }), /***/ 4289: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var keys = __webpack_require__(82215); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var origDefineProperty = Object.defineProperty; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var arePropertyDescriptorsSupported = function () { var obj = {}; try { origDefineProperty(obj, 'x', { enumerable: false, value: obj }); // eslint-disable-next-line no-unused-vars, no-restricted-syntax for (var _ in obj) { // jscs:ignore disallowUnusedVariables return false; } return obj.x === obj; } catch (e) { /* this is IE 8. */ return false; } }; var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { origDefineProperty(object, name, { configurable: true, enumerable: false, value: value, writable: true }); } else { object[name] = value; } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }), /***/ 48590: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); // Only Node.JS has a process variable that is of [[Class]] process /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'); /***/ }), /***/ 93517: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const isObj = __webpack_require__(64290); const disallowedKeys = [ '__proto__', 'prototype', 'constructor' ]; const isValidPath = pathSegments => !pathSegments.some(segment => disallowedKeys.includes(segment)); function getPathSegments(path) { const pathArray = path.split('.'); const parts = []; for (let i = 0; i < pathArray.length; i++) { let p = pathArray[i]; while (p[p.length - 1] === '\\' && pathArray[i + 1] !== undefined) { p = p.slice(0, -1) + '.'; p += pathArray[++i]; } parts.push(p); } if (!isValidPath(parts)) { return []; } return parts; } module.exports = { get(object, path, value) { if (!isObj(object) || typeof path !== 'string') { return value === undefined ? object : value; } const pathArray = getPathSegments(path); if (pathArray.length === 0) { return; } for (let i = 0; i < pathArray.length; i++) { if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) { return value; } object = object[pathArray[i]]; if (object === undefined || object === null) { // `object` is either `undefined` or `null` so we want to stop the loop, and // if this is not the last bit of the path, and // if it did't return `undefined` // it would return `null` if `object` is `null` // but we want `get({foo: null}, 'foo.bar')` to equal `undefined`, or the supplied value, not `null` if (i !== pathArray.length - 1) { return value; } break; } } return object; }, set(object, path, value) { if (!isObj(object) || typeof path !== 'string') { return object; } const root = object; const pathArray = getPathSegments(path); for (let i = 0; i < pathArray.length; i++) { const p = pathArray[i]; if (!isObj(object[p])) { object[p] = {}; } if (i === pathArray.length - 1) { object[p] = value; } object = object[p]; } return root; }, delete(object, path) { if (!isObj(object) || typeof path !== 'string') { return false; } const pathArray = getPathSegments(path); for (let i = 0; i < pathArray.length; i++) { const p = pathArray[i]; if (i === pathArray.length - 1) { delete object[p]; return true; } object = object[p]; if (!isObj(object)) { return false; } } }, has(object, path) { if (!isObj(object) || typeof path !== 'string') { return false; } const pathArray = getPathSegments(path); if (pathArray.length === 0) { return false; } // eslint-disable-next-line unicorn/no-for-loop for (let i = 0; i < pathArray.length; i++) { if (isObj(object)) { if (!(pathArray[i] in object)) { return false; } object = object[pathArray[i]]; } else { return false; } } return true; } }; /***/ }), /***/ 27216: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _extendableBuiltin(cls) { function ExtendableBuiltin() { cls.apply(this, arguments); } ExtendableBuiltin.prototype = Object.create(cls.prototype, { constructor: { value: cls, enumerable: false, writable: true, configurable: true } }); if (Object.setPrototypeOf) { Object.setPrototypeOf(ExtendableBuiltin, cls); } else { ExtendableBuiltin.__proto__ = cls; } return ExtendableBuiltin; } var ExtendableError = function (_extendableBuiltin2) { _inherits(ExtendableError, _extendableBuiltin2); function ExtendableError() { var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; _classCallCheck(this, ExtendableError); // extending Error is weird and does not propagate `message` var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); Object.defineProperty(_this, 'message', { configurable: true, enumerable: false, value: message, writable: true }); Object.defineProperty(_this, 'name', { configurable: true, enumerable: false, value: _this.constructor.name, writable: true }); if (Error.hasOwnProperty('captureStackTrace')) { Error.captureStackTrace(_this, _this.constructor); return _possibleConstructorReturn(_this); } Object.defineProperty(_this, 'stack', { configurable: true, enumerable: false, value: new Error(message).stack, writable: true }); return _this; } return ExtendableError; }(_extendableBuiltin(Error)); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExtendableError); /***/ }), /***/ 63150: /***/ ((module) => { "use strict"; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; module.exports = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } return str.replace(matchOperatorsRe, '\\$&'); }; /***/ }), /***/ 28468: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(71017); const childProcess = __webpack_require__(32081); const crossSpawn = __webpack_require__(37350); const stripFinalNewline = __webpack_require__(48150); const npmRunPath = __webpack_require__(36147); const onetime = __webpack_require__(31322); const makeError = __webpack_require__(44353); const normalizeStdio = __webpack_require__(43111); const {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} = __webpack_require__(43820); const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(4994); const {mergePromise, getSpawnedPromise} = __webpack_require__(91708); const {joinCommand, parseCommand, getEscapedCommand} = __webpack_require__(14077); const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { const env = extendEnv ? {...process.env, ...envOption} : envOption; if (preferLocal) { return npmRunPath.env({env, cwd: localDir, execPath}); } return env; }; const handleArguments = (file, args, options = {}) => { const parsed = crossSpawn._parse(file, args, options); file = parsed.command; args = parsed.args; options = parsed.options; options = { maxBuffer: DEFAULT_MAX_BUFFER, buffer: true, stripFinalNewline: true, extendEnv: true, preferLocal: false, localDir: options.cwd || process.cwd(), execPath: process.execPath, encoding: 'utf8', reject: true, cleanup: true, all: false, windowsHide: true, ...options }; options.env = getEnv(options); options.stdio = normalizeStdio(options); if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { // #116 args.unshift('/q'); } return {file, args, options, parsed}; }; const handleOutput = (options, value, error) => { if (typeof value !== 'string' && !Buffer.isBuffer(value)) { // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` return error === undefined ? undefined : ''; } if (options.stripFinalNewline) { return stripFinalNewline(value); } return value; }; const execa = (file, args, options) => { const parsed = handleArguments(file, args, options); const command = joinCommand(file, args); const escapedCommand = getEscapedCommand(file, args); validateTimeout(parsed.options); let spawned; try { spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); } catch (error) { // Ensure the returned error is always both a promise and a child process const dummySpawned = new childProcess.ChildProcess(); const errorPromise = Promise.reject(makeError({ error, stdout: '', stderr: '', all: '', command, escapedCommand, parsed, timedOut: false, isCanceled: false, killed: false })); return mergePromise(dummySpawned, errorPromise); } const spawnedPromise = getSpawnedPromise(spawned); const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); const processDone = setExitHandler(spawned, parsed.options, timedPromise); const context = {isCanceled: false}; spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); spawned.cancel = spawnedCancel.bind(null, spawned, context); const handlePromise = async () => { const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); const stdout = handleOutput(parsed.options, stdoutResult); const stderr = handleOutput(parsed.options, stderrResult); const all = handleOutput(parsed.options, allResult); if (error || exitCode !== 0 || signal !== null) { const returnedError = makeError({ error, exitCode, signal, stdout, stderr, all, command, escapedCommand, parsed, timedOut, isCanceled: context.isCanceled, killed: spawned.killed }); if (!parsed.options.reject) { return returnedError; } throw returnedError; } return { command, escapedCommand, exitCode: 0, stdout, stderr, all, failed: false, timedOut: false, isCanceled: false, killed: false }; }; const handlePromiseOnce = onetime(handlePromise); handleInput(spawned, parsed.options.input); spawned.all = makeAllStream(spawned, parsed.options); return mergePromise(spawned, handlePromiseOnce); }; module.exports = execa; module.exports.sync = (file, args, options) => { const parsed = handleArguments(file, args, options); const command = joinCommand(file, args); const escapedCommand = getEscapedCommand(file, args); validateInputSync(parsed.options); let result; try { result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); } catch (error) { throw makeError({ error, stdout: '', stderr: '', all: '', command, escapedCommand, parsed, timedOut: false, isCanceled: false, killed: false }); } const stdout = handleOutput(parsed.options, result.stdout, result.error); const stderr = handleOutput(parsed.options, result.stderr, result.error); if (result.error || result.status !== 0 || result.signal !== null) { const error = makeError({ stdout, stderr, error: result.error, signal: result.signal, exitCode: result.status, command, escapedCommand, parsed, timedOut: result.error && result.error.code === 'ETIMEDOUT', isCanceled: false, killed: result.signal !== null }); if (!parsed.options.reject) { return error; } throw error; } return { command, escapedCommand, exitCode: 0, stdout, stderr, failed: false, timedOut: false, isCanceled: false, killed: false }; }; module.exports.command = (command, options) => { const [file, ...args] = parseCommand(command); return execa(file, args, options); }; module.exports.commandSync = (command, options) => { const [file, ...args] = parseCommand(command); return execa.sync(file, args, options); }; module.exports.node = (scriptPath, args, options = {}) => { if (args && !Array.isArray(args) && typeof args === 'object') { options = args; args = []; } const stdio = normalizeStdio.node(options); const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); const { nodePath = process.execPath, nodeOptions = defaultExecArgv } = options; return execa( nodePath, [ ...nodeOptions, scriptPath, ...(Array.isArray(args) ? args : []) ], { ...options, stdin: undefined, stdout: undefined, stderr: undefined, stdio, shell: false } ); }; /***/ }), /***/ 14077: /***/ ((module) => { "use strict"; const normalizeArgs = (file, args = []) => { if (!Array.isArray(args)) { return [file]; } return [file, ...args]; }; const NO_ESCAPE_REGEXP = /^[\w.-]+$/; const DOUBLE_QUOTES_REGEXP = /"/g; const escapeArg = arg => { if (typeof arg !== 'string' || NO_ESCAPE_REGEXP.test(arg)) { return arg; } return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`; }; const joinCommand = (file, args) => { return normalizeArgs(file, args).join(' '); }; const getEscapedCommand = (file, args) => { return normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' '); }; const SPACES_REGEXP = / +/g; // Handle `execa.command()` const parseCommand = command => { const tokens = []; for (const token of command.trim().split(SPACES_REGEXP)) { // Allow spaces to be escaped by a backslash if not meant as a delimiter const previousToken = tokens[tokens.length - 1]; if (previousToken && previousToken.endsWith('\\')) { // Merge previous token with current one tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; } else { tokens.push(token); } } return tokens; }; module.exports = { joinCommand, getEscapedCommand, parseCommand }; /***/ }), /***/ 44353: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {signalsByName} = __webpack_require__(97787); const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { if (timedOut) { return `timed out after ${timeout} milliseconds`; } if (isCanceled) { return 'was canceled'; } if (errorCode !== undefined) { return `failed with ${errorCode}`; } if (signal !== undefined) { return `was killed with ${signal} (${signalDescription})`; } if (exitCode !== undefined) { return `failed with exit code ${exitCode}`; } return 'failed'; }; const makeError = ({ stdout, stderr, all, error, signal, exitCode, command, escapedCommand, timedOut, isCanceled, killed, parsed: {options: {timeout}} }) => { // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. // We normalize them to `undefined` exitCode = exitCode === null ? undefined : exitCode; signal = signal === null ? undefined : signal; const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; const errorCode = error && error.code; const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); const execaMessage = `Command ${prefix}: ${command}`; const isError = Object.prototype.toString.call(error) === '[object Error]'; const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); if (isError) { error.originalMessage = error.message; error.message = message; } else { error = new Error(message); } error.shortMessage = shortMessage; error.command = command; error.escapedCommand = escapedCommand; error.exitCode = exitCode; error.signal = signal; error.signalDescription = signalDescription; error.stdout = stdout; error.stderr = stderr; if (all !== undefined) { error.all = all; } if ('bufferedData' in error) { delete error.bufferedData; } error.failed = true; error.timedOut = Boolean(timedOut); error.isCanceled = isCanceled; error.killed = killed && !timedOut; return error; }; module.exports = makeError; /***/ }), /***/ 43820: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const os = __webpack_require__(22037); const onExit = __webpack_require__(27908); const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; // Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { const killResult = kill(signal); setKillTimeout(kill, signal, options, killResult); return killResult; }; const setKillTimeout = (kill, signal, options, killResult) => { if (!shouldForceKill(signal, options, killResult)) { return; } const timeout = getForceKillAfterTimeout(options); const t = setTimeout(() => { kill('SIGKILL'); }, timeout); // Guarded because there's no `.unref()` when `execa` is used in the renderer // process in Electron. This cannot be tested since we don't run tests in // Electron. // istanbul ignore else if (t.unref) { t.unref(); } }; const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; }; const isSigterm = signal => { return signal === os.constants.signals.SIGTERM || (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); }; const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { if (forceKillAfterTimeout === true) { return DEFAULT_FORCE_KILL_TIMEOUT; } if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); } return forceKillAfterTimeout; }; // `childProcess.cancel()` const spawnedCancel = (spawned, context) => { const killResult = spawned.kill(); if (killResult) { context.isCanceled = true; } }; const timeoutKill = (spawned, signal, reject) => { spawned.kill(signal); reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); }; // `timeout` option handling const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { if (timeout === 0 || timeout === undefined) { return spawnedPromise; } let timeoutId; const timeoutPromise = new Promise((resolve, reject) => { timeoutId = setTimeout(() => { timeoutKill(spawned, killSignal, reject); }, timeout); }); const safeSpawnedPromise = spawnedPromise.finally(() => { clearTimeout(timeoutId); }); return Promise.race([timeoutPromise, safeSpawnedPromise]); }; const validateTimeout = ({timeout}) => { if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) { throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); } }; // `cleanup` option handling const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { if (!cleanup || detached) { return timedPromise; } const removeExitHandler = onExit(() => { spawned.kill(); }); return timedPromise.finally(() => { removeExitHandler(); }); }; module.exports = { spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler }; /***/ }), /***/ 91708: /***/ ((module) => { "use strict"; const nativePromisePrototype = (async () => {})().constructor.prototype; const descriptors = ['then', 'catch', 'finally'].map(property => [ property, Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) ]); // The return value is a mixin of `childProcess` and `Promise` const mergePromise = (spawned, promise) => { for (const [property, descriptor] of descriptors) { // Starting the main `promise` is deferred to avoid consuming streams const value = typeof promise === 'function' ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise); Reflect.defineProperty(spawned, property, {...descriptor, value}); } return spawned; }; // Use promises instead of `child_process` events const getSpawnedPromise = spawned => { return new Promise((resolve, reject) => { spawned.on('exit', (exitCode, signal) => { resolve({exitCode, signal}); }); spawned.on('error', error => { reject(error); }); if (spawned.stdin) { spawned.stdin.on('error', error => { reject(error); }); } }); }; module.exports = { mergePromise, getSpawnedPromise }; /***/ }), /***/ 43111: /***/ ((module) => { "use strict"; const aliases = ['stdin', 'stdout', 'stderr']; const hasAlias = options => aliases.some(alias => options[alias] !== undefined); const normalizeStdio = options => { if (!options) { return; } const {stdio} = options; if (stdio === undefined) { return aliases.map(alias => options[alias]); } if (hasAlias(options)) { throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); } if (typeof stdio === 'string') { return stdio; } if (!Array.isArray(stdio)) { throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); } const length = Math.max(stdio.length, aliases.length); return Array.from({length}, (value, index) => stdio[index]); }; module.exports = normalizeStdio; // `ipc` is pushed unless it is already present module.exports.node = options => { const stdio = normalizeStdio(options); if (stdio === 'ipc') { return 'ipc'; } if (stdio === undefined || typeof stdio === 'string') { return [stdio, stdio, stdio, 'ipc']; } if (stdio.includes('ipc')) { return stdio; } return [...stdio, 'ipc']; }; /***/ }), /***/ 4994: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const isStream = __webpack_require__(24970); const getStream = __webpack_require__(10031); const mergeStream = __webpack_require__(4034); // `input` option const handleInput = (spawned, input) => { // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 // @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 if (input === undefined || spawned.stdin === undefined) { return; } if (isStream(input)) { input.pipe(spawned.stdin); } else { spawned.stdin.end(input); } }; // `all` interleaves `stdout` and `stderr` const makeAllStream = (spawned, {all}) => { if (!all || (!spawned.stdout && !spawned.stderr)) { return; } const mixed = mergeStream(); if (spawned.stdout) { mixed.add(spawned.stdout); } if (spawned.stderr) { mixed.add(spawned.stderr); } return mixed; }; // On failure, `result.stdout|stderr|all` should contain the currently buffered stream const getBufferedData = async (stream, streamPromise) => { if (!stream) { return; } stream.destroy(); try { return await streamPromise; } catch (error) { return error.bufferedData; } }; const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { if (!stream || !buffer) { return; } if (encoding) { return getStream(stream, {encoding, maxBuffer}); } return getStream.buffer(stream, {maxBuffer}); }; // Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); try { return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); } catch (error) { return Promise.all([ {error, signal: error.signal, timedOut: error.timedOut}, getBufferedData(stdout, stdoutPromise), getBufferedData(stderr, stderrPromise), getBufferedData(all, allPromise) ]); } }; const validateInputSync = ({input}) => { if (isStream(input)) { throw new TypeError('The `input` option cannot be a stream in sync mode'); } }; module.exports = { handleInput, makeAllStream, getSpawnedResult, validateInputSync }; /***/ }), /***/ 37350: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const cp = __webpack_require__(32081); const parse = __webpack_require__(36855); const enoent = __webpack_require__(36785); function spawn(command, args, options) { // Parse the arguments const parsed = parse(command, args, options); // Spawn the child process const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); // Hook into child process "exit" event to emit an error if the command // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 enoent.hookChildProcess(spawned, parsed); return spawned; } function spawnSync(command, args, options) { // Parse the arguments const parsed = parse(command, args, options); // Spawn the child process const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); return result; } module.exports = spawn; module.exports.spawn = spawn; module.exports.sync = spawnSync; module.exports._parse = parse; module.exports._enoent = enoent; /***/ }), /***/ 36785: /***/ ((module) => { "use strict"; const isWin = process.platform === 'win32'; function notFoundError(original, syscall) { return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { code: 'ENOENT', errno: 'ENOENT', syscall: `${syscall} ${original.command}`, path: original.command, spawnargs: original.args, }); } function hookChildProcess(cp, parsed) { if (!isWin) { return; } const originalEmit = cp.emit; cp.emit = function (name, arg1) { // If emitting "exit" event and exit code is 1, we need to check if // the command exists and emit an "error" instead // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 if (name === 'exit') { const err = verifyENOENT(arg1, parsed); if (err) { return originalEmit.call(cp, 'error', err); } } return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params }; } function verifyENOENT(status, parsed) { if (isWin && status === 1 && !parsed.file) { return notFoundError(parsed.original, 'spawn'); } return null; } function verifyENOENTSync(status, parsed) { if (isWin && status === 1 && !parsed.file) { return notFoundError(parsed.original, 'spawnSync'); } return null; } module.exports = { hookChildProcess, verifyENOENT, verifyENOENTSync, notFoundError, }; /***/ }), /***/ 36855: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(71017); const resolveCommand = __webpack_require__(22487); const escape = __webpack_require__(62052); const readShebang = __webpack_require__(84204); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; function detectShebang(parsed) { parsed.file = resolveCommand(parsed); const shebang = parsed.file && readShebang(parsed.file); if (shebang) { parsed.args.unshift(parsed.file); parsed.command = shebang; return resolveCommand(parsed); } return parsed.file; } function parseNonShell(parsed) { if (!isWin) { return parsed; } // Detect & add support for shebangs const commandFile = detectShebang(parsed); // We don't need a shell if the command filename is an executable const needsShell = !isExecutableRegExp.test(commandFile); // If a shell is required, use cmd.exe and take care of escaping everything correctly // Note that `forceShell` is an hidden option used only in tests if (parsed.options.forceShell || needsShell) { // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, // we need to double escape them const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) // This is necessary otherwise it will always fail with ENOENT in those cases parsed.command = path.normalize(parsed.command); // Escape command & arguments parsed.command = escape.command(parsed.command); parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); const shellCommand = [parsed.command].concat(parsed.args).join(' '); parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; parsed.command = process.env.comspec || 'cmd.exe'; parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped } return parsed; } function parse(command, args, options) { // Normalize arguments, similar to nodejs if (args && !Array.isArray(args)) { options = args; args = null; } args = args ? args.slice(0) : []; // Clone array to avoid changing the original options = Object.assign({}, options); // Clone object to avoid changing the original // Build our parsed object const parsed = { command, args, options, file: undefined, original: { command, args, }, }; // Delegate further parsing to shell or non-shell return options.shell ? parsed : parseNonShell(parsed); } module.exports = parse; /***/ }), /***/ 62052: /***/ ((module) => { "use strict"; // See http://www.robvanderwoude.com/escapechars.php const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; function escapeCommand(arg) { // Escape meta chars arg = arg.replace(metaCharsRegExp, '^$1'); return arg; } function escapeArgument(arg, doubleEscapeMetaChars) { // Convert to string arg = `${arg}`; // Algorithm below is based on https://qntm.org/cmd // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information // Sequence of backslashes followed by a double quote: // double up all the backslashes and escape the double quote arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"'); // Sequence of backslashes followed by the end of the string // (which will become a double quote later): // double up all the backslashes arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1'); // All other backslashes occur literally // Quote the whole thing: arg = `"${arg}"`; // Escape meta chars arg = arg.replace(metaCharsRegExp, '^$1'); // Double escape meta chars if necessary if (doubleEscapeMetaChars) { arg = arg.replace(metaCharsRegExp, '^$1'); } return arg; } module.exports.command = escapeCommand; module.exports.argument = escapeArgument; /***/ }), /***/ 84204: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(57147); const shebangCommand = __webpack_require__(34650); function readShebang(command) { // Read the first 150 bytes from the file const size = 150; const buffer = Buffer.alloc(size); let fd; try { fd = fs.openSync(command, 'r'); fs.readSync(fd, buffer, 0, size, 0); fs.closeSync(fd); } catch (e) { /* Empty */ } // Attempt to extract shebang (null is returned if not a shebang) return shebangCommand(buffer.toString()); } module.exports = readShebang; /***/ }), /***/ 22487: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(71017); const which = __webpack_require__(28326); const getPathKey = __webpack_require__(7834); function resolveCommandAttempt(parsed, withoutPathExt) { const env = parsed.options.env || process.env; const cwd = process.cwd(); const hasCustomCwd = parsed.options.cwd != null; // Worker threads do not have process.chdir() const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; // If a custom `cwd` was specified, we need to change the process cwd // because `which` will do stat calls but does not support a custom cwd if (shouldSwitchCwd) { try { process.chdir(parsed.options.cwd); } catch (err) { /* Empty */ } } let resolved; try { resolved = which.sync(parsed.command, { path: env[getPathKey({ env })], pathExt: withoutPathExt ? path.delimiter : undefined, }); } catch (e) { /* Empty */ } finally { if (shouldSwitchCwd) { process.chdir(cwd); } } // If we successfully resolved, ensure that an absolute path is returned // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it if (resolved) { resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); } return resolved; } function resolveCommand(parsed) { return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); } module.exports = resolveCommand; /***/ }), /***/ 7834: /***/ ((module) => { "use strict"; const pathKey = (options = {}) => { const environment = options.env || process.env; const platform = options.platform || process.platform; if (platform !== 'win32') { return 'PATH'; } return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; }; module.exports = pathKey; // TODO: Remove this for the next major release module.exports["default"] = pathKey; /***/ }), /***/ 34650: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const shebangRegex = __webpack_require__(7571); module.exports = (string = '') => { const match = string.match(shebangRegex); if (!match) { return null; } const [path, argument] = match[0].replace(/#! ?/, '').split(' '); const binary = path.split('/').pop(); if (binary === 'env') { return argument; } return argument ? `${binary} ${argument}` : binary; }; /***/ }), /***/ 7571: /***/ ((module) => { "use strict"; module.exports = /^#!(.*)/; /***/ }), /***/ 28326: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' const path = __webpack_require__(71017) const COLON = isWindows ? ';' : ':' const isexe = __webpack_require__(31959) const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) const getPathInfo = (cmd, opt) => { const colon = opt.colon || COLON // If it has a slash, then we don't bother searching the pathenv. // just check the file itself, and that's it. const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [''] : ( [ // windows always checks the cwd first ...(isWindows ? [process.cwd()] : []), ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */ '').split(colon), ] ) const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' : '' const pathExt = isWindows ? pathExtExe.split(colon) : [''] if (isWindows) { if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') pathExt.unshift('') } return { pathEnv, pathExt, pathExtExe, } } const which = (cmd, opt, cb) => { if (typeof opt === 'function') { cb = opt opt = {} } if (!opt) opt = {} const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) const found = [] const step = i => new Promise((resolve, reject) => { if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)) const ppRaw = pathEnv[i] const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw const pCmd = path.join(pathPart, cmd) const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd resolve(subStep(p, i, 0)) }) const subStep = (p, i, ii) => new Promise((resolve, reject) => { if (ii === pathExt.length) return resolve(step(i + 1)) const ext = pathExt[ii] isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { if (!er && is) { if (opt.all) found.push(p + ext) else return resolve(p + ext) } return resolve(subStep(p, i, ii + 1)) }) }) return cb ? step(0).then(res => cb(null, res), cb) : step(0) } const whichSync = (cmd, opt) => { opt = opt || {} const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) const found = [] for (let i = 0; i < pathEnv.length; i ++) { const ppRaw = pathEnv[i] const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw const pCmd = path.join(pathPart, cmd) const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd for (let j = 0; j < pathExt.length; j ++) { const cur = p + pathExt[j] try { const is = isexe.sync(cur, { pathExt: pathExtExe }) if (is) { if (opt.all) found.push(cur) else return cur } } catch (ex) {} } } if (opt.all && found.length) return found if (opt.nothrow) return null throw getNotFoundError(cmd) } module.exports = which which.sync = whichSync /***/ }), /***/ 55105: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {PassThrough: PassThroughStream} = __webpack_require__(12781); module.exports = options => { options = {...options}; const {array} = options; let {encoding} = options; const isBuffer = encoding === 'buffer'; let objectMode = false; if (array) { objectMode = !(encoding || isBuffer); } else { encoding = encoding || 'utf8'; } if (isBuffer) { encoding = null; } const stream = new PassThroughStream({objectMode}); if (encoding) { stream.setEncoding(encoding); } let length = 0; const chunks = []; stream.on('data', chunk => { chunks.push(chunk); if (objectMode) { length = chunks.length; } else { length += chunk.length; } }); stream.getBufferedValue = () => { if (array) { return chunks; } return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); }; stream.getBufferedLength = () => length; return stream; }; /***/ }), /***/ 10031: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {constants: BufferConstants} = __webpack_require__(14300); const stream = __webpack_require__(12781); const {promisify} = __webpack_require__(73837); const bufferStream = __webpack_require__(55105); const streamPipelinePromisified = promisify(stream.pipeline); class MaxBufferError extends Error { constructor() { super('maxBuffer exceeded'); this.name = 'MaxBufferError'; } } async function getStream(inputStream, options) { if (!inputStream) { throw new Error('Expected a stream'); } options = { maxBuffer: Infinity, ...options }; const {maxBuffer} = options; const stream = bufferStream(options); await new Promise((resolve, reject) => { const rejectPromise = error => { // Don't retrieve an oversized buffer. if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { error.bufferedData = stream.getBufferedValue(); } reject(error); }; (async () => { try { await streamPipelinePromisified(inputStream, stream); resolve(); } catch (error) { rejectPromise(error); } })(); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { rejectPromise(new MaxBufferError()); } }); }); return stream.getBufferedValue(); } module.exports = getStream; module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 36257: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _roarr = _interopRequireDefault(__webpack_require__(83085)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const Logger = _roarr.default.child({ package: 'global-agent' }); var _default = Logger; exports["default"] = _default; //# sourceMappingURL=Logger.js.map /***/ }), /***/ 44763: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _serializeError = __webpack_require__(7710); var _boolean = __webpack_require__(46088); var _Logger = _interopRequireDefault(__webpack_require__(36257)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const log = _Logger.default.child({ namespace: 'Agent' }); let requestId = 0; class Agent { constructor(isProxyConfigured, mustUrlUseProxy, getUrlProxy, fallbackAgent, socketConnectionTimeout) { this.fallbackAgent = fallbackAgent; this.isProxyConfigured = isProxyConfigured; this.mustUrlUseProxy = mustUrlUseProxy; this.getUrlProxy = getUrlProxy; this.socketConnectionTimeout = socketConnectionTimeout; } addRequest(request, configuration) { let requestUrl; // It is possible that addRequest was constructed for a proxied request already, e.g. // "request" package does this when it detects that a proxy should be used // https://github.com/request/request/blob/212570b6971a732b8dd9f3c73354bcdda158a737/request.js#L402 // https://gist.github.com/gajus/e2074cd3b747864ffeaabbd530d30218 if (request.path.startsWith('http://') || request.path.startsWith('https://')) { requestUrl = request.path; } else { requestUrl = this.protocol + '//' + (configuration.hostname || configuration.host) + (configuration.port === 80 || configuration.port === 443 ? '' : ':' + configuration.port) + request.path; } // If a request should go to a local socket, proxying it through an HTTP // server does not make sense as the information about the target socket // will be lost and the proxy won't be able to correctly handle the request. if (configuration.socketPath) { log.trace({ destination: configuration.socketPath, }, "not proxying request; destination is a socket"); // @ts-expect-error seems like we are using wrong type for fallbackAgent. this.fallbackAgent.addRequest(request, configuration); return; } if (!this.isProxyConfigured()) { log.trace({ destination: requestUrl }, 'not proxying request; GLOBAL_AGENT.HTTP_PROXY is not configured'); // $FlowFixMe It appears that Flow is missing the method description. this.fallbackAgent.addRequest(request, configuration); return; } if (!this.mustUrlUseProxy(requestUrl)) { log.trace({ destination: requestUrl }, 'not proxying request; url matches GLOBAL_AGENT.NO_PROXY'); // $FlowFixMe It appears that Flow is missing the method description. this.fallbackAgent.addRequest(request, configuration); return; } const currentRequestId = requestId++; const proxy = this.getUrlProxy(requestUrl); if (this.protocol === 'http:') { request.path = requestUrl; if (proxy.authorization) { request.setHeader('proxy-authorization', 'Basic ' + Buffer.from(proxy.authorization).toString('base64')); } } log.trace({ destination: requestUrl, proxy: 'http://' + proxy.hostname + ':' + proxy.port, requestId: currentRequestId }, 'proxying request'); request.on('error', error => { log.error({ error: (0, _serializeError.serializeError)(error) }, 'request error'); }); request.once('response', response => { log.trace({ headers: response.headers, requestId: currentRequestId, statusCode: response.statusCode }, 'proxying response'); }); request.shouldKeepAlive = false; const connectionConfiguration = { host: configuration.hostname || configuration.host, port: configuration.port || 80, proxy, tls: {} }; // add optional tls options for https requests. // @see https://nodejs.org/docs/latest-v12.x/api/https.html#https_https_request_url_options_callback : // > The following additional options from tls.connect() // > - https://nodejs.org/docs/latest-v12.x/api/tls.html#tls_tls_connect_options_callback - // > are also accepted: // > ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, honorCipherOrder, // > key, passphrase, pfx, rejectUnauthorized, secureOptions, secureProtocol, servername, sessionIdContext. if (this.protocol === 'https:') { connectionConfiguration.tls = { ca: configuration.ca, cert: configuration.cert, ciphers: configuration.ciphers, clientCertEngine: configuration.clientCertEngine, crl: configuration.crl, dhparam: configuration.dhparam, ecdhCurve: configuration.ecdhCurve, honorCipherOrder: configuration.honorCipherOrder, key: configuration.key, passphrase: configuration.passphrase, pfx: configuration.pfx, rejectUnauthorized: configuration.rejectUnauthorized, secureOptions: configuration.secureOptions, secureProtocol: configuration.secureProtocol, servername: configuration.servername || connectionConfiguration.host, sessionIdContext: configuration.sessionIdContext }; // This is not ideal because there is no way to override this setting using `tls` configuration if `NODE_TLS_REJECT_UNAUTHORIZED=0`. // However, popular HTTP clients (such as https://github.com/sindresorhus/got) come with pre-configured value for `rejectUnauthorized`, // which makes it impossible to override that value globally and respect `rejectUnauthorized` for specific requests only. // // eslint-disable-next-line no-process-env if (typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED === 'string' && (0, _boolean.boolean)(process.env.NODE_TLS_REJECT_UNAUTHORIZED) === false) { connectionConfiguration.tls.rejectUnauthorized = false; } } // $FlowFixMe It appears that Flow is missing the method description. this.createConnection(connectionConfiguration, (error, socket) => { log.trace({ target: connectionConfiguration }, 'connecting'); // @see https://github.com/nodejs/node/issues/5757#issuecomment-305969057 if (socket) { socket.setTimeout(this.socketConnectionTimeout, () => { socket.destroy(); }); socket.once('connect', () => { log.trace({ target: connectionConfiguration }, 'connected'); socket.setTimeout(0); }); socket.once('secureConnect', () => { log.trace({ target: connectionConfiguration }, 'connected (secure)'); socket.setTimeout(0); }); } if (error) { request.emit('error', error); } else { log.debug('created socket'); socket.on('error', socketError => { log.error({ error: (0, _serializeError.serializeError)(socketError) }, 'socket error'); }); request.onSocket(socket); } }); } } var _default = Agent; exports["default"] = _default; //# sourceMappingURL=Agent.js.map /***/ }), /***/ 21878: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _net = _interopRequireDefault(__webpack_require__(41808)); var _Agent = _interopRequireDefault(__webpack_require__(44763)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class HttpProxyAgent extends _Agent.default { // @see https://github.com/sindresorhus/eslint-plugin-unicorn/issues/169#issuecomment-486980290 // eslint-disable-next-line unicorn/prevent-abbreviations constructor(...args) { super(...args); this.protocol = 'http:'; this.defaultPort = 80; } createConnection(configuration, callback) { const socket = _net.default.connect(configuration.proxy.port, configuration.proxy.hostname); callback(null, socket); } } var _default = HttpProxyAgent; exports["default"] = _default; //# sourceMappingURL=HttpProxyAgent.js.map /***/ }), /***/ 87298: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _net = _interopRequireDefault(__webpack_require__(41808)); var _tls = _interopRequireDefault(__webpack_require__(24404)); var _Agent = _interopRequireDefault(__webpack_require__(44763)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class HttpsProxyAgent extends _Agent.default { // eslint-disable-next-line unicorn/prevent-abbreviations constructor(...args) { super(...args); this.protocol = 'https:'; this.defaultPort = 443; } createConnection(configuration, callback) { const socket = _net.default.connect(configuration.proxy.port, configuration.proxy.hostname); socket.on('error', error => { callback(error); }); socket.once('data', () => { const secureSocket = _tls.default.connect({ ...configuration.tls, socket }); callback(null, secureSocket); }); let connectMessage = ''; connectMessage += 'CONNECT ' + configuration.host + ':' + configuration.port + ' HTTP/1.1\r\n'; connectMessage += 'Host: ' + configuration.host + ':' + configuration.port + '\r\n'; if (configuration.proxy.authorization) { connectMessage += 'Proxy-Authorization: Basic ' + Buffer.from(configuration.proxy.authorization).toString('base64') + '\r\n'; } connectMessage += '\r\n'; socket.write(connectMessage); } } var _default = HttpsProxyAgent; exports["default"] = _default; //# sourceMappingURL=HttpsProxyAgent.js.map /***/ }), /***/ 86595: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "Agent", ({ enumerable: true, get: function () { return _Agent.default; } })); Object.defineProperty(exports, "HttpProxyAgent", ({ enumerable: true, get: function () { return _HttpProxyAgent.default; } })); Object.defineProperty(exports, "HttpsProxyAgent", ({ enumerable: true, get: function () { return _HttpsProxyAgent.default; } })); var _Agent = _interopRequireDefault(__webpack_require__(44763)); var _HttpProxyAgent = _interopRequireDefault(__webpack_require__(21878)); var _HttpsProxyAgent = _interopRequireDefault(__webpack_require__(87298)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map /***/ }), /***/ 49714: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.UnexpectedStateError = void 0; var _es6Error = _interopRequireDefault(__webpack_require__(27216)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable fp/no-class, fp/no-this */ class UnexpectedStateError extends _es6Error.default { constructor(message, code = 'UNEXPECTED_STATE_ERROR') { super(message); this.code = code; } } exports.UnexpectedStateError = UnexpectedStateError; //# sourceMappingURL=errors.js.map /***/ }), /***/ 65973: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _http = _interopRequireDefault(__webpack_require__(13685)); var _https = _interopRequireDefault(__webpack_require__(95687)); var _boolean = __webpack_require__(46088); var _semver = _interopRequireDefault(__webpack_require__(81833)); var _Logger = _interopRequireDefault(__webpack_require__(36257)); var _classes = __webpack_require__(86595); var _errors = __webpack_require__(49714); var _utilities = __webpack_require__(49426); var _createProxyController = _interopRequireDefault(__webpack_require__(4117)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const httpGet = _http.default.get; const httpRequest = _http.default.request; const httpsGet = _https.default.get; const httpsRequest = _https.default.request; const log = _Logger.default.child({ namespace: 'createGlobalProxyAgent' }); const defaultConfigurationInput = { environmentVariableNamespace: undefined, forceGlobalAgent: undefined, socketConnectionTimeout: 60000 }; const omitUndefined = subject => { const keys = Object.keys(subject); const result = {}; for (const key of keys) { const value = subject[key]; if (value !== undefined) { result[key] = value; } } return result; }; const createConfiguration = configurationInput => { // eslint-disable-next-line no-process-env const environment = process.env; const defaultConfiguration = { environmentVariableNamespace: typeof environment.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE === 'string' ? environment.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE : 'GLOBAL_AGENT_', forceGlobalAgent: typeof environment.GLOBAL_AGENT_FORCE_GLOBAL_AGENT === 'string' ? (0, _boolean.boolean)(environment.GLOBAL_AGENT_FORCE_GLOBAL_AGENT) : true, socketConnectionTimeout: typeof environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT === 'string' ? Number.parseInt(environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT, 10) : defaultConfigurationInput.socketConnectionTimeout }; // $FlowFixMe return { ...defaultConfiguration, ...omitUndefined(configurationInput) }; }; const createGlobalProxyAgent = (configurationInput = defaultConfigurationInput) => { const configuration = createConfiguration(configurationInput); const proxyController = (0, _createProxyController.default)(); // eslint-disable-next-line no-process-env proxyController.HTTP_PROXY = process.env[configuration.environmentVariableNamespace + 'HTTP_PROXY'] || null; // eslint-disable-next-line no-process-env proxyController.HTTPS_PROXY = process.env[configuration.environmentVariableNamespace + 'HTTPS_PROXY'] || null; // eslint-disable-next-line no-process-env proxyController.NO_PROXY = process.env[configuration.environmentVariableNamespace + 'NO_PROXY'] || null; log.info({ configuration, state: proxyController }, 'global agent has been initialized'); const mustUrlUseProxy = getProxy => { return url => { if (!getProxy()) { return false; } if (!proxyController.NO_PROXY) { return true; } return !(0, _utilities.isUrlMatchingNoProxy)(url, proxyController.NO_PROXY); }; }; const getUrlProxy = getProxy => { return () => { const proxy = getProxy(); if (!proxy) { throw new _errors.UnexpectedStateError('HTTP(S) proxy must be configured.'); } return (0, _utilities.parseProxyUrl)(proxy); }; }; const getHttpProxy = () => { return proxyController.HTTP_PROXY; }; const BoundHttpProxyAgent = class extends _classes.HttpProxyAgent { constructor() { super(() => { return getHttpProxy(); }, mustUrlUseProxy(getHttpProxy), getUrlProxy(getHttpProxy), _http.default.globalAgent, configuration.socketConnectionTimeout); } }; const httpAgent = new BoundHttpProxyAgent(); const getHttpsProxy = () => { return proxyController.HTTPS_PROXY || proxyController.HTTP_PROXY; }; const BoundHttpsProxyAgent = class extends _classes.HttpsProxyAgent { constructor() { super(() => { return getHttpsProxy(); }, mustUrlUseProxy(getHttpsProxy), getUrlProxy(getHttpsProxy), _https.default.globalAgent, configuration.socketConnectionTimeout); } }; const httpsAgent = new BoundHttpsProxyAgent(); // Overriding globalAgent was added in v11.7. // @see https://nodejs.org/uk/blog/release/v11.7.0/ if (_semver.default.gte(process.version, 'v11.7.0')) { // @see https://github.com/facebook/flow/issues/7670 // $FlowFixMe _http.default.globalAgent = httpAgent; // $FlowFixMe _https.default.globalAgent = httpsAgent; } // The reason this logic is used in addition to overriding http(s).globalAgent // is because there is no guarantee that we set http(s).globalAgent variable // before an instance of http(s).Agent has been already constructed by someone, // e.g. Stripe SDK creates instances of http(s).Agent at the top-level. // @see https://github.com/gajus/global-agent/pull/13 // // We still want to override http(s).globalAgent when possible to enable logic // in `bindHttpMethod`. if (_semver.default.gte(process.version, 'v10.0.0')) { // $FlowFixMe _http.default.get = (0, _utilities.bindHttpMethod)(httpGet, httpAgent, configuration.forceGlobalAgent); // $FlowFixMe _http.default.request = (0, _utilities.bindHttpMethod)(httpRequest, httpAgent, configuration.forceGlobalAgent); // $FlowFixMe _https.default.get = (0, _utilities.bindHttpMethod)(httpsGet, httpsAgent, configuration.forceGlobalAgent); // $FlowFixMe _https.default.request = (0, _utilities.bindHttpMethod)(httpsRequest, httpsAgent, configuration.forceGlobalAgent); } else { log.warn('attempt to initialize global-agent in unsupported Node.js version was ignored'); } return proxyController; }; var _default = createGlobalProxyAgent; exports["default"] = _default; //# sourceMappingURL=createGlobalProxyAgent.js.map /***/ }), /***/ 4117: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _Logger = _interopRequireDefault(__webpack_require__(36257)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const log = _Logger.default.child({ namespace: 'createProxyController' }); const KNOWN_PROPERTY_NAMES = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY']; const createProxyController = () => { // eslint-disable-next-line fp/no-proxy return new Proxy({ HTTP_PROXY: null, HTTPS_PROXY: null, NO_PROXY: null }, { set: (subject, name, value) => { if (!KNOWN_PROPERTY_NAMES.includes(name)) { throw new Error('Cannot set an unmapped property "' + name + '".'); } subject[name] = value; log.info({ change: { name, value }, newConfiguration: subject }, 'configuration changed'); return true; } }); }; var _default = createProxyController; exports["default"] = _default; //# sourceMappingURL=createProxyController.js.map /***/ }), /***/ 92842: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "createGlobalProxyAgent", ({ enumerable: true, get: function () { return _createGlobalProxyAgent.default; } })); Object.defineProperty(exports, "createProxyController", ({ enumerable: true, get: function () { return _createProxyController.default; } })); var _createGlobalProxyAgent = _interopRequireDefault(__webpack_require__(65973)); var _createProxyController = _interopRequireDefault(__webpack_require__(4117)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map /***/ }), /***/ 97959: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "bootstrap", ({ enumerable: true, get: function () { return _routines.bootstrap; } })); Object.defineProperty(exports, "createGlobalProxyAgent", ({ enumerable: true, get: function () { return _factories.createGlobalProxyAgent; } })); var _routines = __webpack_require__(41143); var _factories = __webpack_require__(92842); //# sourceMappingURL=index.js.map /***/ }), /***/ 76746: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _Logger = _interopRequireDefault(__webpack_require__(36257)); var _factories = __webpack_require__(92842); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const log = _Logger.default.child({ namespace: 'bootstrap' }); const bootstrap = configurationInput => { if (global.GLOBAL_AGENT) { log.warn('found global.GLOBAL_AGENT; second attempt to bootstrap global-agent was ignored'); return false; } global.GLOBAL_AGENT = (0, _factories.createGlobalProxyAgent)(configurationInput); return true; }; var _default = bootstrap; exports["default"] = _default; //# sourceMappingURL=bootstrap.js.map /***/ }), /***/ 41143: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "bootstrap", ({ enumerable: true, get: function () { return _bootstrap.default; } })); var _bootstrap = _interopRequireDefault(__webpack_require__(76746)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map /***/ }), /***/ 11861: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _http = _interopRequireDefault(__webpack_require__(13685)); var _https = _interopRequireDefault(__webpack_require__(95687)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // eslint-disable-next-line flowtype/no-weak-types const bindHttpMethod = (originalMethod, agent, forceGlobalAgent) => { // eslint-disable-next-line unicorn/prevent-abbreviations return (...args) => { let url; let options; let callback; if (typeof args[0] === 'string' || args[0] instanceof URL) { url = args[0]; if (typeof args[1] === 'function') { options = {}; callback = args[1]; } else { options = { ...args[1] }; callback = args[2]; } } else { options = { ...args[0] }; callback = args[1]; } if (forceGlobalAgent) { options.agent = agent; } else { if (!options.agent) { options.agent = agent; } if (options.agent === _http.default.globalAgent || options.agent === _https.default.globalAgent) { options.agent = agent; } } if (url) { // $FlowFixMe return originalMethod(url, options, callback); } else { return originalMethod(options, callback); } }; }; var _default = bindHttpMethod; exports["default"] = _default; //# sourceMappingURL=bindHttpMethod.js.map /***/ }), /***/ 49426: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "bindHttpMethod", ({ enumerable: true, get: function () { return _bindHttpMethod.default; } })); Object.defineProperty(exports, "isUrlMatchingNoProxy", ({ enumerable: true, get: function () { return _isUrlMatchingNoProxy.default; } })); Object.defineProperty(exports, "parseProxyUrl", ({ enumerable: true, get: function () { return _parseProxyUrl.default; } })); var _bindHttpMethod = _interopRequireDefault(__webpack_require__(11861)); var _isUrlMatchingNoProxy = _interopRequireDefault(__webpack_require__(1278)); var _parseProxyUrl = _interopRequireDefault(__webpack_require__(51600)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map /***/ }), /***/ 1278: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _url = __webpack_require__(57310); var _matcher = _interopRequireDefault(__webpack_require__(63110)); var _errors = __webpack_require__(49714); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const isUrlMatchingNoProxy = (subjectUrl, noProxy) => { const subjectUrlTokens = (0, _url.parse)(subjectUrl); const rules = noProxy.split(/[\s,]+/); for (const rule of rules) { const ruleMatch = rule.replace(/^(?\.)/, '*').match(/^(?.+?)(?::(?\d+))?$/); if (!ruleMatch || !ruleMatch.groups) { throw new _errors.UnexpectedStateError('Invalid NO_PROXY pattern.'); } if (!ruleMatch.groups.hostname) { throw new _errors.UnexpectedStateError('NO_PROXY entry pattern must include hostname. Use * to match any hostname.'); } const hostnameIsMatch = _matcher.default.isMatch(subjectUrlTokens.hostname, ruleMatch.groups.hostname); if (hostnameIsMatch && (!ruleMatch.groups || !ruleMatch.groups.port || subjectUrlTokens.port && subjectUrlTokens.port === ruleMatch.groups.port)) { return true; } } return false; }; var _default = isUrlMatchingNoProxy; exports["default"] = _default; //# sourceMappingURL=isUrlMatchingNoProxy.js.map /***/ }), /***/ 51600: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _url = __webpack_require__(57310); var _errors = __webpack_require__(49714); const parseProxyUrl = url => { const urlTokens = (0, _url.parse)(url); if (urlTokens.query !== null) { throw new _errors.UnexpectedStateError('Unsupported `GLOBAL_AGENT.HTTP_PROXY` configuration value: URL must not have query.'); } if (urlTokens.hash !== null) { throw new _errors.UnexpectedStateError('Unsupported `GLOBAL_AGENT.HTTP_PROXY` configuration value: URL must not have hash.'); } if (urlTokens.protocol !== 'http:') { throw new _errors.UnexpectedStateError('Unsupported `GLOBAL_AGENT.HTTP_PROXY` configuration value: URL protocol must be "http:".'); } let port = 80; if (urlTokens.port) { port = Number.parseInt(urlTokens.port, 10); } return { authorization: urlTokens.auth || null, hostname: urlTokens.hostname, port }; }; var _default = parseProxyUrl; exports["default"] = _default; //# sourceMappingURL=parseProxyUrl.js.map /***/ }), /***/ 40162: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // A linked list to keep track of recently-used-ness const Yallist = __webpack_require__(68981) const MAX = Symbol('max') const LENGTH = Symbol('length') const LENGTH_CALCULATOR = Symbol('lengthCalculator') const ALLOW_STALE = Symbol('allowStale') const MAX_AGE = Symbol('maxAge') const DISPOSE = Symbol('dispose') const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') const LRU_LIST = Symbol('lruList') const CACHE = Symbol('cache') const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') const naiveLength = () => 1 // lruList is a yallist where the head is the youngest // item, and the tail is the oldest. the list contains the Hit // objects as the entries. // Each Hit object has a reference to its Yallist.Node. This // never changes. // // cache is a Map (or PseudoMap) that matches the keys to // the Yallist.Node object. class LRUCache { constructor (options) { if (typeof options === 'number') options = { max: options } if (!options) options = {} if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number') // Kind of weird to have a default max of Infinity, but oh well. const max = this[MAX] = options.max || Infinity const lc = options.length || naiveLength this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc this[ALLOW_STALE] = options.stale || false if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number') this[MAX_AGE] = options.maxAge || 0 this[DISPOSE] = options.dispose this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false this.reset() } // resize the cache when the max changes. set max (mL) { if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number') this[MAX] = mL || Infinity trim(this) } get max () { return this[MAX] } set allowStale (allowStale) { this[ALLOW_STALE] = !!allowStale } get allowStale () { return this[ALLOW_STALE] } set maxAge (mA) { if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number') this[MAX_AGE] = mA trim(this) } get maxAge () { return this[MAX_AGE] } // resize the cache when the lengthCalculator changes. set lengthCalculator (lC) { if (typeof lC !== 'function') lC = naiveLength if (lC !== this[LENGTH_CALCULATOR]) { this[LENGTH_CALCULATOR] = lC this[LENGTH] = 0 this[LRU_LIST].forEach(hit => { hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) this[LENGTH] += hit.length }) } trim(this) } get lengthCalculator () { return this[LENGTH_CALCULATOR] } get length () { return this[LENGTH] } get itemCount () { return this[LRU_LIST].length } rforEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].tail; walker !== null;) { const prev = walker.prev forEachStep(this, fn, walker, thisp) walker = prev } } forEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].head; walker !== null;) { const next = walker.next forEachStep(this, fn, walker, thisp) walker = next } } keys () { return this[LRU_LIST].toArray().map(k => k.key) } values () { return this[LRU_LIST].toArray().map(k => k.value) } reset () { if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) } this[CACHE] = new Map() // hash of items by key this[LRU_LIST] = new Yallist() // list of items in order of use recency this[LENGTH] = 0 // length of items in the list } dump () { return this[LRU_LIST].map(hit => isStale(this, hit) ? false : { k: hit.key, v: hit.value, e: hit.now + (hit.maxAge || 0) }).toArray().filter(h => h) } dumpLru () { return this[LRU_LIST] } set (key, value, maxAge) { maxAge = maxAge || this[MAX_AGE] if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number') const now = maxAge ? Date.now() : 0 const len = this[LENGTH_CALCULATOR](value, key) if (this[CACHE].has(key)) { if (len > this[MAX]) { del(this, this[CACHE].get(key)) return false } const node = this[CACHE].get(key) const item = node.value // dispose of the old one before overwriting // split out into 2 ifs for better coverage tracking if (this[DISPOSE]) { if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value) } item.now = now item.maxAge = maxAge item.value = value this[LENGTH] += len - item.length item.length = len this.get(key) trim(this) return true } const hit = new Entry(key, value, len, now, maxAge) // oversized objects fall out of cache automatically. if (hit.length > this[MAX]) { if (this[DISPOSE]) this[DISPOSE](key, value) return false } this[LENGTH] += hit.length this[LRU_LIST].unshift(hit) this[CACHE].set(key, this[LRU_LIST].head) trim(this) return true } has (key) { if (!this[CACHE].has(key)) return false const hit = this[CACHE].get(key).value return !isStale(this, hit) } get (key) { return get(this, key, true) } peek (key) { return get(this, key, false) } pop () { const node = this[LRU_LIST].tail if (!node) return null del(this, node) return node.value } del (key) { del(this, this[CACHE].get(key)) } load (arr) { // reset the cache this.reset() const now = Date.now() // A previous serialized cache has the most recent items first for (let l = arr.length - 1; l >= 0; l--) { const hit = arr[l] const expiresAt = hit.e || 0 if (expiresAt === 0) // the item was created without expiration in a non aged cache this.set(hit.k, hit.v) else { const maxAge = expiresAt - now // dont add already expired items if (maxAge > 0) { this.set(hit.k, hit.v, maxAge) } } } } prune () { this[CACHE].forEach((value, key) => get(this, key, false)) } } const get = (self, key, doUse) => { const node = self[CACHE].get(key) if (node) { const hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) return undefined } else { if (doUse) { if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now() self[LRU_LIST].unshiftNode(node) } } return hit.value } } const isStale = (self, hit) => { if (!hit || (!hit.maxAge && !self[MAX_AGE])) return false const diff = Date.now() - hit.now return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && (diff > self[MAX_AGE]) } const trim = self => { if (self[LENGTH] > self[MAX]) { for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) { // We know that we're about to delete this one, and also // what the next least recently used key will be, so just // go ahead and set it now. const prev = walker.prev del(self, walker) walker = prev } } } const del = (self, node) => { if (node) { const hit = node.value if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value) self[LENGTH] -= hit.length self[CACHE].delete(hit.key) self[LRU_LIST].removeNode(node) } } class Entry { constructor (key, value, length, now, maxAge) { this.key = key this.value = value this.length = length this.now = now this.maxAge = maxAge || 0 } } const forEachStep = (self, fn, node, thisp) => { let hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) hit = undefined } if (hit) fn.call(thisp, hit.value, hit.key, self) } module.exports = LRUCache /***/ }), /***/ 71378: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency class Comparator { static get ANY () { return ANY } constructor (comp, options) { options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } parse (comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const m = comp.match(r) if (!m) { throw new TypeError(`Invalid comparator: ${comp}`) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } toString () { return this.value } test (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } intersects (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (this.operator === '') { if (this.value === '') { return true } return new Range(comp.value, options).test(this.value) } else if (comp.operator === '') { if (comp.value === '') { return true } return new Range(this.value, options).test(comp.semver) } options = parseOptions(options) // Special cases where nothing can possibly be lower if (options.includePrerelease && (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { return false } if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { return false } // Same direction increasing (> or >=) if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { return true } // Same direction decreasing (< or <=) if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { return true } // same SemVer and both sides are inclusive (<= or >=) if ( (this.semver.version === comp.semver.version) && this.operator.includes('=') && comp.operator.includes('=')) { return true } // opposite directions less than if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) { return true } // opposite directions greater than if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) { return true } return false } } module.exports = Comparator const parseOptions = __webpack_require__(95659) const { safeRe: re, t } = __webpack_require__(5824) const cmp = __webpack_require__(91527) const debug = __webpack_require__(95230) const SemVer = __webpack_require__(32703) const Range = __webpack_require__(47663) /***/ }), /***/ 47663: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // hoisted class for cyclic dependency class Range { constructor (range, options) { options = parseOptions(options) if (range instanceof Range) { if ( range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value this.set = [[range]] this.format() return this } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First reduce all whitespace as much as possible so we do not have to rely // on potentially slow regexes like \s*. This is then stored and used for // future error messages as well. this.raw = range .trim() .split(/\s+/) .join(' ') // First, split on || this.set = this.raw .split('||') // map the range to a 2d array of comparators .map(r => this.parseRange(r.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${this.raw}`) } // if we have any that are not the null set, throw out null sets. if (this.set.length > 1) { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) if (this.set.length === 0) { this.set = [first] } else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c] break } } } } this.format() } format () { this.range = this.set .map((comps) => comps.join(' ').trim()) .join('||') .trim() return this.range } toString () { return this.range } parseRange (range) { // memoize range parsing for performance. // this is a very hot path, and fully deterministic. const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE) const memoKey = memoOpts + ':' + range const cached = cache.get(memoKey) if (cached) { return cached } const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) debug('tilde trim', range) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) debug('caret trim', range) // At this point, the range is completely trimmed and // ready to be split into comparators. let rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) if (loose) { // in loose mode, throw out any that are not valid comparators rangeList = rangeList.filter(comp => { debug('loose invalid filter', comp, this.options) return !!comp.match(re[t.COMPARATORLOOSE]) }) } debug('range list', rangeList) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once const rangeMap = new Map() const comparators = rangeList.map(comp => new Comparator(comp, this.options)) for (const comp of comparators) { if (isNullSet(comp)) { return [comp] } rangeMap.set(comp.value, comp) } if (rangeMap.size > 1 && rangeMap.has('')) { rangeMap.delete('') } const result = [...rangeMap.values()] cache.set(memoKey, result) return result } intersects (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some((thisComparators) => { return ( isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return ( isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // if ANY of the sets match ALL of its comparators, then pass test (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } } module.exports = Range const LRU = __webpack_require__(40162) const cache = new LRU({ max: 1000 }) const parseOptions = __webpack_require__(95659) const Comparator = __webpack_require__(71378) const debug = __webpack_require__(95230) const SemVer = __webpack_require__(32703) const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace, } = __webpack_require__(5824) const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __webpack_require__(76448) const isNullSet = c => c.value === '<0.0.0-0' const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options) => { let result = true const remainingComparators = comparators.slice() let testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 // ~0.0.1 --> >=0.0.1 <0.1.0-0 const replaceTildes = (comp, options) => { return comp .trim() .split(/\s+/) .map((c) => replaceTilde(c, options)) .join(' ') } const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, (_, M, m, p, pr) => { debug('tilde', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0` } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` } else if (pr) { debug('replaceTilde pr', pr) ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p } <${M}.${+m + 1}.0-0` } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 // ^0.0.1 --> >=0.0.1 <0.0.2-0 // ^0.1.0 --> >=0.1.0 <0.2.0-0 const replaceCarets = (comp, options) => { return comp .trim() .split(/\s+/) .map((c) => replaceCaret(c, options)) .join(' ') } const replaceCaret = (comp, options) => { debug('caret', comp, options) const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] const z = options.includePrerelease ? '-0' : '' return comp.replace(r, (_, M, m, p, pr) => { debug('caret', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr } <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p}-${pr } <${+M + 1}.0.0-0` } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p }${z} <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p }${z} <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p } <${+M + 1}.0.0-0` } } debug('caret return', ret) return ret }) } const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) return comp .split(/\s+/) .map((c) => replaceXRange(c, options)) .join(' ') } const replaceXRange = (comp, options) => { comp = comp.trim() const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug('xRange', comp, ret, gtlt, M, m, p, pr) const xM = isX(M) const xm = xM || isX(m) const xp = xm || isX(p) const anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } if (gtlt === '<') { pr = '-0' } ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` } else if (xp) { ret = `>=${M}.${m}.0${pr } <${M}.${+m + 1}.0-0` } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp .trim() .replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) return comp .trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = '' } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}` } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` } else if (fpr) { from = `>=${from}` } else { from = `>=${from}${incPr ? '-0' : ''}` } if (isX(tM)) { to = '' } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0` } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0` } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}` } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0` } else { to = `<=${to}` } return `${from} ${to}`.trim() } const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (let i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === Comparator.ANY) { continue } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } /***/ }), /***/ 32703: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const debug = __webpack_require__(95230) const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(76448) const { safeRe: re, t } = __webpack_require__(5824) const parseOptions = __webpack_require__(95659) const { compareIdentifiers } = __webpack_require__(59187) class SemVer { constructor (version, options) { options = parseOptions(options) if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError(`Invalid Version: ${version}`) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } format () { this.version = `${this.major}.${this.minor}.${this.patch}` if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}` } return this.version } toString () { return this.version } compare (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0 } other = new SemVer(other, this.options) } if (other.version === this.version) { return 0 } return this.compareMain(other) || this.comparePre(other) } compareMain (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return ( compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) ) } comparePre (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } let i = 0 do { const a = this.prerelease[i] const b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } compareBuild (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } let i = 0 do { const a = this.build[i] const b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc (release, identifier, identifierBase) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier, identifierBase) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier, identifierBase) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier, identifierBase) this.inc('pre', identifier, identifierBase) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier, identifierBase) } this.inc('pre', identifier, identifierBase) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': { const base = Number(identifierBase) ? 1 : 0 if (!identifier && identifierBase === false) { throw new Error('invalid increment argument: identifier is empty') } if (this.prerelease.length === 0) { this.prerelease = [base] } else { let i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything if (identifier === this.prerelease.join('.') && identifierBase === false) { throw new Error('invalid increment argument: identifier already exists') } this.prerelease.push(base) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 let prerelease = [identifier, base] if (identifierBase === false) { prerelease = [identifier] } if (compareIdentifiers(this.prerelease[0], identifier) === 0) { if (isNaN(this.prerelease[1])) { this.prerelease = prerelease } } else { this.prerelease = prerelease } } break } default: throw new Error(`invalid increment argument: ${release}`) } this.raw = this.format() if (this.build.length) { this.raw += `+${this.build.join('.')}` } return this } } module.exports = SemVer /***/ }), /***/ 38524: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(38978) const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } module.exports = clean /***/ }), /***/ 91527: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const eq = __webpack_require__(45615) const neq = __webpack_require__(21066) const gt = __webpack_require__(17642) const gte = __webpack_require__(28224) const lt = __webpack_require__(23463) const lte = __webpack_require__(60707) const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') { a = a.version } if (typeof b === 'object') { b = b.version } return a === b case '!==': if (typeof a === 'object') { a = a.version } if (typeof b === 'object') { b = b.version } return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp /***/ }), /***/ 60817: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const parse = __webpack_require__(38978) const { safeRe: re, t } = __webpack_require__(5824) const coerce = (version, options) => { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} let match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. let next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) { return null } return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } module.exports = coerce /***/ }), /***/ 57678: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } module.exports = compareBuild /***/ }), /***/ 65509: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose /***/ }), /***/ 29407: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) module.exports = compare /***/ }), /***/ 87902: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(38978) const diff = (version1, version2) => { const v1 = parse(version1, null, true) const v2 = parse(version2, null, true) const comparison = v1.compare(v2) if (comparison === 0) { return null } const v1Higher = comparison > 0 const highVersion = v1Higher ? v1 : v2 const lowVersion = v1Higher ? v2 : v1 const highHasPre = !!highVersion.prerelease.length const lowHasPre = !!lowVersion.prerelease.length if (lowHasPre && !highHasPre) { // Going from prerelease -> no prerelease requires some special casing // If the low version has only a major, then it will always be a major // Some examples: // 1.0.0-1 -> 1.0.0 // 1.0.0-1 -> 1.1.1 // 1.0.0-1 -> 2.0.0 if (!lowVersion.patch && !lowVersion.minor) { return 'major' } // Otherwise it can be determined by checking the high version if (highVersion.patch) { // anything higher than a patch bump would result in the wrong version return 'patch' } if (highVersion.minor) { // anything higher than a minor bump would result in the wrong version return 'minor' } // bumping major/minor/patch all have same result return 'major' } // add the `pre` prefix if we are going to a prerelease version const prefix = highHasPre ? 'pre' : '' if (v1.major !== v2.major) { return prefix + 'major' } if (v1.minor !== v2.minor) { return prefix + 'minor' } if (v1.patch !== v2.patch) { return prefix + 'patch' } // high and low are preleases return 'prerelease' } module.exports = diff /***/ }), /***/ 45615: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq /***/ }), /***/ 17642: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt /***/ }), /***/ 28224: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte /***/ }), /***/ 52493: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const inc = (version, release, options, identifier, identifierBase) => { if (typeof (options) === 'string') { identifierBase = identifier identifier = options options = undefined } try { return new SemVer( version instanceof SemVer ? version.version : version, options ).inc(release, identifier, identifierBase).version } catch (er) { return null } } module.exports = inc /***/ }), /***/ 23463: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt /***/ }), /***/ 60707: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte /***/ }), /***/ 49777: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const major = (a, loose) => new SemVer(a, loose).major module.exports = major /***/ }), /***/ 16474: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor /***/ }), /***/ 21066: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq /***/ }), /***/ 38978: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const parse = (version, options, throwErrors = false) => { if (version instanceof SemVer) { return version } try { return new SemVer(version, options) } catch (er) { if (!throwErrors) { return null } throw er } } module.exports = parse /***/ }), /***/ 6368: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch /***/ }), /***/ 76714: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(38978) const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } module.exports = prerelease /***/ }), /***/ 95409: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(29407) const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare /***/ }), /***/ 74514: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(57678) const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort /***/ }), /***/ 26643: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(47663) const satisfies = (version, range, options) => { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } module.exports = satisfies /***/ }), /***/ 67486: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(57678) const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort /***/ }), /***/ 17664: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(38978) const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null } module.exports = valid /***/ }), /***/ 81833: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // just pre-load all the stuff that index.js lazily exports const internalRe = __webpack_require__(5824) const constants = __webpack_require__(76448) const SemVer = __webpack_require__(32703) const identifiers = __webpack_require__(59187) const parse = __webpack_require__(38978) const valid = __webpack_require__(17664) const clean = __webpack_require__(38524) const inc = __webpack_require__(52493) const diff = __webpack_require__(87902) const major = __webpack_require__(49777) const minor = __webpack_require__(16474) const patch = __webpack_require__(6368) const prerelease = __webpack_require__(76714) const compare = __webpack_require__(29407) const rcompare = __webpack_require__(95409) const compareLoose = __webpack_require__(65509) const compareBuild = __webpack_require__(57678) const sort = __webpack_require__(67486) const rsort = __webpack_require__(74514) const gt = __webpack_require__(17642) const lt = __webpack_require__(23463) const eq = __webpack_require__(45615) const neq = __webpack_require__(21066) const gte = __webpack_require__(28224) const lte = __webpack_require__(60707) const cmp = __webpack_require__(91527) const coerce = __webpack_require__(60817) const Comparator = __webpack_require__(71378) const Range = __webpack_require__(47663) const satisfies = __webpack_require__(26643) const toComparators = __webpack_require__(24105) const maxSatisfying = __webpack_require__(84341) const minSatisfying = __webpack_require__(98395) const minVersion = __webpack_require__(91498) const validRange = __webpack_require__(18383) const outside = __webpack_require__(89115) const gtr = __webpack_require__(23913) const ltr = __webpack_require__(84646) const intersects = __webpack_require__(67830) const simplifyRange = __webpack_require__(87054) const subset = __webpack_require__(74788) module.exports = { parse, valid, clean, inc, diff, major, minor, patch, prerelease, compare, rcompare, compareLoose, compareBuild, sort, rsort, gt, lt, eq, neq, gte, lte, cmp, coerce, Comparator, Range, satisfies, toComparators, maxSatisfying, minSatisfying, minVersion, validRange, outside, gtr, ltr, intersects, simplifyRange, subset, SemVer, re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, RELEASE_TYPES: constants.RELEASE_TYPES, compareIdentifiers: identifiers.compareIdentifiers, rcompareIdentifiers: identifiers.rcompareIdentifiers, } /***/ }), /***/ 76448: /***/ ((module) => { // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 // Max safe length for a build identifier. The max length minus 6 characters for // the shortest version with a build 0.0.0+BUILD. const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 const RELEASE_TYPES = [ 'major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease', ] module.exports = { MAX_LENGTH, MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_SAFE_INTEGER, RELEASE_TYPES, SEMVER_SPEC_VERSION, FLAG_INCLUDE_PRERELEASE: 0b001, FLAG_LOOSE: 0b010, } /***/ }), /***/ 95230: /***/ ((module) => { const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug /***/ }), /***/ 59187: /***/ ((module) => { const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { const anum = numeric.test(a) const bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, rcompareIdentifiers, } /***/ }), /***/ 95659: /***/ ((module) => { // parse out just the options we care about const looseOption = Object.freeze({ loose: true }) const emptyOpts = Object.freeze({ }) const parseOptions = options => { if (!options) { return emptyOpts } if (typeof options !== 'object') { return looseOption } return options } module.exports = parseOptions /***/ }), /***/ 5824: /***/ ((module, exports, __webpack_require__) => { const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH, } = __webpack_require__(76448) const debug = __webpack_require__(95230) exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] const safeRe = exports.safeRe = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const LETTERDASHNUMBER = '[a-zA-Z0-9-]' // Replace some greedy regex tokens to prevent regex dos issues. These regex are // used internally via the safeRe object since all inputs in this library get // normalized first to trim and collapse all extra whitespace. The original // regexes are exported for userland consumption and lower level usage. A // future breaking change could export the safer regex only with a note that // all input should have extra whitespace removed. const safeRegexReplacements = [ ['\\s', 1], ['\\d', MAX_LENGTH], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], ] const makeSafeRegex = (value) => { for (const [token, max] of safeRegexReplacements) { value = value .split(`${token}*`).join(`${token}{0,${max}}`) .split(`${token}+`).join(`${token}{1,${max}}`) } return value } const createToken = (name, value, isGlobal) => { const safe = makeSafeRegex(value) const index = R++ debug(name, index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIERLOOSE', '\\d+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`) createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] }|${src[t.NONNUMERICIDENTIFIER]})`) createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] }|${src[t.NONNUMERICIDENTIFIER]})`) // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] }(?:\\.${src[t.BUILDIDENTIFIER]})*))`) // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION] }${src[t.PRERELEASE]}?${ src[t.BUILD]}?`) createToken('FULL', `^${src[t.FULLPLAIN]}$`) // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] }${src[t.PRERELEASELOOSE]}?${ src[t.BUILD]}?`) createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) createToken('GTLT', '((?:<|>)?=?)') // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCE', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)') createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) exports.tildeTrimReplace = '$1~' createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)') createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) exports.caretTrimReplace = '$1^' createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) exports.comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`) // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') /***/ }), /***/ 23913: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Determine if version is greater than all the versions possible in the range. const outside = __webpack_require__(89115) const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr /***/ }), /***/ 67830: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(47663) const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2, options) } module.exports = intersects /***/ }), /***/ 84646: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const outside = __webpack_require__(89115) // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr /***/ }), /***/ 84341: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const Range = __webpack_require__(47663) const maxSatisfying = (versions, range, options) => { let max = null let maxSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } module.exports = maxSatisfying /***/ }), /***/ 98395: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const Range = __webpack_require__(47663) const minSatisfying = (versions, range, options) => { let min = null let minSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } module.exports = minSatisfying /***/ }), /***/ 91498: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const Range = __webpack_require__(47663) const gt = __webpack_require__(17642) const minVersion = (range, loose) => { range = new Range(range, loose) let minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!setMin || gt(compver, setMin)) { setMin = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`) } }) if (setMin && (!minver || gt(minver, setMin))) { minver = setMin } } if (minver && range.test(minver)) { return minver } return null } module.exports = minVersion /***/ }), /***/ 89115: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(32703) const Comparator = __webpack_require__(71378) const { ANY } = Comparator const Range = __webpack_require__(47663) const satisfies = __webpack_require__(26643) const gt = __webpack_require__(17642) const lt = __webpack_require__(23463) const lte = __webpack_require__(60707) const gte = __webpack_require__(28224) const outside = (version, range, hilo, options) => { version = new SemVer(version, options) range = new Range(range, options) let gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let high = null let low = null comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } module.exports = outside /***/ }), /***/ 87054: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = __webpack_require__(26643) const compare = __webpack_require__(29407) module.exports = (versions, range, options) => { const set = [] let first = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version if (!first) { first = version } } else { if (prev) { set.push([first, prev]) } prev = null first = null } } if (first) { set.push([first, null]) } const ranges = [] for (const [min, max] of set) { if (min === max) { ranges.push(min) } else if (!max && min === v[0]) { ranges.push('*') } else if (!max) { ranges.push(`>=${min}`) } else if (min === v[0]) { ranges.push(`<=${max}`) } else { ranges.push(`${min} - ${max}`) } } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) return simplified.length < original.length ? simplified : range } /***/ }), /***/ 74788: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(47663) const Comparator = __webpack_require__(71378) const { ANY } = Comparator const satisfies = __webpack_require__(26643) const compare = __webpack_require__(29407) // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a null set, OR // - Every simple range `r1, r2, ...` which is not a null set is a subset of // some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else if in prerelease mode, return false // - else replace c with `[>=0.0.0]` // - If C is only the ANY comparator // - if in prerelease mode, return true // - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true const subset = (sub, dom, options = {}) => { if (sub === dom) { return true } sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null if (isSub) { continue OUTER } } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) { return false } } return true } const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] const minimumVersion = [new Comparator('>=0.0.0')] const simpleSubset = (sub, dom, options) => { if (sub === dom) { return true } if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) { return true } else if (options.includePrerelease) { sub = minimumVersionWithPreRelease } else { sub = minimumVersion } } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) { return true } else { dom = minimumVersion } } const eqSet = new Set() let gt, lt for (const c of sub) { if (c.operator === '>' || c.operator === '>=') { gt = higherGT(gt, c, options) } else if (c.operator === '<' || c.operator === '<=') { lt = lowerLT(lt, c, options) } else { eqSet.add(c.semver) } } if (eqSet.size > 1) { return null } let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) if (gtltComp > 0) { return null } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { return null } } // will iterate one or zero times for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) { return null } if (lt && !satisfies(eq, String(lt), options)) { return null } for (const c of dom) { if (!satisfies(eq, String(c), options)) { return false } } return true } let higher, lower let hasDomLT, hasDomGT // if the subset has a prerelease, we need a comparator in the superset // with the same tuple and a prerelease, or it's not a subset let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false // exception: <1.2.3-0 is the same as <1.2.3 if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false } for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false } } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c && higher !== gt) { return false } } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { return false } } if (lt) { if (needDomLTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { needDomLTPre = false } } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c && lower !== lt) { return false } } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { return false } } if (!c.operator && (lt || gt) && gtltComp !== 0) { return false } } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) { return false } if (lt && hasDomGT && !gt && gtltComp !== 0) { return false } // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple if (needDomGTPre || needDomLTPre) { return false } return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { if (!a) { return b } const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a } // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { if (!a) { return b } const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a } module.exports = subset /***/ }), /***/ 24105: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(47663) // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) module.exports = toComparators /***/ }), /***/ 18383: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(47663) const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } module.exports = validRange /***/ }), /***/ 39846: /***/ ((module) => { "use strict"; module.exports = function (Yallist) { Yallist.prototype[Symbol.iterator] = function* () { for (let walker = this.head; walker; walker = walker.next) { yield walker.value } } } /***/ }), /***/ 68981: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Yallist Yallist.Node = Node Yallist.create = Yallist function Yallist (list) { var self = this if (!(self instanceof Yallist)) { self = new Yallist() } self.tail = null self.head = null self.length = 0 if (list && typeof list.forEach === 'function') { list.forEach(function (item) { self.push(item) }) } else if (arguments.length > 0) { for (var i = 0, l = arguments.length; i < l; i++) { self.push(arguments[i]) } } return self } Yallist.prototype.removeNode = function (node) { if (node.list !== this) { throw new Error('removing node which does not belong to this list') } var next = node.next var prev = node.prev if (next) { next.prev = prev } if (prev) { prev.next = next } if (node === this.head) { this.head = next } if (node === this.tail) { this.tail = prev } node.list.length-- node.next = null node.prev = null node.list = null return next } Yallist.prototype.unshiftNode = function (node) { if (node === this.head) { return } if (node.list) { node.list.removeNode(node) } var head = this.head node.list = this node.next = head if (head) { head.prev = node } this.head = node if (!this.tail) { this.tail = node } this.length++ } Yallist.prototype.pushNode = function (node) { if (node === this.tail) { return } if (node.list) { node.list.removeNode(node) } var tail = this.tail node.list = this node.prev = tail if (tail) { tail.next = node } this.tail = node if (!this.head) { this.head = node } this.length++ } Yallist.prototype.push = function () { for (var i = 0, l = arguments.length; i < l; i++) { push(this, arguments[i]) } return this.length } Yallist.prototype.unshift = function () { for (var i = 0, l = arguments.length; i < l; i++) { unshift(this, arguments[i]) } return this.length } Yallist.prototype.pop = function () { if (!this.tail) { return undefined } var res = this.tail.value this.tail = this.tail.prev if (this.tail) { this.tail.next = null } else { this.head = null } this.length-- return res } Yallist.prototype.shift = function () { if (!this.head) { return undefined } var res = this.head.value this.head = this.head.next if (this.head) { this.head.prev = null } else { this.tail = null } this.length-- return res } Yallist.prototype.forEach = function (fn, thisp) { thisp = thisp || this for (var walker = this.head, i = 0; walker !== null; i++) { fn.call(thisp, walker.value, i, this) walker = walker.next } } Yallist.prototype.forEachReverse = function (fn, thisp) { thisp = thisp || this for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { fn.call(thisp, walker.value, i, this) walker = walker.prev } } Yallist.prototype.get = function (n) { for (var i = 0, walker = this.head; walker !== null && i < n; i++) { // abort out of the list early if we hit a cycle walker = walker.next } if (i === n && walker !== null) { return walker.value } } Yallist.prototype.getReverse = function (n) { for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { // abort out of the list early if we hit a cycle walker = walker.prev } if (i === n && walker !== null) { return walker.value } } Yallist.prototype.map = function (fn, thisp) { thisp = thisp || this var res = new Yallist() for (var walker = this.head; walker !== null;) { res.push(fn.call(thisp, walker.value, this)) walker = walker.next } return res } Yallist.prototype.mapReverse = function (fn, thisp) { thisp = thisp || this var res = new Yallist() for (var walker = this.tail; walker !== null;) { res.push(fn.call(thisp, walker.value, this)) walker = walker.prev } return res } Yallist.prototype.reduce = function (fn, initial) { var acc var walker = this.head if (arguments.length > 1) { acc = initial } else if (this.head) { walker = this.head.next acc = this.head.value } else { throw new TypeError('Reduce of empty list with no initial value') } for (var i = 0; walker !== null; i++) { acc = fn(acc, walker.value, i) walker = walker.next } return acc } Yallist.prototype.reduceReverse = function (fn, initial) { var acc var walker = this.tail if (arguments.length > 1) { acc = initial } else if (this.tail) { walker = this.tail.prev acc = this.tail.value } else { throw new TypeError('Reduce of empty list with no initial value') } for (var i = this.length - 1; walker !== null; i--) { acc = fn(acc, walker.value, i) walker = walker.prev } return acc } Yallist.prototype.toArray = function () { var arr = new Array(this.length) for (var i = 0, walker = this.head; walker !== null; i++) { arr[i] = walker.value walker = walker.next } return arr } Yallist.prototype.toArrayReverse = function () { var arr = new Array(this.length) for (var i = 0, walker = this.tail; walker !== null; i++) { arr[i] = walker.value walker = walker.prev } return arr } Yallist.prototype.slice = function (from, to) { to = to || this.length if (to < 0) { to += this.length } from = from || 0 if (from < 0) { from += this.length } var ret = new Yallist() if (to < from || to < 0) { return ret } if (from < 0) { from = 0 } if (to > this.length) { to = this.length } for (var i = 0, walker = this.head; walker !== null && i < from; i++) { walker = walker.next } for (; walker !== null && i < to; i++, walker = walker.next) { ret.push(walker.value) } return ret } Yallist.prototype.sliceReverse = function (from, to) { to = to || this.length if (to < 0) { to += this.length } from = from || 0 if (from < 0) { from += this.length } var ret = new Yallist() if (to < from || to < 0) { return ret } if (from < 0) { from = 0 } if (to > this.length) { to = this.length } for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { walker = walker.prev } for (; walker !== null && i > from; i--, walker = walker.prev) { ret.push(walker.value) } return ret } Yallist.prototype.splice = function (start, deleteCount, ...nodes) { if (start > this.length) { start = this.length - 1 } if (start < 0) { start = this.length + start; } for (var i = 0, walker = this.head; walker !== null && i < start; i++) { walker = walker.next } var ret = [] for (var i = 0; walker && i < deleteCount; i++) { ret.push(walker.value) walker = this.removeNode(walker) } if (walker === null) { walker = this.tail } if (walker !== this.head && walker !== this.tail) { walker = walker.prev } for (var i = 0; i < nodes.length; i++) { walker = insert(this, walker, nodes[i]) } return ret; } Yallist.prototype.reverse = function () { var head = this.head var tail = this.tail for (var walker = head; walker !== null; walker = walker.prev) { var p = walker.prev walker.prev = walker.next walker.next = p } this.head = tail this.tail = head return this } function insert (self, node, value) { var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self) if (inserted.next === null) { self.tail = inserted } if (inserted.prev === null) { self.head = inserted } self.length++ return inserted } function push (self, item) { self.tail = new Node(item, self.tail, null, self) if (!self.head) { self.head = self.tail } self.length++ } function unshift (self, item) { self.head = new Node(item, null, self.head, self) if (!self.tail) { self.tail = self.head } self.length++ } function Node (value, prev, next, list) { if (!(this instanceof Node)) { return new Node(value, prev, next, list) } this.list = list this.value = value if (prev) { prev.next = this this.prev = prev } else { this.prev = null } if (next) { next.prev = this this.next = next } else { this.next = null } } try { // add if support for Symbol.iterator is present __webpack_require__(39846)(Yallist) } catch (er) {} /***/ }), /***/ 76553: /***/ ((module) => { "use strict"; module.exports = global; /***/ }), /***/ 82503: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var defineProperties = __webpack_require__(4289); var implementation = __webpack_require__(76553); var getPolyfill = __webpack_require__(52168); var shim = __webpack_require__(99471); var polyfill = getPolyfill(); var getGlobal = function () { return polyfill; }; defineProperties(getGlobal, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = getGlobal; /***/ }), /***/ 52168: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var implementation = __webpack_require__(76553); module.exports = function getPolyfill() { if (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) { return implementation; } return global; }; /***/ }), /***/ 99471: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var define = __webpack_require__(4289); var getPolyfill = __webpack_require__(52168); module.exports = function shimGlobal() { var polyfill = getPolyfill(); if (define.supportsDescriptors) { var descriptor = Object.getOwnPropertyDescriptor(polyfill, 'globalThis'); if (!descriptor || (descriptor.configurable && (descriptor.enumerable || descriptor.writable || globalThis !== polyfill))) { // eslint-disable-line max-len Object.defineProperty(polyfill, 'globalThis', { configurable: true, enumerable: false, value: polyfill, writable: false }); } } else if (typeof globalThis !== 'object' || globalThis !== polyfill) { polyfill.globalThis = polyfill; } return polyfill; }; /***/ }), /***/ 66458: /***/ ((module) => { "use strict"; module.exports = clone var getPrototypeOf = Object.getPrototypeOf || function (obj) { return obj.__proto__ } function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) }) return copy } /***/ }), /***/ 20077: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(57147) var polyfills = __webpack_require__(72161) var legacy = __webpack_require__(78520) var clone = __webpack_require__(66458) var util = __webpack_require__(73837) /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue var previousSymbol /* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { gracefulQueue = Symbol.for('graceful-fs.queue') // This is used in testing by future versions previousSymbol = Symbol.for('graceful-fs.previous') } else { gracefulQueue = '___graceful-fs.queue' previousSymbol = '___graceful-fs.previous' } function noop () {} function publishQueue(context, queue) { Object.defineProperty(context, gracefulQueue, { get: function() { return queue } }) } var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug = function() { var m = util.format.apply(util, arguments) m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') console.error(m) } // Once time initialization if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances var queue = global[gracefulQueue] || [] publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. fs.close = (function (fs$close) { function close (fd, cb) { return fs$close.call(fs, fd, function (err) { // This function uses the graceful-fs shared queue if (!err) { resetQueue() } if (typeof cb === 'function') cb.apply(this, arguments) }) } Object.defineProperty(close, previousSymbol, { value: fs$close }) return close })(fs.close) fs.closeSync = (function (fs$closeSync) { function closeSync (fd) { // This function uses the graceful-fs shared queue fs$closeSync.apply(fs, arguments) resetQueue() } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }) return closeSync })(fs.closeSync) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) __webpack_require__(39491).equal(fs[gracefulQueue].length, 0) }) } } if (!global[gracefulQueue]) { publishQueue(global, fs[gracefulQueue]); } module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) fs.__patched = true; } function patch (fs) { // Everything that references the open() function needs to be in here polyfills(fs) fs.gracefulify = patch fs.createReadStream = createReadStream fs.createWriteStream = createWriteStream var fs$readFile = fs.readFile fs.readFile = readFile function readFile (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readFile(path, options, cb) function go$readFile (path, options, cb, startTime) { return fs$readFile(path, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$writeFile = fs.writeFile fs.writeFile = writeFile function writeFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$writeFile(path, data, options, cb) function go$writeFile (path, data, options, cb, startTime) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$appendFile = fs.appendFile if (fs$appendFile) fs.appendFile = appendFile function appendFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$appendFile(path, data, options, cb) function go$appendFile (path, data, options, cb, startTime) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$copyFile = fs.copyFile if (fs$copyFile) fs.copyFile = copyFile function copyFile (src, dest, flags, cb) { if (typeof flags === 'function') { cb = flags flags = 0 } return go$copyFile(src, dest, flags, cb) function go$copyFile (src, dest, flags, cb, startTime) { return fs$copyFile(src, dest, flags, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$readdir = fs.readdir fs.readdir = readdir var noReaddirOptionVersions = /^v[0-5]\./ function readdir (path, options, cb) { if (typeof options === 'function') cb = options, options = null var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir (path, options, cb, startTime) { return fs$readdir(path, fs$readdirCallback( path, options, cb, startTime )) } : function go$readdir (path, options, cb, startTime) { return fs$readdir(path, options, fs$readdirCallback( path, options, cb, startTime )) } return go$readdir(path, options, cb) function fs$readdirCallback (path, options, cb, startTime) { return function (err, files) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now() ]) else { if (files && files.sort) files.sort() if (typeof cb === 'function') cb.call(this, err, files) } } } } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) ReadStream = legStreams.ReadStream WriteStream = legStreams.WriteStream } var fs$ReadStream = fs.ReadStream if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype) ReadStream.prototype.open = ReadStream$open } var fs$WriteStream = fs.WriteStream if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype) WriteStream.prototype.open = WriteStream$open } Object.defineProperty(fs, 'ReadStream', { get: function () { return ReadStream }, set: function (val) { ReadStream = val }, enumerable: true, configurable: true }) Object.defineProperty(fs, 'WriteStream', { get: function () { return WriteStream }, set: function (val) { WriteStream = val }, enumerable: true, configurable: true }) // legacy names var FileReadStream = ReadStream Object.defineProperty(fs, 'FileReadStream', { get: function () { return FileReadStream }, set: function (val) { FileReadStream = val }, enumerable: true, configurable: true }) var FileWriteStream = WriteStream Object.defineProperty(fs, 'FileWriteStream', { get: function () { return FileWriteStream }, set: function (val) { FileWriteStream = val }, enumerable: true, configurable: true }) function ReadStream (path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this else return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } function ReadStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { if (that.autoClose) that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) that.read() } }) } function WriteStream (path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this else return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } function WriteStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) } }) } function createReadStream (path, options) { return new fs.ReadStream(path, options) } function createWriteStream (path, options) { return new fs.WriteStream(path, options) } var fs$open = fs.open fs.open = open function open (path, flags, mode, cb) { if (typeof mode === 'function') cb = mode, mode = null return go$open(path, flags, mode, cb) function go$open (path, flags, mode, cb, startTime) { return fs$open(path, flags, mode, function (err, fd) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } return fs } function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) fs[gracefulQueue].push(elem) retry() } // keep track of the timeout between retry() calls var retryTimer // reset the startTime and lastTime to now // this resets the start of the 60 second overall timeout as well as the // delay between attempts so that we'll retry these jobs sooner function resetQueue () { var now = Date.now() for (var i = 0; i < fs[gracefulQueue].length; ++i) { // entries that are only a length of 2 are from an older version, don't // bother modifying those since they'll be retried anyway. if (fs[gracefulQueue][i].length > 2) { fs[gracefulQueue][i][3] = now // startTime fs[gracefulQueue][i][4] = now // lastTime } } // call retry to make sure we're actively processing the queue retry() } function retry () { // clear the timer and remove it to help prevent unintended concurrency clearTimeout(retryTimer) retryTimer = undefined if (fs[gracefulQueue].length === 0) return var elem = fs[gracefulQueue].shift() var fn = elem[0] var args = elem[1] // these items may be unset if they were added by an older graceful-fs var err = elem[2] var startTime = elem[3] var lastTime = elem[4] // if we don't have a startTime we have no way of knowing if we've waited // long enough, so go ahead and retry this item now if (startTime === undefined) { debug('RETRY', fn.name, args) fn.apply(null, args) } else if (Date.now() - startTime >= 60000) { // it's been more than 60 seconds total, bail now debug('TIMEOUT', fn.name, args) var cb = args.pop() if (typeof cb === 'function') cb.call(null, err) } else { // the amount of time between the last attempt and right now var sinceAttempt = Date.now() - lastTime // the amount of time between when we first tried, and when we last tried // rounded up to at least 1 var sinceStart = Math.max(lastTime - startTime, 1) // backoff. wait longer than the total time we've been retrying, but only // up to a maximum of 100ms var desiredDelay = Math.min(sinceStart * 1.2, 100) // it's been long enough since the last retry, do it again if (sinceAttempt >= desiredDelay) { debug('RETRY', fn.name, args) fn.apply(null, args.concat([startTime])) } else { // if we can't do this job yet, push it to the end of the queue // and let the next iteration check again fs[gracefulQueue].push(elem) } } // schedule our next run if one isn't already scheduled if (retryTimer === undefined) { retryTimer = setTimeout(retry, 0) } } /***/ }), /***/ 78520: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Stream = __webpack_require__(12781).Stream module.exports = legacy function legacy (fs) { return { ReadStream: ReadStream, WriteStream: WriteStream } function ReadStream (path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.mode = 438; /*=0666*/ this.bufferSize = 64 * 1024; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.end === undefined) { this.end = Infinity; } else if ('number' !== typeof this.end) { throw TypeError('end must be a Number'); } if (this.start > this.end) { throw new Error('start must be <= end'); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs.open(this.path, this.flags, this.mode, function (err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); self._read(); }) } function WriteStream (path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 438; /*=0666*/ this.bytesWritten = 0; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.start < 0) { throw new Error('start must be >= zero'); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); this.flush(); } } } /***/ }), /***/ 72161: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var constants = __webpack_require__(22057) var origCwd = process.cwd var cwd = null var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform process.cwd = function() { if (!cwd) cwd = origCwd.call(process) return cwd } try { process.cwd() } catch (er) {} // This check is needed until node.js 12 is required if (typeof process.chdir === 'function') { var chdir = process.chdir process.chdir = function (d) { cwd = null chdir.call(process, d) } if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) } module.exports = patch function patch (fs) { // (re-)implement some things that are known busted or missing. // lchmod, broken prior to 0.6.2 // back-port the fix here. if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs) } // lutimes implementation, or no-op if (!fs.lutimes) { patchLutimes(fs) } // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. // It should not fail on enosys ever, as this just indicates // that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) fs.chmod = chmodFix(fs.chmod) fs.fchmod = chmodFix(fs.fchmod) fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) fs.chmodSync = chmodFixSync(fs.chmodSync) fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) fs.stat = statFix(fs.stat) fs.fstat = statFix(fs.fstat) fs.lstat = statFix(fs.lstat) fs.statSync = statFixSync(fs.statSync) fs.fstatSync = statFixSync(fs.fstatSync) fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops if (fs.chmod && !fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (fs.chown && !fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly // created files. Try again on failure, for up to 60 seconds. // Set the timeout this long because some Windows Anti-Virus, such as Parity // bit9, may lock files for up to a minute, causing npm package install // failures. Also, take care to yield the scheduler. Windows scheduling gives // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { fs.rename = typeof fs.rename !== 'function' ? fs.rename : (function (fs$rename) { function rename (from, to, cb) { var start = Date.now() var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er) }) }, backoff) if (backoff < 100) backoff += 10; return; } if (cb) cb(er) }) } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) return rename })(fs.rename) } // if read() returns EAGAIN, then just try it again. fs.read = typeof fs.read !== 'function' ? fs.read : (function (fs$read) { function read (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { var eagCounter = 0 callback = function (er, _, __) { if (er && er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ return fs$read.call(fs, fd, buffer, offset, length, position, callback) } callback_.apply(this, arguments) } } return fs$read.call(fs, fd, buffer, offset, length, position, callback) } // This ensures `util.promisify` works as it does for native `fs.read`. if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position) } catch (er) { if (er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ continue } throw er } } }})(fs.readSync) function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { if (callback) callback(err || err2) }) }) }) } fs.lchmodSync = function (path, mode) { var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. var threw = true var ret try { ret = fs.fchmodSync(fd, mode) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { if (cb) cb(er) return } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { if (cb) cb(er || er2) }) }) }) } fs.lutimesSync = function (path, at, mt) { var fd = fs.openSync(path, constants.O_SYMLINK) var ret var threw = true try { ret = fs.futimesSync(fd, at, mt) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } else if (fs.futimes) { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } function chmodFix (orig) { if (!orig) return orig return function (target, mode, cb) { return orig.call(fs, target, mode, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chmodFixSync (orig) { if (!orig) return orig return function (target, mode) { try { return orig.call(fs, target, mode) } catch (er) { if (!chownErOk(er)) throw er } } } function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chownFixSync (orig) { if (!orig) return orig return function (target, uid, gid) { try { return orig.call(fs, target, uid, gid) } catch (er) { if (!chownErOk(er)) throw er } } } function statFix (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options, cb) { if (typeof options === 'function') { cb = options options = null } function callback (er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } if (cb) cb.apply(this, arguments) } return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback) } } function statFixSync (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target) if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } return stats; } } // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // // if there's no getuid, or if getuid() is something other // than 0, and the error is EINVAL or EPERM, then just ignore // it. // // This specific case is a silent failure in cp, install, tar, // and most other unix tools that manage permissions. // // When running as root, or if other types of errors are // encountered, then it's strict. function chownErOk (er) { if (!er) return true if (er.code === "ENOSYS") return true var nonroot = !process.getuid || process.getuid() !== 0 if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true } return false } } /***/ }), /***/ 86560: /***/ ((module) => { "use strict"; module.exports = (flag, argv) => { argv = argv || process.argv; const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); const pos = argv.indexOf(prefix + flag); const terminatorPos = argv.indexOf('--'); return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); }; /***/ }), /***/ 7: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({value:true}));exports.SIGNALS=void 0; const SIGNALS=[ { name:"SIGHUP", number:1, action:"terminate", description:"Terminal closed", standard:"posix"}, { name:"SIGINT", number:2, action:"terminate", description:"User interruption with CTRL-C", standard:"ansi"}, { name:"SIGQUIT", number:3, action:"core", description:"User interruption with CTRL-\\", standard:"posix"}, { name:"SIGILL", number:4, action:"core", description:"Invalid machine instruction", standard:"ansi"}, { name:"SIGTRAP", number:5, action:"core", description:"Debugger breakpoint", standard:"posix"}, { name:"SIGABRT", number:6, action:"core", description:"Aborted", standard:"ansi"}, { name:"SIGIOT", number:6, action:"core", description:"Aborted", standard:"bsd"}, { name:"SIGBUS", number:7, action:"core", description: "Bus error due to misaligned, non-existing address or paging error", standard:"bsd"}, { name:"SIGEMT", number:7, action:"terminate", description:"Command should be emulated but is not implemented", standard:"other"}, { name:"SIGFPE", number:8, action:"core", description:"Floating point arithmetic error", standard:"ansi"}, { name:"SIGKILL", number:9, action:"terminate", description:"Forced termination", standard:"posix", forced:true}, { name:"SIGUSR1", number:10, action:"terminate", description:"Application-specific signal", standard:"posix"}, { name:"SIGSEGV", number:11, action:"core", description:"Segmentation fault", standard:"ansi"}, { name:"SIGUSR2", number:12, action:"terminate", description:"Application-specific signal", standard:"posix"}, { name:"SIGPIPE", number:13, action:"terminate", description:"Broken pipe or socket", standard:"posix"}, { name:"SIGALRM", number:14, action:"terminate", description:"Timeout or timer", standard:"posix"}, { name:"SIGTERM", number:15, action:"terminate", description:"Termination", standard:"ansi"}, { name:"SIGSTKFLT", number:16, action:"terminate", description:"Stack is empty or overflowed", standard:"other"}, { name:"SIGCHLD", number:17, action:"ignore", description:"Child process terminated, paused or unpaused", standard:"posix"}, { name:"SIGCLD", number:17, action:"ignore", description:"Child process terminated, paused or unpaused", standard:"other"}, { name:"SIGCONT", number:18, action:"unpause", description:"Unpaused", standard:"posix", forced:true}, { name:"SIGSTOP", number:19, action:"pause", description:"Paused", standard:"posix", forced:true}, { name:"SIGTSTP", number:20, action:"pause", description:"Paused using CTRL-Z or \"suspend\"", standard:"posix"}, { name:"SIGTTIN", number:21, action:"pause", description:"Background process cannot read terminal input", standard:"posix"}, { name:"SIGBREAK", number:21, action:"terminate", description:"User interruption with CTRL-BREAK", standard:"other"}, { name:"SIGTTOU", number:22, action:"pause", description:"Background process cannot write to terminal output", standard:"posix"}, { name:"SIGURG", number:23, action:"ignore", description:"Socket received out-of-band data", standard:"bsd"}, { name:"SIGXCPU", number:24, action:"core", description:"Process timed out", standard:"bsd"}, { name:"SIGXFSZ", number:25, action:"core", description:"File too big", standard:"bsd"}, { name:"SIGVTALRM", number:26, action:"terminate", description:"Timeout or timer", standard:"bsd"}, { name:"SIGPROF", number:27, action:"terminate", description:"Timeout or timer", standard:"bsd"}, { name:"SIGWINCH", number:28, action:"ignore", description:"Terminal window size changed", standard:"bsd"}, { name:"SIGIO", number:29, action:"terminate", description:"I/O is available", standard:"other"}, { name:"SIGPOLL", number:29, action:"terminate", description:"Watched event", standard:"other"}, { name:"SIGINFO", number:29, action:"ignore", description:"Request for process information", standard:"other"}, { name:"SIGPWR", number:30, action:"terminate", description:"Device running out of power", standard:"systemv"}, { name:"SIGSYS", number:31, action:"core", description:"Invalid system call", standard:"other"}, { name:"SIGUNUSED", number:31, action:"terminate", description:"Invalid system call", standard:"other"}];exports.SIGNALS=SIGNALS; //# sourceMappingURL=core.js.map /***/ }), /***/ 97787: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(22037); var _signals=__webpack_require__(48699); var _realtime=__webpack_require__(47603); const getSignalsByName=function(){ const signals=(0,_signals.getSignals)(); return signals.reduce(getSignalByName,{}); }; const getSignalByName=function( signalByNameMemo, {name,number,description,supported,action,forced,standard}) { return{ ...signalByNameMemo, [name]:{name,number,description,supported,action,forced,standard}}; }; const signalsByName=getSignalsByName();exports.signalsByName=signalsByName; const getSignalsByNumber=function(){ const signals=(0,_signals.getSignals)(); const length=_realtime.SIGRTMAX+1; const signalsA=Array.from({length},(value,number)=> getSignalByNumber(number,signals)); return Object.assign({},...signalsA); }; const getSignalByNumber=function(number,signals){ const signal=findSignalByNumber(number,signals); if(signal===undefined){ return{}; } const{name,description,supported,action,forced,standard}=signal; return{ [number]:{ name, number, description, supported, action, forced, standard}}; }; const findSignalByNumber=function(number,signals){ const signal=signals.find(({name})=>_os.constants.signals[name]===number); if(signal!==undefined){ return signal; } return signals.find(signalA=>signalA.number===number); }; const signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumber; //# sourceMappingURL=main.js.map /***/ }), /***/ 47603: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({value:true}));exports.SIGRTMAX=exports.getRealtimeSignals=void 0; const getRealtimeSignals=function(){ const length=SIGRTMAX-SIGRTMIN+1; return Array.from({length},getRealtimeSignal); };exports.getRealtimeSignals=getRealtimeSignals; const getRealtimeSignal=function(value,index){ return{ name:`SIGRT${index+1}`, number:SIGRTMIN+index, action:"terminate", description:"Application-specific signal (realtime)", standard:"posix"}; }; const SIGRTMIN=34; const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; //# sourceMappingURL=realtime.js.map /***/ }), /***/ 48699: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__webpack_require__(22037); var _core=__webpack_require__(7); var _realtime=__webpack_require__(47603); const getSignals=function(){ const realtimeSignals=(0,_realtime.getRealtimeSignals)(); const signals=[..._core.SIGNALS,...realtimeSignals].map(normalizeSignal); return signals; };exports.getSignals=getSignals; const normalizeSignal=function({ name, number:defaultNumber, description, action, forced=false, standard}) { const{ signals:{[name]:constantSignal}}= _os.constants; const supported=constantSignal!==undefined; const number=supported?constantSignal:defaultNumber; return{name,number,description,supported,action,forced,standard}; }; //# sourceMappingURL=signals.js.map /***/ }), /***/ 4269: /***/ ((module) => { /** * @preserve * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) * * @author Jens Taylor * @see http://github.com/homebrewing/brauhaus-diff * @author Gary Court * @see http://github.com/garycourt/murmurhash-js * @author Austin Appleby * @see http://sites.google.com/site/murmurhash/ */ (function(){ var cache; // Call this function without `new` to use the cached object (good for // single-threaded environments), or with `new` to create a new object. // // @param {string} key A UTF-16 or ASCII string // @param {number} seed An optional positive integer // @return {object} A MurmurHash3 object for incremental hashing function MurmurHash3(key, seed) { var m = this instanceof MurmurHash3 ? this : cache; m.reset(seed) if (typeof key === 'string' && key.length > 0) { m.hash(key); } if (m !== this) { return m; } }; // Incrementally add a string to this hash // // @param {string} key A UTF-16 or ASCII string // @return {object} this MurmurHash3.prototype.hash = function(key) { var h1, k1, i, top, len; len = key.length; this.len += len; k1 = this.k1; i = 0; switch (this.rem) { case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; case 3: k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; } this.rem = (len + this.rem) & 3; // & 3 is same as % 4 len -= this.rem; if (len > 0) { h1 = this.h1; while (1) { k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; h1 ^= k1; h1 = (h1 << 13) | (h1 >>> 19); h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; if (i >= len) { break; } k1 = ((key.charCodeAt(i++) & 0xffff)) ^ ((key.charCodeAt(i++) & 0xffff) << 8) ^ ((key.charCodeAt(i++) & 0xffff) << 16); top = key.charCodeAt(i++); k1 ^= ((top & 0xff) << 24) ^ ((top & 0xff00) >> 8); } k1 = 0; switch (this.rem) { case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; case 1: k1 ^= (key.charCodeAt(i) & 0xffff); } this.h1 = h1; } this.k1 = k1; return this; }; // Get the result of this hash // // @return {number} The 32-bit hash MurmurHash3.prototype.result = function() { var k1, h1; k1 = this.k1; h1 = this.h1; if (k1 > 0) { k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; h1 ^= k1; } h1 ^= this.len; h1 ^= h1 >>> 16; h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; h1 ^= h1 >>> 13; h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; h1 ^= h1 >>> 16; return h1 >>> 0; }; // Reset the hash object for reuse // // @param {number} seed An optional positive integer MurmurHash3.prototype.reset = function(seed) { this.h1 = typeof seed === 'number' ? seed : 0; this.rem = this.k1 = this.len = 0; return this; }; // A cached object to use. This can be safely used if you're in a single- // threaded environment, otherwise you need to create new hashes to use. cache = new MurmurHash3(); if (true) { module.exports = MurmurHash3; } else {} }()); /***/ }), /***/ 64290: /***/ ((module) => { "use strict"; module.exports = value => { const type = typeof value; return value !== null && (type === 'object' || type === 'function'); }; /***/ }), /***/ 24970: /***/ ((module) => { "use strict"; const isStream = stream => stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; isStream.writable = stream => isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; isStream.readable = stream => isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; isStream.duplex = stream => isStream.writable(stream) && isStream.readable(stream); isStream.transform = stream => isStream.duplex(stream) && typeof stream._transform === 'function'; module.exports = isStream; /***/ }), /***/ 4501: /***/ ((module) => { module.exports = isTypedArray isTypedArray.strict = isStrictTypedArray isTypedArray.loose = isLooseTypedArray var toString = Object.prototype.toString var names = { '[object Int8Array]': true , '[object Int16Array]': true , '[object Int32Array]': true , '[object Uint8Array]': true , '[object Uint8ClampedArray]': true , '[object Uint16Array]': true , '[object Uint32Array]': true , '[object Float32Array]': true , '[object Float64Array]': true } function isTypedArray(arr) { return ( isStrictTypedArray(arr) || isLooseTypedArray(arr) ) } function isStrictTypedArray(arr) { return ( arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array ) } function isLooseTypedArray(arr) { return names[toString.call(arr)] } /***/ }), /***/ 31959: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(57147) var core if (process.platform === 'win32' || global.TESTING_WINDOWS) { core = __webpack_require__(61429) } else { core = __webpack_require__(44601) } module.exports = isexe isexe.sync = sync function isexe (path, options, cb) { if (typeof options === 'function') { cb = options options = {} } if (!cb) { if (typeof Promise !== 'function') { throw new TypeError('callback not provided') } return new Promise(function (resolve, reject) { isexe(path, options || {}, function (er, is) { if (er) { reject(er) } else { resolve(is) } }) }) } core(path, options || {}, function (er, is) { // ignore EACCES because that just means we aren't allowed to run it if (er) { if (er.code === 'EACCES' || options && options.ignoreErrors) { er = null is = false } } cb(er, is) }) } function sync (path, options) { // my kingdom for a filtered catch try { return core.sync(path, options || {}) } catch (er) { if (options && options.ignoreErrors || er.code === 'EACCES') { return false } else { throw er } } } /***/ }), /***/ 44601: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = isexe isexe.sync = sync var fs = __webpack_require__(57147) function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), options) } function checkStat (stat, options) { return stat.isFile() && checkMode(stat, options) } function checkMode (stat, options) { var mod = stat.mode var uid = stat.uid var gid = stat.gid var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid() var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid() var u = parseInt('100', 8) var g = parseInt('010', 8) var o = parseInt('001', 8) var ug = u | g var ret = (mod & o) || (mod & g) && gid === myGid || (mod & u) && uid === myUid || (mod & ug) && myUid === 0 return ret } /***/ }), /***/ 61429: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = isexe isexe.sync = sync var fs = __webpack_require__(57147) function checkPathExt (path, options) { var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT if (!pathext) { return true } pathext = pathext.split(';') if (pathext.indexOf('') !== -1) { return true } for (var i = 0; i < pathext.length; i++) { var p = pathext[i].toLowerCase() if (p && path.substr(-p.length).toLowerCase() === p) { return true } } return false } function checkStat (stat, path, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false } return checkPathExt(path, options) } function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, path, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), path, options) } /***/ }), /***/ 55664: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { (function (global, factory) { true ? factory(exports, __webpack_require__(12781)) : 0; })(this, (function (exports, stream) { 'use strict'; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var _global, _global$JSON; const rxEscapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; // table of character substitutions const meta = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }; function isReadableStream(value) { return typeof value.read === 'function' && typeof value.pause === 'function' && typeof value.resume === 'function' && typeof value.pipe === 'function' && typeof value.once === 'function' && typeof value.removeListener === 'function'; } var Types; (function (Types) { Types[Types["Array"] = 0] = "Array"; Types[Types["Object"] = 1] = "Object"; Types[Types["ReadableString"] = 2] = "ReadableString"; Types[Types["ReadableObject"] = 3] = "ReadableObject"; Types[Types["Primitive"] = 4] = "Primitive"; Types[Types["Promise"] = 5] = "Promise"; })(Types || (Types = {})); function getType(value) { if (!value) return Types.Primitive; if (typeof value.then === 'function') return Types.Promise; if (isReadableStream(value)) return value._readableState.objectMode ? Types.ReadableObject : Types.ReadableString; if (Array.isArray(value)) return Types.Array; if (typeof value === 'object' || value instanceof Object) return Types.Object; return Types.Primitive; } const stackItemOpen = []; stackItemOpen[Types.Array] = '['; stackItemOpen[Types.Object] = '{'; stackItemOpen[Types.ReadableString] = '"'; stackItemOpen[Types.ReadableObject] = '['; const stackItemEnd = []; stackItemEnd[Types.Array] = ']'; stackItemEnd[Types.Object] = '}'; stackItemEnd[Types.ReadableString] = '"'; stackItemEnd[Types.ReadableObject] = ']'; function escapeString(string) { // Modified code, original code by Douglas Crockford // Original: https://github.com/douglascrockford/JSON-js/blob/master/json2.js // If the string contains no control characters, no quote characters, and no // backslash characters, then we can safely slap some quotes around it. // Otherwise we must also replace the offending characters with safe escape // sequences. return string.replace(rxEscapable, a => { const c = meta[a]; return typeof c === 'string' ? c : `\\u${a.charCodeAt(0).toString(16).padStart(4, '0')}`; }); } let primitiveToJSON; if (((_global = global) === null || _global === void 0 ? void 0 : (_global$JSON = _global.JSON) === null || _global$JSON === void 0 ? void 0 : _global$JSON.stringify) instanceof Function) { let canSerializeBigInt = true; try { if (JSON.stringify(global.BigInt ? global.BigInt('123') : '') !== '123') throw new Error(); } catch (err) { canSerializeBigInt = false; } if (canSerializeBigInt) { primitiveToJSON = JSON.parse; } else { // eslint-disable-next-line no-confusing-arrow primitiveToJSON = value => typeof value === 'bigint' ? String(value) : JSON.stringify(value); } } else { primitiveToJSON = value => { switch (typeof value) { case 'string': return `"${escapeString(value)}"`; case 'number': return Number.isFinite(value) ? String(value) : 'null'; case 'bigint': return String(value); case 'boolean': return value ? 'true' : 'false'; case 'object': if (!value) { return 'null'; } // eslint-disable-next-line no-fallthrough default: // This should never happen, I can't imagine a situation where this executes. // If you find a way, please open a ticket or PR throw Object.assign(new Error(`Not a primitive "${typeof value}".`), { value }); } }; } /* function quoteString(string: string) { return primitiveToJSON(String(string)); } */ const cache = new Map(); function quoteString(string) { const useCache = string.length < 10000; // eslint-disable-next-line no-lonely-if if (useCache && cache.has(string)) { return cache.get(string); } const str = primitiveToJSON(String(string)); if (useCache) cache.set(string, str); return str; } function readAsPromised(stream, size) { const value = stream.read(size); if (value === null) { return new Promise((resolve, reject) => { if (stream.readableEnded) { resolve(null); return; } const endListener = () => resolve(null); stream.once('end', endListener); stream.once('error', reject); stream.once('readable', () => { stream.removeListener('end', endListener); stream.removeListener('error', reject); resolve(stream.read()); }); }); } return Promise.resolve(value); } var ReadState; (function (ReadState) { ReadState[ReadState["NotReading"] = 0] = "NotReading"; ReadState[ReadState["Reading"] = 1] = "Reading"; ReadState[ReadState["ReadMore"] = 2] = "ReadMore"; ReadState[ReadState["Consumed"] = 3] = "Consumed"; })(ReadState || (ReadState = {})); class JsonStreamStringify extends stream.Readable { constructor(input, replacer, spaces, cycle = false, bufferSize = 512) { super({ encoding: 'utf8' }); _defineProperty(this, "cycle", void 0); _defineProperty(this, "bufferSize", void 0); _defineProperty(this, "item", void 0); _defineProperty(this, "indent", void 0); _defineProperty(this, "root", void 0); _defineProperty(this, "include", void 0); _defineProperty(this, "replacer", void 0); _defineProperty(this, "visited", void 0); _defineProperty(this, "objectItem", void 0); _defineProperty(this, "prePush", undefined); _defineProperty(this, "buffer", ''); _defineProperty(this, "bufferLength", 0); _defineProperty(this, "pushCalled", false); _defineProperty(this, "readSize", 0); _defineProperty(this, "reading", false); _defineProperty(this, "readMore", false); _defineProperty(this, "readState", ReadState.NotReading); this.cycle = cycle; this.bufferSize = bufferSize; const spaceType = typeof spaces; if (spaceType === 'number') { this.indent = ' '.repeat(spaces); } else if (spaceType === 'string') { this.indent = spaces; } const replacerType = typeof replacer; if (replacerType === 'object') { this.include = replacer; } else if (replacerType === 'function') { this.replacer = replacer; } this.visited = cycle ? new WeakMap() : []; this.root = { value: { '': input }, depth: 0, indent: '', path: [] }; this.setItem(input, this.root, ''); } setItem(value, parent, key = '') { // call toJSON where applicable if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key); } // use replacer if applicable if (this.replacer) { value = this.replacer.call(parent.value, key, value); } // coerece functions and symbols into undefined if (value instanceof Function || typeof value === 'symbol') { value = undefined; } const type = getType(value); let path; // check for circular structure if (!this.cycle && type !== Types.Primitive) { if (this.visited.some(v => v === value)) { this.destroy(Object.assign(new Error('Converting circular structure to JSON'), { value, key })); return; } this.visited.push(value); } else if (this.cycle && type !== Types.Primitive) { path = this.visited.get(value); if (path) { this._push(`{"$ref":"$${path.map(v => `[${Number.isInteger(v) ? v : escapeString(quoteString(v))}]`).join('')}"}`); this.item = parent; return; } path = parent === this.root ? [] : parent.path.concat(key); this.visited.set(value, path); } if (type === Types.Object) { this.setObjectItem(value, parent); } else if (type === Types.Array) { this.setArrayItem(value, parent); } else if (type === Types.Primitive) { if (parent !== this.root && typeof key === 'string') { // (parent).write(key, primitiveToJSON(value)); if (value === undefined) ; else { this._push(primitiveToJSON(value)); } // undefined values in objects should be rejected } else if (value === undefined && typeof key === 'number') { // undefined values in array should be null this._push('null'); } else if (value === undefined) ; else { this._push(primitiveToJSON(value)); } this.item = parent; return; } else if (type === Types.Promise) { this.setPromiseItem(value, parent, key); } else if (type === Types.ReadableString) { this.setReadableStringItem(value, parent); } else if (type === Types.ReadableObject) { this.setReadableObjectItem(value, parent); } this.item.value = value; this.item.depth = parent.depth + 1; if (this.indent) this.item.indent = this.indent.repeat(this.item.depth); this.item.path = path; } setReadableStringItem(input, parent) { var _input$_readableState, _input$_readableState2; if (input.readableEnded || (_input$_readableState = input._readableState) !== null && _input$_readableState !== void 0 && _input$_readableState.endEmitted) { this.emit('error', new Error('Readable Stream has ended before it was serialized. All stream data have been lost'), input, parent.path); } else if (input.readableFlowing || (_input$_readableState2 = input._readableState) !== null && _input$_readableState2 !== void 0 && _input$_readableState2.flowing) { input.pause(); this.emit('error', new Error('Readable Stream is in flowing mode, data may have been lost. Trying to pause stream.'), input, parent.path); } const that = this; this._push('"'); input.once('end', () => { this._push('"'); this.item = parent; this.emit('readable'); }); this.item = { type: 'readable string', async read(size) { try { const data = await readAsPromised(input, size); if (data) that._push(escapeString(data.toString())); } catch (err) { that.emit('error', err); that.destroy(); } } }; } setReadableObjectItem(input, parent) { var _input$_readableState3, _input$_readableState4; if (input.readableEnded || (_input$_readableState3 = input._readableState) !== null && _input$_readableState3 !== void 0 && _input$_readableState3.endEmitted) { this.emit('error', new Error('Readable Stream has ended before it was serialized. All stream data have been lost'), input, parent.path); } else if (input.readableFlowing || (_input$_readableState4 = input._readableState) !== null && _input$_readableState4 !== void 0 && _input$_readableState4.flowing) { input.pause(); this.emit('error', new Error('Readable Stream is in flowing mode, data may have been lost. Trying to pause stream.'), input, parent.path); } const that = this; this._push('['); let first = true; let i = 0; const item = { type: 'readable object', async read(size) { try { let out = ''; const data = await readAsPromised(input, size); if (data === null) { if (i && that.indent) { out += `\n${parent.indent}`; } out += ']'; that._push(out); that.item = parent; that.unvisit(input); return; } if (first) first = false;else out += ','; if (that.indent) out += `\n${item.indent}`; that._push(out); that.setItem(data, item, i); i += 1; } catch (err) { that.emit('error', err); that.destroy(); } } }; this.item = item; } setPromiseItem(input, parent, key) { const that = this; let read = false; this.item = { async read() { if (read) return; try { read = true; that.setItem(await input, parent, key); } catch (err) { that.emit('error', err); that.destroy(); } } }; } setArrayItem(input, parent) { // const entries = input.slice().reverse(); let i = 0; const len = input.length; let first = true; const that = this; const item = { read() { let out = ''; let wasFirst = false; if (first) { first = false; wasFirst = true; if (!len) { that._push('[]'); that.unvisit(input); that.item = parent; return; } out += '['; } const entry = input[i]; if (i === len) { if (that.indent) out += `\n${parent.indent}`; out += ']'; that._push(out); that.item = parent; that.unvisit(input); return; } if (!wasFirst) out += ','; if (that.indent) out += `\n${item.indent}`; that._push(out); that.setItem(entry, item, i); i += 1; } }; this.item = item; } unvisit(item) { if (this.cycle) return; const _i = this.visited.indexOf(item); if (_i > -1) this.visited.splice(_i, 1); } setObjectItem(input, parent = undefined) { const keys = Object.keys(input); let i = 0; const len = keys.length; let first = true; const that = this; const { include } = this; let hasItems = false; let key; const item = { read() { var _include$indexOf; if (i === 0) that._push('{'); if (i === len) { that.objectItem = undefined; if (!hasItems) { that._push('}'); } else { that._push(`${that.indent ? `\n${parent.indent}` : ''}}`); } that.item = parent; that.unvisit(input); return; } key = keys[i]; if ((include === null || include === void 0 ? void 0 : (_include$indexOf = include.indexOf) === null || _include$indexOf === void 0 ? void 0 : _include$indexOf.call(include, key)) === -1) { // replacer array excludes this key i += 1; return; } that.objectItem = item; i += 1; that.setItem(input[key], item, key); }, write() { const out = `${hasItems && !first ? ',' : ''}${item.indent ? `\n${item.indent}` : ''}${quoteString(key)}:${that.indent ? ' ' : ''}`; first = false; hasItems = true; that.objectItem = undefined; return out; } }; this.item = item; } _push(data) { this.buffer += (this.objectItem ? this.objectItem.write() : '') + data; this.prePush = undefined; if (this.buffer.length >= this.bufferSize) { this.pushCalled = !this.push(this.buffer); this.buffer = ''; this.bufferLength = 0; return false; } return true; } async _read(size) { if (this.readState !== ReadState.NotReading) { this.readState = ReadState.ReadMore; return; } this.readState = ReadState.Reading; this.pushCalled = false; let p; while (!this.pushCalled && this.item !== this.root && !this.destroyed) { p = this.item.read(size); // eslint-disable-next-line no-await-in-loop if (p) await p; } if (this.item === this.root) { if (this.buffer.length) this.push(this.buffer); this.push(null); this.readState = ReadState.Consumed; this._destroy(); } if (this.readState === ReadState.ReadMore) { this.readState = ReadState.NotReading; this._read(size); } this.readState = ReadState.NotReading; } _destroy() { this.destroyed = true; this.buffer = undefined; this.visited = undefined; this.item = undefined; this.prePush = undefined; } destroy(error) { var _super$destroy; if (error) this.emit('error', error); (_super$destroy = super.destroy) === null || _super$destroy === void 0 ? void 0 : _super$destroy.call(this); this._destroy(); return this; } } exports.JsonStreamStringify = JsonStreamStringify; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=index.js.map /***/ }), /***/ 64530: /***/ ((module, exports) => { exports = module.exports = stringify exports.getSerialize = serializer function stringify(obj, replacer, spaces, cycleReplacer) { return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) } function serializer(replacer, cycleReplacer) { var stack = [], keys = [] if (cycleReplacer == null) cycleReplacer = function(key, value) { if (stack[0] === value) return "[Circular ~]" return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" } return function(key, value) { if (stack.length > 0) { var thisPos = stack.indexOf(this) ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) } else stack.push(value) return replacer == null ? value : replacer.call(this, key, value) } } /***/ }), /***/ 83465: /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', promiseTag = '[object Promise]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** * Adds the key-value `pair` to `map`. * * @private * @param {Object} map The map to modify. * @param {Array} pair The key-value pair to add. * @returns {Object} Returns `map`. */ function addMapEntry(map, pair) { // Don't return `map.set` because it's not chainable in IE 11. map.set(pair[0], pair[1]); return map; } /** * Adds `value` to `set`. * * @private * @param {Object} set The set to modify. * @param {*} value The value to add. * @returns {Object} Returns `set`. */ function addSetEntry(set, value) { // Don't return `set.add` because it's not chainable in IE 11. set.add(value); return set; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array ? array.length : 0; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array ? array.length : 0; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `value` is a host object in IE < 9. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a host object, else `false`. */ function isHostObject(value) { // Many host objects are `Object` objects that can coerce to strings // despite having improperly defined `toString` methods. var result = false; if (value != null && typeof value.toString != 'function') { try { result = !!(value + ''); } catch (e) {} } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined, Symbol = root.Symbol, Uint8Array = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeKeys = overArg(Object.keys, Object); /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'), Map = getNative(root, 'Map'), Promise = getNative(root, 'Promise'), Set = getNative(root, 'Set'), WeakMap = getNative(root, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { return this.has(key) && delete this.__data__[key]; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { return getMapData(this, key)['delete'](key); } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { getMapData(this, key).set(key, value); return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { this.__data__ = new ListCache(entries); } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { return this.__data__['delete'](key); } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var cache = this.__data__; if (cache instanceof ListCache) { var pairs = cache.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); return this; } cache = this.__data__ = new MapCache(pairs); } cache.set(key, value); return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { // Safari 8.1 makes `arguments.callee` enumerable in strict mode. // Safari 9 makes `arguments.length` enumerable in strict mode. var result = (isArray(value) || isArguments(value)) ? baseTimes(value.length, String) : []; var length = result.length, skipIndexes = !!length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) { result.push(key); } } return result; } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { object[key] = value; } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} [isDeep] Specify a deep clone. * @param {boolean} [isFull] Specify a clone including symbols. * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, isDeep, isFull, customizer, key, object, stack) { var result; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { if (isHostObject(value)) { return object ? value : {}; } result = initCloneObject(isFunc ? {} : value); if (!isDeep) { return copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, baseClone, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (!isArr) { var props = isFull ? getAllKeys(value) : keys(value); } arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} prototype The object to inherit from. * @returns {Object} Returns the new object. */ function baseCreate(proto) { return isObject(proto) ? objectCreate(proto) : {}; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { return objectToString.call(value); } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var result = new buffer.constructor(buffer.length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `map`. * * @private * @param {Object} map The map to clone. * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned map. */ function cloneMap(map, isDeep, cloneFunc) { var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); return arrayReduce(array, addMapEntry, new map.constructor); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of `set`. * * @private * @param {Object} set The set to clone. * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned set. */ function cloneSet(set, isDeep, cloneFunc) { var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); return arrayReduce(array, addSetEntry, new set.constructor); } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; assignValue(object, key, newValue === undefined ? source[key] : newValue); } return object; } /** * Copies own symbol properties of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * Creates an array of the own enumerable symbol properties of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11, // for data views in Edge < 14, and promises in Node.js. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : undefined; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, cloneFunc, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return cloneMap(object, isDeep, cloneFunc); case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return cloneSet(object, isDeep, cloneFunc); case symbolTag: return cloneSymbol(object); } } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (typeof value == 'number' || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to process. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, true, true); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ function isArguments(value) { // Safari 8.1 makes `arguments.callee` enumerable in strict mode. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); } /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = cloneDeep; /***/ }), /***/ 72378: /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /** * Lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined, Symbol = root.Symbol, Uint8Array = root.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeMax = Math.max, nativeNow = Date.now; /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'), nativeCreate = getNative(Object, 'create'); /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = merge; /***/ }), /***/ 18552: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getNative = __webpack_require__(10852), root = __webpack_require__(55639); /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'); module.exports = DataView; /***/ }), /***/ 57071: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getNative = __webpack_require__(10852), root = __webpack_require__(55639); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); module.exports = Map; /***/ }), /***/ 53818: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getNative = __webpack_require__(10852), root = __webpack_require__(55639); /* Built-in method references that are verified to be native. */ var Promise = getNative(root, 'Promise'); module.exports = Promise; /***/ }), /***/ 58525: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getNative = __webpack_require__(10852), root = __webpack_require__(55639); /* Built-in method references that are verified to be native. */ var Set = getNative(root, 'Set'); module.exports = Set; /***/ }), /***/ 62705: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var root = __webpack_require__(55639); /** Built-in value references. */ var Symbol = root.Symbol; module.exports = Symbol; /***/ }), /***/ 70577: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getNative = __webpack_require__(10852), root = __webpack_require__(55639); /* Built-in method references that are verified to be native. */ var WeakMap = getNative(root, 'WeakMap'); module.exports = WeakMap; /***/ }), /***/ 44239: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Symbol = __webpack_require__(62705), getRawTag = __webpack_require__(89607), objectToString = __webpack_require__(2333); /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } module.exports = baseGetTag; /***/ }), /***/ 9454: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(44239), isObjectLike = __webpack_require__(37005); /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } module.exports = baseIsArguments; /***/ }), /***/ 28458: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isFunction = __webpack_require__(23560), isMasked = __webpack_require__(15346), isObject = __webpack_require__(13218), toSource = __webpack_require__(80346); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } module.exports = baseIsNative; /***/ }), /***/ 38749: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(44239), isLength = __webpack_require__(41780), isObjectLike = __webpack_require__(37005); /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } module.exports = baseIsTypedArray; /***/ }), /***/ 280: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isPrototype = __webpack_require__(25726), nativeKeys = __webpack_require__(86916); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } module.exports = baseKeys; /***/ }), /***/ 7518: /***/ ((module) => { /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } module.exports = baseUnary; /***/ }), /***/ 14429: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var root = __webpack_require__(55639); /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; /***/ }), /***/ 31957: /***/ ((module) => { /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; module.exports = freeGlobal; /***/ }), /***/ 10852: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIsNative = __webpack_require__(28458), getValue = __webpack_require__(47801); /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } module.exports = getNative; /***/ }), /***/ 89607: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Symbol = __webpack_require__(62705); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } module.exports = getRawTag; /***/ }), /***/ 64160: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DataView = __webpack_require__(18552), Map = __webpack_require__(57071), Promise = __webpack_require__(53818), Set = __webpack_require__(58525), WeakMap = __webpack_require__(70577), baseGetTag = __webpack_require__(44239), toSource = __webpack_require__(80346); /** `Object#toString` result references. */ var mapTag = '[object Map]', objectTag = '[object Object]', promiseTag = '[object Promise]', setTag = '[object Set]', weakMapTag = '[object WeakMap]'; var dataViewTag = '[object DataView]'; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } module.exports = getTag; /***/ }), /***/ 47801: /***/ ((module) => { /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } module.exports = getValue; /***/ }), /***/ 15346: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var coreJsData = __webpack_require__(14429); /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } module.exports = isMasked; /***/ }), /***/ 25726: /***/ ((module) => { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } module.exports = isPrototype; /***/ }), /***/ 86916: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var overArg = __webpack_require__(5569); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object); module.exports = nativeKeys; /***/ }), /***/ 31167: /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); var freeGlobal = __webpack_require__(31957); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); module.exports = nodeUtil; /***/ }), /***/ 2333: /***/ ((module) => { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } module.exports = objectToString; /***/ }), /***/ 5569: /***/ ((module) => { /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } module.exports = overArg; /***/ }), /***/ 55639: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var freeGlobal = __webpack_require__(31957); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; /***/ }), /***/ 80346: /***/ ((module) => { /** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } module.exports = toSource; /***/ }), /***/ 35694: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIsArguments = __webpack_require__(9454), isObjectLike = __webpack_require__(37005); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; module.exports = isArguments; /***/ }), /***/ 1469: /***/ ((module) => { /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray; /***/ }), /***/ 98612: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isFunction = __webpack_require__(23560), isLength = __webpack_require__(41780); /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } module.exports = isArrayLike; /***/ }), /***/ 44144: /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); var root = __webpack_require__(55639), stubFalse = __webpack_require__(95062); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; module.exports = isBuffer; /***/ }), /***/ 41609: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseKeys = __webpack_require__(280), getTag = __webpack_require__(64160), isArguments = __webpack_require__(35694), isArray = __webpack_require__(1469), isArrayLike = __webpack_require__(98612), isBuffer = __webpack_require__(44144), isPrototype = __webpack_require__(25726), isTypedArray = __webpack_require__(36719); /** `Object#toString` result references. */ var mapTag = '[object Map]', setTag = '[object Set]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } module.exports = isEmpty; /***/ }), /***/ 23560: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseGetTag = __webpack_require__(44239), isObject = __webpack_require__(13218); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } module.exports = isFunction; /***/ }), /***/ 41780: /***/ ((module) => { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; /***/ }), /***/ 13218: /***/ ((module) => { /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }), /***/ 37005: /***/ ((module) => { /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } module.exports = isObjectLike; /***/ }), /***/ 36719: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var baseIsTypedArray = __webpack_require__(38749), baseUnary = __webpack_require__(7518), nodeUtil = __webpack_require__(31167); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; module.exports = isTypedArray; /***/ }), /***/ 95062: /***/ ((module) => { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ 27612: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * A doubly linked list-based Least Recently Used (LRU) cache. Will keep most * recently used items while discarding least recently used items when its limit * is reached. * * Licensed under MIT. Copyright (c) 2010 Rasmus Andersson * See README.md for details. * * Illustration of the design: * * entry entry entry entry * ______ ______ ______ ______ * | head |.newer => | |.newer => | |.newer => | tail | * | A | | B | | C | | D | * |______| <= older.|______| <= older.|______| <= older.|______| * * removed <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- added */ (function(g,f){ const e = true ? exports : 0; f(e); if (true) { !(__WEBPACK_AMD_DEFINE_FACTORY__ = (e), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } })(this, function(exports) { const NEWER = Symbol('newer'); const OLDER = Symbol('older'); function LRUMap(limit, entries) { if (typeof limit !== 'number') { // called as (entries) entries = limit; limit = 0; } this.size = 0; this.limit = limit; this.oldest = this.newest = undefined; this._keymap = new Map(); if (entries) { this.assign(entries); if (limit < 1) { this.limit = this.size; } } } exports.LRUMap = LRUMap; function Entry(key, value) { this.key = key; this.value = value; this[NEWER] = undefined; this[OLDER] = undefined; } LRUMap.prototype._markEntryAsUsed = function(entry) { if (entry === this.newest) { // Already the most recenlty used entry, so no need to update the list return; } // HEAD--------------TAIL // <.older .newer> // <--- add direction -- // A B C E if (entry[NEWER]) { if (entry === this.oldest) { this.oldest = entry[NEWER]; } entry[NEWER][OLDER] = entry[OLDER]; // C <-- E. } if (entry[OLDER]) { entry[OLDER][NEWER] = entry[NEWER]; // C. --> E } entry[NEWER] = undefined; // D --x entry[OLDER] = this.newest; // D. --> E if (this.newest) { this.newest[NEWER] = entry; // E. <-- D } this.newest = entry; }; LRUMap.prototype.assign = function(entries) { let entry, limit = this.limit || Number.MAX_VALUE; this._keymap.clear(); let it = entries[Symbol.iterator](); for (let itv = it.next(); !itv.done; itv = it.next()) { let e = new Entry(itv.value[0], itv.value[1]); this._keymap.set(e.key, e); if (!entry) { this.oldest = e; } else { entry[NEWER] = e; e[OLDER] = entry; } entry = e; if (limit-- == 0) { throw new Error('overflow'); } } this.newest = entry; this.size = this._keymap.size; }; LRUMap.prototype.get = function(key) { // First, find our cache entry var entry = this._keymap.get(key); if (!entry) return; // Not cached. Sorry. // As was found in the cache, register it as being requested recently this._markEntryAsUsed(entry); return entry.value; }; LRUMap.prototype.set = function(key, value) { var entry = this._keymap.get(key); if (entry) { // update existing entry.value = value; this._markEntryAsUsed(entry); return this; } // new entry this._keymap.set(key, (entry = new Entry(key, value))); if (this.newest) { // link previous tail to the new tail (entry) this.newest[NEWER] = entry; entry[OLDER] = this.newest; } else { // we're first in -- yay this.oldest = entry; } // add new entry to the end of the linked list -- it's now the freshest entry. this.newest = entry; ++this.size; if (this.size > this.limit) { // we hit the limit -- remove the head this.shift(); } return this; }; LRUMap.prototype.shift = function() { // todo: handle special case when limit == 1 var entry = this.oldest; if (entry) { if (this.oldest[NEWER]) { // advance the list this.oldest = this.oldest[NEWER]; this.oldest[OLDER] = undefined; } else { // the cache is exhausted this.oldest = undefined; this.newest = undefined; } // Remove last strong reference to and remove links from the purged // entry being returned: entry[NEWER] = entry[OLDER] = undefined; this._keymap.delete(entry.key); --this.size; return [entry.key, entry.value]; } }; // ---------------------------------------------------------------------------- // Following code is optional and can be removed without breaking the core // functionality. LRUMap.prototype.find = function(key) { let e = this._keymap.get(key); return e ? e.value : undefined; }; LRUMap.prototype.has = function(key) { return this._keymap.has(key); }; LRUMap.prototype['delete'] = function(key) { var entry = this._keymap.get(key); if (!entry) return; this._keymap.delete(entry.key); if (entry[NEWER] && entry[OLDER]) { // relink the older entry with the newer entry entry[OLDER][NEWER] = entry[NEWER]; entry[NEWER][OLDER] = entry[OLDER]; } else if (entry[NEWER]) { // remove the link to us entry[NEWER][OLDER] = undefined; // link the newer entry to head this.oldest = entry[NEWER]; } else if (entry[OLDER]) { // remove the link to us entry[OLDER][NEWER] = undefined; // link the newer entry to head this.newest = entry[OLDER]; } else {// if(entry[OLDER] === undefined && entry.newer === undefined) { this.oldest = this.newest = undefined; } this.size--; return entry.value; }; LRUMap.prototype.clear = function() { // Not clearing links should be safe, as we don't expose live links to user this.oldest = this.newest = undefined; this.size = 0; this._keymap.clear(); }; function EntryIterator(oldestEntry) { this.entry = oldestEntry; } EntryIterator.prototype[Symbol.iterator] = function() { return this; } EntryIterator.prototype.next = function() { let ent = this.entry; if (ent) { this.entry = ent[NEWER]; return { done: false, value: [ent.key, ent.value] }; } else { return { done: true, value: undefined }; } }; function KeyIterator(oldestEntry) { this.entry = oldestEntry; } KeyIterator.prototype[Symbol.iterator] = function() { return this; } KeyIterator.prototype.next = function() { let ent = this.entry; if (ent) { this.entry = ent[NEWER]; return { done: false, value: ent.key }; } else { return { done: true, value: undefined }; } }; function ValueIterator(oldestEntry) { this.entry = oldestEntry; } ValueIterator.prototype[Symbol.iterator] = function() { return this; } ValueIterator.prototype.next = function() { let ent = this.entry; if (ent) { this.entry = ent[NEWER]; return { done: false, value: ent.value }; } else { return { done: true, value: undefined }; } }; LRUMap.prototype.keys = function() { return new KeyIterator(this.oldest); }; LRUMap.prototype.values = function() { return new ValueIterator(this.oldest); }; LRUMap.prototype.entries = function() { return this; }; LRUMap.prototype[Symbol.iterator] = function() { return new EntryIterator(this.oldest); }; LRUMap.prototype.forEach = function(fun, thisObj) { if (typeof thisObj !== 'object') { thisObj = this; } let entry = this.oldest; while (entry) { fun.call(thisObj, entry.value, entry.key, this); entry = entry[NEWER]; } }; /** Returns a JSON (array) representation */ LRUMap.prototype.toJSON = function() { var s = new Array(this.size), i = 0, entry = this.oldest; while (entry) { s[i++] = { key: entry.key, value: entry.value }; entry = entry[NEWER]; } return s; }; /** Returns a String representation */ LRUMap.prototype.toString = function() { var s = '', entry = this.oldest; while (entry) { s += String(entry.key)+':'+entry.value; entry = entry[NEWER]; if (entry) { s += ' < '; } } return s; }; }); /***/ }), /***/ 40789: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(57147); const path = __webpack_require__(71017); const {promisify} = __webpack_require__(73837); const semver = __webpack_require__(36625); const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); // https://github.com/nodejs/node/issues/8987 // https://github.com/libuv/libuv/pull/1088 const checkPath = pth => { if (process.platform === 'win32') { const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); if (pathHasInvalidWinCharacters) { const error = new Error(`Path contains invalid characters: ${pth}`); error.code = 'EINVAL'; throw error; } } }; const processOptions = options => { // https://github.com/sindresorhus/make-dir/issues/18 const defaults = { mode: 0o777, fs }; return { ...defaults, ...options }; }; const permissionError = pth => { // This replicates the exception of `fs.mkdir` with native the // `recusive` option when run on an invalid drive under Windows. const error = new Error(`operation not permitted, mkdir '${pth}'`); error.code = 'EPERM'; error.errno = -4048; error.path = pth; error.syscall = 'mkdir'; return error; }; const makeDir = async (input, options) => { checkPath(input); options = processOptions(options); const mkdir = promisify(options.fs.mkdir); const stat = promisify(options.fs.stat); if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { const pth = path.resolve(input); await mkdir(pth, { mode: options.mode, recursive: true }); return pth; } const make = async pth => { try { await mkdir(pth, options.mode); return pth; } catch (error) { if (error.code === 'EPERM') { throw error; } if (error.code === 'ENOENT') { if (path.dirname(pth) === pth) { throw permissionError(pth); } if (error.message.includes('null bytes')) { throw error; } await make(path.dirname(pth)); return make(pth); } try { const stats = await stat(pth); if (!stats.isDirectory()) { throw new Error('The path is not a directory'); } } catch (_) { throw error; } return pth; } }; return make(path.resolve(input)); }; module.exports = makeDir; module.exports.sync = (input, options) => { checkPath(input); options = processOptions(options); if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { const pth = path.resolve(input); fs.mkdirSync(pth, { mode: options.mode, recursive: true }); return pth; } const make = pth => { try { options.fs.mkdirSync(pth, options.mode); } catch (error) { if (error.code === 'EPERM') { throw error; } if (error.code === 'ENOENT') { if (path.dirname(pth) === pth) { throw permissionError(pth); } if (error.message.includes('null bytes')) { throw error; } make(path.dirname(pth)); return make(pth); } try { if (!options.fs.statSync(pth).isDirectory()) { throw new Error('The path is not a directory'); } } catch (_) { throw error; } } return pth; }; return make(path.resolve(input)); }; /***/ }), /***/ 63110: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const escapeStringRegexp = __webpack_require__(95601); const regexpCache = new Map(); function makeRegexp(pattern, options) { options = { caseSensitive: false, ...options }; const cacheKey = pattern + JSON.stringify(options); if (regexpCache.has(cacheKey)) { return regexpCache.get(cacheKey); } const negated = pattern[0] === '!'; if (negated) { pattern = pattern.slice(1); } pattern = escapeStringRegexp(pattern).replace(/\\\*/g, '[\\s\\S]*'); const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i'); regexp.negated = negated; regexpCache.set(cacheKey, regexp); return regexp; } module.exports = (inputs, patterns, options) => { if (!(Array.isArray(inputs) && Array.isArray(patterns))) { throw new TypeError(`Expected two arrays, got ${typeof inputs} ${typeof patterns}`); } if (patterns.length === 0) { return inputs; } const isFirstPatternNegated = patterns[0][0] === '!'; patterns = patterns.map(pattern => makeRegexp(pattern, options)); const result = []; for (const input of inputs) { // If first pattern is negated we include everything to match user expectation. let matches = isFirstPatternNegated; for (const pattern of patterns) { if (pattern.test(input)) { matches = !pattern.negated; } } if (matches) { result.push(input); } } return result; }; module.exports.isMatch = (input, pattern, options) => { const inputArray = Array.isArray(input) ? input : [input]; const patternArray = Array.isArray(pattern) ? pattern : [pattern]; return inputArray.some(input => { return patternArray.every(pattern => { const regexp = makeRegexp(pattern, options); const matches = regexp.test(input); return regexp.negated ? !matches : matches; }); }); }; /***/ }), /***/ 95601: /***/ ((module) => { "use strict"; module.exports = string => { if (typeof string !== 'string') { throw new TypeError('Expected a string'); } // Escape characters with special meaning either inside or outside character sets. // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. return string .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') .replace(/-/g, '\\x2d'); }; /***/ }), /***/ 4034: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PassThrough } = __webpack_require__(12781); module.exports = function (/*streams...*/) { var sources = [] var output = new PassThrough({objectMode: true}) output.setMaxListeners(0) output.add = add output.isEmpty = isEmpty output.on('unpipe', remove) Array.prototype.slice.call(arguments).forEach(add) return output function add (source) { if (Array.isArray(source)) { source.forEach(add) return this } sources.push(source); source.once('end', remove.bind(null, source)) source.once('error', output.emit.bind(output, 'error')) source.pipe(output, {end: false}) return this } function isEmpty () { return sources.length == 0; } function remove (source) { sources = sources.filter(function (it) { return it !== source }) if (!sources.length && output.readable) { output.end() } } } /***/ }), /***/ 34341: /***/ ((module) => { "use strict"; const mimicFn = (to, from) => { for (const prop of Reflect.ownKeys(from)) { Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); } return to; }; module.exports = mimicFn; // TODO: Remove this for the next major release module.exports["default"] = mimicFn; /***/ }), /***/ 96562: /***/ ((module) => { module.exports = function (args, opts) { if (!opts) opts = {}; var flags = { bools : {}, strings : {}, unknownFn: null }; if (typeof opts['unknown'] === 'function') { flags.unknownFn = opts['unknown']; } if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { flags.allBools = true; } else { [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); } var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); aliases[key].forEach(function (x) { aliases[x] = [key].concat(aliases[key].filter(function (y) { return x !== y; })); }); }); [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; if (aliases[key]) { flags.strings[aliases[key]] = true; } }); var defaults = opts['default'] || {}; var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); var notFlags = []; if (args.indexOf('--') !== -1) { notFlags = args.slice(args.indexOf('--')+1); args = args.slice(0, args.indexOf('--')); } function argDefined(key, arg) { return (flags.allBools && /^--[^=]+$/.test(arg)) || flags.strings[key] || flags.bools[key] || aliases[key]; } function setArg (key, val, arg) { if (arg && flags.unknownFn && !argDefined(key, arg)) { if (flags.unknownFn(arg) === false) return; } var value = !flags.strings[key] && isNumber(val) ? Number(val) : val ; setKey(argv, key.split('.'), value); (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } function setKey (obj, keys, value) { var o = obj; for (var i = 0; i < keys.length-1; i++) { var key = keys[i]; if (isConstructorOrProto(o, key)) return; if (o[key] === undefined) o[key] = {}; if (o[key] === Object.prototype || o[key] === Number.prototype || o[key] === String.prototype) o[key] = {}; if (o[key] === Array.prototype) o[key] = []; o = o[key]; } var key = keys[keys.length - 1]; if (isConstructorOrProto(o, key)) return; if (o === Object.prototype || o === Number.prototype || o === String.prototype) o = {}; if (o === Array.prototype) o = []; if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { o[key] = value; } else if (Array.isArray(o[key])) { o[key].push(value); } else { o[key] = [ o[key], value ]; } } function aliasIsBoolean(key) { return aliases[key].some(function (x) { return flags.bools[x]; }); } for (var i = 0; i < args.length; i++) { var arg = args[i]; if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: // http://stackoverflow.com/a/1068308/13216 var m = arg.match(/^--([^=]+)=([\s\S]*)$/); var key = m[1]; var value = m[2]; if (flags.bools[key]) { value = value !== 'false'; } setArg(key, value, arg); } else if (/^--no-.+/.test(arg)) { var key = arg.match(/^--no-(.+)/)[1]; setArg(key, false, arg); } else if (/^--.+/.test(arg)) { var key = arg.match(/^--(.+)/)[1]; var next = args[i + 1]; if (next !== undefined && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) { setArg(key, next, arg); i++; } else if (/^(true|false)$/.test(next)) { setArg(key, next === 'true', arg); i++; } else { setArg(key, flags.strings[key] ? '' : true, arg); } } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); if (next === '-') { setArg(letters[j], next, arg) continue; } if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { setArg(letters[j], next.split('=')[1], arg); broken = true; break; } if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next, arg); broken = true; break; } if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2), arg); broken = true; break; } else { setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); } } var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) { setArg(key, args[i+1], arg); i++; } else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { setArg(key, args[i+1] === 'true', arg); i++; } else { setArg(key, flags.strings[key] ? '' : true, arg); } } } else { if (!flags.unknownFn || flags.unknownFn(arg) !== false) { argv._.push( flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) ); } if (opts.stopEarly) { argv._.push.apply(argv._, args.slice(i + 1)); break; } } } Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); if (opts['--']) { argv['--'] = new Array(); notFlags.forEach(function(key) { argv['--'].push(key); }); } else { notFlags.forEach(function(key) { argv._.push(key); }); } return argv; }; function hasKey (obj, keys) { var o = obj; keys.slice(0,-1).forEach(function (key) { o = (o[key] || {}); }); var key = keys[keys.length - 1]; return key in o; } function isNumber (x) { if (typeof x === 'number') return true; if (/^0x[0-9a-f]+$/i.test(x)) return true; return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); } function isConstructorOrProto (obj, key) { return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__'; } /***/ }), /***/ 57824: /***/ ((module) => { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } /***/ }), /***/ 21901: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var createHash = __webpack_require__(6113).createHash; function get_header(header, credentials, opts) { var type = header.split(' ')[0], user = credentials[0], pass = credentials[1]; if (type == 'Digest') { return digest.generate(header, user, pass, opts.method, opts.path); } else if (type == 'Basic') { return basic(user, pass); } } //////////////////// // basic function md5(string) { return createHash('md5').update(string).digest('hex'); } function basic(user, pass) { var str = typeof pass == 'undefined' ? user : [user, pass].join(':'); return 'Basic ' + Buffer.from(str).toString('base64'); } //////////////////// // digest // logic inspired from https://github.com/simme/node-http-digest-client var digest = {}; digest.parse_header = function(header) { var challenge = {}, matches = header.match(/([a-z0-9_-]+)="?([a-z0-9_=\/\.@\s-\+:)()]+)"?/gi); for (var i = 0, l = matches.length; i < l; i++) { var parts = matches[i].split('='), key = parts.shift(), val = parts.join('=').replace(/^"/, '').replace(/"$/, ''); challenge[key] = val; } return challenge; } digest.update_nc = function(nc) { var max = 99999999; nc++; if (nc > max) nc = 1; var padding = new Array(8).join('0') + ''; nc = nc + ''; return padding.substr(0, 8 - nc.length) + nc; } digest.generate = function(header, user, pass, method, path) { var nc = 1, cnonce = null, challenge = digest.parse_header(header); var ha1 = md5(user + ':' + challenge.realm + ':' + pass), ha2 = md5(method.toUpperCase() + ':' + path), resp = [ha1, challenge.nonce]; if (typeof challenge.qop === 'string') { cnonce = md5(Math.random().toString(36)).substr(0, 8); nc = digest.update_nc(nc); resp = resp.concat(nc, cnonce); resp = resp.concat(challenge.qop, ha2); } else { resp = resp.concat(ha2); } var params = { uri : path, realm : challenge.realm, nonce : challenge.nonce, username : user, response : md5(resp.join(':')) } if (challenge.qop) { params.qop = challenge.qop; } if (challenge.opaque) { params.opaque = challenge.opaque; } if (cnonce) { params.nc = nc; params.cnonce = cnonce; } header = [] for (var k in params) header.push(k + '="' + params[k] + '"') return 'Digest ' + header.join(', '); } module.exports = { header : get_header, basic : basic, digest : digest.generate } /***/ }), /***/ 70035: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { // Simple cookie handling implementation based on the standard RFC 6265. // // This module just has two functionalities: // - Parse a set-cookie-header as a key value object // - Write a cookie-string from a key value object // // All cookie attributes are ignored. var unescape = __webpack_require__(63477).unescape; var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/; var EXCLUDED_CHARS = /[\x00-\x1F\x7F\x3B\x3B\s\"\,\\"%]/g; var TRAILING_SEMICOLON = /\x3B+$/; var SEP_SEMICOLON = /\s*\x3B\s*/; // i know these should be 'const', but I'd like to keep // supporting earlier node.js versions as long as I can. :) var KEY_INDEX = 1; // index of key from COOKIE_PAIR match var VALUE_INDEX = 3; // index of value from COOKIE_PAIR match // Returns a copy str trimmed and without trainling semicolon. function cleanCookieString(str) { return str.trim().replace(/\x3B+$/, ''); } function getFirstPair(str) { var index = str.indexOf('\x3B'); return index === -1 ? str : str.substr(0, index); } // Returns a encoded copy of str based on RFC6265 S4.1.1. function encodeCookieComponent(str) { return str.toString().replace(EXCLUDED_CHARS, encodeURIComponent); } // Parses a set-cookie-string based on the standard defined in RFC6265 S4.1.1. function parseSetCookieString(str) { str = cleanCookieString(str); str = getFirstPair(str); var res = COOKIE_PAIR.exec(str); if (!res || !res[VALUE_INDEX]) return null; return { name : unescape(res[KEY_INDEX]), value : unescape(res[VALUE_INDEX]) }; } // Parses a set-cookie-header and returns a key/value object. // Each key represents the name of a cookie. function parseSetCookieHeader(header) { if (!header) return {}; header = Array.isArray(header) ? header : [header]; return header.reduce(function(res, str) { var cookie = parseSetCookieString(str); if (cookie) res[cookie.name] = cookie.value; return res; }, {}); } // Writes a set-cookie-string based on the standard definded in RFC6265 S4.1.1. function writeCookieString(obj) { return Object.keys(obj).reduce(function(str, name) { var encodedName = encodeCookieComponent(name); var encodedValue = encodeCookieComponent(obj[name]); str += (str ? '; ' : '') + encodedName + '=' + encodedValue; return str; }, ''); } // returns a key/val object from an array of cookie strings exports.read = parseSetCookieHeader; // writes a cookie string header exports.write = writeCookieString; /***/ }), /***/ 64313: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var iconv, inherits = __webpack_require__(73837).inherits, stream = __webpack_require__(12781); var regex = /(?:charset|encoding)\s*=\s*['"]? *([\w\-]+)/i; inherits(StreamDecoder, stream.Transform); function StreamDecoder(charset) { if (!(this instanceof StreamDecoder)) return new StreamDecoder(charset); stream.Transform.call(this, charset); this.charset = charset; this.parsed_chunk = false; } StreamDecoder.prototype._transform = function(chunk, encoding, done) { // try to get charset from chunk, but just once if (!this.parsed_chunk && (this.charset == 'utf-8' || this.charset == 'utf8')) { this.parsed_chunk = true; var matches = regex.exec(chunk.toString()); if (matches) { var found = matches[1].toLowerCase().replace('utf8', 'utf-8'); // canonicalize; // set charset, but only if iconv can handle it if (iconv.encodingExists(found)) this.charset = found; } } // if charset is already utf-8 or given encoding isn't supported, just pass through if (this.charset == 'utf-8' || !iconv.encodingExists(this.charset)) { this.push(chunk); return done(); } // initialize stream decoder if not present var self = this; if (!this.decoder) { this.decoder = iconv.decodeStream(this.charset); this.decoder.on('data', function(decoded_chunk) { self.push(decoded_chunk); }); }; this.decoder.write(chunk); done(); } module.exports = function(charset) { try { if (!iconv) iconv = __webpack_require__(50029); } catch(e) { /* iconv not found */ } if (iconv) return new StreamDecoder(charset); else return new stream.PassThrough; } /***/ }), /***/ 99095: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var readFile = __webpack_require__(57147).readFile, basename = __webpack_require__(71017).basename; exports.build = function(data, boundary, callback) { if (typeof data != 'object' || typeof data.pipe == 'function') return callback(new Error('Multipart builder expects data as key/val object.')); var body = '', object = flatten(data), count = Object.keys(object).length; if (count === 0) return callback(new Error('Empty multipart body. Invalid data.')) function done(err, section) { if (err) return callback(err); if (section) body += section; --count || callback(null, body + '--' + boundary + '--'); }; for (var key in object) { var value = object[key]; if (value === null || typeof value == 'undefined') { done(); } else if (Buffer.isBuffer(value)) { var part = { buffer: value, content_type: 'application/octet-stream' }; generate_part(key, part, boundary, done); } else { var part = (value.buffer || value.file || value.content_type) ? value : { value: value }; generate_part(key, part, boundary, done); } } } function generate_part(name, part, boundary, callback) { var return_part = '--' + boundary + '\r\n'; return_part += 'Content-Disposition: form-data; name="' + name + '"'; function append(data, filename) { if (data) { var binary = part.content_type.indexOf('text') == -1; return_part += '; filename="' + encodeURIComponent(filename) + '"\r\n'; if (binary) return_part += 'Content-Transfer-Encoding: binary\r\n'; return_part += 'Content-Type: ' + part.content_type + '\r\n\r\n'; return_part += binary ? data.toString('binary') : data.toString('utf8'); } callback(null, return_part + '\r\n'); }; if ((part.file || part.buffer) && part.content_type) { var filename = part.filename ? part.filename : part.file ? basename(part.file) : name; if (part.buffer) return append(part.buffer, filename); readFile(part.file, function(err, data) { if (err) return callback(err); append(data, filename); }); } else { if (typeof part.value == 'object') return callback(new Error('Object received for ' + name + ', expected string.')) if (part.content_type) { return_part += '\r\n'; return_part += 'Content-Type: ' + part.content_type; } return_part += '\r\n\r\n'; return_part += Buffer.from(String(part.value), 'utf8').toString('binary'); append(); } } // flattens nested objects for multipart body function flatten(object, into, prefix) { into = into || {}; for(var key in object) { var prefix_key = prefix ? prefix + '[' + key + ']' : key; var prop = object[key]; if (prop && typeof prop === 'object' && !(prop.buffer || prop.file || prop.content_type)) flatten(prop, into, prefix_key) else into[prefix_key] = prop; } return into; } /***/ }), /***/ 64484: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { ////////////////////////////////////////// // Needle -- HTTP Client for Node.js // Written by Tomás Pollak // (c) 2012-2023 - Fork Ltd. // MIT Licensed ////////////////////////////////////////// var fs = __webpack_require__(57147), http = __webpack_require__(13685), https = __webpack_require__(95687), url = __webpack_require__(57310), stream = __webpack_require__(12781), debug = __webpack_require__(73837).debuglog('needle'), stringify = __webpack_require__(40773)/* .build */ .J, multipart = __webpack_require__(99095), auth = __webpack_require__(21901), cookies = __webpack_require__(70035), parsers = __webpack_require__(34417), decoder = __webpack_require__(64313), utils = __webpack_require__(21168); ////////////////////////////////////////// // variabilia var version = __webpack_require__(666)/* .version */ .i8; var user_agent = 'Needle/' + version; user_agent += ' (Node.js ' + process.version + '; ' + process.platform + ' ' + process.arch + ')'; var tls_options = 'pfx key passphrase cert ca ciphers rejectUnauthorized secureProtocol checkServerIdentity family'; // older versions of node (< 0.11.4) prevent the runtime from exiting // because of connections in keep-alive state. so if this is the case // we'll default new requests to set a Connection: close header. var close_by_default = !http.Agent || http.Agent.defaultMaxSockets != Infinity; // see if we have Object.assign. otherwise fall back to util._extend var extend = Object.assign ? Object.assign : __webpack_require__(73837)._extend; // these are the status codes that Needle interprets as redirects. var redirect_codes = [301, 302, 303, 307, 308]; ////////////////////////////////////////// // decompressors for gzip/deflate/br bodies function bind_opts(fn, options) { return fn.bind(null, options); } var decompressors = {}; try { var zlib = __webpack_require__(59796); // Enable Z_SYNC_FLUSH to avoid Z_BUF_ERROR errors (Node PR #2595) var zlib_options = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH }; var br_options = { flush: zlib.BROTLI_OPERATION_FLUSH, finishFlush: zlib.BROTLI_OPERATION_FLUSH }; decompressors['x-deflate'] = bind_opts(zlib.Inflate, zlib_options); decompressors['deflate'] = bind_opts(zlib.Inflate, zlib_options); decompressors['x-gzip'] = bind_opts(zlib.Gunzip, zlib_options); decompressors['gzip'] = bind_opts(zlib.Gunzip, zlib_options); if (typeof zlib.BrotliDecompress === 'function') { decompressors['br'] = bind_opts(zlib.BrotliDecompress, br_options); } } catch(e) { /* zlib not available */ } ////////////////////////////////////////// // options and aliases var defaults = { // data boundary : '--------------------NODENEEDLEHTTPCLIENT', encoding : 'utf8', parse_response : 'all', // same as true. valid options: 'json', 'xml' or false/null proxy : null, // agent & headers agent : null, headers : {}, accept : '*/*', user_agent : user_agent, // numbers open_timeout : 10000, response_timeout : 0, read_timeout : 0, follow_max : 0, stream_length : -1, // abort signal signal : null, // booleans compressed : false, decode_response : true, parse_cookies : true, follow_set_cookies : false, follow_set_referer : false, follow_keep_method : false, follow_if_same_host : false, follow_if_same_protocol : false, follow_if_same_location : false, use_proxy_from_env_var : true } var aliased = { options: { decode : 'decode_response', parse : 'parse_response', timeout : 'open_timeout', follow : 'follow_max' }, inverted: {} } // only once, invert aliased keys so we can get passed options. Object.keys(aliased.options).map(function(k) { var value = aliased.options[k]; aliased.inverted[value] = k; }); ////////////////////////////////////////// // helpers function keys_by_type(type) { return Object.keys(defaults).map(function(el) { if (defaults[el] !== null && defaults[el].constructor == type) return el; }).filter(function(el) { return el }) } ////////////////////////////////////////// // the main act function Needle(method, uri, data, options, callback) { // if (!(this instanceof Needle)) { // return new Needle(method, uri, data, options, callback); // } if (typeof uri !== 'string') throw new TypeError('URL must be a string, not ' + uri); this.method = method.toLowerCase(); this.uri = uri; this.data = data; if (typeof options == 'function') { this.callback = options; this.options = {}; } else { this.callback = callback; this.options = options; } } Needle.prototype.setup = function(uri, options) { function get_option(key, fallback) { // if original is in options, return that value if (typeof options[key] != 'undefined') return options[key]; // otherwise, return value from alias or fallback/undefined return typeof options[aliased.inverted[key]] != 'undefined' ? options[aliased.inverted[key]] : fallback; } function check_value(expected, key) { var value = get_option(key), type = typeof value; if (type != 'undefined' && type != expected) throw new TypeError(type + ' received for ' + key + ', but expected a ' + expected); return (type == expected) ? value : defaults[key]; } ////////////////////////////////////////////////// // the basics var config = { http_opts : { agent: get_option('agent', defaults.agent), localAddress: get_option('localAddress', undefined), lookup: get_option('lookup', undefined), signal: get_option('signal', defaults.signal) }, // passed later to http.request() directly headers : {}, output : options.output, proxy : get_option('proxy', defaults.proxy), parser : get_option('parse_response', defaults.parse_response), encoding : options.encoding || (options.multipart ? 'binary' : defaults.encoding) } keys_by_type(Boolean).forEach(function(key) { config[key] = check_value('boolean', key); }) keys_by_type(Number).forEach(function(key) { config[key] = check_value('number', key); }) if (config.http_opts.signal && !(config.http_opts.signal instanceof AbortSignal)) throw new TypeError(typeof config.http_opts.signal + ' received for signal, but expected an AbortSignal'); // populate http_opts with given TLS options tls_options.split(' ').forEach(function(key) { if (typeof options[key] != 'undefined') { if (config.http_opts.agent) { // pass option to existing agent config.http_opts.agent.options[key] = options[key]; } else { config.http_opts[key] = options[key]; } } }); ////////////////////////////////////////////////// // headers, cookies for (var key in defaults.headers) config.headers[key] = defaults.headers[key]; config.headers['accept'] = options.accept || defaults.accept; config.headers['user-agent'] = options.user_agent || defaults.user_agent; if (options.content_type) config.headers['content-type'] = options.content_type; // set connection header if opts.connection was passed, or if node < 0.11.4 (close) if (options.connection || close_by_default) config.headers['connection'] = options.connection || 'close'; if ((options.compressed || defaults.compressed) && typeof zlib != 'undefined') config.headers['accept-encoding'] = decompressors['br'] ? 'gzip, deflate, br' : 'gzip, deflate'; if (options.cookies) config.headers['cookie'] = cookies.write(options.cookies); ////////////////////////////////////////////////// // basic/digest auth if (uri.match(/[^\/]@/)) { // url contains user:pass@host, so parse it. var parts = (url.parse(uri).auth || '').split(':'); options.username = parts[0]; options.password = parts[1]; } if (options.username) { if (options.auth && (options.auth == 'auto' || options.auth == 'digest')) { config.credentials = [options.username, options.password]; } else { config.headers['authorization'] = auth.basic(options.username, options.password); } } if (config.use_proxy_from_env_var) { var env_proxy = utils.get_env_var(['HTTP_PROXY', 'HTTPS_PROXY'], true); if (!config.proxy && env_proxy) config.proxy = env_proxy; } // if proxy is present, set auth header from either url or proxy_user option. if (config.proxy) { if (!config.use_proxy_from_env_var || utils.should_proxy_to(uri)) { if (config.proxy.indexOf('http') === -1) config.proxy = 'http://' + config.proxy; if (config.proxy.indexOf('@') !== -1) { var proxy = (url.parse(config.proxy).auth || '').split(':'); options.proxy_user = proxy[0]; options.proxy_pass = proxy[1]; } if (options.proxy_user) config.headers['proxy-authorization'] = auth.basic(options.proxy_user, options.proxy_pass); } else { delete config.proxy; } } // now that all our headers are set, overwrite them if instructed. for (var h in options.headers) config.headers[h.toLowerCase()] = options.headers[h]; config.uri_modifier = get_option('uri_modifier', null); return config; } Needle.prototype.start = function() { var out = new stream.PassThrough({ objectMode: false }), uri = this.uri, data = this.data, method = this.method, callback = (typeof this.options == 'function') ? this.options : this.callback, options = this.options || {}; // if no 'http' is found on URL, prepend it. if (uri.indexOf('http') === -1) uri = uri.replace(/^(\/\/)?/, 'http://'); var self = this, body, waiting = false, config = this.setup(uri, options); // unless options.json was set to false, assume boss also wants JSON if content-type matches. var json = options.json || (options.json !== false && config.headers['content-type'] == 'application/json'); if (data) { if (options.multipart) { // boss says we do multipart. so we do it. var boundary = options.boundary || defaults.boundary; waiting = true; multipart.build(data, boundary, function(err, parts) { if (err) throw(err); config.headers['content-type'] = 'multipart/form-data; boundary=' + boundary; next(parts); }); } else if (utils.is_stream(data)) { if (method == 'get') throw new Error('Refusing to pipe() a stream via GET. Did you mean .post?'); if (config.stream_length > 0 || (config.stream_length === 0 && data.path)) { // ok, let's get the stream's length and set it as the content-length header. // this prevents some servers from cutting us off before all the data is sent. waiting = true; utils.get_stream_length(data, config.stream_length, function(length) { data.length = length; next(data); }) } else { // if the boss doesn't want us to get the stream's length, or if it doesn't // have a file descriptor for that purpose, then just head on. body = data; } } else if (Buffer.isBuffer(data)) { body = data; // use the raw buffer as request body. } else if (method == 'get' && !json) { // append the data to the URI as a querystring. uri = uri.replace(/\?.*|$/, '?' + stringify(data)); } else { // string or object data, no multipart. // if string, leave it as it is, otherwise, stringify. body = (typeof(data) === 'string') ? data : json ? JSON.stringify(data) : stringify(data); // ensure we have a buffer so bytecount is correct. body = Buffer.from(body, config.encoding); } } function next(body) { if (body) { if (body.length) config.headers['content-length'] = body.length; // if no content-type was passed, determine if json or not. if (!config.headers['content-type']) { config.headers['content-type'] = json ? 'application/json; charset=utf-8' : 'application/x-www-form-urlencoded'; // no charset says W3 spec. } } // unless a specific accept header was set, assume json: true wants JSON back. if (options.json && (!options.accept && !(options.headers || {}).accept)) config.headers['accept'] = 'application/json'; self.send_request(1, method, uri, config, body, out, callback); } if (!waiting) next(body); return out; } Needle.prototype.get_request_opts = function(method, uri, config) { var opts = config.http_opts, proxy = config.proxy, remote = proxy ? url.parse(proxy) : url.parse(uri); opts.protocol = remote.protocol; opts.host = remote.hostname; opts.port = remote.port || (remote.protocol == 'https:' ? 443 : 80); opts.path = proxy ? uri : remote.pathname + (remote.search || ''); opts.method = method; opts.headers = config.headers; if (!opts.headers['host']) { // if using proxy, make sure the host header shows the final destination var target = proxy ? url.parse(uri) : remote; opts.headers['host'] = target.hostname; // and if a non standard port was passed, append it to the port header if (target.port && [80, 443].indexOf(target.port) === -1) { opts.headers['host'] += ':' + target.port; } } return opts; } Needle.prototype.should_follow = function(location, config, original) { if (!location) return false; // returns true if location contains matching property (host or protocol) function matches(property) { var property = original[property]; return location.indexOf(property) !== -1; } // first, check whether the requested location is actually different from the original if (!config.follow_if_same_location && location === original) return false; if (config.follow_if_same_host && !matches('host')) return false; // host does not match, so not following if (config.follow_if_same_protocol && !matches('protocol')) return false; // procotol does not match, so not following return true; } Needle.prototype.send_request = function(count, method, uri, config, post_data, out, callback) { if (typeof config.uri_modifier === 'function') { var modified_uri = config.uri_modifier(uri); debug('Modifying request URI', uri + ' => ' + modified_uri); uri = modified_uri; } var request, timer, returned = 0, self = this, request_opts = this.get_request_opts(method, uri, config), protocol = request_opts.protocol == 'https:' ? https : http; signal = request_opts.signal; function done(err, resp) { if (returned++ > 0) return debug('Already finished, stopping here.'); if (timer) clearTimeout(timer); request.removeListener('error', had_error); out.done = true; // An error can still be fired after closing. In particular, on macOS. // See also: // - https://github.com/tomas/needle/issues/391 // - https://github.com/less/less.js/issues/3693 // - https://github.com/nodejs/node/issues/27916 request.once('error', function() {}); if (callback) return callback(err, resp, resp ? resp.body : undefined); // NOTE: this event used to be called 'end', but the behaviour was confusing // when errors ocurred, because the stream would still emit an 'end' event. out.emit('done', err); // trigger the 'done' event on streams we're being piped to, if any var pipes = out._readableState.pipes || []; if (!pipes.forEach) pipes = [pipes]; pipes.forEach(function(st) { st.emit('done', err); }) } function had_error(err) { debug('Request error', err); out.emit('err', err); done(err || new Error('Unknown error when making request.')); } function abort_handler() { out.emit('err', new Error('Aborted by signal.')); request.destroy(); } function set_timeout(type, milisecs) { if (timer) clearTimeout(timer); if (milisecs <= 0) return; timer = setTimeout(function() { out.emit('timeout', type); request.destroy(); // also invoke done() to terminate job on read_timeout if (type == 'read') done(new Error(type + ' timeout')); signal && signal.removeEventListener('abort', abort_handler); }, milisecs); } debug('Making request #' + count, request_opts); request = protocol.request(request_opts, function(resp) { var headers = resp.headers; debug('Got response', resp.statusCode, headers); out.emit('response', resp); set_timeout('read', config.read_timeout); // if we got cookies, parse them unless we were instructed not to. make sure to include any // cookies that might have been set on previous redirects. if (config.parse_cookies && (headers['set-cookie'] || config.previous_resp_cookies)) { resp.cookies = extend(config.previous_resp_cookies || {}, cookies.read(headers['set-cookie'])); debug('Got cookies', resp.cookies); } // if redirect code is found, determine if we should follow it according to the given options. if (redirect_codes.indexOf(resp.statusCode) !== -1 && self.should_follow(headers.location, config, uri)) { // clear timer before following redirects to prevent unexpected setTimeout consequence clearTimeout(timer); if (count <= config.follow_max) { out.emit('redirect', headers.location); // unless 'follow_keep_method' is true, rewrite the request to GET before continuing. if (!config.follow_keep_method) { method = 'GET'; post_data = null; delete config.headers['content-length']; // in case the original was a multipart POST request. } // if follow_set_cookies is true, insert cookies in the next request's headers. // we set both the original request cookies plus any response cookies we might have received. if (config.follow_set_cookies && utils.host_and_ports_match(headers.location, uri)) { var request_cookies = cookies.read(config.headers['cookie']); config.previous_resp_cookies = resp.cookies; if (Object.keys(request_cookies).length || Object.keys(resp.cookies || {}).length) { config.headers['cookie'] = cookies.write(extend(request_cookies, resp.cookies)); } } else if (config.headers['cookie']) { debug('Clearing original request cookie', config.headers['cookie']); delete config.headers['cookie']; } if (config.follow_set_referer) config.headers['referer'] = encodeURI(uri); // the original, not the destination URL. config.headers['host'] = null; // clear previous Host header to avoid conflicts. var redirect_url = utils.resolve_url(headers.location, uri); debug('Redirecting to ' + redirect_url.toString()); return self.send_request(++count, method, redirect_url.toString(), config, post_data, out, callback); } else if (config.follow_max > 0) { return done(new Error('Max redirects reached. Possible loop in: ' + headers.location)); } } // if auth is requested and credentials were not passed, resend request, provided we have user/pass. if (resp.statusCode == 401 && headers['www-authenticate'] && config.credentials) { if (!config.headers['authorization']) { // only if authentication hasn't been sent var auth_header = auth.header(headers['www-authenticate'], config.credentials, request_opts); if (auth_header) { config.headers['authorization'] = auth_header; return self.send_request(count, method, uri, config, post_data, out, callback); } } } // ok, so we got a valid (non-redirect & authorized) response. let's notify the stream guys. out.emit('header', resp.statusCode, headers); out.emit('headers', headers); var pipeline = [], mime = utils.parse_content_type(headers['content-type']), text_response = mime.type && (mime.type.indexOf('text/') != -1 || !!mime.type.match(/(\/|\+)(xml|json)$/)); // To start, if our body is compressed and we're able to inflate it, do it. if (headers['content-encoding'] && decompressors[headers['content-encoding']]) { var decompressor = decompressors[headers['content-encoding']](); // make sure we catch errors triggered by the decompressor. decompressor.on('error', had_error); pipeline.push(decompressor); } // If parse is enabled and we have a parser for it, then go for it. if (config.parser && parsers[mime.type]) { // If a specific parser was requested, make sure we don't parse other types. var parser_name = config.parser.toString().toLowerCase(); if (['xml', 'json'].indexOf(parser_name) == -1 || parsers[mime.type].name == parser_name) { // OK, so either we're parsing all content types or the one requested matches. out.parser = parsers[mime.type].name; pipeline.push(parsers[mime.type].fn()); // Set objectMode on out stream to improve performance. out._writableState.objectMode = true; out._readableState.objectMode = true; } // If we're not parsing, and unless decoding was disabled, we'll try // decoding non UTF-8 bodies to UTF-8, using the iconv-lite library. } else if (text_response && config.decode_response && mime.charset) { pipeline.push(decoder(mime.charset)); } // And `out` is the stream we finally push the decoded/parsed output to. pipeline.push(out); // Now, release the kraken! utils.pump_streams([resp].concat(pipeline), function(err) { if (err) debug(err) // on node v8.x, if an error ocurrs on the receiving end, // then we want to abort the request to avoid having dangling sockets if (err && err.message == 'write after end') request.destroy(); }); // If the user has requested and output file, pipe the output stream to it. // In stream mode, we will still get the response stream to play with. if (config.output && resp.statusCode == 200) { // for some reason, simply piping resp to the writable stream doesn't // work all the time (stream gets cut in the middle with no warning). // so we'll manually need to do the readable/write(chunk) trick. var file = fs.createWriteStream(config.output); file.on('error', had_error); out.on('end', function() { if (file.writable) file.end(); }); file.on('close', function() { delete out.file; }) out.on('readable', function() { var chunk; while ((chunk = this.read()) !== null) { if (file.writable) file.write(chunk); // if callback was requested, also push it to resp.body if (resp.body) resp.body.push(chunk); } }) out.file = file; } // Only aggregate the full body if a callback was requested. if (callback) { resp.raw = []; resp.body = []; resp.bytes = 0; // Gather and count the amount of (raw) bytes using a PassThrough stream. var clean_pipe = new stream.PassThrough(); clean_pipe.on('readable', function() { var chunk; while ((chunk = this.read()) != null) { resp.bytes += chunk.length; resp.raw.push(chunk); } }) utils.pump_streams([resp, clean_pipe], function(err) { if (err) debug(err); }); // Listen on the 'readable' event to aggregate the chunks, but only if // file output wasn't requested. Otherwise we'd have two stream readers. if (!config.output || resp.statusCode != 200) { out.on('readable', function() { var chunk; while ((chunk = this.read()) !== null) { // We're either pushing buffers or objects, never strings. if (typeof chunk == 'string') chunk = Buffer.from(chunk); // Push all chunks to resp.body. We'll bind them in resp.end(). resp.body.push(chunk); } }) } } // And set the .body property once all data is in. out.on('end', function() { if (resp.body) { // callback mode // we want to be able to access to the raw data later, so keep a reference. resp.raw = Buffer.concat(resp.raw); // if parse was successful, we should have an array with one object if (resp.body[0] !== undefined && !Buffer.isBuffer(resp.body[0])) { // that's our body right there. resp.body = resp.body[0]; // set the parser property on our response. we may want to check. if (out.parser) resp.parser = out.parser; } else { // we got one or several buffers. string or binary. resp.body = Buffer.concat(resp.body); // if we're here and parsed is true, it means we tried to but it didn't work. // so given that we got a text response, let's stringify it. if (text_response || out.parser) { resp.body = resp.body.toString(); } } } // if an output file is being written to, make sure the callback // is triggered after all data has been written to it. if (out.file) { out.file.on('close', function() { done(null, resp); }) } else { // elvis has left the building. done(null, resp); } }); // out.on('error', function(err) { // had_error(err); // if (err.code == 'ERR_STREAM_DESTROYED' || err.code == 'ERR_STREAM_PREMATURE_CLOSE') { // request.abort(); // } // }) }); // end request call // unless open_timeout was disabled, set a timeout to abort the request. set_timeout('open', config.open_timeout); // handle errors on the request object. things might get bumpy. request.on('error', had_error); // make sure timer is cleared if request is aborted (issue #257) request.once('abort', function() { if (timer) clearTimeout(timer); }) // set response timeout once we get a valid socket request.once('socket', function(socket) { if (socket.connecting) { socket.once('connect', function() { set_timeout('response', config.response_timeout); }) } else { set_timeout('response', config.response_timeout); } }) if (post_data) { if (utils.is_stream(post_data)) { utils.pump_streams([post_data, request], function(err) { if (err) debug(err); }); } else { request.write(post_data, config.encoding); request.end(); } } else { request.end(); } if (signal) { // abort signal given, so handle it if (signal.aborted === true) { abort_handler(); } else { signal.addEventListener('abort', abort_handler, { once: true }); } } out.abort = function() { request.destroy() }; // easier access out.request = request; return out; } ////////////////////////////////////////// // exports if (typeof Promise !== 'undefined') { module.exports = function() { var verb, args = [].slice.call(arguments); if (args[0].match(/\.|\//)) // first argument looks like a URL verb = (args.length > 2) ? 'post' : 'get'; else verb = args.shift(); if (verb.match(/get|head/i) && args.length == 2) args.splice(1, 0, null); // assume no data if head/get with two args (url, options) return new Promise(function(resolve, reject) { module.exports.request(verb, args[0], args[1], args[2], function(err, resp) { return err ? reject(err) : resolve(resp); }); }) } } module.exports.version = version; module.exports.defaults = function(obj) { for (var key in obj) { var target_key = aliased.options[key] || key; if (defaults.hasOwnProperty(target_key) && typeof obj[key] != 'undefined') { if (target_key != 'parse_response' && target_key != 'proxy' && target_key != 'agent' && target_key != 'signal') { // ensure type matches the original, except for proxy/parse_response that can be null/bool or string, and signal that can be null/AbortSignal var valid_type = defaults[target_key].constructor.name; if (obj[key].constructor.name != valid_type) throw new TypeError('Invalid type for ' + key + ', should be ' + valid_type); } else if (target_key === 'signal' && obj[key] !== null && !(obj[key] instanceof AbortSignal)) { throw new TypeError('Invalid type for ' + key + ', should be AbortSignal'); } defaults[target_key] = obj[key]; } else { throw new Error('Invalid property for defaults:' + target_key); } } return defaults; } 'head get'.split(' ').forEach(function(method) { module.exports[method] = function(uri, options, callback) { return new Needle(method, uri, null, options, callback).start(); } }) 'post put patch delete'.split(' ').forEach(function(method) { module.exports[method] = function(uri, data, options, callback) { return new Needle(method, uri, data, options, callback).start(); } }) module.exports.request = function(method, uri, data, opts, callback) { return new Needle(method, uri, data, opts, callback).start(); }; /***/ }), /***/ 34417: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { ////////////////////////////////////////// // Defines mappings between content-type // and the appropriate parsers. ////////////////////////////////////////// var Transform = __webpack_require__(12781).Transform; var sax = __webpack_require__(36099); function parseXML(str, cb) { var obj, current, parser = sax.parser(true, { trim: true, lowercase: true }) parser.onerror = parser.onend = done; function done(err) { parser.onerror = parser.onend = function() { } cb(err, obj) } function newElement(name, attributes) { return { name: name || '', value: '', attributes: attributes || {}, children: [] } } parser.oncdata = parser.ontext = function(t) { if (current) current.value += t } parser.onopentag = function(node) { var element = newElement(node.name, node.attributes) if (current) { element.parent = current current.children.push(element) } else { // root object obj = element } current = element }; parser.onclosetag = function() { if (typeof current.parent !== 'undefined') { var just_closed = current current = current.parent delete just_closed.parent } } parser.write(str).close() } function parserFactory(name, fn) { function parser() { var chunks = [], stream = new Transform({ objectMode: true }); // Buffer all our data stream._transform = function(chunk, encoding, done) { chunks.push(chunk); done(); } // And call the parser when all is there. stream._flush = function(done) { var self = this, data = Buffer.concat(chunks); try { fn(data, function(err, result) { if (err) throw err; self.push(result); }); } catch (err) { self.push(data); // just pass the original data } finally { done(); } } return stream; } return { fn: parser, name: name }; } var parsers = {} function buildParser(name, types, fn) { var parser = parserFactory(name, fn); types.forEach(function(type) { parsers[type] = parser; }) } buildParser('json', [ 'application/json', 'application/hal+json', 'text/javascript', 'application/vnd.api+json' ], function(buffer, cb) { var err, data; try { data = JSON.parse(buffer); } catch (e) { err = e; } cb(err, data); }); buildParser('xml', [ 'text/xml', 'application/xml', 'application/rdf+xml', 'application/rss+xml', 'application/atom+xml' ], function(buffer, cb) { parseXML(buffer.toString(), function(err, obj) { cb(err, obj) }) }); module.exports = parsers; module.exports.use = buildParser; /***/ }), /***/ 40773: /***/ ((__unused_webpack_module, exports) => { // based on the qs module, but handles null objects as expected // fixes by Tomas Pollak. var toString = Object.prototype.toString; function stringify(obj, prefix) { if (prefix && (obj === null || typeof obj == 'undefined')) { return prefix + '='; } else if (toString.call(obj) == '[object Array]') { return stringifyArray(obj, prefix); } else if (toString.call(obj) == '[object Object]') { return stringifyObject(obj, prefix); } else if (toString.call(obj) == '[object Date]') { return obj.toISOString(); } else if (prefix) { // string inside array or hash return prefix + '=' + encodeURIComponent(String(obj)); } else if (String(obj).indexOf('=') !== -1) { // string with equal sign return String(obj); } else { throw new TypeError('Cannot build a querystring out of: ' + obj); } }; function stringifyArray(arr, prefix) { var ret = []; for (var i = 0, len = arr.length; i < len; i++) { if (prefix) ret.push(stringify(arr[i], prefix + '[]')); else ret.push(stringify(arr[i])); } return ret.join('&'); } function stringifyObject(obj, prefix) { var ret = []; Object.keys(obj).forEach(function(key) { ret.push(stringify(obj[key], prefix ? prefix + '[' + encodeURIComponent(key) + ']' : encodeURIComponent(key))); }) return ret.join('&'); } exports.J = stringify; /***/ }), /***/ 21168: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(57147), url = __webpack_require__(57310), stream = __webpack_require__(12781); function resolve_url(href, base) { if (url.URL) return new url.URL(href, base); // older Node version (< v6.13) return base ? url.resolve(base, href) : href; } function host_and_ports_match(url1, url2) { if (url1.indexOf('http') < 0) url1 = 'http://' + url1; if (url2.indexOf('http') < 0) url2 = 'http://' + url2; var a = url.parse(url1), b = url.parse(url2); return a.host == b.host && String(a.port || (a.protocol == 'https:' ? 443 : 80)) == String(b.port || (b.protocol == 'https:' ? 443 : 80)); } // returns false if a no_proxy host or pattern matches given url function should_proxy_to(uri) { var no_proxy = get_env_var(['NO_PROXY'], true); if (!no_proxy) return true; // previous (naive, simple) strategy // var host, hosts = no_proxy.split(','); // for (var i in hosts) { // host = hosts[i]; // if (host_and_ports_match(host, uri)) { // return false; // } // } var pattern, pattern_list = no_proxy.split(/[\s,]+/); for (var i in pattern_list) { pattern = pattern_list[i]; if (pattern.trim().length == 0) continue; // replace leading dot by asterisk, escape dots and finally replace asterisk by .* var regex = new RegExp(pattern.replace(/^\./, "*").replace(/[.]/g, '\\$&').replace(/\*/g, '.*')) if (uri.match(regex)) return false; } return true; } function get_env_var(keys, try_lower) { var val, i = -1, env = process.env; while (!val && i < keys.length-1) { val = env[keys[++i]]; if (!val && try_lower) { val = env[keys[i].toLowerCase()]; } } return val; } function parse_content_type(header) { if (!header || header === '') return {}; var found, charset = 'utf8', arr = header.split(';'); if (arr.length > 1 && (found = arr[1].match(/charset=(.+)/))) charset = found[1]; return { type: arr[0], charset: charset }; } function is_stream(obj) { return typeof obj.pipe === 'function'; } function get_stream_length(stream, given_length, cb) { if (given_length > 0) return cb(given_length); if (stream.end !== void 0 && stream.end !== Infinity && stream.start !== void 0) return cb((stream.end + 1) - (stream.start || 0)); fs.stat(stream.path, function(err, stat) { cb(stat ? stat.size - (stream.start || 0) : null); }); } function pump_streams(streams, cb) { if (stream.pipeline) return stream.pipeline.apply(null, streams.concat(cb)); var tmp = streams.shift(); while (streams.length) { tmp = tmp.pipe(streams.shift()); tmp.once('error', function(e) { cb && cb(e); cb = null; }) } } module.exports = { resolve_url: resolve_url, get_env_var: get_env_var, host_and_ports_match: host_and_ports_match, should_proxy_to: should_proxy_to, parse_content_type: parse_content_type, is_stream: is_stream, get_stream_length: get_stream_length, pump_streams: pump_streams } /***/ }), /***/ 16457: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. exports._dbcs = DBCSCodec; var UNASSIGNED = -1, GB18030_CODE = -2, SEQ_START = -10, NODE_START = -1000, UNASSIGNED_NODE = new Array(0x100), DEF_CHAR = -1; for (var i = 0; i < 0x100; i++) UNASSIGNED_NODE[i] = UNASSIGNED; // Class DBCSCodec reads and initializes mapping tables. function DBCSCodec(codecOptions, iconv) { this.encodingName = codecOptions.encodingName; if (!codecOptions) throw new Error("DBCS codec is called without the data.") if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); // Load tables. var mappingTable = codecOptions.table(); // Decode tables: MBCS -> Unicode. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. // Trie root is decodeTables[0]. // Values: >= 0 -> unicode character code. can be > 0xFFFF // == UNASSIGNED -> unknown/unassigned sequence. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. // <= NODE_START -> index of the next node in our trie to process next byte. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. this.decodeTables = []; this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = []; // Actual mapping tables consist of chunks. Use them to fill up decode tables. for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); // Load & create GB18030 tables when needed. if (typeof codecOptions.gb18030 === 'function') { this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. // Add GB18030 common decode nodes. var commonThirdByteNodeIdx = this.decodeTables.length; this.decodeTables.push(UNASSIGNED_NODE.slice(0)); var commonFourthByteNodeIdx = this.decodeTables.length; this.decodeTables.push(UNASSIGNED_NODE.slice(0)); // Fill out the tree var firstByteNode = this.decodeTables[0]; for (var i = 0x81; i <= 0xFE; i++) { var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; for (var j = 0x30; j <= 0x39; j++) { if (secondByteNode[j] === UNASSIGNED) { secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; } else if (secondByteNode[j] > NODE_START) { throw new Error("gb18030 decode tables conflict at byte 2"); } var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; for (var k = 0x81; k <= 0xFE; k++) { if (thirdByteNode[k] === UNASSIGNED) { thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { continue; } else if (thirdByteNode[k] > NODE_START) { throw new Error("gb18030 decode tables conflict at byte 3"); } var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; for (var l = 0x30; l <= 0x39; l++) { if (fourthByteNode[l] === UNASSIGNED) fourthByteNode[l] = GB18030_CODE; } } } } } this.defaultCharUnicode = iconv.defaultCharUnicode; // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = []; // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). // Objects are kept separately from encodeTable to increase performance. this.encodeTableSeq = []; // Some chars can be decoded, but need not be encoded. var skipEncodeChars = {}; if (codecOptions.encodeSkipVals) for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { var val = codecOptions.encodeSkipVals[i]; if (typeof val === 'number') skipEncodeChars[val] = true; else for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = true; } // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars); // Add more encoding pairs when needed. if (codecOptions.encodeAdd) { for (var uChar in codecOptions.encodeAdd) if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); } this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); } DBCSCodec.prototype.encoder = DBCSEncoder; DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function(addr) { var bytes = []; for (; addr > 0; addr >>>= 8) bytes.push(addr & 0xFF); if (bytes.length == 0) bytes.push(0); var node = this.decodeTables[0]; for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. var val = node[bytes[i]]; if (val == UNASSIGNED) { // Create new node. node[bytes[i]] = NODE_START - this.decodeTables.length; this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); } else if (val <= NODE_START) { // Existing node. node = this.decodeTables[NODE_START - val]; } else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } return node; } DBCSCodec.prototype._addDecodeChunk = function(chunk) { // First element of chunk is the hex mbcs code where we start. var curAddr = parseInt(chunk[0], 16); // Choose the decoding node where we'll write our chars. var writeTable = this._getDecodeTrieNode(curAddr); curAddr = curAddr & 0xFF; // Write all other elements of the chunk to the table. for (var k = 1; k < chunk.length; k++) { var part = chunk[k]; if (typeof part === "string") { // String, write as-is. for (var l = 0; l < part.length;) { var code = part.charCodeAt(l++); if (0xD800 <= code && code < 0xDC00) { // Decode surrogate var codeTrail = part.charCodeAt(l++); if (0xDC00 <= codeTrail && codeTrail < 0xE000) writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); } else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) var len = 0xFFF - code + 2; var seq = []; for (var m = 0; m < len; m++) seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; this.decodeTableSeq.push(seq); } else writeTable[curAddr++] = code; // Basic char } } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. var charCode = writeTable[curAddr - 1] + 1; for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode++; } else throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); } if (curAddr > 0xFF) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); } // Encoder helpers DBCSCodec.prototype._getEncodeBucket = function(uCode) { var high = uCode >> 8; // This could be > 0xFF because of astral characters. if (this.encodeTable[high] === undefined) this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. return this.encodeTable[high]; } DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; if (bucket[low] <= SEQ_START) this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. else if (bucket[low] == UNASSIGNED) bucket[low] = dbcsCode; } DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { // Get the root of character tree according to first character of the sequence. var uCode = seq[0]; var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; var node; if (bucket[low] <= SEQ_START) { // There's already a sequence with - use it. node = this.encodeTableSeq[SEQ_START-bucket[low]]; } else { // There was no sequence object - allocate a new one. node = {}; if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. bucket[low] = SEQ_START - this.encodeTableSeq.length; this.encodeTableSeq.push(node); } // Traverse the character tree, allocating new nodes as needed. for (var j = 1; j < seq.length-1; j++) { var oldVal = node[uCode]; if (typeof oldVal === 'object') node = oldVal; else { node = node[uCode] = {} if (oldVal !== undefined) node[DEF_CHAR] = oldVal } } // Set the leaf to given dbcsCode. uCode = seq[seq.length-1]; node[uCode] = dbcsCode; } DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; var hasValues = false; var subNodeEmpty = {}; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; if (uCode >= 0) { this._setEncodeChar(uCode, mbCode); hasValues = true; } else if (uCode <= NODE_START) { var subNodeIdx = NODE_START - uCode; if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) hasValues = true; else subNodeEmpty[subNodeIdx] = true; } } else if (uCode <= SEQ_START) { this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); hasValues = true; } } return hasValues; } // == Encoder ================================================================== function DBCSEncoder(options, codec) { // Encoder state this.leadSurrogate = -1; this.seqObj = undefined; // Static data this.encodeTable = codec.encodeTable; this.encodeTableSeq = codec.encodeTableSeq; this.defaultCharSingleByte = codec.defCharSB; this.gb18030 = codec.gb18030; } DBCSEncoder.prototype.write = function(str) { var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; while (true) { // 0. Get next character. if (nextChar === -1) { if (i == str.length) break; var uCode = str.charCodeAt(i++); } else { var uCode = nextChar; nextChar = -1; } // 1. Handle surrogates. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. if (uCode < 0xDC00) { // We've got lead surrogate. if (leadSurrogate === -1) { leadSurrogate = uCode; continue; } else { leadSurrogate = uCode; // Double lead surrogate found. uCode = UNASSIGNED; } } else { // We've got trail surrogate. if (leadSurrogate !== -1) { uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); leadSurrogate = -1; } else { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED; } } } else if (leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. leadSurrogate = -1; } // 2. Convert uCode character. var dbcsCode = UNASSIGNED; if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence var resCode = seqObj[uCode]; if (typeof resCode === 'object') { // Sequence continues. seqObj = resCode; continue; } else if (typeof resCode == 'number') { // Sequence finished. Write it. dbcsCode = resCode; } else if (resCode == undefined) { // Current character is not part of the sequence. // Try default character for this sequence resCode = seqObj[DEF_CHAR]; if (resCode !== undefined) { dbcsCode = resCode; // Found. Write it. nextChar = uCode; // Current character will be written too in the next iteration. } else { // TODO: What if we have no default? (resCode == undefined) // Then, we should write first char of the sequence as-is and try the rest recursively. // Didn't do it for now because no encoding has this situation yet. // Currently, just skip the sequence and write current char. } } seqObj = undefined; } else if (uCode >= 0) { // Regular character var subtable = this.encodeTable[uCode >> 8]; if (subtable !== undefined) dbcsCode = subtable[uCode & 0xFF]; if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; continue; } if (dbcsCode == UNASSIGNED && this.gb18030) { // Use GB18030 algorithm to find character(s) to write. var idx = findIdx(this.gb18030.uChars, uCode); if (idx != -1) { var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; newBuf[j++] = 0x30 + dbcsCode; continue; } } } // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte; if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else if (dbcsCode < 0x10000) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } else if (dbcsCode < 0x1000000) { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = (dbcsCode >> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } else { newBuf[j++] = dbcsCode >>> 24; newBuf[j++] = (dbcsCode >>> 16) & 0xFF; newBuf[j++] = (dbcsCode >>> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } } this.seqObj = seqObj; this.leadSurrogate = leadSurrogate; return newBuf.slice(0, j); } DBCSEncoder.prototype.end = function() { if (this.leadSurrogate === -1 && this.seqObj === undefined) return; // All clean. Most often case. var newBuf = Buffer.alloc(10), j = 0; if (this.seqObj) { // We're in the sequence. var dbcsCode = this.seqObj[DEF_CHAR]; if (dbcsCode !== undefined) { // Write beginning of the sequence. if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } } else { // See todo above. } this.seqObj = undefined; } if (this.leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. newBuf[j++] = this.defaultCharSingleByte; this.leadSurrogate = -1; } return newBuf.slice(0, j); } // Export for testing DBCSEncoder.prototype.findIdx = findIdx; // == Decoder ================================================================== function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; this.prevBytes = []; // Static data this.decodeTables = codec.decodeTables; this.decodeTableSeq = codec.decodeTableSeq; this.defaultCharUnicode = codec.defaultCharUnicode; this.gb18030 = codec.gb18030; } DBCSDecoder.prototype.write = function(buf) { var newBuf = Buffer.alloc(buf.length*2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. uCode; for (var i = 0, j = 0; i < buf.length; i++) { var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. uCode = this.defaultCharUnicode.charCodeAt(0); i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. } else if (uCode === GB18030_CODE) { if (i >= 3) { var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); } else { var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + (curByte-0x30); } var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } else if (uCode <= NODE_START) { // Go to next trie node. nodeIdx = NODE_START - uCode; continue; } else if (uCode <= SEQ_START) { // Output a sequence of chars. var seq = this.decodeTableSeq[SEQ_START - uCode]; for (var k = 0; k < seq.length - 1; k++) { uCode = seq[k]; newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; } uCode = seq[seq.length-1]; } else throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. if (uCode >= 0x10000) { uCode -= 0x10000; var uCodeLead = 0xD800 | (uCode >> 10); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; uCode = 0xDC00 | (uCode & 0x3FF); } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; // Reset trie node. nodeIdx = 0; seqStart = i+1; } this.nodeIdx = nodeIdx; this.prevBytes = (seqStart >= 0) ? Array.prototype.slice.call(buf, seqStart) : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); return newBuf.slice(0, j).toString('ucs2'); } DBCSDecoder.prototype.end = function() { var ret = ''; // Try to parse all remaining chars. while (this.prevBytes.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; var bytesArr = this.prevBytes.slice(1); // Parse remaining as usual. this.prevBytes = []; this.nodeIdx = 0; if (bytesArr.length > 0) ret += this.write(bytesArr); } this.prevBytes = []; this.nodeIdx = 0; return ret; } // Binary search for GB18030. Returns largest i such that table[i] <= val. function findIdx(table, val) { if (table[0] > val) return -1; var l = 0, r = table.length; while (l < r-1) { // always table[l] <= val < table[r] var mid = l + ((r-l+1) >> 1); if (table[mid] <= val) l = mid; else r = mid; } return l; } /***/ }), /***/ 38733: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html 'shiftjis': { type: '_dbcs', table: function() { return __webpack_require__(39593) }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, encodeSkipVals: [{from: 0xED40, to: 0xF940}], }, 'csshiftjis': 'shiftjis', 'mskanji': 'shiftjis', 'sjis': 'shiftjis', 'windows31j': 'shiftjis', 'ms31j': 'shiftjis', 'xsjis': 'shiftjis', 'windows932': 'shiftjis', 'ms932': 'shiftjis', '932': 'shiftjis', 'cp932': 'shiftjis', 'eucjp': { type: '_dbcs', table: function() { return __webpack_require__(64489) }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 'gb2312': 'cp936', 'gb231280': 'cp936', 'gb23121980': 'cp936', 'csgb2312': 'cp936', 'csiso58gb231280': 'cp936', 'euccn': 'cp936', // Microsoft's CP936 is a subset and approximation of GBK. 'windows936': 'cp936', 'ms936': 'cp936', '936': 'cp936', 'cp936': { type: '_dbcs', table: function() { return __webpack_require__(636) }, }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. 'gbk': { type: '_dbcs', table: function() { return __webpack_require__(636).concat(__webpack_require__(3225)) }, }, 'xgbk': 'gbk', 'isoir58': 'gbk', // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 'gb18030': { type: '_dbcs', table: function() { return __webpack_require__(636).concat(__webpack_require__(3225)) }, gb18030: function() { return __webpack_require__(56390) }, encodeSkipVals: [0x80], encodeAdd: {'€': 0xA2E3}, }, 'chinese': 'gb18030', // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. 'windows949': 'cp949', 'ms949': 'cp949', '949': 'cp949', 'cp949': { type: '_dbcs', table: function() { return __webpack_require__(74804) }, }, 'cseuckr': 'cp949', 'csksc56011987': 'cp949', 'euckr': 'cp949', 'isoir149': 'cp949', 'korean': 'cp949', 'ksc56011987': 'cp949', 'ksc56011989': 'cp949', 'ksc5601': 'cp949', // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. 'windows950': 'cp950', 'ms950': 'cp950', '950': 'cp950', 'cp950': { type: '_dbcs', table: function() { return __webpack_require__(32644) }, }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. 'big5': 'big5hkscs', 'big5hkscs': { type: '_dbcs', table: function() { return __webpack_require__(32644).concat(__webpack_require__(60439)) }, encodeSkipVals: [ // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, ], }, 'cnbig5': 'big5hkscs', 'csbig5': 'big5hkscs', 'xxbig5': 'big5hkscs', }; /***/ }), /***/ 88369: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ __webpack_require__(11189), __webpack_require__(18763), __webpack_require__(89482), __webpack_require__(33996), __webpack_require__(57362), __webpack_require__(86127), __webpack_require__(5429), __webpack_require__(16457), __webpack_require__(38733), ]; // Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) if (Object.prototype.hasOwnProperty.call(module, enc)) exports[enc] = module[enc]; } /***/ }), /***/ 11189: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; // Export Node.js internal encodings. module.exports = { // Encodings utf8: { type: "_internal", bomAware: true}, cesu8: { type: "_internal", bomAware: true}, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: true}, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, // Codec. _internal: InternalCodec, }; //------------------------------------------------------------------------------ function InternalCodec(codecOptions, iconv) { this.enc = codecOptions.encodingName; this.bomAware = codecOptions.bomAware; if (this.enc === "base64") this.encoder = InternalEncoderBase64; else if (this.enc === "cesu8") { this.enc = "utf8"; // Use utf8 for decoding. this.encoder = InternalEncoderCesu8; // Add decoder for versions of Node not supporting CESU-8 if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8; this.defaultCharUnicode = iconv.defaultCharUnicode; } } } InternalCodec.prototype.encoder = InternalEncoder; InternalCodec.prototype.decoder = InternalDecoder; //------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. var StringDecoder = __webpack_require__(71576).StringDecoder; if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. StringDecoder.prototype.end = function() {}; function InternalDecoder(options, codec) { this.decoder = new StringDecoder(codec.enc); } InternalDecoder.prototype.write = function(buf) { if (!Buffer.isBuffer(buf)) { buf = Buffer.from(buf); } return this.decoder.write(buf); } InternalDecoder.prototype.end = function() { return this.decoder.end(); } //------------------------------------------------------------------------------ // Encoder is mostly trivial function InternalEncoder(options, codec) { this.enc = codec.enc; } InternalEncoder.prototype.write = function(str) { return Buffer.from(str, this.enc); } InternalEncoder.prototype.end = function() { } //------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. function InternalEncoderBase64(options, codec) { this.prevStr = ''; } InternalEncoderBase64.prototype.write = function(str) { str = this.prevStr + str; var completeQuads = str.length - (str.length % 4); this.prevStr = str.slice(completeQuads); str = str.slice(0, completeQuads); return Buffer.from(str, "base64"); } InternalEncoderBase64.prototype.end = function() { return Buffer.from(this.prevStr, "base64"); } //------------------------------------------------------------------------------ // CESU-8 encoder is also special. function InternalEncoderCesu8(options, codec) { } InternalEncoderCesu8.prototype.write = function(str) { var buf = Buffer.alloc(str.length * 3), bufIdx = 0; for (var i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); // Naive implementation, but it works because CESU-8 is especially easy // to convert from UTF-16 (which all JS strings are encoded in). if (charCode < 0x80) buf[bufIdx++] = charCode; else if (charCode < 0x800) { buf[bufIdx++] = 0xC0 + (charCode >>> 6); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } else { // charCode will always be < 0x10000 in javascript. buf[bufIdx++] = 0xE0 + (charCode >>> 12); buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } } return buf.slice(0, bufIdx); } InternalEncoderCesu8.prototype.end = function() { } //------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ function InternalDecoderCesu8(options, codec) { this.acc = 0; this.contBytes = 0; this.accBytes = 0; this.defaultCharUnicode = codec.defaultCharUnicode; } InternalDecoderCesu8.prototype.write = function(buf) { var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ''; for (var i = 0; i < buf.length; i++) { var curByte = buf[i]; if ((curByte & 0xC0) !== 0x80) { // Leading byte if (contBytes > 0) { // Previous code is invalid res += this.defaultCharUnicode; contBytes = 0; } if (curByte < 0x80) { // Single-byte code res += String.fromCharCode(curByte); } else if (curByte < 0xE0) { // Two-byte code acc = curByte & 0x1F; contBytes = 1; accBytes = 1; } else if (curByte < 0xF0) { // Three-byte code acc = curByte & 0x0F; contBytes = 2; accBytes = 1; } else { // Four or more are not supported for CESU-8. res += this.defaultCharUnicode; } } else { // Continuation byte if (contBytes > 0) { // We're waiting for it. acc = (acc << 6) | (curByte & 0x3f); contBytes--; accBytes++; if (contBytes === 0) { // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) if (accBytes === 2 && acc < 0x80 && acc > 0) res += this.defaultCharUnicode; else if (accBytes === 3 && acc < 0x800) res += this.defaultCharUnicode; else // Actually add character. res += String.fromCharCode(acc); } } else { // Unexpected continuation byte res += this.defaultCharUnicode; } } } this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; return res; } InternalDecoderCesu8.prototype.end = function() { var res = 0; if (this.contBytes > 0) res += this.defaultCharUnicode; return res; } /***/ }), /***/ 57362: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that // correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data.") // Prepare char buffer for decoding. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); if (codecOptions.chars.length === 128) { var asciiString = ""; for (var i = 0; i < 128; i++) asciiString += String.fromCharCode(i); codecOptions.chars = asciiString + codecOptions.chars; } this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); // Encoding buffer. var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; this.encodeBuf = encodeBuf; } SBCSCodec.prototype.encoder = SBCSEncoder; SBCSCodec.prototype.decoder = SBCSDecoder; function SBCSEncoder(options, codec) { this.encodeBuf = codec.encodeBuf; } SBCSEncoder.prototype.write = function(str) { var buf = Buffer.alloc(str.length); for (var i = 0; i < str.length; i++) buf[i] = this.encodeBuf[str.charCodeAt(i)]; return buf; } SBCSEncoder.prototype.end = function() { } function SBCSDecoder(options, codec) { this.decodeBuf = codec.decodeBuf; } SBCSDecoder.prototype.write = function(buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. var decodeBuf = this.decodeBuf; var newBuf = Buffer.alloc(buf.length*2); var idx1 = 0, idx2 = 0; for (var i = 0; i < buf.length; i++) { idx1 = buf[i]*2; idx2 = i*2; newBuf[idx2] = decodeBuf[idx1]; newBuf[idx2+1] = decodeBuf[idx1+1]; } return newBuf.toString('ucs2'); } SBCSDecoder.prototype.end = function() { } /***/ }), /***/ 5429: /***/ ((module) => { "use strict"; // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. module.exports = { "437": "cp437", "737": "cp737", "775": "cp775", "850": "cp850", "852": "cp852", "855": "cp855", "856": "cp856", "857": "cp857", "858": "cp858", "860": "cp860", "861": "cp861", "862": "cp862", "863": "cp863", "864": "cp864", "865": "cp865", "866": "cp866", "869": "cp869", "874": "windows874", "922": "cp922", "1046": "cp1046", "1124": "cp1124", "1125": "cp1125", "1129": "cp1129", "1133": "cp1133", "1161": "cp1161", "1162": "cp1162", "1163": "cp1163", "1250": "windows1250", "1251": "windows1251", "1252": "windows1252", "1253": "windows1253", "1254": "windows1254", "1255": "windows1255", "1256": "windows1256", "1257": "windows1257", "1258": "windows1258", "28591": "iso88591", "28592": "iso88592", "28593": "iso88593", "28594": "iso88594", "28595": "iso88595", "28596": "iso88596", "28597": "iso88597", "28598": "iso88598", "28599": "iso88599", "28600": "iso885910", "28601": "iso885911", "28603": "iso885913", "28604": "iso885914", "28605": "iso885915", "28606": "iso885916", "windows874": { "type": "_sbcs", "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "win874": "windows874", "cp874": "windows874", "windows1250": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "win1250": "windows1250", "cp1250": "windows1250", "windows1251": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "win1251": "windows1251", "cp1251": "windows1251", "windows1252": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "win1252": "windows1252", "cp1252": "windows1252", "windows1253": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "win1253": "windows1253", "cp1253": "windows1253", "windows1254": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "win1254": "windows1254", "cp1254": "windows1254", "windows1255": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "win1255": "windows1255", "cp1255": "windows1255", "windows1256": { "type": "_sbcs", "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" }, "win1256": "windows1256", "cp1256": "windows1256", "windows1257": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, "win1257": "windows1257", "cp1257": "windows1257", "windows1258": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "win1258": "windows1258", "cp1258": "windows1258", "iso88591": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28591": "iso88591", "iso88592": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "cp28592": "iso88592", "iso88593": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, "cp28593": "iso88593", "iso88594": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, "cp28594": "iso88594", "iso88595": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, "cp28595": "iso88595", "iso88596": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, "cp28596": "iso88596", "iso88597": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "cp28597": "iso88597", "iso88598": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "cp28598": "iso88598", "iso88599": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "cp28599": "iso88599", "iso885910": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, "cp28600": "iso885910", "iso885911": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "cp28601": "iso885911", "iso885913": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, "cp28603": "iso885913", "iso885914": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, "cp28604": "iso885914", "iso885915": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28605": "iso885915", "iso885916": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, "cp28606": "iso885916", "cp437": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm437": "cp437", "csibm437": "cp437", "cp737": { "type": "_sbcs", "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, "ibm737": "cp737", "csibm737": "cp737", "cp775": { "type": "_sbcs", "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " }, "ibm775": "cp775", "csibm775": "cp775", "cp850": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm850": "cp850", "csibm850": "cp850", "cp852": { "type": "_sbcs", "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " }, "ibm852": "cp852", "csibm852": "cp852", "cp855": { "type": "_sbcs", "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " }, "ibm855": "cp855", "csibm855": "cp855", "cp856": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm856": "cp856", "csibm856": "cp856", "cp857": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " }, "ibm857": "cp857", "csibm857": "cp857", "cp858": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm858": "cp858", "csibm858": "cp858", "cp860": { "type": "_sbcs", "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm860": "cp860", "csibm860": "cp860", "cp861": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm861": "cp861", "csibm861": "cp861", "cp862": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm862": "cp862", "csibm862": "cp862", "cp863": { "type": "_sbcs", "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm863": "cp863", "csibm863": "cp863", "cp864": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" }, "ibm864": "cp864", "csibm864": "cp864", "cp865": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm865": "cp865", "csibm865": "cp865", "cp866": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, "ibm866": "cp866", "csibm866": "cp866", "cp869": { "type": "_sbcs", "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " }, "ibm869": "cp869", "csibm869": "cp869", "cp922": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, "ibm922": "cp922", "csibm922": "cp922", "cp1046": { "type": "_sbcs", "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, "ibm1046": "cp1046", "csibm1046": "cp1046", "cp1124": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, "ibm1124": "cp1124", "csibm1124": "cp1124", "cp1125": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, "ibm1125": "cp1125", "csibm1125": "cp1125", "cp1129": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1129": "cp1129", "csibm1129": "cp1129", "cp1133": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, "ibm1133": "cp1133", "csibm1133": "cp1133", "cp1161": { "type": "_sbcs", "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, "ibm1161": "cp1161", "csibm1161": "cp1161", "cp1162": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "ibm1162": "cp1162", "csibm1162": "cp1162", "cp1163": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1163": "cp1163", "csibm1163": "cp1163", "maccroatian": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, "maccyrillic": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "macgreek": { "type": "_sbcs", "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, "maciceland": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macroman": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macromania": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macthai": { "type": "_sbcs", "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, "macturkish": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, "macukraine": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "koi8r": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8u": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8ru": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8t": { "type": "_sbcs", "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "armscii8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, "rk1048": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "tcvn": { "type": "_sbcs", "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" }, "georgianacademy": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "georgianps": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "pt154": { "type": "_sbcs", "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "viscii": { "type": "_sbcs", "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" }, "iso646cn": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "iso646jp": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "hproman8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, "macintosh": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "ascii": { "type": "_sbcs", "chars": "��������������������������������������������������������������������������������������������������������������������������������" }, "tis620": { "type": "_sbcs", "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } } /***/ }), /***/ 86127: /***/ ((module) => { "use strict"; // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { // Not supported by iconv, not sure why. "10029": "maccenteuro", "maccenteuro": { "type": "_sbcs", "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, "808": "cp808", "ibm808": "cp808", "cp808": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, "mik": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "cp720": { "type": "_sbcs", "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" }, // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", "ansix34": "ascii", "ansix341968": "ascii", "ansix341986": "ascii", "csascii": "ascii", "cp367": "ascii", "ibm367": "ascii", "isoir6": "ascii", "iso646us": "ascii", "iso646irv": "ascii", "us": "ascii", "latin1": "iso88591", "latin2": "iso88592", "latin3": "iso88593", "latin4": "iso88594", "latin5": "iso88599", "latin6": "iso885910", "latin7": "iso885913", "latin8": "iso885914", "latin9": "iso885915", "latin10": "iso885916", "csisolatin1": "iso88591", "csisolatin2": "iso88592", "csisolatin3": "iso88593", "csisolatin4": "iso88594", "csisolatincyrillic": "iso88595", "csisolatinarabic": "iso88596", "csisolatingreek" : "iso88597", "csisolatinhebrew": "iso88598", "csisolatin5": "iso88599", "csisolatin6": "iso885910", "l1": "iso88591", "l2": "iso88592", "l3": "iso88593", "l4": "iso88594", "l5": "iso88599", "l6": "iso885910", "l7": "iso885913", "l8": "iso885914", "l9": "iso885915", "l10": "iso885916", "isoir14": "iso646jp", "isoir57": "iso646cn", "isoir100": "iso88591", "isoir101": "iso88592", "isoir109": "iso88593", "isoir110": "iso88594", "isoir144": "iso88595", "isoir127": "iso88596", "isoir126": "iso88597", "isoir138": "iso88598", "isoir148": "iso88599", "isoir157": "iso885910", "isoir166": "tis620", "isoir179": "iso885913", "isoir199": "iso885914", "isoir203": "iso885915", "isoir226": "iso885916", "cp819": "iso88591", "ibm819": "iso88591", "cyrillic": "iso88595", "arabic": "iso88596", "arabic8": "iso88596", "ecma114": "iso88596", "asmo708": "iso88596", "greek" : "iso88597", "greek8" : "iso88597", "ecma118" : "iso88597", "elot928" : "iso88597", "hebrew": "iso88598", "hebrew8": "iso88598", "turkish": "iso88599", "turkish8": "iso88599", "thai": "iso885911", "thai8": "iso885911", "celtic": "iso885914", "celtic8": "iso885914", "isoceltic": "iso885914", "tis6200": "tis620", "tis62025291": "tis620", "tis62025330": "tis620", "10000": "macroman", "10006": "macgreek", "10007": "maccyrillic", "10079": "maciceland", "10081": "macturkish", "cspc8codepage437": "cp437", "cspc775baltic": "cp775", "cspc850multilingual": "cp850", "cspcp852": "cp852", "cspc862latinhebrew": "cp862", "cpgr": "cp869", "msee": "cp1250", "mscyrl": "cp1251", "msansi": "cp1252", "msgreek": "cp1253", "msturk": "cp1254", "mshebr": "cp1255", "msarab": "cp1256", "winbaltrim": "cp1257", "cp20866": "koi8r", "20866": "koi8r", "ibm878": "koi8r", "cskoi8r": "koi8r", "cp21866": "koi8u", "21866": "koi8u", "ibm1168": "koi8u", "strk10482002": "rk1048", "tcvn5712": "tcvn", "tcvn57121": "tcvn", "gb198880": "iso646cn", "cn": "iso646cn", "csiso14jisc6220ro": "iso646jp", "jisc62201969ro": "iso646jp", "jp": "iso646jp", "cshproman8": "hproman8", "r8": "hproman8", "roman8": "hproman8", "xroman8": "hproman8", "ibm1051": "hproman8", "mac": "macintosh", "csmacintosh": "macintosh", }; /***/ }), /***/ 89482: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== exports.utf16be = Utf16BECodec; function Utf16BECodec() { } Utf16BECodec.prototype.encoder = Utf16BEEncoder; Utf16BECodec.prototype.decoder = Utf16BEDecoder; Utf16BECodec.prototype.bomAware = true; // -- Encoding function Utf16BEEncoder() { } Utf16BEEncoder.prototype.write = function(str) { var buf = Buffer.from(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } return buf; } Utf16BEEncoder.prototype.end = function() { } // -- Decoding function Utf16BEDecoder() { this.overflowByte = -1; } Utf16BEDecoder.prototype.write = function(buf) { if (buf.length == 0) return ''; var buf2 = Buffer.alloc(buf.length + 1), i = 0, j = 0; if (this.overflowByte !== -1) { buf2[0] = buf[0]; buf2[1] = this.overflowByte; i = 1; j = 2; } for (; i < buf.length-1; i += 2, j+= 2) { buf2[j] = buf[i+1]; buf2[j+1] = buf[i]; } this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; return buf2.slice(0, j).toString('ucs2'); } Utf16BEDecoder.prototype.end = function() { this.overflowByte = -1; } // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). exports.utf16 = Utf16Codec; function Utf16Codec(codecOptions, iconv) { this.iconv = iconv; } Utf16Codec.prototype.encoder = Utf16Encoder; Utf16Codec.prototype.decoder = Utf16Decoder; // -- Encoding (pass-through) function Utf16Encoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder('utf-16le', options); } Utf16Encoder.prototype.write = function(str) { return this.encoder.write(str); } Utf16Encoder.prototype.end = function() { return this.encoder.end(); } // -- Decoding function Utf16Decoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length; if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.write(buf); } Utf16Decoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); var trail = this.decoder.end(); if (trail) resStr += trail; this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.end(); } function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 2) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; } if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; b.length = 0; charsProcessed++; if (charsProcessed >= 100) { break outer_loop; } } } } // Make decisions. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-16le'; } /***/ }), /***/ 18763: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; // == UTF32-LE/BE codec. ========================================================== exports._utf32 = Utf32Codec; function Utf32Codec(codecOptions, iconv) { this.iconv = iconv; this.bomAware = true; this.isLE = codecOptions.isLE; } exports.utf32le = { type: '_utf32', isLE: true }; exports.utf32be = { type: '_utf32', isLE: false }; // Aliases exports.ucs4le = 'utf32le'; exports.ucs4be = 'utf32be'; Utf32Codec.prototype.encoder = Utf32Encoder; Utf32Codec.prototype.decoder = Utf32Decoder; // -- Encoding function Utf32Encoder(options, codec) { this.isLE = codec.isLE; this.highSurrogate = 0; } Utf32Encoder.prototype.write = function(str) { var src = Buffer.from(str, 'ucs2'); var dst = Buffer.alloc(src.length * 2); var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; var offset = 0; for (var i = 0; i < src.length; i += 2) { var code = src.readUInt16LE(i); var isHighSurrogate = (0xD800 <= code && code < 0xDC00); var isLowSurrogate = (0xDC00 <= code && code < 0xE000); if (this.highSurrogate) { if (isHighSurrogate || !isLowSurrogate) { // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character // (technically wrong, but expected by some applications, like Windows file names). write32.call(dst, this.highSurrogate, offset); offset += 4; } else { // Create 32-bit value from high and low surrogates; var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; write32.call(dst, codepoint, offset); offset += 4; this.highSurrogate = 0; continue; } } if (isHighSurrogate) this.highSurrogate = code; else { // Even if the current character is a low surrogate, with no previous high surrogate, we'll // encode it as a semi-invalid stand-alone character for the same reasons expressed above for // unpaired high surrogates. write32.call(dst, code, offset); offset += 4; this.highSurrogate = 0; } } if (offset < dst.length) dst = dst.slice(0, offset); return dst; }; Utf32Encoder.prototype.end = function() { // Treat any leftover high surrogate as a semi-valid independent character. if (!this.highSurrogate) return; var buf = Buffer.alloc(4); if (this.isLE) buf.writeUInt32LE(this.highSurrogate, 0); else buf.writeUInt32BE(this.highSurrogate, 0); this.highSurrogate = 0; return buf; }; // -- Decoding function Utf32Decoder(options, codec) { this.isLE = codec.isLE; this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); this.overflow = []; } Utf32Decoder.prototype.write = function(src) { if (src.length === 0) return ''; var i = 0; var codepoint = 0; var dst = Buffer.alloc(src.length + 4); var offset = 0; var isLE = this.isLE; var overflow = this.overflow; var badChar = this.badChar; if (overflow.length > 0) { for (; i < src.length && overflow.length < 4; i++) overflow.push(src[i]); if (overflow.length === 4) { // NOTE: codepoint is a signed int32 and can be negative. // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). if (isLE) { codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); } else { codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); } overflow.length = 0; offset = _writeCodepoint(dst, offset, codepoint, badChar); } } // Main loop. Should be as optimized as possible. for (; i < src.length - 3; i += 4) { // NOTE: codepoint is a signed int32 and can be negative. if (isLE) { codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); } else { codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); } offset = _writeCodepoint(dst, offset, codepoint, badChar); } // Keep overflowing bytes. for (; i < src.length; i++) { overflow.push(src[i]); } return dst.slice(0, offset).toString('ucs2'); }; function _writeCodepoint(dst, offset, codepoint, badChar) { // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. if (codepoint < 0 || codepoint > 0x10FFFF) { // Not a valid Unicode codepoint codepoint = badChar; } // Ephemeral Planes: Write high surrogate. if (codepoint >= 0x10000) { codepoint -= 0x10000; var high = 0xD800 | (codepoint >> 10); dst[offset++] = high & 0xff; dst[offset++] = high >> 8; // Low surrogate is written below. var codepoint = 0xDC00 | (codepoint & 0x3FF); } // Write BMP char or low surrogate. dst[offset++] = codepoint & 0xff; dst[offset++] = codepoint >> 8; return offset; }; Utf32Decoder.prototype.end = function() { this.overflow.length = 0; }; // == UTF-32 Auto codec ============================================================= // Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. // Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 // Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); // Encoder prepends BOM (which can be overridden with (addBOM: false}). exports.utf32 = Utf32AutoCodec; exports.ucs4 = 'utf32'; function Utf32AutoCodec(options, iconv) { this.iconv = iconv; } Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; // -- Encoding function Utf32AutoEncoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); } Utf32AutoEncoder.prototype.write = function(str) { return this.encoder.write(str); }; Utf32AutoEncoder.prototype.end = function() { return this.encoder.end(); }; // -- Decoding function Utf32AutoDecoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf32AutoDecoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length; if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.write(buf); }; Utf32AutoDecoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); var trail = this.decoder.end(); if (trail) resStr += trail; this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.end(); }; function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 4) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { return 'utf-32le'; } if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { return 'utf-32be'; } } if (b[0] !== 0 || b[1] > 0x10) invalidBE++; if (b[3] !== 0 || b[2] > 0x10) invalidLE++; if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; b.length = 0; charsProcessed++; if (charsProcessed >= 100) { break outer_loop; } } } } // Make decisions. if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-32le'; } /***/ }), /***/ 33996: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 exports.utf7 = Utf7Codec; exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 function Utf7Codec(codecOptions, iconv) { this.iconv = iconv; }; Utf7Codec.prototype.encoder = Utf7Encoder; Utf7Codec.prototype.decoder = Utf7Decoder; Utf7Codec.prototype.bomAware = true; // -- Encoding var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function Utf7Encoder(options, codec) { this.iconv = codec.iconv; } Utf7Encoder.prototype.write = function(str) { // Naive implementation. // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". return Buffer.from(str.replace(nonDirectChars, function(chunk) { return "+" + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this))); } Utf7Encoder.prototype.end = function() { } // -- Decoding function Utf7Decoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64Regex = /[A-Za-z0-9\/+]/; var base64Chars = []; for (var i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i)); var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0); Utf7Decoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus is absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7Decoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: // * Base64 part is started by "&" instead of "+" // * Direct characters are 0x20-0x7E, except "&" (0x26) // * In Base64, "," is used instead of "/" // * Base64 must not be used to represent direct characters. // * No implicit shift back from Base64 (should always end with '-') // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. exports.utf7imap = Utf7IMAPCodec; function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv; }; Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; Utf7IMAPCodec.prototype.bomAware = true; // -- Encoding function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = Buffer.alloc(6); this.base64AccumIdx = 0; } Utf7IMAPEncoder.prototype.write = function(str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. inBase64 = false; } if (!inBase64) { buf[bufIdx++] = uChar; // Write direct character if (uChar === andChar) // Ampersand -> '&-' buf[bufIdx++] = minusChar; } } else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. inBase64 = true; } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8; base64Accum[base64AccumIdx++] = uChar & 0xFF; if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); base64AccumIdx = 0; } } } } this.inBase64 = inBase64; this.base64AccumIdx = base64AccumIdx; return buf.slice(0, bufIdx); } Utf7IMAPEncoder.prototype.end = function() { var buf = Buffer.alloc(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); this.base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. this.inBase64 = false; } return buf.slice(0, bufIdx); } // -- Decoding function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64IMAPChars = base64Chars.slice(); base64IMAPChars[','.charCodeAt(0)] = true; Utf7IMAPDecoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus may be absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7IMAPDecoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } /***/ }), /***/ 41139: /***/ ((__unused_webpack_module, exports) => { "use strict"; var BOMChar = '\uFEFF'; exports.PrependBOM = PrependBOMWrapper function PrependBOMWrapper(encoder, options) { this.encoder = encoder; this.addBOM = true; } PrependBOMWrapper.prototype.write = function(str) { if (this.addBOM) { str = BOMChar + str; this.addBOM = false; } return this.encoder.write(str); } PrependBOMWrapper.prototype.end = function() { return this.encoder.end(); } //------------------------------------------------------------------------------ exports.StripBOM = StripBOMWrapper; function StripBOMWrapper(decoder, options) { this.decoder = decoder; this.pass = false; this.options = options || {}; } StripBOMWrapper.prototype.write = function(buf) { var res = this.decoder.write(buf); if (this.pass || !res) return res; if (res[0] === BOMChar) { res = res.slice(1); if (typeof this.options.stripBOM === 'function') this.options.stripBOM(); } this.pass = true; return res; } StripBOMWrapper.prototype.end = function() { return this.decoder.end(); } /***/ }), /***/ 50029: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; var bomHandling = __webpack_require__(41139), iconv = module.exports; // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. iconv.encodings = null; // Characters emitted in case of error. iconv.defaultCharUnicode = '�'; iconv.defaultCharSingleByte = '?'; // Public API. iconv.encode = function encode(str, encoding, options) { str = "" + (str || ""); // Ensure string. var encoder = iconv.getEncoder(encoding, options); var res = encoder.write(str); var trail = encoder.end(); return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } iconv.decode = function decode(buf, encoding, options) { if (typeof buf === 'string') { if (!iconv.skipDecodeWarning) { console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); iconv.skipDecodeWarning = true; } buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. } var decoder = iconv.getDecoder(encoding, options); var res = decoder.write(buf); var trail = decoder.end(); return trail ? (res + trail) : res; } iconv.encodingExists = function encodingExists(enc) { try { iconv.getCodec(enc); return true; } catch (e) { return false; } } // Legacy aliases to convert functions iconv.toEncoding = iconv.encode; iconv.fromEncoding = iconv.decode; // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = __webpack_require__(88369); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = iconv._canonicalizeEncoding(encoding); // Traverse iconv.encodings to find actual codec. var codecOptions = {}; while (true) { var codec = iconv._codecDataCache[enc]; if (codec) return codec; var codecDef = iconv.encodings[enc]; switch (typeof codecDef) { case "string": // Direct alias to other encoding. enc = codecDef; break; case "object": // Alias with options. Can be layered. for (var key in codecDef) codecOptions[key] = codecDef[key]; if (!codecOptions.encodingName) codecOptions.encodingName = enc; enc = codecDef.type; break; case "function": // Codec itself. if (!codecOptions.encodingName) codecOptions.encodingName = enc; // The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv); iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. return codec; default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); } } } iconv._canonicalizeEncoding = function(encoding) { // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); } iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options); return encoder; } iconv.getDecoder = function getDecoder(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options); return decoder; } // Streaming API // NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add // up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. // If you would like to enable it explicitly, please add the following code to your app: // > iconv.enableStreamingAPI(require('stream')); iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { if (iconv.supportsStreams) return; // Dependency-inject stream module to create IconvLite stream classes. var streams = __webpack_require__(32321)(stream_module); // Not public API yet, but expose the stream classes. iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; // Streaming API. iconv.encodeStream = function encodeStream(encoding, options) { return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } iconv.decodeStream = function decodeStream(encoding, options) { return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } iconv.supportsStreams = true; } // Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). var stream_module; try { stream_module = __webpack_require__(12781); } catch (e) {} if (stream_module && stream_module.Transform) { iconv.enableStreamingAPI(stream_module); } else { // In rare cases where 'stream' module is not available by default, throw a helpful exception. iconv.encodeStream = iconv.decodeStream = function() { throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); }; } if (false) {} /***/ }), /***/ 32321: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(2399).Buffer; // NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), // we opt to dependency-inject it instead of creating a hard dependency. module.exports = function(stream_module) { var Transform = stream_module.Transform; // == Encoder stream ======================================================= function IconvLiteEncoderStream(conv, options) { this.conv = conv; options = options || {}; options.decodeStrings = false; // We accept only strings, so we don't need to decode them. Transform.call(this, options); } IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }); IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { if (typeof chunk != 'string') return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype.collect = function(cb) { var chunks = []; this.on('error', cb); this.on('data', function(chunk) { chunks.push(chunk); }); this.on('end', function() { cb(null, Buffer.concat(chunks)); }); return this; } // == Decoder stream ======================================================= function IconvLiteDecoderStream(conv, options) { this.conv = conv; options = options || {}; options.encoding = this.encoding = 'utf8'; // We output strings. Transform.call(this, options); } IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }); IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype.collect = function(cb) { var res = ''; this.on('error', cb); this.on('data', function(chunk) { res += chunk; }); this.on('end', function() { cb(null, res); }); return this; } return { IconvLiteEncoderStream: IconvLiteEncoderStream, IconvLiteDecoderStream: IconvLiteDecoderStream, }; }; /***/ }), /***/ 36147: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(71017); const pathKey = __webpack_require__(7856); const npmRunPath = options => { options = { cwd: process.cwd(), path: process.env[pathKey()], execPath: process.execPath, ...options }; let previous; let cwdPath = path.resolve(options.cwd); const result = []; while (previous !== cwdPath) { result.push(path.join(cwdPath, 'node_modules/.bin')); previous = cwdPath; cwdPath = path.resolve(cwdPath, '..'); } // Ensure the running `node` binary is used const execPathDir = path.resolve(options.cwd, options.execPath, '..'); result.push(execPathDir); return result.concat(options.path).join(path.delimiter); }; module.exports = npmRunPath; // TODO: Remove this for the next major release module.exports["default"] = npmRunPath; module.exports.env = options => { options = { env: process.env, ...options }; const env = {...options.env}; const path = pathKey({env}); options.path = env[path]; env[path] = module.exports(options); return env; }; /***/ }), /***/ 7856: /***/ ((module) => { "use strict"; const pathKey = (options = {}) => { const environment = options.env || process.env; const platform = options.platform || process.platform; if (platform !== 'win32') { return 'PATH'; } return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; }; module.exports = pathKey; // TODO: Remove this for the next major release module.exports["default"] = pathKey; /***/ }), /***/ 18987: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var keysShim; if (!Object.keys) { // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var isArgs = __webpack_require__(21414); // eslint-disable-line global-require var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); var dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var excludedKeys = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }; var hasAutomationEqualityBug = (function () { /* global window */ if (typeof window === 'undefined') { return false; } for (var k in window) { try { if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]); } catch (e) { return true; } } } catch (e) { return true; } } return false; }()); var equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(o); } try { return equalsConstructorPrototype(o); } catch (e) { return false; } }; keysShim = function keys(object) { var isObject = object !== null && typeof object === 'object'; var isFunction = toStr.call(object) === '[object Function]'; var isArguments = isArgs(object); var isString = isObject && toStr.call(object) === '[object String]'; var theKeys = []; if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object'); } var skipProto = hasProtoEnumBug && isFunction; if (isString && object.length > 0 && !has.call(object, 0)) { for (var i = 0; i < object.length; ++i) { theKeys.push(String(i)); } } if (isArguments && object.length > 0) { for (var j = 0; j < object.length; ++j) { theKeys.push(String(j)); } } else { for (var name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]); } } } return theKeys; }; } module.exports = keysShim; /***/ }), /***/ 82215: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var slice = Array.prototype.slice; var isArgs = __webpack_require__(21414); var origKeys = Object.keys; var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(18987); var originalKeys = Object.keys; keysShim.shim = function shimObjectKeys() { if (Object.keys) { var keysWorksWithArguments = (function () { // Safari 5.0 bug var args = Object.keys(arguments); return args && args.length === arguments.length; }(1, 2)); if (!keysWorksWithArguments) { Object.keys = function keys(object) { // eslint-disable-line func-name-matching if (isArgs(object)) { return originalKeys(slice.call(object)); } return originalKeys(object); }; } } else { Object.keys = keysShim; } return Object.keys || keysShim; }; module.exports = keysShim; /***/ }), /***/ 21414: /***/ ((module) => { "use strict"; var toStr = Object.prototype.toString; module.exports = function isArguments(value) { var str = toStr.call(value); var isArgs = str === '[object Arguments]'; if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]'; } return isArgs; }; /***/ }), /***/ 31322: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const mimicFn = __webpack_require__(34341); const calledFunctions = new WeakMap(); const onetime = (function_, options = {}) => { if (typeof function_ !== 'function') { throw new TypeError('Expected a function'); } let returnValue; let callCount = 0; const functionName = function_.displayName || function_.name || ''; const onetime = function (...arguments_) { calledFunctions.set(onetime, ++callCount); if (callCount === 1) { returnValue = function_.apply(this, arguments_); function_ = null; } else if (options.throw === true) { throw new Error(`Function \`${functionName}\` can only be called once`); } return returnValue; }; mimicFn(onetime, function_); calledFunctions.set(onetime, callCount); return onetime; }; module.exports = onetime; // TODO: Remove this for the next major release module.exports["default"] = onetime; module.exports.callCount = function_ => { if (!calledFunctions.has(function_)) { throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } return calledFunctions.get(function_); }; /***/ }), /***/ 21394: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var parseUrl = __webpack_require__(57310).parse; var DEFAULT_PORTS = { ftp: 21, gopher: 70, http: 80, https: 443, ws: 80, wss: 443, }; var stringEndsWith = String.prototype.endsWith || function(s) { return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; }; /** * @param {string|object} url - The URL, or the result from url.parse. * @return {string} The URL of the proxy that should handle the request to the * given URL. If no proxy is set, this will be an empty string. */ function getProxyForUrl(url) { var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {}; var proto = parsedUrl.protocol; var hostname = parsedUrl.host; var port = parsedUrl.port; if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') { return ''; // Don't proxy URLs without a valid scheme or host. } proto = proto.split(':', 1)[0]; // Stripping ports in this way instead of using parsedUrl.hostname to make // sure that the brackets around IPv6 addresses are kept. hostname = hostname.replace(/:\d*$/, ''); port = parseInt(port) || DEFAULT_PORTS[proto] || 0; if (!shouldProxy(hostname, port)) { return ''; // Don't proxy URLs that match NO_PROXY. } var proxy = getEnv('npm_config_' + proto + '_proxy') || getEnv(proto + '_proxy') || getEnv('npm_config_proxy') || getEnv('all_proxy'); if (proxy && proxy.indexOf('://') === -1) { // Missing scheme in proxy, default to the requested URL's scheme. proxy = proto + '://' + proxy; } return proxy; } /** * Determines whether a given URL should be proxied. * * @param {string} hostname - The host name of the URL. * @param {number} port - The effective port of the URL. * @returns {boolean} Whether the given URL should be proxied. * @private */ function shouldProxy(hostname, port) { var NO_PROXY = (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase(); if (!NO_PROXY) { return true; // Always proxy if NO_PROXY is not set. } if (NO_PROXY === '*') { return false; // Never proxy if wildcard is set. } return NO_PROXY.split(/[,\s]/).every(function(proxy) { if (!proxy) { return true; // Skip zero-length hosts. } var parsedProxy = proxy.match(/^(.+):(\d+)$/); var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; if (parsedProxyPort && parsedProxyPort !== port) { return true; // Skip if ports don't match. } if (!/^[.*]/.test(parsedProxyHostname)) { // No wildcards, so stop proxying if there is an exact match. return hostname !== parsedProxyHostname; } if (parsedProxyHostname.charAt(0) === '*') { // Remove leading wildcard. parsedProxyHostname = parsedProxyHostname.slice(1); } // Stop proxying if the hostname ends with the no_proxy host. return !stringEndsWith.call(hostname, parsedProxyHostname); }); } /** * Get the value for an environment variable. * * @param {string} key - The name of the environment variable. * @return {string} The value of the environment variable. * @private */ function getEnv(key) { return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; } exports.getProxyForUrl = getProxyForUrl; /***/ }), /***/ 34584: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.logLevels = void 0; const logLevels = { debug: 20, error: 50, fatal: 60, info: 30, trace: 10, warn: 40 }; exports.logLevels = logLevels; //# sourceMappingURL=constants.js.map /***/ }), /***/ 57843: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _detectNode = _interopRequireDefault(__webpack_require__(48590)); var _globalthis = _interopRequireDefault(__webpack_require__(82503)); var _jsonStringifySafe = _interopRequireDefault(__webpack_require__(64530)); var _sprintfJs = __webpack_require__(8975); var _constants = __webpack_require__(34584); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } const globalThis = (0, _globalthis.default)(); let domain; if (_detectNode.default) { // eslint-disable-next-line global-require domain = __webpack_require__(13639); } const getParentDomainContext = () => { if (!domain) { return {}; } const parentRoarrContexts = []; let currentDomain = process.domain; // $FlowFixMe if (!currentDomain || !currentDomain.parentDomain) { return {}; } while (currentDomain && currentDomain.parentDomain) { currentDomain = currentDomain.parentDomain; if (currentDomain.roarr && currentDomain.roarr.context) { parentRoarrContexts.push(currentDomain.roarr.context); } } let domainContext = {}; for (const parentRoarrContext of parentRoarrContexts) { domainContext = _objectSpread(_objectSpread({}, domainContext), parentRoarrContext); } return domainContext; }; const getFirstParentDomainContext = () => { if (!domain) { return {}; } let currentDomain = process.domain; // $FlowFixMe if (currentDomain && currentDomain.roarr && currentDomain.roarr.context) { return currentDomain.roarr.context; } // $FlowFixMe if (!currentDomain || !currentDomain.parentDomain) { return {}; } while (currentDomain && currentDomain.parentDomain) { currentDomain = currentDomain.parentDomain; if (currentDomain.roarr && currentDomain.roarr.context) { return currentDomain.roarr.context; } } return {}; }; const createLogger = (onMessage, parentContext) => { // eslint-disable-next-line id-length, unicorn/prevent-abbreviations const log = (a, b, c, d, e, f, g, h, i, k) => { const time = Date.now(); const sequence = globalThis.ROARR.sequence++; let context; let message; if (typeof a === 'string') { context = _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}); // eslint-disable-next-line id-length, object-property-newline const args = _extends({}, { a, b, c, d, e, f, g, h, i, k }); const values = Object.keys(args).map(key => { return args[key]; }); // eslint-disable-next-line unicorn/no-reduce const hasOnlyOneParameterValued = 1 === values.reduce((accumulator, value) => { // eslint-disable-next-line no-return-assign, no-param-reassign return accumulator += typeof value === 'undefined' ? 0 : 1; }, 0); message = hasOnlyOneParameterValued ? (0, _sprintfJs.sprintf)('%s', a) : (0, _sprintfJs.sprintf)(a, b, c, d, e, f, g, h, i, k); } else { if (typeof b !== 'string') { throw new TypeError('Message must be a string.'); } context = JSON.parse((0, _jsonStringifySafe.default)(_objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}), a))); message = (0, _sprintfJs.sprintf)(b, c, d, e, f, g, h, i, k); } onMessage({ context, message, sequence, time, version: '1.0.0' }); }; log.child = context => { if (typeof context === 'function') { return createLogger(message => { if (typeof context !== 'function') { throw new TypeError('Unexpected state.'); } onMessage(context(message)); }, parentContext); } return createLogger(onMessage, _objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext), context)); }; log.getContext = () => { return _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}); }; log.adopt = async (routine, context) => { if (!domain) { return routine(); } const adoptedDomain = domain.create(); return adoptedDomain.run(() => { // $FlowFixMe adoptedDomain.roarr = { context: _objectSpread(_objectSpread({}, getParentDomainContext()), context) }; return routine(); }); }; for (const logLevel of Object.keys(_constants.logLevels)) { // eslint-disable-next-line id-length, unicorn/prevent-abbreviations log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => { return log.child({ logLevel: _constants.logLevels[logLevel] })(a, b, c, d, e, f, g, h, i, k); }; } // @see https://github.com/facebook/flow/issues/6705 // $FlowFixMe return log; }; var _default = createLogger; exports["default"] = _default; //# sourceMappingURL=createLogger.js.map /***/ }), /***/ 86800: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _constants = __webpack_require__(34584); const createMockLogger = (onMessage, parentContext) => { // eslint-disable-next-line id-length, unicorn/prevent-abbreviations, no-unused-vars const log = (a, b, c, d, e, f, g, h, i, k) => {// }; log.adopt = async routine => { return routine(); }; // eslint-disable-next-line no-unused-vars log.child = context => { return createMockLogger(onMessage, parentContext); }; log.getContext = () => { return {}; }; for (const logLevel of Object.keys(_constants.logLevels)) { // eslint-disable-next-line id-length, unicorn/prevent-abbreviations log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => { return log.child({ logLevel: _constants.logLevels[logLevel] })(a, b, c, d, e, f, g, h, i, k); }; } // @see https://github.com/facebook/flow/issues/6705 // $FlowFixMe return log; }; var _default = createMockLogger; exports["default"] = _default; //# sourceMappingURL=createMockLogger.js.map /***/ }), /***/ 68370: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; const createBlockingWriter = stream => { return { write: message => { stream.write(message + '\n'); } }; }; const createNodeWriter = () => { // eslint-disable-next-line no-process-env const targetStream = (process.env.ROARR_STREAM || 'STDOUT').toUpperCase(); const stream = targetStream.toUpperCase() === 'STDOUT' ? process.stdout : process.stderr; return createBlockingWriter(stream); }; var _default = createNodeWriter; exports["default"] = _default; //# sourceMappingURL=createNodeWriter.js.map /***/ }), /***/ 64909: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _detectNode = _interopRequireDefault(__webpack_require__(48590)); var _semverCompare = _interopRequireDefault(__webpack_require__(29140)); var _package = __webpack_require__(98799); var _createNodeWriter = _interopRequireDefault(__webpack_require__(68370)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // eslint-disable-next-line flowtype/no-weak-types const createRoarrInititialGlobalState = currentState => { const versions = (currentState.versions || []).concat(); versions.sort(_semverCompare.default); const currentIsLatestVersion = !versions.length || (0, _semverCompare.default)(_package.version, versions[versions.length - 1]) === 1; if (!versions.includes(_package.version)) { versions.push(_package.version); } versions.sort(_semverCompare.default); let newState = _objectSpread(_objectSpread({ sequence: 0 }, currentState), {}, { versions }); if (_detectNode.default) { if (currentIsLatestVersion || !newState.write) { newState = _objectSpread(_objectSpread({}, newState), (0, _createNodeWriter.default)()); } } return newState; }; var _default = createRoarrInititialGlobalState; exports["default"] = _default; //# sourceMappingURL=createRoarrInititialGlobalState.js.map /***/ }), /***/ 69089: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "createLogger", ({ enumerable: true, get: function () { return _createLogger.default; } })); Object.defineProperty(exports, "createMockLogger", ({ enumerable: true, get: function () { return _createMockLogger.default; } })); Object.defineProperty(exports, "createRoarrInititialGlobalState", ({ enumerable: true, get: function () { return _createRoarrInititialGlobalState.default; } })); var _createLogger = _interopRequireDefault(__webpack_require__(57843)); var _createMockLogger = _interopRequireDefault(__webpack_require__(86800)); var _createRoarrInititialGlobalState = _interopRequireDefault(__webpack_require__(64909)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map /***/ }), /***/ 83085: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = exports.ROARR = void 0; var _boolean = __webpack_require__(46088); var _detectNode = _interopRequireDefault(__webpack_require__(48590)); var _globalthis = _interopRequireDefault(__webpack_require__(82503)); var _factories = __webpack_require__(69089); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const globalThis = (0, _globalthis.default)(); const ROARR = globalThis.ROARR = (0, _factories.createRoarrInititialGlobalState)(globalThis.ROARR || {}); exports.ROARR = ROARR; let logFactory = _factories.createLogger; if (_detectNode.default) { // eslint-disable-next-line no-process-env const enabled = (0, _boolean.boolean)(process.env.ROARR_LOG || ''); if (!enabled) { logFactory = _factories.createMockLogger; } } var _default = logFactory(message => { if (ROARR.write) { // Stringify message as soon as it is received to prevent // properties of the context from being modified by reference. const body = JSON.stringify(message); ROARR.write(body); } }); exports["default"] = _default; //# sourceMappingURL=log.js.map /***/ }), /***/ 2399: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(14300) var Buffer = buffer.Buffer var safer = {} var key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } var Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } return Buffer(value, encodingOrOffset, length) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } var buf = Buffer(size) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /***/ }), /***/ 36099: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { ;(function (sax) { // wrapper for non-node envs sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } sax.SAXParser = SAXParser sax.SAXStream = SAXStream sax.createStream = createStream // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), // since that's the earliest that a buffer overrun could occur. This way, checks are // as rare as required, but as often as necessary to ensure never crossing this bound. // Furthermore, buffers are only tested at most once per write(), so passing a very // large string into write() might have undesirable effects, but this is manageable by // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme // edge case, result in creating at most one complete copy of the string passed in. // Set to Infinity to have unlimited buffers. sax.MAX_BUFFER_LENGTH = 64 * 1024 var buffers = [ 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', 'procInstName', 'procInstBody', 'entity', 'attribName', 'attribValue', 'cdata', 'script' ] sax.EVENTS = [ 'text', 'processinginstruction', 'sgmldeclaration', 'doctype', 'comment', 'opentagstart', 'attribute', 'opentag', 'closetag', 'opencdata', 'cdata', 'closecdata', 'error', 'end', 'ready', 'script', 'opennamespace', 'closenamespace' ] function SAXParser (strict, opt) { if (!(this instanceof SAXParser)) { return new SAXParser(strict, opt) } var parser = this clearBuffers(parser) parser.q = parser.c = '' parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH parser.opt = opt || {} parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' parser.tags = [] parser.closed = parser.closedRoot = parser.sawRoot = false parser.tag = parser.error = null parser.strict = !!strict parser.noscript = !!(strict || parser.opt.noscript) parser.state = S.BEGIN parser.strictEntities = parser.opt.strictEntities parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) parser.attribList = [] // namespaces form a prototype chain. // it always points at the current tag, // which protos to its parent tag. if (parser.opt.xmlns) { parser.ns = Object.create(rootNS) } // mostly just for error reporting parser.trackPosition = parser.opt.position !== false if (parser.trackPosition) { parser.position = parser.line = parser.column = 0 } emit(parser, 'onready') } if (!Object.create) { Object.create = function (o) { function F () {} F.prototype = o var newf = new F() return newf } } if (!Object.keys) { Object.keys = function (o) { var a = [] for (var i in o) if (o.hasOwnProperty(i)) a.push(i) return a } } function checkBufferLength (parser) { var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) var maxActual = 0 for (var i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length if (len > maxAllowed) { // Text/cdata nodes can get big, and since they're buffered, // we can get here under normal conditions. // Avoid issues by emitting the text node now, // so at least it won't get any bigger. switch (buffers[i]) { case 'textNode': closeText(parser) break case 'cdata': emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' break case 'script': emitNode(parser, 'onscript', parser.script) parser.script = '' break default: error(parser, 'Max buffer length exceeded: ' + buffers[i]) } } maxActual = Math.max(maxActual, len) } // schedule the next check for the earliest possible buffer overrun. var m = sax.MAX_BUFFER_LENGTH - maxActual parser.bufferCheckPosition = m + parser.position } function clearBuffers (parser) { for (var i = 0, l = buffers.length; i < l; i++) { parser[buffers[i]] = '' } } function flushBuffers (parser) { closeText(parser) if (parser.cdata !== '') { emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' } if (parser.script !== '') { emitNode(parser, 'onscript', parser.script) parser.script = '' } } SAXParser.prototype = { end: function () { end(this) }, write: write, resume: function () { this.error = null; return this }, close: function () { return this.write(null) }, flush: function () { flushBuffers(this) } } var Stream try { Stream = __webpack_require__(12781).Stream } catch (ex) { Stream = function () {} } var streamWraps = sax.EVENTS.filter(function (ev) { return ev !== 'error' && ev !== 'end' }) function createStream (strict, opt) { return new SAXStream(strict, opt) } function SAXStream (strict, opt) { if (!(this instanceof SAXStream)) { return new SAXStream(strict, opt) } Stream.apply(this) this._parser = new SAXParser(strict, opt) this.writable = true this.readable = true var me = this this._parser.onend = function () { me.emit('end') } this._parser.onerror = function (er) { me.emit('error', er) // if didn't throw, then means error was handled. // go ahead and clear error, so we can write again. me._parser.error = null } this._decoder = null streamWraps.forEach(function (ev) { Object.defineProperty(me, 'on' + ev, { get: function () { return me._parser['on' + ev] }, set: function (h) { if (!h) { me.removeAllListeners(ev) me._parser['on' + ev] = h return h } me.on(ev, h) }, enumerable: true, configurable: false }) }) } SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } }) SAXStream.prototype.write = function (data) { if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(data)) { if (!this._decoder) { var SD = __webpack_require__(71576).StringDecoder this._decoder = new SD('utf8') } data = this._decoder.write(data) } this._parser.write(data.toString()) this.emit('data', data) return true } SAXStream.prototype.end = function (chunk) { if (chunk && chunk.length) { this.write(chunk) } this._parser.end() return true } SAXStream.prototype.on = function (ev, handler) { var me = this if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { me._parser['on' + ev] = function () { var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) args.splice(0, 0, ev) me.emit.apply(me, args) } } return Stream.prototype.on.call(me, ev, handler) } // this really needs to be replaced with character classes. // XML allows all manner of ridiculous numbers and digits. var CDATA = '[CDATA[' var DOCTYPE = 'DOCTYPE' var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } // http://www.w3.org/TR/REC-xml/#NT-NameStartChar // This implementation works on strings, a single character at a time // as such, it cannot ever support astral-plane characters (10000-EFFFF) // without a significant breaking change to either this parser, or the // JavaScript language. Implementation of an emoji-capable xml parser // is left as an exercise for the reader. var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ function isWhitespace (c) { return c === ' ' || c === '\n' || c === '\r' || c === '\t' } function isQuote (c) { return c === '"' || c === '\'' } function isAttribEnd (c) { return c === '>' || isWhitespace(c) } function isMatch (regex, c) { return regex.test(c) } function notMatch (regex, c) { return !isMatch(regex, c) } var S = 0 sax.STATE = { BEGIN: S++, // leading byte order mark or whitespace BEGIN_WHITESPACE: S++, // leading whitespace TEXT: S++, // general stuff TEXT_ENTITY: S++, // & and such. OPEN_WAKA: S++, // < SGML_DECL: S++, // SCRIPT: S++, //