diff --git a/.changeset/fast-pumpkins-visit.md b/.changeset/fast-pumpkins-visit.md new file mode 100644 index 00000000000..282c092b6c8 --- /dev/null +++ b/.changeset/fast-pumpkins-visit.md @@ -0,0 +1,6 @@ +--- +"@smithy/signature-v4a": patch +"@smithy/external-dependencies": patch +--- + +external dependency container diff --git a/packages/external-dependencies/.gitignore b/packages/external-dependencies/.gitignore new file mode 100644 index 00000000000..e757f1e7ec3 --- /dev/null +++ b/packages/external-dependencies/.gitignore @@ -0,0 +1,8 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +*.tsbuildinfo +*.tgz +*.log +package-lock.json \ No newline at end of file diff --git a/packages/external-dependencies/LICENSE b/packages/external-dependencies/LICENSE new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/external-dependencies/api-extractor.json b/packages/external-dependencies/api-extractor.json new file mode 100644 index 00000000000..b03e22a16a0 --- /dev/null +++ b/packages/external-dependencies/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.packages.json", + "mainEntryPointFilePath": "./dist-types/index.d.ts" +} diff --git a/packages/external-dependencies/package.json b/packages/external-dependencies/package.json new file mode 100644 index 00000000000..66869605207 --- /dev/null +++ b/packages/external-dependencies/package.json @@ -0,0 +1,63 @@ +{ + "name": "@smithy/external-dependencies", + "version": "3.1.3", + "description": "Elliptic cryptography wrapper for Smithy", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'", + "build:cjs": "node ../../scripts/inline external-dependencies", + "build:es": "yarn g:tsc -p tsconfig.es.json", + "build:types": "yarn g:tsc -p tsconfig.types.json", + "build:types:downlevel": "rimraf dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4", + "build:elliptic": "node ./scripts/esbuild.mjs", + "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"", + "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"", + "extract:docs": "api-extractor run --local", + "test": "yarn g:vitest run" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "sideEffects": false, + "dependencies": { + "tslib": "^2.6.2" + }, + "devDependencies": { + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "elliptic": "6.5.5", + "esbuild": "^0.25.9", + "rimraf": "3.0.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "homepage": "https://github.com/awslabs/smithy-typescript/tree/main/packages/elliptic", + "repository": { + "type": "git", + "url": "https://github.com/awslabs/smithy-typescript.git", + "directory": "packages/elliptic" + }, + "typedoc": { + "entryPoint": "src/index.ts" + }, + "publishConfig": { + "directory": ".release/package" + } +} diff --git a/packages/external-dependencies/scripts/Ec.js b/packages/external-dependencies/scripts/Ec.js new file mode 100644 index 00000000000..fadb4fa6ee7 --- /dev/null +++ b/packages/external-dependencies/scripts/Ec.js @@ -0,0 +1 @@ +export { ec as Ec } from "elliptic"; \ No newline at end of file diff --git a/packages/signature-v4a/scripts/esbuild.mjs b/packages/external-dependencies/scripts/esbuild.mjs similarity index 99% rename from packages/signature-v4a/scripts/esbuild.mjs rename to packages/external-dependencies/scripts/esbuild.mjs index 5f845e60950..4dd4fe3d789 100644 --- a/packages/signature-v4a/scripts/esbuild.mjs +++ b/packages/external-dependencies/scripts/esbuild.mjs @@ -1,6 +1,6 @@ import * as esbuild from "esbuild"; -import * as path from "path"; import * as fs from "fs"; +import * as path from "path"; import { fileURLToPath } from "url"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -31,4 +31,4 @@ fs.writeFileSync( /* eslint-disable */ ` + typescript, "utf-8" -); +); \ No newline at end of file diff --git a/packages/signature-v4a/src/elliptic/Ec.ts b/packages/external-dependencies/src/Ec.ts similarity index 71% rename from packages/signature-v4a/src/elliptic/Ec.ts rename to packages/external-dependencies/src/Ec.ts index c192d518df9..d9b604ee18e 100644 --- a/packages/signature-v4a/src/elliptic/Ec.ts +++ b/packages/external-dependencies/src/Ec.ts @@ -6,8 +6,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; +var __require = /* @__PURE__ */ ((x) => + typeof require !== "undefined" + ? require + : typeof Proxy !== "undefined" + ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b], + }) + : x)(function (x) { + if (typeof require !== "undefined") return require.apply(this, arguments); + throw Error('Dynamic require of "' + x + '" is not supported'); +}); var __commonJS = (cb, mod) => - function __require() { + function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __copyProps = (to, from, except, desc) => { @@ -435,16 +446,16 @@ var require_bn = __commonJS({ var w = this.words[i]; var word = (((w << off) | carry) & 16777215).toString(16); carry = (w >>> (24 - off)) & 16777215; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } off += 2; if (off >= 26) { off -= 26; i--; } + if (carry !== 0 || i !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } } if (carry !== 0) { out = carry.toString(16) + out; @@ -3289,2613 +3300,6 @@ var require_base = __commonJS({ }, }); -// ../../node_modules/has-symbols/shams.js -var require_shams = __commonJS({ - "../../node_modules/has-symbols/shams.js"(exports, module) { - "use strict"; - module.exports = function hasSymbols() { - if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { - return false; - } - if (typeof Symbol.iterator === "symbol") { - return true; - } - var obj = {}; - var sym = Symbol("test"); - var symObj = Object(sym); - if (typeof sym === "string") { - return false; - } - if (Object.prototype.toString.call(sym) !== "[object Symbol]") { - return false; - } - if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { - return false; - } - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { - return false; - } - if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { - return false; - } - if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { - return false; - } - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { - return false; - } - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { - return false; - } - if (typeof Object.getOwnPropertyDescriptor === "function") { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { - return false; - } - } - return true; - }; - }, -}); - -// ../../node_modules/has-tostringtag/shams.js -var require_shams2 = __commonJS({ - "../../node_modules/has-tostringtag/shams.js"(exports, module) { - "use strict"; - var hasSymbols = require_shams(); - module.exports = function hasToStringTagShams() { - return hasSymbols() && !!Symbol.toStringTag; - }; - }, -}); - -// ../../node_modules/has-symbols/index.js -var require_has_symbols = __commonJS({ - "../../node_modules/has-symbols/index.js"(exports, module) { - "use strict"; - var origSymbol = typeof Symbol !== "undefined" && Symbol; - var hasSymbolSham = require_shams(); - module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== "function") { - return false; - } - if (typeof Symbol !== "function") { - return false; - } - if (typeof origSymbol("foo") !== "symbol") { - return false; - } - if (typeof Symbol("bar") !== "symbol") { - return false; - } - return hasSymbolSham(); - }; - }, -}); - -// ../../node_modules/is-arguments/node_modules/function-bind/implementation.js -var require_implementation = __commonJS({ - "../../node_modules/is-arguments/node_modules/function-bind/implementation.js"(exports, module) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var slice = Array.prototype.slice; - var toStr = Object.prototype.toString; - var funcType = "[object Function]"; - module.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply(this, args.concat(slice.call(arguments))); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply(that, args.concat(slice.call(arguments))); - } - }; - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push("$" + i); - } - bound = Function( - "binder", - "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }" - )(binder); - if (target.prototype) { - var Empty = function Empty2() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - }, -}); - -// ../../node_modules/is-arguments/node_modules/function-bind/index.js -var require_function_bind = __commonJS({ - "../../node_modules/is-arguments/node_modules/function-bind/index.js"(exports, module) { - "use strict"; - var implementation = require_implementation(); - module.exports = Function.prototype.bind || implementation; - }, -}); - -// ../../node_modules/has/node_modules/function-bind/implementation.js -var require_implementation2 = __commonJS({ - "../../node_modules/has/node_modules/function-bind/implementation.js"(exports, module) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var slice = Array.prototype.slice; - var toStr = Object.prototype.toString; - var funcType = "[object Function]"; - module.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply(this, args.concat(slice.call(arguments))); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply(that, args.concat(slice.call(arguments))); - } - }; - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push("$" + i); - } - bound = Function( - "binder", - "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }" - )(binder); - if (target.prototype) { - var Empty = function Empty2() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - }, -}); - -// ../../node_modules/has/node_modules/function-bind/index.js -var require_function_bind2 = __commonJS({ - "../../node_modules/has/node_modules/function-bind/index.js"(exports, module) { - "use strict"; - var implementation = require_implementation2(); - module.exports = Function.prototype.bind || implementation; - }, -}); - -// ../../node_modules/has/src/index.js -var require_src = __commonJS({ - "../../node_modules/has/src/index.js"(exports, module) { - "use strict"; - var bind = require_function_bind2(); - module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); - }, -}); - -// ../../node_modules/is-arguments/node_modules/get-intrinsic/index.js -var require_get_intrinsic = __commonJS({ - "../../node_modules/is-arguments/node_modules/get-intrinsic/index.js"(exports, module) { - "use strict"; - var undefined2; - var $SyntaxError = SyntaxError; - var $Function = Function; - var $TypeError = TypeError; - var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) {} - }; - var $gOPD = Object.getOwnPropertyDescriptor; - if ($gOPD) { - try { - $gOPD({}, ""); - } catch (e) { - $gOPD = null; - } - } - var throwTypeError = function () { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD - ? (function () { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - })() - : throwTypeError; - var hasSymbols = require_has_symbols()(); - var getProto = - Object.getPrototypeOf || - function (x) { - return x.__proto__; - }; - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": EvalError, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": - typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Map()[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": Object, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": RangeError, - "%ReferenceError%": ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": - typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Set()[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, - }; - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"], - }; - var bind = require_function_bind(); - var hasOwn = require_src(); - var $concat = bind.call(Function.call, Array.prototype.concat); - var $spliceApply = bind.call(Function.apply, Array.prototype.splice); - var $replace = bind.call(Function.call, String.prototype.replace); - var $strSlice = bind.call(Function.call, String.prototype.slice); - var $exec = bind.call(Function.call, RegExp.prototype.exec); - var rePropName = - /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === "%" && last !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last === "%" && first !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value, - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - (first === '"' || first === "'" || first === "`" || last === '"' || last === "'" || last === "`") && - first !== last - ) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void 0; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - }, -}); - -// ../../node_modules/is-arguments/node_modules/call-bind/index.js -var require_call_bind = __commonJS({ - "../../node_modules/is-arguments/node_modules/call-bind/index.js"(exports, module) { - "use strict"; - var bind = require_function_bind(); - var GetIntrinsic = require_get_intrinsic(); - var $apply = GetIntrinsic("%Function.prototype.apply%"); - var $call = GetIntrinsic("%Function.prototype.call%"); - var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); - var $max = GetIntrinsic("%Math.max%"); - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = null; - } - } - module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, "length"); - if (desc.configurable) { - $defineProperty(func, "length", { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }); - } - } - return func; - }; - var applyBind = function applyBind2() { - return $reflectApply(bind, $apply, arguments); - }; - if ($defineProperty) { - $defineProperty(module.exports, "apply", { value: applyBind }); - } else { - module.exports.apply = applyBind; - } - }, -}); - -// ../../node_modules/is-arguments/node_modules/call-bind/callBound.js -var require_callBound = __commonJS({ - "../../node_modules/is-arguments/node_modules/call-bind/callBound.js"(exports, module) { - "use strict"; - var GetIntrinsic = require_get_intrinsic(); - var callBind = require_call_bind(); - var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); - module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { - return callBind(intrinsic); - } - return intrinsic; - }; - }, -}); - -// ../../node_modules/is-arguments/index.js -var require_is_arguments = __commonJS({ - "../../node_modules/is-arguments/index.js"(exports, module) { - "use strict"; - var hasToStringTag = require_shams2()(); - var callBound = require_callBound(); - var $toString = callBound("Object.prototype.toString"); - var isStandardArguments = function isArguments(value) { - if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) { - return false; - } - return $toString(value) === "[object Arguments]"; - }; - var isLegacyArguments = function isArguments(value) { - if (isStandardArguments(value)) { - return true; - } - return ( - value !== null && - typeof value === "object" && - typeof value.length === "number" && - value.length >= 0 && - $toString(value) !== "[object Array]" && - $toString(value.callee) === "[object Function]" - ); - }; - var supportsStandardArguments = (function () { - return isStandardArguments(arguments); - })(); - isStandardArguments.isLegacyArguments = isLegacyArguments; - module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; - }, -}); - -// ../../node_modules/is-generator-function/index.js -var require_is_generator_function = __commonJS({ - "../../node_modules/is-generator-function/index.js"(exports, module) { - "use strict"; - var toStr = Object.prototype.toString; - var fnToStr = Function.prototype.toString; - var isFnRegex = /^\s*(?:function)?\*/; - var hasToStringTag = require_shams2()(); - var getProto = Object.getPrototypeOf; - var getGeneratorFunc = function () { - if (!hasToStringTag) { - return false; - } - try { - return Function("return function*() {}")(); - } catch (e) {} - }; - var GeneratorFunction; - module.exports = function isGeneratorFunction(fn) { - if (typeof fn !== "function") { - return false; - } - if (isFnRegex.test(fnToStr.call(fn))) { - return true; - } - if (!hasToStringTag) { - var str = toStr.call(fn); - return str === "[object GeneratorFunction]"; - } - if (!getProto) { - return false; - } - if (typeof GeneratorFunction === "undefined") { - var generatorFunc = getGeneratorFunc(); - GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false; - } - return getProto(fn) === GeneratorFunction; - }; - }, -}); - -// ../../node_modules/is-callable/index.js -var require_is_callable = __commonJS({ - "../../node_modules/is-callable/index.js"(exports, module) { - "use strict"; - var fnToStr = Function.prototype.toString; - var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; - var badArrayLike; - var isCallableMarker; - if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { - try { - badArrayLike = Object.defineProperty({}, "length", { - get: function () { - throw isCallableMarker; - }, - }); - isCallableMarker = {}; - reflectApply( - function () { - throw 42; - }, - null, - badArrayLike - ); - } catch (_) { - if (_ !== isCallableMarker) { - reflectApply = null; - } - } - } else { - reflectApply = null; - } - var constructorRegex = /^\s*class\b/; - var isES6ClassFn = function isES6ClassFunction(value) { - try { - var fnStr = fnToStr.call(value); - return constructorRegex.test(fnStr); - } catch (e) { - return false; - } - }; - var tryFunctionObject = function tryFunctionToStr(value) { - try { - if (isES6ClassFn(value)) { - return false; - } - fnToStr.call(value); - return true; - } catch (e) { - return false; - } - }; - var toStr = Object.prototype.toString; - var objectClass = "[object Object]"; - var fnClass = "[object Function]"; - var genClass = "[object GeneratorFunction]"; - var ddaClass = "[object HTMLAllCollection]"; - var ddaClass2 = "[object HTML document.all class]"; - var ddaClass3 = "[object HTMLCollection]"; - var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; - var isIE68 = !(0 in [,]); - var isDDA = function isDocumentDotAll() { - return false; - }; - if (typeof document === "object") { - all = document.all; - if (toStr.call(all) === toStr.call(document.all)) { - isDDA = function isDocumentDotAll(value) { - if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) { - try { - var str = toStr.call(value); - return ( - (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null - ); - } catch (e) {} - } - return false; - }; - } - } - var all; - module.exports = reflectApply - ? function isCallable(value) { - if (isDDA(value)) { - return true; - } - if (!value) { - return false; - } - if (typeof value !== "function" && typeof value !== "object") { - return false; - } - try { - reflectApply(value, null, badArrayLike); - } catch (e) { - if (e !== isCallableMarker) { - return false; - } - } - return !isES6ClassFn(value) && tryFunctionObject(value); - } - : function isCallable(value) { - if (isDDA(value)) { - return true; - } - if (!value) { - return false; - } - if (typeof value !== "function" && typeof value !== "object") { - return false; - } - if (hasToStringTag) { - return tryFunctionObject(value); - } - if (isES6ClassFn(value)) { - return false; - } - var strClass = toStr.call(value); - if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { - return false; - } - return tryFunctionObject(value); - }; - }, -}); - -// ../../node_modules/for-each/index.js -var require_for_each = __commonJS({ - "../../node_modules/for-each/index.js"(exports, module) { - "use strict"; - var isCallable = require_is_callable(); - var toStr = Object.prototype.toString; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var forEachArray = function forEachArray2(array, iterator, receiver) { - for (var i = 0, len = array.length; i < len; i++) { - if (hasOwnProperty.call(array, i)) { - if (receiver == null) { - iterator(array[i], i, array); - } else { - iterator.call(receiver, array[i], i, array); - } - } - } - }; - var forEachString = function forEachString2(string, iterator, receiver) { - for (var i = 0, len = string.length; i < len; i++) { - if (receiver == null) { - iterator(string.charAt(i), i, string); - } else { - iterator.call(receiver, string.charAt(i), i, string); - } - } - }; - var forEachObject = function forEachObject2(object, iterator, receiver) { - for (var k in object) { - if (hasOwnProperty.call(object, k)) { - if (receiver == null) { - iterator(object[k], k, object); - } else { - iterator.call(receiver, object[k], k, object); - } - } - } - }; - var forEach = function forEach2(list, iterator, thisArg) { - if (!isCallable(iterator)) { - throw new TypeError("iterator must be a function"); - } - var receiver; - if (arguments.length >= 3) { - receiver = thisArg; - } - if (toStr.call(list) === "[object Array]") { - forEachArray(list, iterator, receiver); - } else if (typeof list === "string") { - forEachString(list, iterator, receiver); - } else { - forEachObject(list, iterator, receiver); - } - }; - module.exports = forEach; - }, -}); - -// ../../node_modules/util/node_modules/available-typed-arrays/index.js -var require_available_typed_arrays = __commonJS({ - "../../node_modules/util/node_modules/available-typed-arrays/index.js"(exports, module) { - "use strict"; - var possibleNames = [ - "BigInt64Array", - "BigUint64Array", - "Float32Array", - "Float64Array", - "Int16Array", - "Int32Array", - "Int8Array", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - ]; - var g = typeof globalThis === "undefined" ? global : globalThis; - module.exports = function availableTypedArrays() { - var out = []; - for (var i = 0; i < possibleNames.length; i++) { - if (typeof g[possibleNames[i]] === "function") { - out[out.length] = possibleNames[i]; - } - } - return out; - }; - }, -}); - -// ../../node_modules/util/node_modules/function-bind/implementation.js -var require_implementation3 = __commonJS({ - "../../node_modules/util/node_modules/function-bind/implementation.js"(exports, module) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var slice = Array.prototype.slice; - var toStr = Object.prototype.toString; - var funcType = "[object Function]"; - module.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply(this, args.concat(slice.call(arguments))); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply(that, args.concat(slice.call(arguments))); - } - }; - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push("$" + i); - } - bound = Function( - "binder", - "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }" - )(binder); - if (target.prototype) { - var Empty = function Empty2() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - }, -}); - -// ../../node_modules/util/node_modules/function-bind/index.js -var require_function_bind3 = __commonJS({ - "../../node_modules/util/node_modules/function-bind/index.js"(exports, module) { - "use strict"; - var implementation = require_implementation3(); - module.exports = Function.prototype.bind || implementation; - }, -}); - -// ../../node_modules/util/node_modules/get-intrinsic/index.js -var require_get_intrinsic2 = __commonJS({ - "../../node_modules/util/node_modules/get-intrinsic/index.js"(exports, module) { - "use strict"; - var undefined2; - var $SyntaxError = SyntaxError; - var $Function = Function; - var $TypeError = TypeError; - var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) {} - }; - var $gOPD = Object.getOwnPropertyDescriptor; - if ($gOPD) { - try { - $gOPD({}, ""); - } catch (e) { - $gOPD = null; - } - } - var throwTypeError = function () { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD - ? (function () { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - })() - : throwTypeError; - var hasSymbols = require_has_symbols()(); - var getProto = - Object.getPrototypeOf || - function (x) { - return x.__proto__; - }; - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": EvalError, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": - typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Map()[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": Object, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": RangeError, - "%ReferenceError%": ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": - typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Set()[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, - }; - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"], - }; - var bind = require_function_bind3(); - var hasOwn = require_src(); - var $concat = bind.call(Function.call, Array.prototype.concat); - var $spliceApply = bind.call(Function.apply, Array.prototype.splice); - var $replace = bind.call(Function.call, String.prototype.replace); - var $strSlice = bind.call(Function.call, String.prototype.slice); - var $exec = bind.call(Function.call, RegExp.prototype.exec); - var rePropName = - /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === "%" && last !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last === "%" && first !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value, - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - (first === '"' || first === "'" || first === "`" || last === '"' || last === "'" || last === "`") && - first !== last - ) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void 0; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - }, -}); - -// ../../node_modules/util/node_modules/call-bind/index.js -var require_call_bind2 = __commonJS({ - "../../node_modules/util/node_modules/call-bind/index.js"(exports, module) { - "use strict"; - var bind = require_function_bind3(); - var GetIntrinsic = require_get_intrinsic2(); - var $apply = GetIntrinsic("%Function.prototype.apply%"); - var $call = GetIntrinsic("%Function.prototype.call%"); - var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); - var $max = GetIntrinsic("%Math.max%"); - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = null; - } - } - module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, "length"); - if (desc.configurable) { - $defineProperty(func, "length", { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }); - } - } - return func; - }; - var applyBind = function applyBind2() { - return $reflectApply(bind, $apply, arguments); - }; - if ($defineProperty) { - $defineProperty(module.exports, "apply", { value: applyBind }); - } else { - module.exports.apply = applyBind; - } - }, -}); - -// ../../node_modules/util/node_modules/call-bind/callBound.js -var require_callBound2 = __commonJS({ - "../../node_modules/util/node_modules/call-bind/callBound.js"(exports, module) { - "use strict"; - var GetIntrinsic = require_get_intrinsic2(); - var callBind = require_call_bind2(); - var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); - module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { - return callBind(intrinsic); - } - return intrinsic; - }; - }, -}); - -// ../../node_modules/gopd/node_modules/function-bind/implementation.js -var require_implementation4 = __commonJS({ - "../../node_modules/gopd/node_modules/function-bind/implementation.js"(exports, module) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var slice = Array.prototype.slice; - var toStr = Object.prototype.toString; - var funcType = "[object Function]"; - module.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply(this, args.concat(slice.call(arguments))); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply(that, args.concat(slice.call(arguments))); - } - }; - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push("$" + i); - } - bound = Function( - "binder", - "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }" - )(binder); - if (target.prototype) { - var Empty = function Empty2() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - }, -}); - -// ../../node_modules/gopd/node_modules/function-bind/index.js -var require_function_bind4 = __commonJS({ - "../../node_modules/gopd/node_modules/function-bind/index.js"(exports, module) { - "use strict"; - var implementation = require_implementation4(); - module.exports = Function.prototype.bind || implementation; - }, -}); - -// ../../node_modules/gopd/node_modules/get-intrinsic/index.js -var require_get_intrinsic3 = __commonJS({ - "../../node_modules/gopd/node_modules/get-intrinsic/index.js"(exports, module) { - "use strict"; - var undefined2; - var $SyntaxError = SyntaxError; - var $Function = Function; - var $TypeError = TypeError; - var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) {} - }; - var $gOPD = Object.getOwnPropertyDescriptor; - if ($gOPD) { - try { - $gOPD({}, ""); - } catch (e) { - $gOPD = null; - } - } - var throwTypeError = function () { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD - ? (function () { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - })() - : throwTypeError; - var hasSymbols = require_has_symbols()(); - var getProto = - Object.getPrototypeOf || - function (x) { - return x.__proto__; - }; - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": EvalError, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": - typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Map()[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": Object, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": RangeError, - "%ReferenceError%": ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": - typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Set()[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, - }; - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"], - }; - var bind = require_function_bind4(); - var hasOwn = require_src(); - var $concat = bind.call(Function.call, Array.prototype.concat); - var $spliceApply = bind.call(Function.apply, Array.prototype.splice); - var $replace = bind.call(Function.call, String.prototype.replace); - var $strSlice = bind.call(Function.call, String.prototype.slice); - var $exec = bind.call(Function.call, RegExp.prototype.exec); - var rePropName = - /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === "%" && last !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last === "%" && first !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value, - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - (first === '"' || first === "'" || first === "`" || last === '"' || last === "'" || last === "`") && - first !== last - ) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void 0; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - }, -}); - -// ../../node_modules/gopd/index.js -var require_gopd = __commonJS({ - "../../node_modules/gopd/index.js"(exports, module) { - "use strict"; - var GetIntrinsic = require_get_intrinsic3(); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); - if ($gOPD) { - try { - $gOPD([], "length"); - } catch (e) { - $gOPD = null; - } - } - module.exports = $gOPD; - }, -}); - -// ../../node_modules/util/node_modules/is-typed-array/index.js -var require_is_typed_array = __commonJS({ - "../../node_modules/util/node_modules/is-typed-array/index.js"(exports, module) { - "use strict"; - var forEach = require_for_each(); - var availableTypedArrays = require_available_typed_arrays(); - var callBound = require_callBound2(); - var $toString = callBound("Object.prototype.toString"); - var hasToStringTag = require_shams2()(); - var gOPD = require_gopd(); - var g = typeof globalThis === "undefined" ? global : globalThis; - var typedArrays = availableTypedArrays(); - var $indexOf = - callBound("Array.prototype.indexOf", true) || - function indexOf(array, value) { - for (var i = 0; i < array.length; i += 1) { - if (array[i] === value) { - return i; - } - } - return -1; - }; - var $slice = callBound("String.prototype.slice"); - var toStrTags = {}; - var getPrototypeOf = Object.getPrototypeOf; - if (hasToStringTag && gOPD && getPrototypeOf) { - forEach(typedArrays, function (typedArray) { - var arr = new g[typedArray](); - if (Symbol.toStringTag in arr) { - var proto = getPrototypeOf(arr); - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor) { - var superProto = getPrototypeOf(proto); - descriptor = gOPD(superProto, Symbol.toStringTag); - } - toStrTags[typedArray] = descriptor.get; - } - }); - } - var tryTypedArrays = function tryAllTypedArrays(value) { - var anyTrue = false; - forEach(toStrTags, function (getter, typedArray) { - if (!anyTrue) { - try { - anyTrue = getter.call(value) === typedArray; - } catch (e) {} - } - }); - return anyTrue; - }; - module.exports = function isTypedArray(value) { - if (!value || typeof value !== "object") { - return false; - } - if (!hasToStringTag || !(Symbol.toStringTag in value)) { - var tag = $slice($toString(value), 8, -1); - return $indexOf(typedArrays, tag) > -1; - } - if (!gOPD) { - return false; - } - return tryTypedArrays(value); - }; - }, -}); - -// ../../node_modules/util/node_modules/which-typed-array/index.js -var require_which_typed_array = __commonJS({ - "../../node_modules/util/node_modules/which-typed-array/index.js"(exports, module) { - "use strict"; - var forEach = require_for_each(); - var availableTypedArrays = require_available_typed_arrays(); - var callBound = require_callBound2(); - var gOPD = require_gopd(); - var $toString = callBound("Object.prototype.toString"); - var hasToStringTag = require_shams2()(); - var g = typeof globalThis === "undefined" ? global : globalThis; - var typedArrays = availableTypedArrays(); - var $slice = callBound("String.prototype.slice"); - var toStrTags = {}; - var getPrototypeOf = Object.getPrototypeOf; - if (hasToStringTag && gOPD && getPrototypeOf) { - forEach(typedArrays, function (typedArray) { - if (typeof g[typedArray] === "function") { - var arr = new g[typedArray](); - if (Symbol.toStringTag in arr) { - var proto = getPrototypeOf(arr); - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor) { - var superProto = getPrototypeOf(proto); - descriptor = gOPD(superProto, Symbol.toStringTag); - } - toStrTags[typedArray] = descriptor.get; - } - } - }); - } - var tryTypedArrays = function tryAllTypedArrays(value) { - var foundName = false; - forEach(toStrTags, function (getter, typedArray) { - if (!foundName) { - try { - var name = getter.call(value); - if (name === typedArray) { - foundName = name; - } - } catch (e) {} - } - }); - return foundName; - }; - var isTypedArray = require_is_typed_array(); - module.exports = function whichTypedArray(value) { - if (!isTypedArray(value)) { - return false; - } - if (!hasToStringTag || !(Symbol.toStringTag in value)) { - return $slice($toString(value), 8, -1); - } - return tryTypedArrays(value); - }; - }, -}); - -// ../../node_modules/util/support/types.js -var require_types = __commonJS({ - "../../node_modules/util/support/types.js"(exports) { - "use strict"; - var isArgumentsObject = require_is_arguments(); - var isGeneratorFunction = require_is_generator_function(); - var whichTypedArray = require_which_typed_array(); - var isTypedArray = require_is_typed_array(); - function uncurryThis(f) { - return f.call.bind(f); - } - var BigIntSupported = typeof BigInt !== "undefined"; - var SymbolSupported = typeof Symbol !== "undefined"; - var ObjectToString = uncurryThis(Object.prototype.toString); - var numberValue = uncurryThis(Number.prototype.valueOf); - var stringValue = uncurryThis(String.prototype.valueOf); - var booleanValue = uncurryThis(Boolean.prototype.valueOf); - if (BigIntSupported) { - bigIntValue = uncurryThis(BigInt.prototype.valueOf); - } - var bigIntValue; - if (SymbolSupported) { - symbolValue = uncurryThis(Symbol.prototype.valueOf); - } - var symbolValue; - function checkBoxedPrimitive(value, prototypeValueOf) { - if (typeof value !== "object") { - return false; - } - try { - prototypeValueOf(value); - return true; - } catch (e) { - return false; - } - } - exports.isArgumentsObject = isArgumentsObject; - exports.isGeneratorFunction = isGeneratorFunction; - exports.isTypedArray = isTypedArray; - function isPromise(input) { - return ( - (typeof Promise !== "undefined" && input instanceof Promise) || - (input !== null && - typeof input === "object" && - typeof input.then === "function" && - typeof input.catch === "function") - ); - } - exports.isPromise = isPromise; - function isArrayBufferView(value) { - if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { - return ArrayBuffer.isView(value); - } - return isTypedArray(value) || isDataView(value); - } - exports.isArrayBufferView = isArrayBufferView; - function isUint8Array(value) { - return whichTypedArray(value) === "Uint8Array"; - } - exports.isUint8Array = isUint8Array; - function isUint8ClampedArray(value) { - return whichTypedArray(value) === "Uint8ClampedArray"; - } - exports.isUint8ClampedArray = isUint8ClampedArray; - function isUint16Array(value) { - return whichTypedArray(value) === "Uint16Array"; - } - exports.isUint16Array = isUint16Array; - function isUint32Array(value) { - return whichTypedArray(value) === "Uint32Array"; - } - exports.isUint32Array = isUint32Array; - function isInt8Array(value) { - return whichTypedArray(value) === "Int8Array"; - } - exports.isInt8Array = isInt8Array; - function isInt16Array(value) { - return whichTypedArray(value) === "Int16Array"; - } - exports.isInt16Array = isInt16Array; - function isInt32Array(value) { - return whichTypedArray(value) === "Int32Array"; - } - exports.isInt32Array = isInt32Array; - function isFloat32Array(value) { - return whichTypedArray(value) === "Float32Array"; - } - exports.isFloat32Array = isFloat32Array; - function isFloat64Array(value) { - return whichTypedArray(value) === "Float64Array"; - } - exports.isFloat64Array = isFloat64Array; - function isBigInt64Array(value) { - return whichTypedArray(value) === "BigInt64Array"; - } - exports.isBigInt64Array = isBigInt64Array; - function isBigUint64Array(value) { - return whichTypedArray(value) === "BigUint64Array"; - } - exports.isBigUint64Array = isBigUint64Array; - function isMapToString(value) { - return ObjectToString(value) === "[object Map]"; - } - isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map()); - function isMap(value) { - if (typeof Map === "undefined") { - return false; - } - return isMapToString.working ? isMapToString(value) : value instanceof Map; - } - exports.isMap = isMap; - function isSetToString(value) { - return ObjectToString(value) === "[object Set]"; - } - isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set()); - function isSet(value) { - if (typeof Set === "undefined") { - return false; - } - return isSetToString.working ? isSetToString(value) : value instanceof Set; - } - exports.isSet = isSet; - function isWeakMapToString(value) { - return ObjectToString(value) === "[object WeakMap]"; - } - isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap()); - function isWeakMap(value) { - if (typeof WeakMap === "undefined") { - return false; - } - return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap; - } - exports.isWeakMap = isWeakMap; - function isWeakSetToString(value) { - return ObjectToString(value) === "[object WeakSet]"; - } - isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet()); - function isWeakSet(value) { - return isWeakSetToString(value); - } - exports.isWeakSet = isWeakSet; - function isArrayBufferToString(value) { - return ObjectToString(value) === "[object ArrayBuffer]"; - } - isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer()); - function isArrayBuffer(value) { - if (typeof ArrayBuffer === "undefined") { - return false; - } - return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer; - } - exports.isArrayBuffer = isArrayBuffer; - function isDataViewToString(value) { - return ObjectToString(value) === "[object DataView]"; - } - isDataViewToString.working = - typeof ArrayBuffer !== "undefined" && - typeof DataView !== "undefined" && - isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)); - function isDataView(value) { - if (typeof DataView === "undefined") { - return false; - } - return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView; - } - exports.isDataView = isDataView; - var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0; - function isSharedArrayBufferToString(value) { - return ObjectToString(value) === "[object SharedArrayBuffer]"; - } - function isSharedArrayBuffer(value) { - if (typeof SharedArrayBufferCopy === "undefined") { - return false; - } - if (typeof isSharedArrayBufferToString.working === "undefined") { - isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); - } - return isSharedArrayBufferToString.working - ? isSharedArrayBufferToString(value) - : value instanceof SharedArrayBufferCopy; - } - exports.isSharedArrayBuffer = isSharedArrayBuffer; - function isAsyncFunction(value) { - return ObjectToString(value) === "[object AsyncFunction]"; - } - exports.isAsyncFunction = isAsyncFunction; - function isMapIterator(value) { - return ObjectToString(value) === "[object Map Iterator]"; - } - exports.isMapIterator = isMapIterator; - function isSetIterator(value) { - return ObjectToString(value) === "[object Set Iterator]"; - } - exports.isSetIterator = isSetIterator; - function isGeneratorObject(value) { - return ObjectToString(value) === "[object Generator]"; - } - exports.isGeneratorObject = isGeneratorObject; - function isWebAssemblyCompiledModule(value) { - return ObjectToString(value) === "[object WebAssembly.Module]"; - } - exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; - function isNumberObject(value) { - return checkBoxedPrimitive(value, numberValue); - } - exports.isNumberObject = isNumberObject; - function isStringObject(value) { - return checkBoxedPrimitive(value, stringValue); - } - exports.isStringObject = isStringObject; - function isBooleanObject(value) { - return checkBoxedPrimitive(value, booleanValue); - } - exports.isBooleanObject = isBooleanObject; - function isBigIntObject(value) { - return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); - } - exports.isBigIntObject = isBigIntObject; - function isSymbolObject(value) { - return SymbolSupported && checkBoxedPrimitive(value, symbolValue); - } - exports.isSymbolObject = isSymbolObject; - function isBoxedPrimitive(value) { - return ( - isNumberObject(value) || - isStringObject(value) || - isBooleanObject(value) || - isBigIntObject(value) || - isSymbolObject(value) - ); - } - exports.isBoxedPrimitive = isBoxedPrimitive; - function isAnyArrayBuffer(value) { - return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value)); - } - exports.isAnyArrayBuffer = isAnyArrayBuffer; - ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function (method) { - Object.defineProperty(exports, method, { - enumerable: false, - value: function () { - throw new Error(method + " is not supported in userland"); - }, - }); - }); - }, -}); - -// ../../node_modules/util/support/isBufferBrowser.js -var require_isBufferBrowser = __commonJS({ - "../../node_modules/util/support/isBufferBrowser.js"(exports, module) { - module.exports = function isBuffer(arg) { - return ( - arg && - typeof arg === "object" && - typeof arg.copy === "function" && - typeof arg.fill === "function" && - typeof arg.readUInt8 === "function" - ); - }; - }, -}); - -// ../../node_modules/util/util.js -var require_util = __commonJS({ - "../../node_modules/util/util.js"(exports) { - var getOwnPropertyDescriptors = - Object.getOwnPropertyDescriptors || - function getOwnPropertyDescriptors2(obj) { - var keys = Object.keys(obj); - var descriptors = {}; - for (var i = 0; i < keys.length; i++) { - descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); - } - return descriptors; - }; - var formatRegExp = /%[sdj%]/g; - exports.format = function (f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(" "); - } - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function (x2) { - if (x2 === "%%") return "%"; - if (i >= len) return x2; - switch (x2) { - case "%s": - return String(args[i++]); - case "%d": - return Number(args[i++]); - case "%j": - try { - return JSON.stringify(args[i++]); - } catch (_) { - return "[Circular]"; - } - default: - return x2; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += " " + x; - } else { - str += " " + inspect(x); - } - } - return str; - }; - exports.deprecate = function (fn, msg) { - if (typeof process !== "undefined" && process.noDeprecation === true) { - return fn; - } - if (typeof process === "undefined") { - return function () { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - return deprecated; - }; - var debugs = {}; - var debugEnvRegex = /^$/; - if (process.env.NODE_DEBUG) { - debugEnv = process.env.NODE_DEBUG; - debugEnv = debugEnv - .replace(/[|\\{}()[\]^$+?.]/g, "\\$&") - .replace(/\*/g, ".*") - .replace(/,/g, "$|^") - .toUpperCase(); - debugEnvRegex = new RegExp("^" + debugEnv + "$", "i"); - } - var debugEnv; - exports.debuglog = function (set) { - set = set.toUpperCase(); - if (!debugs[set]) { - if (debugEnvRegex.test(set)) { - var pid = process.pid; - debugs[set] = function () { - var msg = exports.format.apply(exports, arguments); - console.error("%s %d: %s", set, pid, msg); - }; - } else { - debugs[set] = function () {}; - } - } - return debugs[set]; - }; - function inspect(obj, opts) { - var ctx = { - seen: [], - stylize: stylizeNoColor, - }; - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - ctx.showHidden = opts; - } else if (opts) { - exports._extend(ctx, opts); - } - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); - } - exports.inspect = inspect; - inspect.colors = { - bold: [1, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - white: [37, 39], - grey: [90, 39], - black: [30, 39], - blue: [34, 39], - cyan: [36, 39], - green: [32, 39], - magenta: [35, 39], - red: [31, 39], - yellow: [33, 39], - }; - inspect.styles = { - special: "cyan", - number: "yellow", - boolean: "yellow", - undefined: "grey", - null: "bold", - string: "green", - date: "magenta", - // "name": intentionally not styling - regexp: "red", - }; - function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - if (style) { - return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m"; - } else { - return str; - } - } - function stylizeNoColor(str, styleType) { - return str; - } - function arrayToHash(array) { - var hash = {}; - array.forEach(function (val, idx) { - hash[val] = true; - }); - return hash; - } - function formatValue(ctx, value, recurseTimes) { - if ( - ctx.customInspect && - value && - isFunction(value.inspect) && // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value) - ) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) { - return formatError(value); - } - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ": " + value.name : ""; - return ctx.stylize("[Function" + name + "]", "special"); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), "regexp"); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), "date"); - } - if (isError(value)) { - return formatError(value); - } - } - var base = "", - array = false, - braces = ["{", "}"]; - if (isArray(value)) { - array = true; - braces = ["[", "]"]; - } - if (isFunction(value)) { - var n = value.name ? ": " + value.name : ""; - base = " [Function" + n + "]"; - } - if (isRegExp(value)) { - base = " " + RegExp.prototype.toString.call(value); - } - if (isDate(value)) { - base = " " + Date.prototype.toUTCString.call(value); - } - if (isError(value)) { - base = " " + formatError(value); - } - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), "regexp"); - } else { - return ctx.stylize("[Object]", "special"); - } - } - ctx.seen.push(value); - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function (key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - ctx.seen.pop(); - return reduceToSingleString(output, base, braces); - } - function formatPrimitive(ctx, value) { - if (isUndefined(value)) return ctx.stylize("undefined", "undefined"); - if (isString(value)) { - var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; - return ctx.stylize(simple, "string"); - } - if (isNumber(value)) return ctx.stylize("" + value, "number"); - if (isBoolean(value)) return ctx.stylize("" + value, "boolean"); - if (isNull(value)) return ctx.stylize("null", "null"); - } - function formatError(value) { - return "[" + Error.prototype.toString.call(value) + "]"; - } - function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); - } else { - output.push(""); - } - } - keys.forEach(function (key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); - } - }); - return output; - } - function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize("[Getter/Setter]", "special"); - } else { - str = ctx.stylize("[Getter]", "special"); - } - } else { - if (desc.set) { - str = ctx.stylize("[Setter]", "special"); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = "[" + key + "]"; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf("\n") > -1) { - if (array) { - str = str - .split("\n") - .map(function (line) { - return " " + line; - }) - .join("\n") - .slice(2); - } else { - str = - "\n" + - str - .split("\n") - .map(function (line) { - return " " + line; - }) - .join("\n"); - } - } - } else { - str = ctx.stylize("[Circular]", "special"); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify("" + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.slice(1, -1); - name = ctx.stylize(name, "name"); - } else { - name = name - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, "string"); - } - } - return name + ": " + str; - } - function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function (prev, cur) { - numLinesEst++; - if (cur.indexOf("\n") >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1; - }, 0); - if (length > 60) { - return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1]; - } - return braces[0] + base + " " + output.join(", ") + " " + braces[1]; - } - exports.types = require_types(); - function isArray(ar) { - return Array.isArray(ar); - } - exports.isArray = isArray; - function isBoolean(arg) { - return typeof arg === "boolean"; - } - exports.isBoolean = isBoolean; - function isNull(arg) { - return arg === null; - } - exports.isNull = isNull; - function isNullOrUndefined(arg) { - return arg == null; - } - exports.isNullOrUndefined = isNullOrUndefined; - function isNumber(arg) { - return typeof arg === "number"; - } - exports.isNumber = isNumber; - function isString(arg) { - return typeof arg === "string"; - } - exports.isString = isString; - function isSymbol(arg) { - return typeof arg === "symbol"; - } - exports.isSymbol = isSymbol; - function isUndefined(arg) { - return arg === void 0; - } - exports.isUndefined = isUndefined; - function isRegExp(re) { - return isObject(re) && objectToString(re) === "[object RegExp]"; - } - exports.isRegExp = isRegExp; - exports.types.isRegExp = isRegExp; - function isObject(arg) { - return typeof arg === "object" && arg !== null; - } - exports.isObject = isObject; - function isDate(d) { - return isObject(d) && objectToString(d) === "[object Date]"; - } - exports.isDate = isDate; - exports.types.isDate = isDate; - function isError(e) { - return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error); - } - exports.isError = isError; - exports.types.isNativeError = isError; - function isFunction(arg) { - return typeof arg === "function"; - } - exports.isFunction = isFunction; - function isPrimitive(arg) { - return ( - arg === null || - typeof arg === "boolean" || - typeof arg === "number" || - typeof arg === "string" || - typeof arg === "symbol" || // ES6 symbol - typeof arg === "undefined" - ); - } - exports.isPrimitive = isPrimitive; - exports.isBuffer = require_isBufferBrowser(); - function objectToString(o) { - return Object.prototype.toString.call(o); - } - function pad(n) { - return n < 10 ? "0" + n.toString(10) : n.toString(10); - } - var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - function timestamp() { - var d = /* @__PURE__ */ new Date(); - var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(":"); - return [d.getDate(), months[d.getMonth()], time].join(" "); - } - exports.log = function () { - console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments)); - }; - exports.inherits = require_inherits(); - exports._extend = function (origin, add) { - if (!add || !isObject(add)) return origin; - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; - }; - function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); - } - var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0; - exports.promisify = function promisify(original) { - if (typeof original !== "function") throw new TypeError('The "original" argument must be of type Function'); - if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { - var fn = original[kCustomPromisifiedSymbol]; - if (typeof fn !== "function") { - throw new TypeError('The "util.promisify.custom" argument must be of type Function'); - } - Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, - enumerable: false, - writable: false, - configurable: true, - }); - return fn; - } - function fn() { - var promiseResolve, promiseReject; - var promise = new Promise(function (resolve, reject) { - promiseResolve = resolve; - promiseReject = reject; - }); - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - args.push(function (err, value) { - if (err) { - promiseReject(err); - } else { - promiseResolve(value); - } - }); - try { - original.apply(this, args); - } catch (err) { - promiseReject(err); - } - return promise; - } - Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); - if (kCustomPromisifiedSymbol) - Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, - enumerable: false, - writable: false, - configurable: true, - }); - return Object.defineProperties(fn, getOwnPropertyDescriptors(original)); - }; - exports.promisify.custom = kCustomPromisifiedSymbol; - function callbackifyOnRejected(reason, cb) { - if (!reason) { - var newReason = new Error("Promise was rejected with a falsy value"); - newReason.reason = reason; - reason = newReason; - } - return cb(reason); - } - function callbackify(original) { - if (typeof original !== "function") { - throw new TypeError('The "original" argument must be of type Function'); - } - function callbackified() { - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - var maybeCb = args.pop(); - if (typeof maybeCb !== "function") { - throw new TypeError("The last argument must be of type Function"); - } - var self2 = this; - var cb = function () { - return maybeCb.apply(self2, arguments); - }; - original.apply(this, args).then( - function (ret) { - process.nextTick(cb.bind(null, null, ret)); - }, - function (rej) { - process.nextTick(callbackifyOnRejected.bind(null, rej, cb)); - } - ); - } - Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); - Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)); - return callbackified; - } - exports.callbackify = callbackify; - }, -}); - // ../../node_modules/inherits/inherits_browser.js var require_inherits_browser = __commonJS({ "../../node_modules/inherits/inherits_browser.js"(exports, module) { @@ -5931,7 +3335,7 @@ var require_inherits_browser = __commonJS({ var require_inherits = __commonJS({ "../../node_modules/inherits/inherits.js"(exports, module) { try { - util = require_util(); + util = __require("util"); if (typeof util.inherits !== "function") throw ""; module.exports = util.inherits; } catch (e) { diff --git a/packages/external-dependencies/src/index.ts b/packages/external-dependencies/src/index.ts new file mode 100644 index 00000000000..ee19019dedd --- /dev/null +++ b/packages/external-dependencies/src/index.ts @@ -0,0 +1 @@ +export { Ec } from "./Ec"; diff --git a/packages/external-dependencies/tsconfig.cjs.json b/packages/external-dependencies/tsconfig.cjs.json new file mode 100644 index 00000000000..1a4dd131cc4 --- /dev/null +++ b/packages/external-dependencies/tsconfig.cjs.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "outDir": "dist-cjs", + "rootDir": "src", + "stripInternal": true + }, + "extends": "../../tsconfig.cjs.json", + "include": ["src/"] +} diff --git a/packages/external-dependencies/tsconfig.es.json b/packages/external-dependencies/tsconfig.es.json new file mode 100644 index 00000000000..37d7418d473 --- /dev/null +++ b/packages/external-dependencies/tsconfig.es.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "lib": [], + "noUnusedLocals": true, + "outDir": "dist-es", + "rootDir": "src", + "stripInternal": true + }, + "extends": "../../tsconfig.es.json", + "include": ["src/"] +} diff --git a/packages/external-dependencies/tsconfig.types.json b/packages/external-dependencies/tsconfig.types.json new file mode 100644 index 00000000000..6cdf9f52ea0 --- /dev/null +++ b/packages/external-dependencies/tsconfig.types.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declarationDir": "dist-types", + "rootDir": "src" + }, + "extends": "../../tsconfig.types.json", + "include": ["src/"] +} diff --git a/packages/external-dependencies/vitest.config.mts b/packages/external-dependencies/vitest.config.mts new file mode 100644 index 00000000000..124a7707680 --- /dev/null +++ b/packages/external-dependencies/vitest.config.mts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*.{integ,e2e,browser}.spec.ts"], + include: ["**/*.spec.ts"], + environment: "node", + }, +}); \ No newline at end of file diff --git a/packages/signature-v4a/package.json b/packages/signature-v4a/package.json index b6836201e2f..189e0252f96 100644 --- a/packages/signature-v4a/package.json +++ b/packages/signature-v4a/package.json @@ -11,7 +11,6 @@ "build:es": "yarn g:tsc -p tsconfig.es.json", "build:types": "yarn g:tsc -p tsconfig.types.json", "build:types:downlevel": "rimraf dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4", - "build:elliptic": "node ./scripts/esbuild.mjs", "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz", "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"", @@ -26,6 +25,7 @@ "license": "Apache-2.0", "sideEffects": true, "dependencies": { + "@smithy/external-dependencies": "workspace:^", "@smithy/signature-v4": "workspace:^", "@smithy/types": "workspace:^", "@smithy/util-hex-encoding": "workspace:^", @@ -37,7 +37,6 @@ "@smithy/protocol-http": "workspace:^", "concurrently": "7.0.0", "downlevel-dts": "0.10.1", - "elliptic": "6.5.5", "rimraf": "3.0.2" }, "engines": { diff --git a/packages/signature-v4a/scripts/Ec.js b/packages/signature-v4a/scripts/Ec.js deleted file mode 100644 index 16399575d73..00000000000 --- a/packages/signature-v4a/scripts/Ec.js +++ /dev/null @@ -1 +0,0 @@ -export { ec as Ec } from "elliptic"; diff --git a/packages/signature-v4a/src/SignatureV4a.ts b/packages/signature-v4a/src/SignatureV4a.ts index d0d240a733f..a019d754c12 100644 --- a/packages/signature-v4a/src/SignatureV4a.ts +++ b/packages/signature-v4a/src/SignatureV4a.ts @@ -1,3 +1,4 @@ +import { Ec } from "@smithy/external-dependencies"; import type { SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4"; import { ALGORITHM_IDENTIFIER_V4A, @@ -17,8 +18,6 @@ import { toUint8Array } from "@smithy/util-utf8"; import { REGION_HEADER } from "./constants"; import { createSigV4aScope, getSigV4aSigningKey } from "./credentialDerivation"; -// @ts-ignore -import { Ec } from "./elliptic/Ec"; /** * @public @@ -123,7 +122,7 @@ export class SignatureV4a extends SignatureV4Base implements RequestSigner { */ private async getSignature(privateKey: Uint8Array, stringToSign: string): Promise { // Create ECDSA and get key pair - const ecdsa = new Ec("p256"); + const ecdsa = new (Ec as any)("p256"); const key = ecdsa.keyFromPrivate(privateKey); // Format request using SHA256 diff --git a/scripts/compilation/Inliner.js b/scripts/compilation/Inliner.js index 66432ea9630..e18202a0723 100644 --- a/scripts/compilation/Inliner.js +++ b/scripts/compilation/Inliner.js @@ -469,6 +469,7 @@ module.exports = class Inliner { "limitedParseFloat", // aliased to limitedParseDouble "strictParseFloat", // aliased to strictParseDouble "strictParseInt", // aliased to strictParseLong + "Ec", // name gets renamed as EC ].includes(sym) ) { return `import { ${sym} } from "${this.pkgJson.name}";`; diff --git a/yarn.lock b/yarn.lock index 5de2ba342cd..ef9ada1a0c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2659,6 +2659,19 @@ __metadata: languageName: unknown linkType: soft +"@smithy/external-dependencies@workspace:^, @smithy/external-dependencies@workspace:packages/external-dependencies": + version: 0.0.0-use.local + resolution: "@smithy/external-dependencies@workspace:packages/external-dependencies" + dependencies: + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + elliptic: "npm:6.5.5" + esbuild: "npm:^0.25.9" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + languageName: unknown + linkType: soft + "@smithy/fetch-http-handler@workspace:^, @smithy/fetch-http-handler@workspace:packages/fetch-http-handler": version: 0.0.0-use.local resolution: "@smithy/fetch-http-handler@workspace:packages/fetch-http-handler" @@ -3048,6 +3061,7 @@ __metadata: resolution: "@smithy/signature-v4a@workspace:packages/signature-v4a" dependencies: "@aws-crypto/sha256-js": "npm:5.2.0" + "@smithy/external-dependencies": "workspace:^" "@smithy/protocol-http": "workspace:^" "@smithy/signature-v4": "workspace:^" "@smithy/types": "workspace:^" @@ -3055,7 +3069,6 @@ __metadata: "@smithy/util-utf8": "workspace:^" concurrently: "npm:7.0.0" downlevel-dts: "npm:0.10.1" - elliptic: "npm:6.5.5" rimraf: "npm:3.0.2" tslib: "npm:^2.6.2" languageName: unknown