@builderbot/bot 1.2.8-alpha.0 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4,12 +4,12 @@ var console$1 = require('console');
4
4
  var require$$3$1 = require('fs');
5
5
  var node_events = require('node:events');
6
6
  var crypto = require('crypto');
7
- var require$$0$4 = require('tty');
8
7
  var require$$0$6 = require('url');
9
8
  var require$$1$3 = require('http');
10
9
  var require$$2$1 = require('https');
11
10
  var require$$1$2 = require('stream');
12
11
  var require$$4$1 = require('assert');
12
+ var require$$0$4 = require('tty');
13
13
  var require$$1$1 = require('util');
14
14
  var require$$0$5 = require('os');
15
15
  var path = require('path');
@@ -313,8 +313,6 @@ const eventCall = () => {
313
313
  };
314
314
  const REGEX_EVENT_CALL = generateRegex(`_event_call`);
315
315
 
316
- const REGEX_EVENT_CUSTOM = /^_event_custom__[\w\d]{8}-(?:[\w\d]{4}-){3}[\w\d]{12}$/;
317
-
318
316
  const eventDocument = () => {
319
317
  return generateRef('_event_document_');
320
318
  };
@@ -367,7 +365,6 @@ const LIST_REGEX = {
367
365
  REGEX_EVENT_VOICE_NOTE,
368
366
  REGEX_EVENT_ORDER,
369
367
  REGEX_EVENT_TEMPLATE,
370
- REGEX_EVENT_CUSTOM,
371
368
  REGEX_EVENT_CALL,
372
369
  };
373
370
 
@@ -682,35 +679,21 @@ function getAugmentedNamespace(n) {
682
679
  return a;
683
680
  }
684
681
 
685
- function commonjsRequire(path) {
686
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
687
- }
688
-
689
682
  var picocolors = {exports: {}};
690
683
 
691
- let argv = process.argv || [],
692
- env = process.env;
684
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
693
685
  let isColorSupported =
694
- !("NO_COLOR" in env || argv.includes("--no-color")) &&
695
- ("FORCE_COLOR" in env ||
696
- argv.includes("--color") ||
697
- process.platform === "win32" ||
698
- (commonjsRequire != null && require$$0$4.isatty(1) && env.TERM !== "dumb") ||
699
- "CI" in env);
700
-
701
- let formatter =
702
- (open, close, replace = open) =>
686
+ !(!!env.NO_COLOR || argv.includes("--no-color")) &&
687
+ (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI);
688
+
689
+ let formatter = (open, close, replace = open) =>
703
690
  input => {
704
- let string = "" + input;
705
- let index = string.indexOf(close, open.length);
706
- return ~index
707
- ? open + replaceClose(string, close, replace, index) + close
708
- : open + string + close
691
+ let string = "" + input, index = string.indexOf(close, open.length);
692
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
709
693
  };
710
694
 
711
695
  let replaceClose = (string, close, replace, index) => {
712
- let result = "";
713
- let cursor = 0;
696
+ let result = "", cursor = 0;
714
697
  do {
715
698
  result += string.substring(cursor, index) + replace;
716
699
  cursor = index + close.length;
@@ -720,34 +703,54 @@ let replaceClose = (string, close, replace, index) => {
720
703
  };
721
704
 
722
705
  let createColors = (enabled = isColorSupported) => {
723
- let init = enabled ? formatter : () => String;
706
+ let f = enabled ? formatter : () => String;
724
707
  return {
725
708
  isColorSupported: enabled,
726
- reset: init("\x1b[0m", "\x1b[0m"),
727
- bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
728
- dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
729
- italic: init("\x1b[3m", "\x1b[23m"),
730
- underline: init("\x1b[4m", "\x1b[24m"),
731
- inverse: init("\x1b[7m", "\x1b[27m"),
732
- hidden: init("\x1b[8m", "\x1b[28m"),
733
- strikethrough: init("\x1b[9m", "\x1b[29m"),
734
- black: init("\x1b[30m", "\x1b[39m"),
735
- red: init("\x1b[31m", "\x1b[39m"),
736
- green: init("\x1b[32m", "\x1b[39m"),
737
- yellow: init("\x1b[33m", "\x1b[39m"),
738
- blue: init("\x1b[34m", "\x1b[39m"),
739
- magenta: init("\x1b[35m", "\x1b[39m"),
740
- cyan: init("\x1b[36m", "\x1b[39m"),
741
- white: init("\x1b[37m", "\x1b[39m"),
742
- gray: init("\x1b[90m", "\x1b[39m"),
743
- bgBlack: init("\x1b[40m", "\x1b[49m"),
744
- bgRed: init("\x1b[41m", "\x1b[49m"),
745
- bgGreen: init("\x1b[42m", "\x1b[49m"),
746
- bgYellow: init("\x1b[43m", "\x1b[49m"),
747
- bgBlue: init("\x1b[44m", "\x1b[49m"),
748
- bgMagenta: init("\x1b[45m", "\x1b[49m"),
749
- bgCyan: init("\x1b[46m", "\x1b[49m"),
750
- bgWhite: init("\x1b[47m", "\x1b[49m"),
709
+ reset: f("\x1b[0m", "\x1b[0m"),
710
+ bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
711
+ dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
712
+ italic: f("\x1b[3m", "\x1b[23m"),
713
+ underline: f("\x1b[4m", "\x1b[24m"),
714
+ inverse: f("\x1b[7m", "\x1b[27m"),
715
+ hidden: f("\x1b[8m", "\x1b[28m"),
716
+ strikethrough: f("\x1b[9m", "\x1b[29m"),
717
+
718
+ black: f("\x1b[30m", "\x1b[39m"),
719
+ red: f("\x1b[31m", "\x1b[39m"),
720
+ green: f("\x1b[32m", "\x1b[39m"),
721
+ yellow: f("\x1b[33m", "\x1b[39m"),
722
+ blue: f("\x1b[34m", "\x1b[39m"),
723
+ magenta: f("\x1b[35m", "\x1b[39m"),
724
+ cyan: f("\x1b[36m", "\x1b[39m"),
725
+ white: f("\x1b[37m", "\x1b[39m"),
726
+ gray: f("\x1b[90m", "\x1b[39m"),
727
+
728
+ bgBlack: f("\x1b[40m", "\x1b[49m"),
729
+ bgRed: f("\x1b[41m", "\x1b[49m"),
730
+ bgGreen: f("\x1b[42m", "\x1b[49m"),
731
+ bgYellow: f("\x1b[43m", "\x1b[49m"),
732
+ bgBlue: f("\x1b[44m", "\x1b[49m"),
733
+ bgMagenta: f("\x1b[45m", "\x1b[49m"),
734
+ bgCyan: f("\x1b[46m", "\x1b[49m"),
735
+ bgWhite: f("\x1b[47m", "\x1b[49m"),
736
+
737
+ blackBright: f("\x1b[90m", "\x1b[39m"),
738
+ redBright: f("\x1b[91m", "\x1b[39m"),
739
+ greenBright: f("\x1b[92m", "\x1b[39m"),
740
+ yellowBright: f("\x1b[93m", "\x1b[39m"),
741
+ blueBright: f("\x1b[94m", "\x1b[39m"),
742
+ magentaBright: f("\x1b[95m", "\x1b[39m"),
743
+ cyanBright: f("\x1b[96m", "\x1b[39m"),
744
+ whiteBright: f("\x1b[97m", "\x1b[39m"),
745
+
746
+ bgBlackBright: f("\x1b[100m", "\x1b[49m"),
747
+ bgRedBright: f("\x1b[101m", "\x1b[49m"),
748
+ bgGreenBright: f("\x1b[102m", "\x1b[49m"),
749
+ bgYellowBright: f("\x1b[103m", "\x1b[49m"),
750
+ bgBlueBright: f("\x1b[104m", "\x1b[49m"),
751
+ bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
752
+ bgCyanBright: f("\x1b[106m", "\x1b[49m"),
753
+ bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
751
754
  }
752
755
  };
753
756
 
@@ -837,7 +840,7 @@ class Queue {
837
840
  reject('cancelled');
838
841
  }
839
842
  if (!this.timers.has(fingerIdRef)) {
840
- const refIdTimeOut = timer({ reject, resolve });
843
+ const refIdTimeOut = timer({ resolve });
841
844
  clearTimeout(this.timers.get(fingerIdRef));
842
845
  this.timers.set(fingerIdRef, refIdTimeOut);
843
846
  this.clearAndDone(from, item);
@@ -969,7 +972,7 @@ function requireMs$1 () {
969
972
  * @api public
970
973
  */
971
974
 
972
- ms$1 = function(val, options) {
975
+ ms$1 = function (val, options) {
973
976
  options = options || {};
974
977
  var type = typeof val;
975
978
  if (type === 'string' && val.length > 0) {
@@ -1282,24 +1285,62 @@ function requireCommon () {
1282
1285
  createDebug.names = [];
1283
1286
  createDebug.skips = [];
1284
1287
 
1285
- let i;
1286
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
1287
- const len = split.length;
1288
+ const split = (typeof namespaces === 'string' ? namespaces : '')
1289
+ .trim()
1290
+ .replace(/\s+/g, ',')
1291
+ .split(',')
1292
+ .filter(Boolean);
1288
1293
 
1289
- for (i = 0; i < len; i++) {
1290
- if (!split[i]) {
1291
- // ignore empty strings
1292
- continue;
1294
+ for (const ns of split) {
1295
+ if (ns[0] === '-') {
1296
+ createDebug.skips.push(ns.slice(1));
1297
+ } else {
1298
+ createDebug.names.push(ns);
1293
1299
  }
1300
+ }
1301
+ }
1294
1302
 
1295
- namespaces = split[i].replace(/\*/g, '.*?');
1296
-
1297
- if (namespaces[0] === '-') {
1298
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
1303
+ /**
1304
+ * Checks if the given string matches a namespace template, honoring
1305
+ * asterisks as wildcards.
1306
+ *
1307
+ * @param {String} search
1308
+ * @param {String} template
1309
+ * @return {Boolean}
1310
+ */
1311
+ function matchesTemplate(search, template) {
1312
+ let searchIndex = 0;
1313
+ let templateIndex = 0;
1314
+ let starIndex = -1;
1315
+ let matchIndex = 0;
1316
+
1317
+ while (searchIndex < search.length) {
1318
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
1319
+ // Match character or proceed with wildcard
1320
+ if (template[templateIndex] === '*') {
1321
+ starIndex = templateIndex;
1322
+ matchIndex = searchIndex;
1323
+ templateIndex++; // Skip the '*'
1324
+ } else {
1325
+ searchIndex++;
1326
+ templateIndex++;
1327
+ }
1328
+ } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
1329
+ // Backtrack to the last '*' and try to match more characters
1330
+ templateIndex = starIndex + 1;
1331
+ matchIndex++;
1332
+ searchIndex = matchIndex;
1299
1333
  } else {
1300
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
1334
+ return false; // No match
1301
1335
  }
1302
1336
  }
1337
+
1338
+ // Handle trailing '*' in template
1339
+ while (templateIndex < template.length && template[templateIndex] === '*') {
1340
+ templateIndex++;
1341
+ }
1342
+
1343
+ return templateIndex === template.length;
1303
1344
  }
1304
1345
 
1305
1346
  /**
@@ -1310,8 +1351,8 @@ function requireCommon () {
1310
1351
  */
1311
1352
  function disable() {
1312
1353
  const namespaces = [
1313
- ...createDebug.names.map(toNamespace),
1314
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
1354
+ ...createDebug.names,
1355
+ ...createDebug.skips.map(namespace => '-' + namespace)
1315
1356
  ].join(',');
1316
1357
  createDebug.enable('');
1317
1358
  return namespaces;
@@ -1325,21 +1366,14 @@ function requireCommon () {
1325
1366
  * @api public
1326
1367
  */
1327
1368
  function enabled(name) {
1328
- if (name[name.length - 1] === '*') {
1329
- return true;
1330
- }
1331
-
1332
- let i;
1333
- let len;
1334
-
1335
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
1336
- if (createDebug.skips[i].test(name)) {
1369
+ for (const skip of createDebug.skips) {
1370
+ if (matchesTemplate(name, skip)) {
1337
1371
  return false;
1338
1372
  }
1339
1373
  }
1340
1374
 
1341
- for (i = 0, len = createDebug.names.length; i < len; i++) {
1342
- if (createDebug.names[i].test(name)) {
1375
+ for (const ns of createDebug.names) {
1376
+ if (matchesTemplate(name, ns)) {
1343
1377
  return true;
1344
1378
  }
1345
1379
  }
@@ -1347,19 +1381,6 @@ function requireCommon () {
1347
1381
  return false;
1348
1382
  }
1349
1383
 
1350
- /**
1351
- * Convert regexp to namespace
1352
- *
1353
- * @param {RegExp} regxep
1354
- * @return {String} namespace
1355
- * @api private
1356
- */
1357
- function toNamespace(regexp) {
1358
- return regexp.toString()
1359
- .substring(2, regexp.toString().length - 2)
1360
- .replace(/\.\*\?$/, '*');
1361
- }
1362
-
1363
1384
  /**
1364
1385
  * Coerce `val`.
1365
1386
  *
@@ -1528,6 +1549,7 @@ function requireBrowser$1 () {
1528
1549
 
1529
1550
  // Is webkit? http://stackoverflow.com/a/16459606/376773
1530
1551
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
1552
+ // eslint-disable-next-line no-return-assign
1531
1553
  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
1532
1554
  // Is firebug? http://stackoverflow.com/a/398120/376773
1533
1555
  (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
@@ -1617,7 +1639,7 @@ function requireBrowser$1 () {
1617
1639
  function load() {
1618
1640
  let r;
1619
1641
  try {
1620
- r = exports.storage.getItem('debug');
1642
+ r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
1621
1643
  } catch (error) {
1622
1644
  // Swallow
1623
1645
  // XXX (@Qix-) should we be logging these?
@@ -2148,10 +2170,21 @@ var Writable = require$$1$2.Writable;
2148
2170
  var assert = require$$4$1;
2149
2171
  var debug$1 = debug_1;
2150
2172
 
2173
+ // Preventive platform detection
2174
+ // istanbul ignore next
2175
+ (function detectUnsupportedEnvironment() {
2176
+ var looksLikeNode = typeof process !== "undefined";
2177
+ var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
2178
+ var looksLikeV8 = isFunction(Error.captureStackTrace);
2179
+ if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
2180
+ console.warn("The follow-redirects package should be excluded from browser builds.");
2181
+ }
2182
+ }());
2183
+
2151
2184
  // Whether to use the native URL object or the legacy url module
2152
2185
  var useNativeURL = false;
2153
2186
  try {
2154
- assert(new URL$1());
2187
+ assert(new URL$1(""));
2155
2188
  }
2156
2189
  catch (error) {
2157
2190
  useNativeURL = error.code === "ERR_INVALID_URL";
@@ -2488,17 +2521,17 @@ RedirectableRequest.prototype._performRequest = function () {
2488
2521
  var buffers = this._requestBodyBuffers;
2489
2522
  (function writeNext(error) {
2490
2523
  // Only write if this request has not been redirected yet
2491
- /* istanbul ignore else */
2524
+ // istanbul ignore else
2492
2525
  if (request === self._currentRequest) {
2493
2526
  // Report any write errors
2494
- /* istanbul ignore if */
2527
+ // istanbul ignore if
2495
2528
  if (error) {
2496
2529
  self.emit("error", error);
2497
2530
  }
2498
2531
  // Write the next buffer if there are still left
2499
2532
  else if (i < buffers.length) {
2500
2533
  var buffer = buffers[i++];
2501
- /* istanbul ignore else */
2534
+ // istanbul ignore else
2502
2535
  if (!request.finished) {
2503
2536
  request.write(buffer.data, buffer.encoding, writeNext);
2504
2537
  }
@@ -2694,7 +2727,7 @@ function noop() { /* empty */ }
2694
2727
 
2695
2728
  function parseUrl(input) {
2696
2729
  var parsed;
2697
- /* istanbul ignore else */
2730
+ // istanbul ignore else
2698
2731
  if (useNativeURL) {
2699
2732
  parsed = new URL$1(input);
2700
2733
  }
@@ -2709,7 +2742,7 @@ function parseUrl(input) {
2709
2742
  }
2710
2743
 
2711
2744
  function resolveUrl(relative, base) {
2712
- /* istanbul ignore next */
2745
+ // istanbul ignore next
2713
2746
  return useNativeURL ? new URL$1(relative, base) : parseUrl(url$1.resolve(base, relative));
2714
2747
  }
2715
2748
 
@@ -2758,7 +2791,10 @@ function removeMatchingHeaders(regex, headers) {
2758
2791
  function createErrorType(code, message, baseClass) {
2759
2792
  // Create constructor
2760
2793
  function CustomError(properties) {
2761
- Error.captureStackTrace(this, this.constructor);
2794
+ // istanbul ignore else
2795
+ if (isFunction(Error.captureStackTrace)) {
2796
+ Error.captureStackTrace(this, this.constructor);
2797
+ }
2762
2798
  Object.assign(this, properties || {});
2763
2799
  this.code = code;
2764
2800
  this.message = this.cause ? message + ": " + this.cause.message : message;
@@ -14013,7 +14049,6 @@ class CoreClass extends EventEmitterClass {
14013
14049
  const { body, from } = messageCtxInComing;
14014
14050
  let msgToSend = [];
14015
14051
  let endFlowFlag = false;
14016
- const fallBackFlag = false;
14017
14052
  if (this.dynamicBlacklist.checkIf(from))
14018
14053
  return;
14019
14054
  if (!body)
@@ -14391,11 +14426,7 @@ class CoreClass extends EventEmitterClass {
14391
14426
  }
14392
14427
  // 📄🤘(tiene return) Si el mensaje previo implementa capture
14393
14428
  if (!endFlowFlag && !prevMsg?.options?.nested?.length) {
14394
- const typeCapture = typeof prevMsg?.options?.capture;
14395
- if (typeCapture === 'boolean' && fallBackFlag) {
14396
- msgToSend = this.flowClass.find(refToContinue?.ref, true) || [];
14397
- return exportFunctionsSend(() => sendFlow(msgToSend, from, { forceQueue: true }));
14398
- }
14429
+ typeof prevMsg?.options?.capture;
14399
14430
  }
14400
14431
  msgToSend = this.flowClass.find(body) || [];
14401
14432
  if (msgToSend.length) {
@@ -18856,7 +18887,7 @@ function requireDbcsCodec () {
18856
18887
  var UNASSIGNED = -1,
18857
18888
  GB18030_CODE = -2,
18858
18889
  SEQ_START = -10,
18859
- NODE_START = -1000,
18890
+ NODE_START = -1e3,
18860
18891
  UNASSIGNED_NODE = new Array(0x100),
18861
18892
  DEF_CHAR = -1;
18862
18893
 
@@ -30428,66 +30459,6 @@ function requireText () {
30428
30459
  return text_1;
30429
30460
  }
30430
30461
 
30431
- var esErrors;
30432
- var hasRequiredEsErrors;
30433
-
30434
- function requireEsErrors () {
30435
- if (hasRequiredEsErrors) return esErrors;
30436
- hasRequiredEsErrors = 1;
30437
-
30438
- /** @type {import('.')} */
30439
- esErrors = Error;
30440
- return esErrors;
30441
- }
30442
-
30443
- var _eval;
30444
- var hasRequired_eval;
30445
-
30446
- function require_eval () {
30447
- if (hasRequired_eval) return _eval;
30448
- hasRequired_eval = 1;
30449
-
30450
- /** @type {import('./eval')} */
30451
- _eval = EvalError;
30452
- return _eval;
30453
- }
30454
-
30455
- var range;
30456
- var hasRequiredRange;
30457
-
30458
- function requireRange () {
30459
- if (hasRequiredRange) return range;
30460
- hasRequiredRange = 1;
30461
-
30462
- /** @type {import('./range')} */
30463
- range = RangeError;
30464
- return range;
30465
- }
30466
-
30467
- var ref;
30468
- var hasRequiredRef;
30469
-
30470
- function requireRef () {
30471
- if (hasRequiredRef) return ref;
30472
- hasRequiredRef = 1;
30473
-
30474
- /** @type {import('./ref')} */
30475
- ref = ReferenceError;
30476
- return ref;
30477
- }
30478
-
30479
- var syntax;
30480
- var hasRequiredSyntax;
30481
-
30482
- function requireSyntax () {
30483
- if (hasRequiredSyntax) return syntax;
30484
- hasRequiredSyntax = 1;
30485
-
30486
- /** @type {import('./syntax')} */
30487
- syntax = SyntaxError;
30488
- return syntax;
30489
- }
30490
-
30491
30462
  var type;
30492
30463
  var hasRequiredType;
30493
30464
 
@@ -30500,624 +30471,889 @@ function requireType () {
30500
30471
  return type;
30501
30472
  }
30502
30473
 
30503
- var uri;
30504
- var hasRequiredUri;
30505
-
30506
- function requireUri () {
30507
- if (hasRequiredUri) return uri;
30508
- hasRequiredUri = 1;
30474
+ var util_inspect;
30475
+ var hasRequiredUtil_inspect;
30509
30476
 
30510
- /** @type {import('./uri')} */
30511
- uri = URIError;
30512
- return uri;
30477
+ function requireUtil_inspect () {
30478
+ if (hasRequiredUtil_inspect) return util_inspect;
30479
+ hasRequiredUtil_inspect = 1;
30480
+ util_inspect = require$$1$1.inspect;
30481
+ return util_inspect;
30513
30482
  }
30514
30483
 
30515
- var shams;
30516
- var hasRequiredShams;
30517
-
30518
- function requireShams () {
30519
- if (hasRequiredShams) return shams;
30520
- hasRequiredShams = 1;
30521
-
30522
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
30523
- shams = function hasSymbols() {
30524
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
30525
- if (typeof Symbol.iterator === 'symbol') { return true; }
30526
-
30527
- var obj = {};
30528
- var sym = Symbol('test');
30529
- var symObj = Object(sym);
30530
- if (typeof sym === 'string') { return false; }
30531
-
30532
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
30533
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
30534
-
30535
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
30536
- // if (sym instanceof Symbol) { return false; }
30537
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
30538
- // if (!(symObj instanceof Symbol)) { return false; }
30539
-
30540
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
30541
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
30542
-
30543
- var symVal = 42;
30544
- obj[sym] = symVal;
30545
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
30546
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
30484
+ var objectInspect;
30485
+ var hasRequiredObjectInspect;
30547
30486
 
30548
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
30487
+ function requireObjectInspect () {
30488
+ if (hasRequiredObjectInspect) return objectInspect;
30489
+ hasRequiredObjectInspect = 1;
30490
+ var hasMap = typeof Map === 'function' && Map.prototype;
30491
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
30492
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
30493
+ var mapForEach = hasMap && Map.prototype.forEach;
30494
+ var hasSet = typeof Set === 'function' && Set.prototype;
30495
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
30496
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
30497
+ var setForEach = hasSet && Set.prototype.forEach;
30498
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
30499
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
30500
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
30501
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
30502
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
30503
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
30504
+ var booleanValueOf = Boolean.prototype.valueOf;
30505
+ var objectToString = Object.prototype.toString;
30506
+ var functionToString = Function.prototype.toString;
30507
+ var $match = String.prototype.match;
30508
+ var $slice = String.prototype.slice;
30509
+ var $replace = String.prototype.replace;
30510
+ var $toUpperCase = String.prototype.toUpperCase;
30511
+ var $toLowerCase = String.prototype.toLowerCase;
30512
+ var $test = RegExp.prototype.test;
30513
+ var $concat = Array.prototype.concat;
30514
+ var $join = Array.prototype.join;
30515
+ var $arrSlice = Array.prototype.slice;
30516
+ var $floor = Math.floor;
30517
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
30518
+ var gOPS = Object.getOwnPropertySymbols;
30519
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
30520
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
30521
+ // ie, `has-tostringtag/shams
30522
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
30523
+ ? Symbol.toStringTag
30524
+ : null;
30525
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
30549
30526
 
30550
- var syms = Object.getOwnPropertySymbols(obj);
30551
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
30527
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
30528
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
30529
+ ? function (O) {
30530
+ return O.__proto__; // eslint-disable-line no-proto
30531
+ }
30532
+ : null
30533
+ );
30552
30534
 
30553
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
30535
+ function addNumericSeparator(num, str) {
30536
+ if (
30537
+ num === Infinity
30538
+ || num === -Infinity
30539
+ || num !== num
30540
+ || (num && num > -1e3 && num < 1000)
30541
+ || $test.call(/e/, str)
30542
+ ) {
30543
+ return str;
30544
+ }
30545
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
30546
+ if (typeof num === 'number') {
30547
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
30548
+ if (int !== num) {
30549
+ var intStr = String(int);
30550
+ var dec = $slice.call(str, intStr.length + 1);
30551
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
30552
+ }
30553
+ }
30554
+ return $replace.call(str, sepRegex, '$&_');
30555
+ }
30554
30556
 
30555
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
30556
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
30557
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
30558
- }
30557
+ var utilInspect = requireUtil_inspect();
30558
+ var inspectCustom = utilInspect.custom;
30559
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
30559
30560
 
30560
- return true;
30561
+ var quotes = {
30562
+ __proto__: null,
30563
+ 'double': '"',
30564
+ single: "'"
30561
30565
  };
30562
- return shams;
30563
- }
30564
-
30565
- var hasSymbols;
30566
- var hasRequiredHasSymbols;
30567
-
30568
- function requireHasSymbols () {
30569
- if (hasRequiredHasSymbols) return hasSymbols;
30570
- hasRequiredHasSymbols = 1;
30571
-
30572
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
30573
- var hasSymbolSham = requireShams();
30574
-
30575
- hasSymbols = function hasNativeSymbols() {
30576
- if (typeof origSymbol !== 'function') { return false; }
30577
- if (typeof Symbol !== 'function') { return false; }
30578
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
30579
- if (typeof Symbol('bar') !== 'symbol') { return false; }
30580
-
30581
- return hasSymbolSham();
30566
+ var quoteREs = {
30567
+ __proto__: null,
30568
+ 'double': /(["\\])/g,
30569
+ single: /(['\\])/g
30582
30570
  };
30583
- return hasSymbols;
30584
- }
30585
-
30586
- var hasProto;
30587
- var hasRequiredHasProto;
30588
30571
 
30589
- function requireHasProto () {
30590
- if (hasRequiredHasProto) return hasProto;
30591
- hasRequiredHasProto = 1;
30572
+ objectInspect = function inspect_(obj, options, depth, seen) {
30573
+ var opts = options || {};
30592
30574
 
30593
- var test = {
30594
- __proto__: null,
30595
- foo: {}
30596
- };
30575
+ if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
30576
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
30577
+ }
30578
+ if (
30579
+ has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
30580
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
30581
+ : opts.maxStringLength !== null
30582
+ )
30583
+ ) {
30584
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
30585
+ }
30586
+ var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
30587
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
30588
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
30589
+ }
30597
30590
 
30598
- var $Object = Object;
30591
+ if (
30592
+ has(opts, 'indent')
30593
+ && opts.indent !== null
30594
+ && opts.indent !== '\t'
30595
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
30596
+ ) {
30597
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
30598
+ }
30599
+ if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
30600
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
30601
+ }
30602
+ var numericSeparator = opts.numericSeparator;
30599
30603
 
30600
- /** @type {import('.')} */
30601
- hasProto = function hasProto() {
30602
- // @ts-expect-error: TS errors on an inherited property for some reason
30603
- return { __proto__: test }.foo === test.foo
30604
- && !(test instanceof $Object);
30605
- };
30606
- return hasProto;
30607
- }
30604
+ if (typeof obj === 'undefined') {
30605
+ return 'undefined';
30606
+ }
30607
+ if (obj === null) {
30608
+ return 'null';
30609
+ }
30610
+ if (typeof obj === 'boolean') {
30611
+ return obj ? 'true' : 'false';
30612
+ }
30608
30613
 
30609
- var implementation;
30610
- var hasRequiredImplementation;
30614
+ if (typeof obj === 'string') {
30615
+ return inspectString(obj, opts);
30616
+ }
30617
+ if (typeof obj === 'number') {
30618
+ if (obj === 0) {
30619
+ return Infinity / obj > 0 ? '0' : '-0';
30620
+ }
30621
+ var str = String(obj);
30622
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
30623
+ }
30624
+ if (typeof obj === 'bigint') {
30625
+ var bigIntStr = String(obj) + 'n';
30626
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
30627
+ }
30611
30628
 
30612
- function requireImplementation () {
30613
- if (hasRequiredImplementation) return implementation;
30614
- hasRequiredImplementation = 1;
30629
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
30630
+ if (typeof depth === 'undefined') { depth = 0; }
30631
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
30632
+ return isArray(obj) ? '[Array]' : '[Object]';
30633
+ }
30615
30634
 
30616
- /* eslint no-invalid-this: 1 */
30635
+ var indent = getIndent(opts, depth);
30617
30636
 
30618
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
30619
- var toStr = Object.prototype.toString;
30620
- var max = Math.max;
30621
- var funcType = '[object Function]';
30637
+ if (typeof seen === 'undefined') {
30638
+ seen = [];
30639
+ } else if (indexOf(seen, obj) >= 0) {
30640
+ return '[Circular]';
30641
+ }
30622
30642
 
30623
- var concatty = function concatty(a, b) {
30624
- var arr = [];
30643
+ function inspect(value, from, noIndent) {
30644
+ if (from) {
30645
+ seen = $arrSlice.call(seen);
30646
+ seen.push(from);
30647
+ }
30648
+ if (noIndent) {
30649
+ var newOpts = {
30650
+ depth: opts.depth
30651
+ };
30652
+ if (has(opts, 'quoteStyle')) {
30653
+ newOpts.quoteStyle = opts.quoteStyle;
30654
+ }
30655
+ return inspect_(value, newOpts, depth + 1, seen);
30656
+ }
30657
+ return inspect_(value, opts, depth + 1, seen);
30658
+ }
30625
30659
 
30626
- for (var i = 0; i < a.length; i += 1) {
30627
- arr[i] = a[i];
30660
+ if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
30661
+ var name = nameOf(obj);
30662
+ var keys = arrObjKeys(obj, inspect);
30663
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
30628
30664
  }
30629
- for (var j = 0; j < b.length; j += 1) {
30630
- arr[j + a.length] = b[j];
30665
+ if (isSymbol(obj)) {
30666
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
30667
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
30631
30668
  }
30632
-
30633
- return arr;
30634
- };
30635
-
30636
- var slicy = function slicy(arrLike, offset) {
30637
- var arr = [];
30638
- for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
30639
- arr[j] = arrLike[i];
30669
+ if (isElement(obj)) {
30670
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
30671
+ var attrs = obj.attributes || [];
30672
+ for (var i = 0; i < attrs.length; i++) {
30673
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
30674
+ }
30675
+ s += '>';
30676
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
30677
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
30678
+ return s;
30640
30679
  }
30641
- return arr;
30642
- };
30643
-
30644
- var joiny = function (arr, joiner) {
30645
- var str = '';
30646
- for (var i = 0; i < arr.length; i += 1) {
30647
- str += arr[i];
30648
- if (i + 1 < arr.length) {
30649
- str += joiner;
30680
+ if (isArray(obj)) {
30681
+ if (obj.length === 0) { return '[]'; }
30682
+ var xs = arrObjKeys(obj, inspect);
30683
+ if (indent && !singleLineValues(xs)) {
30684
+ return '[' + indentedJoin(xs, indent) + ']';
30685
+ }
30686
+ return '[ ' + $join.call(xs, ', ') + ' ]';
30687
+ }
30688
+ if (isError(obj)) {
30689
+ var parts = arrObjKeys(obj, inspect);
30690
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
30691
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
30650
30692
  }
30693
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
30694
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
30651
30695
  }
30652
- return str;
30653
- };
30654
-
30655
- implementation = function bind(that) {
30656
- var target = this;
30657
- if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
30658
- throw new TypeError(ERROR_MESSAGE + target);
30696
+ if (typeof obj === 'object' && customInspect) {
30697
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
30698
+ return utilInspect(obj, { depth: maxDepth - depth });
30699
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
30700
+ return obj.inspect();
30701
+ }
30659
30702
  }
30660
- var args = slicy(arguments, 1);
30661
-
30662
- var bound;
30663
- var binder = function () {
30664
- if (this instanceof bound) {
30665
- var result = target.apply(
30666
- this,
30667
- concatty(args, arguments)
30668
- );
30669
- if (Object(result) === result) {
30670
- return result;
30671
- }
30672
- return this;
30703
+ if (isMap(obj)) {
30704
+ var mapParts = [];
30705
+ if (mapForEach) {
30706
+ mapForEach.call(obj, function (value, key) {
30707
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
30708
+ });
30673
30709
  }
30674
- return target.apply(
30675
- that,
30676
- concatty(args, arguments)
30677
- );
30678
-
30679
- };
30680
-
30681
- var boundLength = max(0, target.length - args.length);
30682
- var boundArgs = [];
30683
- for (var i = 0; i < boundLength; i++) {
30684
- boundArgs[i] = '$' + i;
30710
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
30685
30711
  }
30686
-
30687
- bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
30688
-
30689
- if (target.prototype) {
30690
- var Empty = function Empty() {};
30691
- Empty.prototype = target.prototype;
30692
- bound.prototype = new Empty();
30693
- Empty.prototype = null;
30712
+ if (isSet(obj)) {
30713
+ var setParts = [];
30714
+ if (setForEach) {
30715
+ setForEach.call(obj, function (value) {
30716
+ setParts.push(inspect(value, obj));
30717
+ });
30718
+ }
30719
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
30694
30720
  }
30695
-
30696
- return bound;
30721
+ if (isWeakMap(obj)) {
30722
+ return weakCollectionOf('WeakMap');
30723
+ }
30724
+ if (isWeakSet(obj)) {
30725
+ return weakCollectionOf('WeakSet');
30726
+ }
30727
+ if (isWeakRef(obj)) {
30728
+ return weakCollectionOf('WeakRef');
30729
+ }
30730
+ if (isNumber(obj)) {
30731
+ return markBoxed(inspect(Number(obj)));
30732
+ }
30733
+ if (isBigInt(obj)) {
30734
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
30735
+ }
30736
+ if (isBoolean(obj)) {
30737
+ return markBoxed(booleanValueOf.call(obj));
30738
+ }
30739
+ if (isString(obj)) {
30740
+ return markBoxed(inspect(String(obj)));
30741
+ }
30742
+ // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
30743
+ /* eslint-env browser */
30744
+ if (typeof window !== 'undefined' && obj === window) {
30745
+ return '{ [object Window] }';
30746
+ }
30747
+ if (
30748
+ (typeof globalThis !== 'undefined' && obj === globalThis)
30749
+ || (typeof commonjsGlobal !== 'undefined' && obj === commonjsGlobal)
30750
+ ) {
30751
+ return '{ [object globalThis] }';
30752
+ }
30753
+ if (!isDate(obj) && !isRegExp(obj)) {
30754
+ var ys = arrObjKeys(obj, inspect);
30755
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
30756
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
30757
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
30758
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
30759
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
30760
+ if (ys.length === 0) { return tag + '{}'; }
30761
+ if (indent) {
30762
+ return tag + '{' + indentedJoin(ys, indent) + '}';
30763
+ }
30764
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
30765
+ }
30766
+ return String(obj);
30697
30767
  };
30698
- return implementation;
30699
- }
30700
-
30701
- var functionBind;
30702
- var hasRequiredFunctionBind;
30703
30768
 
30704
- function requireFunctionBind () {
30705
- if (hasRequiredFunctionBind) return functionBind;
30706
- hasRequiredFunctionBind = 1;
30769
+ function wrapQuotes(s, defaultStyle, opts) {
30770
+ var style = opts.quoteStyle || defaultStyle;
30771
+ var quoteChar = quotes[style];
30772
+ return quoteChar + s + quoteChar;
30773
+ }
30707
30774
 
30708
- var implementation = requireImplementation();
30775
+ function quote(s) {
30776
+ return $replace.call(String(s), /"/g, '&quot;');
30777
+ }
30709
30778
 
30710
- functionBind = Function.prototype.bind || implementation;
30711
- return functionBind;
30712
- }
30779
+ function canTrustToString(obj) {
30780
+ return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
30781
+ }
30782
+ function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }
30783
+ function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }
30784
+ function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }
30785
+ function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }
30786
+ function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }
30787
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }
30788
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }
30713
30789
 
30714
- var hasown;
30715
- var hasRequiredHasown;
30790
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
30791
+ function isSymbol(obj) {
30792
+ if (hasShammedSymbols) {
30793
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
30794
+ }
30795
+ if (typeof obj === 'symbol') {
30796
+ return true;
30797
+ }
30798
+ if (!obj || typeof obj !== 'object' || !symToString) {
30799
+ return false;
30800
+ }
30801
+ try {
30802
+ symToString.call(obj);
30803
+ return true;
30804
+ } catch (e) {}
30805
+ return false;
30806
+ }
30716
30807
 
30717
- function requireHasown () {
30718
- if (hasRequiredHasown) return hasown;
30719
- hasRequiredHasown = 1;
30808
+ function isBigInt(obj) {
30809
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
30810
+ return false;
30811
+ }
30812
+ try {
30813
+ bigIntValueOf.call(obj);
30814
+ return true;
30815
+ } catch (e) {}
30816
+ return false;
30817
+ }
30720
30818
 
30721
- var call = Function.prototype.call;
30722
- var $hasOwn = Object.prototype.hasOwnProperty;
30723
- var bind = requireFunctionBind();
30819
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
30820
+ function has(obj, key) {
30821
+ return hasOwn.call(obj, key);
30822
+ }
30724
30823
 
30725
- /** @type {import('.')} */
30726
- hasown = bind.call(call, $hasOwn);
30727
- return hasown;
30728
- }
30824
+ function toStr(obj) {
30825
+ return objectToString.call(obj);
30826
+ }
30729
30827
 
30730
- var getIntrinsic;
30731
- var hasRequiredGetIntrinsic;
30828
+ function nameOf(f) {
30829
+ if (f.name) { return f.name; }
30830
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
30831
+ if (m) { return m[1]; }
30832
+ return null;
30833
+ }
30732
30834
 
30733
- function requireGetIntrinsic () {
30734
- if (hasRequiredGetIntrinsic) return getIntrinsic;
30735
- hasRequiredGetIntrinsic = 1;
30835
+ function indexOf(xs, x) {
30836
+ if (xs.indexOf) { return xs.indexOf(x); }
30837
+ for (var i = 0, l = xs.length; i < l; i++) {
30838
+ if (xs[i] === x) { return i; }
30839
+ }
30840
+ return -1;
30841
+ }
30736
30842
 
30737
- var undefined$1;
30843
+ function isMap(x) {
30844
+ if (!mapSize || !x || typeof x !== 'object') {
30845
+ return false;
30846
+ }
30847
+ try {
30848
+ mapSize.call(x);
30849
+ try {
30850
+ setSize.call(x);
30851
+ } catch (s) {
30852
+ return true;
30853
+ }
30854
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
30855
+ } catch (e) {}
30856
+ return false;
30857
+ }
30738
30858
 
30739
- var $Error = requireEsErrors();
30740
- var $EvalError = require_eval();
30741
- var $RangeError = requireRange();
30742
- var $ReferenceError = requireRef();
30743
- var $SyntaxError = requireSyntax();
30744
- var $TypeError = requireType();
30745
- var $URIError = requireUri();
30859
+ function isWeakMap(x) {
30860
+ if (!weakMapHas || !x || typeof x !== 'object') {
30861
+ return false;
30862
+ }
30863
+ try {
30864
+ weakMapHas.call(x, weakMapHas);
30865
+ try {
30866
+ weakSetHas.call(x, weakSetHas);
30867
+ } catch (s) {
30868
+ return true;
30869
+ }
30870
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
30871
+ } catch (e) {}
30872
+ return false;
30873
+ }
30746
30874
 
30747
- var $Function = Function;
30875
+ function isWeakRef(x) {
30876
+ if (!weakRefDeref || !x || typeof x !== 'object') {
30877
+ return false;
30878
+ }
30879
+ try {
30880
+ weakRefDeref.call(x);
30881
+ return true;
30882
+ } catch (e) {}
30883
+ return false;
30884
+ }
30748
30885
 
30749
- // eslint-disable-next-line consistent-return
30750
- var getEvalledConstructor = function (expressionSyntax) {
30751
- try {
30752
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
30753
- } catch (e) {}
30754
- };
30886
+ function isSet(x) {
30887
+ if (!setSize || !x || typeof x !== 'object') {
30888
+ return false;
30889
+ }
30890
+ try {
30891
+ setSize.call(x);
30892
+ try {
30893
+ mapSize.call(x);
30894
+ } catch (m) {
30895
+ return true;
30896
+ }
30897
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
30898
+ } catch (e) {}
30899
+ return false;
30900
+ }
30755
30901
 
30756
- var $gOPD = Object.getOwnPropertyDescriptor;
30757
- if ($gOPD) {
30758
- try {
30759
- $gOPD({}, '');
30760
- } catch (e) {
30761
- $gOPD = null; // this is IE 8, which has a broken gOPD
30762
- }
30902
+ function isWeakSet(x) {
30903
+ if (!weakSetHas || !x || typeof x !== 'object') {
30904
+ return false;
30905
+ }
30906
+ try {
30907
+ weakSetHas.call(x, weakSetHas);
30908
+ try {
30909
+ weakMapHas.call(x, weakMapHas);
30910
+ } catch (s) {
30911
+ return true;
30912
+ }
30913
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
30914
+ } catch (e) {}
30915
+ return false;
30763
30916
  }
30764
30917
 
30765
- var throwTypeError = function () {
30766
- throw new $TypeError();
30767
- };
30768
- var ThrowTypeError = $gOPD
30769
- ? (function () {
30770
- try {
30771
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
30772
- arguments.callee; // IE 8 does not throw here
30773
- return throwTypeError;
30774
- } catch (calleeThrows) {
30775
- try {
30776
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
30777
- return $gOPD(arguments, 'callee').get;
30778
- } catch (gOPDthrows) {
30779
- return throwTypeError;
30780
- }
30781
- }
30782
- }())
30783
- : throwTypeError;
30918
+ function isElement(x) {
30919
+ if (!x || typeof x !== 'object') { return false; }
30920
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
30921
+ return true;
30922
+ }
30923
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
30924
+ }
30784
30925
 
30785
- var hasSymbols = requireHasSymbols()();
30786
- var hasProto = requireHasProto()();
30926
+ function inspectString(str, opts) {
30927
+ if (str.length > opts.maxStringLength) {
30928
+ var remaining = str.length - opts.maxStringLength;
30929
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
30930
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
30931
+ }
30932
+ var quoteRE = quoteREs[opts.quoteStyle || 'single'];
30933
+ quoteRE.lastIndex = 0;
30934
+ // eslint-disable-next-line no-control-regex
30935
+ var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
30936
+ return wrapQuotes(s, 'single', opts);
30937
+ }
30787
30938
 
30788
- var getProto = Object.getPrototypeOf || (
30789
- hasProto
30790
- ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
30791
- : null
30792
- );
30939
+ function lowbyte(c) {
30940
+ var n = c.charCodeAt(0);
30941
+ var x = {
30942
+ 8: 'b',
30943
+ 9: 't',
30944
+ 10: 'n',
30945
+ 12: 'f',
30946
+ 13: 'r'
30947
+ }[n];
30948
+ if (x) { return '\\' + x; }
30949
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
30950
+ }
30793
30951
 
30794
- var needsEval = {};
30952
+ function markBoxed(str) {
30953
+ return 'Object(' + str + ')';
30954
+ }
30795
30955
 
30796
- var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
30956
+ function weakCollectionOf(type) {
30957
+ return type + ' { ? }';
30958
+ }
30797
30959
 
30798
- var INTRINSICS = {
30799
- __proto__: null,
30800
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
30801
- '%Array%': Array,
30802
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
30803
- '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
30804
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
30805
- '%AsyncFunction%': needsEval,
30806
- '%AsyncGenerator%': needsEval,
30807
- '%AsyncGeneratorFunction%': needsEval,
30808
- '%AsyncIteratorPrototype%': needsEval,
30809
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
30810
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
30811
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
30812
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
30813
- '%Boolean%': Boolean,
30814
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
30815
- '%Date%': Date,
30816
- '%decodeURI%': decodeURI,
30817
- '%decodeURIComponent%': decodeURIComponent,
30818
- '%encodeURI%': encodeURI,
30819
- '%encodeURIComponent%': encodeURIComponent,
30820
- '%Error%': $Error,
30821
- '%eval%': eval, // eslint-disable-line no-eval
30822
- '%EvalError%': $EvalError,
30823
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
30824
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
30825
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
30826
- '%Function%': $Function,
30827
- '%GeneratorFunction%': needsEval,
30828
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
30829
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
30830
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
30831
- '%isFinite%': isFinite,
30832
- '%isNaN%': isNaN,
30833
- '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
30834
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
30835
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
30836
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
30837
- '%Math%': Math,
30838
- '%Number%': Number,
30839
- '%Object%': Object,
30840
- '%parseFloat%': parseFloat,
30841
- '%parseInt%': parseInt,
30842
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
30843
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
30844
- '%RangeError%': $RangeError,
30845
- '%ReferenceError%': $ReferenceError,
30846
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
30847
- '%RegExp%': RegExp,
30848
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
30849
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
30850
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
30851
- '%String%': String,
30852
- '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
30853
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
30854
- '%SyntaxError%': $SyntaxError,
30855
- '%ThrowTypeError%': ThrowTypeError,
30856
- '%TypedArray%': TypedArray,
30857
- '%TypeError%': $TypeError,
30858
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
30859
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
30860
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
30861
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
30862
- '%URIError%': $URIError,
30863
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
30864
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
30865
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
30866
- };
30960
+ function collectionOf(type, size, entries, indent) {
30961
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
30962
+ return type + ' (' + size + ') {' + joinedEntries + '}';
30963
+ }
30867
30964
 
30868
- if (getProto) {
30869
- try {
30870
- null.error; // eslint-disable-line no-unused-expressions
30871
- } catch (e) {
30872
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
30873
- var errorProto = getProto(getProto(e));
30874
- INTRINSICS['%Error.prototype%'] = errorProto;
30875
- }
30965
+ function singleLineValues(xs) {
30966
+ for (var i = 0; i < xs.length; i++) {
30967
+ if (indexOf(xs[i], '\n') >= 0) {
30968
+ return false;
30969
+ }
30970
+ }
30971
+ return true;
30876
30972
  }
30877
30973
 
30878
- var doEval = function doEval(name) {
30879
- var value;
30880
- if (name === '%AsyncFunction%') {
30881
- value = getEvalledConstructor('async function () {}');
30882
- } else if (name === '%GeneratorFunction%') {
30883
- value = getEvalledConstructor('function* () {}');
30884
- } else if (name === '%AsyncGeneratorFunction%') {
30885
- value = getEvalledConstructor('async function* () {}');
30886
- } else if (name === '%AsyncGenerator%') {
30887
- var fn = doEval('%AsyncGeneratorFunction%');
30888
- if (fn) {
30889
- value = fn.prototype;
30890
- }
30891
- } else if (name === '%AsyncIteratorPrototype%') {
30892
- var gen = doEval('%AsyncGenerator%');
30893
- if (gen && getProto) {
30894
- value = getProto(gen.prototype);
30895
- }
30896
- }
30974
+ function getIndent(opts, depth) {
30975
+ var baseIndent;
30976
+ if (opts.indent === '\t') {
30977
+ baseIndent = '\t';
30978
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
30979
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
30980
+ } else {
30981
+ return null;
30982
+ }
30983
+ return {
30984
+ base: baseIndent,
30985
+ prev: $join.call(Array(depth + 1), baseIndent)
30986
+ };
30987
+ }
30897
30988
 
30898
- INTRINSICS[name] = value;
30989
+ function indentedJoin(xs, indent) {
30990
+ if (xs.length === 0) { return ''; }
30991
+ var lineJoiner = '\n' + indent.prev + indent.base;
30992
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
30993
+ }
30899
30994
 
30900
- return value;
30901
- };
30995
+ function arrObjKeys(obj, inspect) {
30996
+ var isArr = isArray(obj);
30997
+ var xs = [];
30998
+ if (isArr) {
30999
+ xs.length = obj.length;
31000
+ for (var i = 0; i < obj.length; i++) {
31001
+ xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
31002
+ }
31003
+ }
31004
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
31005
+ var symMap;
31006
+ if (hasShammedSymbols) {
31007
+ symMap = {};
31008
+ for (var k = 0; k < syms.length; k++) {
31009
+ symMap['$' + syms[k]] = syms[k];
31010
+ }
31011
+ }
30902
31012
 
30903
- var LEGACY_ALIASES = {
30904
- __proto__: null,
30905
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
30906
- '%ArrayPrototype%': ['Array', 'prototype'],
30907
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
30908
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
30909
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
30910
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
30911
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
30912
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
30913
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
30914
- '%BooleanPrototype%': ['Boolean', 'prototype'],
30915
- '%DataViewPrototype%': ['DataView', 'prototype'],
30916
- '%DatePrototype%': ['Date', 'prototype'],
30917
- '%ErrorPrototype%': ['Error', 'prototype'],
30918
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
30919
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
30920
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
30921
- '%FunctionPrototype%': ['Function', 'prototype'],
30922
- '%Generator%': ['GeneratorFunction', 'prototype'],
30923
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
30924
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
30925
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
30926
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
30927
- '%JSONParse%': ['JSON', 'parse'],
30928
- '%JSONStringify%': ['JSON', 'stringify'],
30929
- '%MapPrototype%': ['Map', 'prototype'],
30930
- '%NumberPrototype%': ['Number', 'prototype'],
30931
- '%ObjectPrototype%': ['Object', 'prototype'],
30932
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
30933
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
30934
- '%PromisePrototype%': ['Promise', 'prototype'],
30935
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
30936
- '%Promise_all%': ['Promise', 'all'],
30937
- '%Promise_reject%': ['Promise', 'reject'],
30938
- '%Promise_resolve%': ['Promise', 'resolve'],
30939
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
30940
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
30941
- '%RegExpPrototype%': ['RegExp', 'prototype'],
30942
- '%SetPrototype%': ['Set', 'prototype'],
30943
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
30944
- '%StringPrototype%': ['String', 'prototype'],
30945
- '%SymbolPrototype%': ['Symbol', 'prototype'],
30946
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
30947
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
30948
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
30949
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
30950
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
30951
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
30952
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
30953
- '%URIErrorPrototype%': ['URIError', 'prototype'],
30954
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
30955
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
30956
- };
31013
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
31014
+ if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
31015
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
31016
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
31017
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
31018
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
31019
+ } else if ($test.call(/[^\w$]/, key)) {
31020
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
31021
+ } else {
31022
+ xs.push(key + ': ' + inspect(obj[key], obj));
31023
+ }
31024
+ }
31025
+ if (typeof gOPS === 'function') {
31026
+ for (var j = 0; j < syms.length; j++) {
31027
+ if (isEnumerable.call(obj, syms[j])) {
31028
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
31029
+ }
31030
+ }
31031
+ }
31032
+ return xs;
31033
+ }
31034
+ return objectInspect;
31035
+ }
30957
31036
 
30958
- var bind = requireFunctionBind();
30959
- var hasOwn = requireHasown();
30960
- var $concat = bind.call(Function.call, Array.prototype.concat);
30961
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
30962
- var $replace = bind.call(Function.call, String.prototype.replace);
30963
- var $strSlice = bind.call(Function.call, String.prototype.slice);
30964
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
31037
+ var sideChannelList;
31038
+ var hasRequiredSideChannelList;
30965
31039
 
30966
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
30967
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
30968
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
30969
- var stringToPath = function stringToPath(string) {
30970
- var first = $strSlice(string, 0, 1);
30971
- var last = $strSlice(string, -1);
30972
- if (first === '%' && last !== '%') {
30973
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
30974
- } else if (last === '%' && first !== '%') {
30975
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
30976
- }
30977
- var result = [];
30978
- $replace(string, rePropName, function (match, number, quote, subString) {
30979
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
30980
- });
30981
- return result;
30982
- };
30983
- /* end adaptation */
31040
+ function requireSideChannelList () {
31041
+ if (hasRequiredSideChannelList) return sideChannelList;
31042
+ hasRequiredSideChannelList = 1;
30984
31043
 
30985
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
30986
- var intrinsicName = name;
30987
- var alias;
30988
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
30989
- alias = LEGACY_ALIASES[intrinsicName];
30990
- intrinsicName = '%' + alias[0] + '%';
30991
- }
31044
+ var inspect = requireObjectInspect();
30992
31045
 
30993
- if (hasOwn(INTRINSICS, intrinsicName)) {
30994
- var value = INTRINSICS[intrinsicName];
30995
- if (value === needsEval) {
30996
- value = doEval(intrinsicName);
30997
- }
30998
- if (typeof value === 'undefined' && !allowMissing) {
30999
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
31000
- }
31046
+ var $TypeError = requireType();
31001
31047
 
31002
- return {
31003
- alias: alias,
31004
- name: intrinsicName,
31005
- value: value
31006
- };
31048
+ /*
31049
+ * This function traverses the list returning the node corresponding to the given key.
31050
+ *
31051
+ * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
31052
+ * By doing so, all the recently used nodes can be accessed relatively quickly.
31053
+ */
31054
+ /** @type {import('./list.d.ts').listGetNode} */
31055
+ // eslint-disable-next-line consistent-return
31056
+ var listGetNode = function (list, key, isDelete) {
31057
+ /** @type {typeof list | NonNullable<(typeof list)['next']>} */
31058
+ var prev = list;
31059
+ /** @type {(typeof list)['next']} */
31060
+ var curr;
31061
+ // eslint-disable-next-line eqeqeq
31062
+ for (; (curr = prev.next) != null; prev = curr) {
31063
+ if (curr.key === key) {
31064
+ prev.next = curr.next;
31065
+ if (!isDelete) {
31066
+ // eslint-disable-next-line no-extra-parens
31067
+ curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
31068
+ list.next = curr; // eslint-disable-line no-param-reassign
31069
+ }
31070
+ return curr;
31071
+ }
31007
31072
  }
31008
-
31009
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
31010
31073
  };
31011
31074
 
31012
- getIntrinsic = function GetIntrinsic(name, allowMissing) {
31013
- if (typeof name !== 'string' || name.length === 0) {
31014
- throw new $TypeError('intrinsic name must be a non-empty string');
31015
- }
31016
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
31017
- throw new $TypeError('"allowMissing" argument must be a boolean');
31018
- }
31019
-
31020
- if ($exec(/^%?[^%]*%?$/, name) === null) {
31021
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
31075
+ /** @type {import('./list.d.ts').listGet} */
31076
+ var listGet = function (objects, key) {
31077
+ if (!objects) {
31078
+ return void 0;
31022
31079
  }
31023
- var parts = stringToPath(name);
31024
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
31025
-
31026
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
31027
- var intrinsicRealName = intrinsic.name;
31028
- var value = intrinsic.value;
31029
- var skipFurtherCaching = false;
31030
-
31031
- var alias = intrinsic.alias;
31032
- if (alias) {
31033
- intrinsicBaseName = alias[0];
31034
- $spliceApply(parts, $concat([0, 1], alias));
31080
+ var node = listGetNode(objects, key);
31081
+ return node && node.value;
31082
+ };
31083
+ /** @type {import('./list.d.ts').listSet} */
31084
+ var listSet = function (objects, key, value) {
31085
+ var node = listGetNode(objects, key);
31086
+ if (node) {
31087
+ node.value = value;
31088
+ } else {
31089
+ // Prepend the new node to the beginning of the list
31090
+ objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
31091
+ key: key,
31092
+ next: objects.next,
31093
+ value: value
31094
+ });
31095
+ }
31096
+ };
31097
+ /** @type {import('./list.d.ts').listHas} */
31098
+ var listHas = function (objects, key) {
31099
+ if (!objects) {
31100
+ return false;
31035
31101
  }
31102
+ return !!listGetNode(objects, key);
31103
+ };
31104
+ /** @type {import('./list.d.ts').listDelete} */
31105
+ // eslint-disable-next-line consistent-return
31106
+ var listDelete = function (objects, key) {
31107
+ if (objects) {
31108
+ return listGetNode(objects, key, true);
31109
+ }
31110
+ };
31036
31111
 
31037
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
31038
- var part = parts[i];
31039
- var first = $strSlice(part, 0, 1);
31040
- var last = $strSlice(part, -1);
31041
- if (
31042
- (
31043
- (first === '"' || first === "'" || first === '`')
31044
- || (last === '"' || last === "'" || last === '`')
31045
- )
31046
- && first !== last
31047
- ) {
31048
- throw new $SyntaxError('property names with quotes must have matching quotes');
31049
- }
31050
- if (part === 'constructor' || !isOwn) {
31051
- skipFurtherCaching = true;
31052
- }
31112
+ /** @type {import('.')} */
31113
+ sideChannelList = function getSideChannelList() {
31114
+ /** @typedef {ReturnType<typeof getSideChannelList>} Channel */
31115
+ /** @typedef {Parameters<Channel['get']>[0]} K */
31116
+ /** @typedef {Parameters<Channel['set']>[1]} V */
31053
31117
 
31054
- intrinsicBaseName += '.' + part;
31055
- intrinsicRealName = '%' + intrinsicBaseName + '%';
31118
+ /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
31056
31119
 
31057
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
31058
- value = INTRINSICS[intrinsicRealName];
31059
- } else if (value != null) {
31060
- if (!(part in value)) {
31061
- if (!allowMissing) {
31062
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
31063
- }
31064
- return void undefined$1;
31120
+ /** @type {Channel} */
31121
+ var channel = {
31122
+ assert: function (key) {
31123
+ if (!channel.has(key)) {
31124
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
31065
31125
  }
31066
- if ($gOPD && (i + 1) >= parts.length) {
31067
- var desc = $gOPD(value, part);
31068
- isOwn = !!desc;
31069
-
31070
- // By convention, when a data property is converted to an accessor
31071
- // property to emulate a data property that does not suffer from
31072
- // the override mistake, that accessor's getter is marked with
31073
- // an `originalValue` property. Here, when we detect this, we
31074
- // uphold the illusion by pretending to see that original data
31075
- // property, i.e., returning the value rather than the getter
31076
- // itself.
31077
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
31078
- value = desc.get;
31079
- } else {
31080
- value = value[part];
31081
- }
31082
- } else {
31083
- isOwn = hasOwn(value, part);
31084
- value = value[part];
31126
+ },
31127
+ 'delete': function (key) {
31128
+ var root = $o && $o.next;
31129
+ var deletedNode = listDelete($o, key);
31130
+ if (deletedNode && root && root === deletedNode) {
31131
+ $o = void 0;
31085
31132
  }
31086
-
31087
- if (isOwn && !skipFurtherCaching) {
31088
- INTRINSICS[intrinsicRealName] = value;
31133
+ return !!deletedNode;
31134
+ },
31135
+ get: function (key) {
31136
+ return listGet($o, key);
31137
+ },
31138
+ has: function (key) {
31139
+ return listHas($o, key);
31140
+ },
31141
+ set: function (key, value) {
31142
+ if (!$o) {
31143
+ // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
31144
+ $o = {
31145
+ next: void 0
31146
+ };
31089
31147
  }
31148
+ // eslint-disable-next-line no-extra-parens
31149
+ listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);
31090
31150
  }
31091
- }
31092
- return value;
31151
+ };
31152
+ // @ts-expect-error TODO: figure out why this is erroring
31153
+ return channel;
31093
31154
  };
31094
- return getIntrinsic;
31155
+ return sideChannelList;
31095
31156
  }
31096
31157
 
31097
- var callBind = {exports: {}};
31158
+ var esObjectAtoms;
31159
+ var hasRequiredEsObjectAtoms;
31098
31160
 
31099
- var esDefineProperty;
31100
- var hasRequiredEsDefineProperty;
31161
+ function requireEsObjectAtoms () {
31162
+ if (hasRequiredEsObjectAtoms) return esObjectAtoms;
31163
+ hasRequiredEsObjectAtoms = 1;
31101
31164
 
31102
- function requireEsDefineProperty () {
31103
- if (hasRequiredEsDefineProperty) return esDefineProperty;
31104
- hasRequiredEsDefineProperty = 1;
31165
+ /** @type {import('.')} */
31166
+ esObjectAtoms = Object;
31167
+ return esObjectAtoms;
31168
+ }
31105
31169
 
31106
- var GetIntrinsic = requireGetIntrinsic();
31170
+ var esErrors;
31171
+ var hasRequiredEsErrors;
31172
+
31173
+ function requireEsErrors () {
31174
+ if (hasRequiredEsErrors) return esErrors;
31175
+ hasRequiredEsErrors = 1;
31107
31176
 
31108
31177
  /** @type {import('.')} */
31109
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
31110
- if ($defineProperty) {
31111
- try {
31112
- $defineProperty({}, 'a', { value: 1 });
31113
- } catch (e) {
31114
- // IE 8 has a broken defineProperty
31115
- $defineProperty = false;
31178
+ esErrors = Error;
31179
+ return esErrors;
31180
+ }
31181
+
31182
+ var _eval;
31183
+ var hasRequired_eval;
31184
+
31185
+ function require_eval () {
31186
+ if (hasRequired_eval) return _eval;
31187
+ hasRequired_eval = 1;
31188
+
31189
+ /** @type {import('./eval')} */
31190
+ _eval = EvalError;
31191
+ return _eval;
31192
+ }
31193
+
31194
+ var range;
31195
+ var hasRequiredRange;
31196
+
31197
+ function requireRange () {
31198
+ if (hasRequiredRange) return range;
31199
+ hasRequiredRange = 1;
31200
+
31201
+ /** @type {import('./range')} */
31202
+ range = RangeError;
31203
+ return range;
31204
+ }
31205
+
31206
+ var ref;
31207
+ var hasRequiredRef;
31208
+
31209
+ function requireRef () {
31210
+ if (hasRequiredRef) return ref;
31211
+ hasRequiredRef = 1;
31212
+
31213
+ /** @type {import('./ref')} */
31214
+ ref = ReferenceError;
31215
+ return ref;
31216
+ }
31217
+
31218
+ var syntax;
31219
+ var hasRequiredSyntax;
31220
+
31221
+ function requireSyntax () {
31222
+ if (hasRequiredSyntax) return syntax;
31223
+ hasRequiredSyntax = 1;
31224
+
31225
+ /** @type {import('./syntax')} */
31226
+ syntax = SyntaxError;
31227
+ return syntax;
31228
+ }
31229
+
31230
+ var uri;
31231
+ var hasRequiredUri;
31232
+
31233
+ function requireUri () {
31234
+ if (hasRequiredUri) return uri;
31235
+ hasRequiredUri = 1;
31236
+
31237
+ /** @type {import('./uri')} */
31238
+ uri = URIError;
31239
+ return uri;
31240
+ }
31241
+
31242
+ var abs;
31243
+ var hasRequiredAbs;
31244
+
31245
+ function requireAbs () {
31246
+ if (hasRequiredAbs) return abs;
31247
+ hasRequiredAbs = 1;
31248
+
31249
+ /** @type {import('./abs')} */
31250
+ abs = Math.abs;
31251
+ return abs;
31252
+ }
31253
+
31254
+ var floor;
31255
+ var hasRequiredFloor;
31256
+
31257
+ function requireFloor () {
31258
+ if (hasRequiredFloor) return floor;
31259
+ hasRequiredFloor = 1;
31260
+
31261
+ /** @type {import('./floor')} */
31262
+ floor = Math.floor;
31263
+ return floor;
31264
+ }
31265
+
31266
+ var max;
31267
+ var hasRequiredMax;
31268
+
31269
+ function requireMax () {
31270
+ if (hasRequiredMax) return max;
31271
+ hasRequiredMax = 1;
31272
+
31273
+ /** @type {import('./max')} */
31274
+ max = Math.max;
31275
+ return max;
31276
+ }
31277
+
31278
+ var min;
31279
+ var hasRequiredMin;
31280
+
31281
+ function requireMin () {
31282
+ if (hasRequiredMin) return min;
31283
+ hasRequiredMin = 1;
31284
+
31285
+ /** @type {import('./min')} */
31286
+ min = Math.min;
31287
+ return min;
31288
+ }
31289
+
31290
+ var pow;
31291
+ var hasRequiredPow;
31292
+
31293
+ function requirePow () {
31294
+ if (hasRequiredPow) return pow;
31295
+ hasRequiredPow = 1;
31296
+
31297
+ /** @type {import('./pow')} */
31298
+ pow = Math.pow;
31299
+ return pow;
31300
+ }
31301
+
31302
+ var round;
31303
+ var hasRequiredRound;
31304
+
31305
+ function requireRound () {
31306
+ if (hasRequiredRound) return round;
31307
+ hasRequiredRound = 1;
31308
+
31309
+ /** @type {import('./round')} */
31310
+ round = Math.round;
31311
+ return round;
31312
+ }
31313
+
31314
+ var _isNaN;
31315
+ var hasRequired_isNaN;
31316
+
31317
+ function require_isNaN () {
31318
+ if (hasRequired_isNaN) return _isNaN;
31319
+ hasRequired_isNaN = 1;
31320
+
31321
+ /** @type {import('./isNaN')} */
31322
+ _isNaN = Number.isNaN || function isNaN(a) {
31323
+ return a !== a;
31324
+ };
31325
+ return _isNaN;
31326
+ }
31327
+
31328
+ var sign;
31329
+ var hasRequiredSign;
31330
+
31331
+ function requireSign () {
31332
+ if (hasRequiredSign) return sign;
31333
+ hasRequiredSign = 1;
31334
+
31335
+ var $isNaN = require_isNaN();
31336
+
31337
+ /** @type {import('./sign')} */
31338
+ sign = function sign(number) {
31339
+ if ($isNaN(number) || number === 0) {
31340
+ return number;
31116
31341
  }
31117
- }
31342
+ return number < 0 ? -1 : 1;
31343
+ };
31344
+ return sign;
31345
+ }
31118
31346
 
31119
- esDefineProperty = $defineProperty;
31120
- return esDefineProperty;
31347
+ var gOPD;
31348
+ var hasRequiredGOPD;
31349
+
31350
+ function requireGOPD () {
31351
+ if (hasRequiredGOPD) return gOPD;
31352
+ hasRequiredGOPD = 1;
31353
+
31354
+ /** @type {import('./gOPD')} */
31355
+ gOPD = Object.getOwnPropertyDescriptor;
31356
+ return gOPD;
31121
31357
  }
31122
31358
 
31123
31359
  var gopd;
@@ -31127,9 +31363,8 @@ function requireGopd () {
31127
31363
  if (hasRequiredGopd) return gopd;
31128
31364
  hasRequiredGopd = 1;
31129
31365
 
31130
- var GetIntrinsic = requireGetIntrinsic();
31131
-
31132
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
31366
+ /** @type {import('.')} */
31367
+ var $gOPD = requireGOPD();
31133
31368
 
31134
31369
  if ($gOPD) {
31135
31370
  try {
@@ -31144,895 +31379,1027 @@ function requireGopd () {
31144
31379
  return gopd;
31145
31380
  }
31146
31381
 
31147
- var defineDataProperty;
31148
- var hasRequiredDefineDataProperty;
31382
+ var esDefineProperty;
31383
+ var hasRequiredEsDefineProperty;
31149
31384
 
31150
- function requireDefineDataProperty () {
31151
- if (hasRequiredDefineDataProperty) return defineDataProperty;
31152
- hasRequiredDefineDataProperty = 1;
31385
+ function requireEsDefineProperty () {
31386
+ if (hasRequiredEsDefineProperty) return esDefineProperty;
31387
+ hasRequiredEsDefineProperty = 1;
31153
31388
 
31154
- var $defineProperty = requireEsDefineProperty();
31389
+ /** @type {import('.')} */
31390
+ var $defineProperty = Object.defineProperty || false;
31391
+ if ($defineProperty) {
31392
+ try {
31393
+ $defineProperty({}, 'a', { value: 1 });
31394
+ } catch (e) {
31395
+ // IE 8 has a broken defineProperty
31396
+ $defineProperty = false;
31397
+ }
31398
+ }
31155
31399
 
31156
- var $SyntaxError = requireSyntax();
31157
- var $TypeError = requireType();
31400
+ esDefineProperty = $defineProperty;
31401
+ return esDefineProperty;
31402
+ }
31158
31403
 
31159
- var gopd = requireGopd();
31404
+ var shams;
31405
+ var hasRequiredShams;
31160
31406
 
31161
- /** @type {import('.')} */
31162
- defineDataProperty = function defineDataProperty(
31163
- obj,
31164
- property,
31165
- value
31166
- ) {
31167
- if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
31168
- throw new $TypeError('`obj` must be an object or a function`');
31169
- }
31170
- if (typeof property !== 'string' && typeof property !== 'symbol') {
31171
- throw new $TypeError('`property` must be a string or a symbol`');
31172
- }
31173
- if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
31174
- throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
31175
- }
31176
- if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
31177
- throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
31178
- }
31179
- if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
31180
- throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
31181
- }
31182
- if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
31183
- throw new $TypeError('`loose`, if provided, must be a boolean');
31184
- }
31407
+ function requireShams () {
31408
+ if (hasRequiredShams) return shams;
31409
+ hasRequiredShams = 1;
31410
+
31411
+ /** @type {import('./shams')} */
31412
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
31413
+ shams = function hasSymbols() {
31414
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
31415
+ if (typeof Symbol.iterator === 'symbol') { return true; }
31185
31416
 
31186
- var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
31187
- var nonWritable = arguments.length > 4 ? arguments[4] : null;
31188
- var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
31189
- var loose = arguments.length > 6 ? arguments[6] : false;
31417
+ /** @type {{ [k in symbol]?: unknown }} */
31418
+ var obj = {};
31419
+ var sym = Symbol('test');
31420
+ var symObj = Object(sym);
31421
+ if (typeof sym === 'string') { return false; }
31190
31422
 
31191
- /* @type {false | TypedPropertyDescriptor<unknown>} */
31192
- var desc = !!gopd && gopd(obj, property);
31423
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
31424
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
31193
31425
 
31194
- if ($defineProperty) {
31195
- $defineProperty(obj, property, {
31196
- configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
31197
- enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
31198
- value: value,
31199
- writable: nonWritable === null && desc ? desc.writable : !nonWritable
31200
- });
31201
- } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
31202
- // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
31203
- obj[property] = value; // eslint-disable-line no-param-reassign
31204
- } else {
31205
- throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
31426
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
31427
+ // if (sym instanceof Symbol) { return false; }
31428
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
31429
+ // if (!(symObj instanceof Symbol)) { return false; }
31430
+
31431
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
31432
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
31433
+
31434
+ var symVal = 42;
31435
+ obj[sym] = symVal;
31436
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
31437
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
31438
+
31439
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
31440
+
31441
+ var syms = Object.getOwnPropertySymbols(obj);
31442
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
31443
+
31444
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
31445
+
31446
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
31447
+ // eslint-disable-next-line no-extra-parens
31448
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
31449
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
31206
31450
  }
31451
+
31452
+ return true;
31207
31453
  };
31208
- return defineDataProperty;
31454
+ return shams;
31209
31455
  }
31210
31456
 
31211
- var hasPropertyDescriptors_1;
31212
- var hasRequiredHasPropertyDescriptors;
31457
+ var hasSymbols;
31458
+ var hasRequiredHasSymbols;
31213
31459
 
31214
- function requireHasPropertyDescriptors () {
31215
- if (hasRequiredHasPropertyDescriptors) return hasPropertyDescriptors_1;
31216
- hasRequiredHasPropertyDescriptors = 1;
31460
+ function requireHasSymbols () {
31461
+ if (hasRequiredHasSymbols) return hasSymbols;
31462
+ hasRequiredHasSymbols = 1;
31217
31463
 
31218
- var $defineProperty = requireEsDefineProperty();
31464
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
31465
+ var hasSymbolSham = requireShams();
31466
+
31467
+ /** @type {import('.')} */
31468
+ hasSymbols = function hasNativeSymbols() {
31469
+ if (typeof origSymbol !== 'function') { return false; }
31470
+ if (typeof Symbol !== 'function') { return false; }
31471
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
31472
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
31219
31473
 
31220
- var hasPropertyDescriptors = function hasPropertyDescriptors() {
31221
- return !!$defineProperty;
31474
+ return hasSymbolSham();
31222
31475
  };
31476
+ return hasSymbols;
31477
+ }
31223
31478
 
31224
- hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
31225
- // node v0.6 has a bug where array lengths can be Set but not Defined
31226
- if (!$defineProperty) {
31227
- return null;
31228
- }
31229
- try {
31230
- return $defineProperty([], 'length', { value: 1 }).length !== 1;
31231
- } catch (e) {
31232
- // In Firefox 4-22, defining length on an array throws an exception.
31233
- return true;
31234
- }
31479
+ var Reflect_getPrototypeOf;
31480
+ var hasRequiredReflect_getPrototypeOf;
31481
+
31482
+ function requireReflect_getPrototypeOf () {
31483
+ if (hasRequiredReflect_getPrototypeOf) return Reflect_getPrototypeOf;
31484
+ hasRequiredReflect_getPrototypeOf = 1;
31485
+
31486
+ /** @type {import('./Reflect.getPrototypeOf')} */
31487
+ Reflect_getPrototypeOf = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
31488
+ return Reflect_getPrototypeOf;
31489
+ }
31490
+
31491
+ var Object_getPrototypeOf;
31492
+ var hasRequiredObject_getPrototypeOf;
31493
+
31494
+ function requireObject_getPrototypeOf () {
31495
+ if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
31496
+ hasRequiredObject_getPrototypeOf = 1;
31497
+
31498
+ var $Object = requireEsObjectAtoms();
31499
+
31500
+ /** @type {import('./Object.getPrototypeOf')} */
31501
+ Object_getPrototypeOf = $Object.getPrototypeOf || null;
31502
+ return Object_getPrototypeOf;
31503
+ }
31504
+
31505
+ var implementation;
31506
+ var hasRequiredImplementation;
31507
+
31508
+ function requireImplementation () {
31509
+ if (hasRequiredImplementation) return implementation;
31510
+ hasRequiredImplementation = 1;
31511
+
31512
+ /* eslint no-invalid-this: 1 */
31513
+
31514
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
31515
+ var toStr = Object.prototype.toString;
31516
+ var max = Math.max;
31517
+ var funcType = '[object Function]';
31518
+
31519
+ var concatty = function concatty(a, b) {
31520
+ var arr = [];
31521
+
31522
+ for (var i = 0; i < a.length; i += 1) {
31523
+ arr[i] = a[i];
31524
+ }
31525
+ for (var j = 0; j < b.length; j += 1) {
31526
+ arr[j + a.length] = b[j];
31527
+ }
31528
+
31529
+ return arr;
31530
+ };
31531
+
31532
+ var slicy = function slicy(arrLike, offset) {
31533
+ var arr = [];
31534
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
31535
+ arr[j] = arrLike[i];
31536
+ }
31537
+ return arr;
31538
+ };
31539
+
31540
+ var joiny = function (arr, joiner) {
31541
+ var str = '';
31542
+ for (var i = 0; i < arr.length; i += 1) {
31543
+ str += arr[i];
31544
+ if (i + 1 < arr.length) {
31545
+ str += joiner;
31546
+ }
31547
+ }
31548
+ return str;
31549
+ };
31550
+
31551
+ implementation = function bind(that) {
31552
+ var target = this;
31553
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
31554
+ throw new TypeError(ERROR_MESSAGE + target);
31555
+ }
31556
+ var args = slicy(arguments, 1);
31557
+
31558
+ var bound;
31559
+ var binder = function () {
31560
+ if (this instanceof bound) {
31561
+ var result = target.apply(
31562
+ this,
31563
+ concatty(args, arguments)
31564
+ );
31565
+ if (Object(result) === result) {
31566
+ return result;
31567
+ }
31568
+ return this;
31569
+ }
31570
+ return target.apply(
31571
+ that,
31572
+ concatty(args, arguments)
31573
+ );
31574
+
31575
+ };
31576
+
31577
+ var boundLength = max(0, target.length - args.length);
31578
+ var boundArgs = [];
31579
+ for (var i = 0; i < boundLength; i++) {
31580
+ boundArgs[i] = '$' + i;
31581
+ }
31582
+
31583
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
31584
+
31585
+ if (target.prototype) {
31586
+ var Empty = function Empty() {};
31587
+ Empty.prototype = target.prototype;
31588
+ bound.prototype = new Empty();
31589
+ Empty.prototype = null;
31590
+ }
31591
+
31592
+ return bound;
31235
31593
  };
31594
+ return implementation;
31595
+ }
31596
+
31597
+ var functionBind;
31598
+ var hasRequiredFunctionBind;
31599
+
31600
+ function requireFunctionBind () {
31601
+ if (hasRequiredFunctionBind) return functionBind;
31602
+ hasRequiredFunctionBind = 1;
31603
+
31604
+ var implementation = requireImplementation();
31236
31605
 
31237
- hasPropertyDescriptors_1 = hasPropertyDescriptors;
31238
- return hasPropertyDescriptors_1;
31606
+ functionBind = Function.prototype.bind || implementation;
31607
+ return functionBind;
31239
31608
  }
31240
31609
 
31241
- var setFunctionLength;
31242
- var hasRequiredSetFunctionLength;
31610
+ var functionCall;
31611
+ var hasRequiredFunctionCall;
31243
31612
 
31244
- function requireSetFunctionLength () {
31245
- if (hasRequiredSetFunctionLength) return setFunctionLength;
31246
- hasRequiredSetFunctionLength = 1;
31613
+ function requireFunctionCall () {
31614
+ if (hasRequiredFunctionCall) return functionCall;
31615
+ hasRequiredFunctionCall = 1;
31247
31616
 
31248
- var GetIntrinsic = requireGetIntrinsic();
31249
- var define = requireDefineDataProperty();
31250
- var hasDescriptors = requireHasPropertyDescriptors()();
31251
- var gOPD = requireGopd();
31617
+ /** @type {import('./functionCall')} */
31618
+ functionCall = Function.prototype.call;
31619
+ return functionCall;
31620
+ }
31621
+
31622
+ var functionApply;
31623
+ var hasRequiredFunctionApply;
31624
+
31625
+ function requireFunctionApply () {
31626
+ if (hasRequiredFunctionApply) return functionApply;
31627
+ hasRequiredFunctionApply = 1;
31628
+
31629
+ /** @type {import('./functionApply')} */
31630
+ functionApply = Function.prototype.apply;
31631
+ return functionApply;
31632
+ }
31633
+
31634
+ var reflectApply;
31635
+ var hasRequiredReflectApply;
31636
+
31637
+ function requireReflectApply () {
31638
+ if (hasRequiredReflectApply) return reflectApply;
31639
+ hasRequiredReflectApply = 1;
31640
+
31641
+ /** @type {import('./reflectApply')} */
31642
+ reflectApply = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
31643
+ return reflectApply;
31644
+ }
31645
+
31646
+ var actualApply;
31647
+ var hasRequiredActualApply;
31648
+
31649
+ function requireActualApply () {
31650
+ if (hasRequiredActualApply) return actualApply;
31651
+ hasRequiredActualApply = 1;
31652
+
31653
+ var bind = requireFunctionBind();
31654
+
31655
+ var $apply = requireFunctionApply();
31656
+ var $call = requireFunctionCall();
31657
+ var $reflectApply = requireReflectApply();
31658
+
31659
+ /** @type {import('./actualApply')} */
31660
+ actualApply = $reflectApply || bind.call($call, $apply);
31661
+ return actualApply;
31662
+ }
31252
31663
 
31664
+ var callBindApplyHelpers;
31665
+ var hasRequiredCallBindApplyHelpers;
31666
+
31667
+ function requireCallBindApplyHelpers () {
31668
+ if (hasRequiredCallBindApplyHelpers) return callBindApplyHelpers;
31669
+ hasRequiredCallBindApplyHelpers = 1;
31670
+
31671
+ var bind = requireFunctionBind();
31253
31672
  var $TypeError = requireType();
31254
- var $floor = GetIntrinsic('%Math.floor%');
31255
31673
 
31256
- /** @type {import('.')} */
31257
- setFunctionLength = function setFunctionLength(fn, length) {
31258
- if (typeof fn !== 'function') {
31259
- throw new $TypeError('`fn` is not a function');
31260
- }
31261
- if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
31262
- throw new $TypeError('`length` must be a positive 32-bit integer');
31674
+ var $call = requireFunctionCall();
31675
+ var $actualApply = requireActualApply();
31676
+
31677
+ /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
31678
+ callBindApplyHelpers = function callBindBasic(args) {
31679
+ if (args.length < 1 || typeof args[0] !== 'function') {
31680
+ throw new $TypeError('a function is required');
31263
31681
  }
31682
+ return $actualApply(bind, $call, args);
31683
+ };
31684
+ return callBindApplyHelpers;
31685
+ }
31264
31686
 
31265
- var loose = arguments.length > 2 && !!arguments[2];
31687
+ var get;
31688
+ var hasRequiredGet;
31266
31689
 
31267
- var functionLengthIsConfigurable = true;
31268
- var functionLengthIsWritable = true;
31269
- if ('length' in fn && gOPD) {
31270
- var desc = gOPD(fn, 'length');
31271
- if (desc && !desc.configurable) {
31272
- functionLengthIsConfigurable = false;
31273
- }
31274
- if (desc && !desc.writable) {
31275
- functionLengthIsWritable = false;
31276
- }
31690
+ function requireGet () {
31691
+ if (hasRequiredGet) return get;
31692
+ hasRequiredGet = 1;
31693
+
31694
+ var callBind = requireCallBindApplyHelpers();
31695
+ var gOPD = requireGopd();
31696
+
31697
+ var hasProtoAccessor;
31698
+ try {
31699
+ // eslint-disable-next-line no-extra-parens, no-proto
31700
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
31701
+ } catch (e) {
31702
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
31703
+ throw e;
31277
31704
  }
31705
+ }
31278
31706
 
31279
- if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
31280
- if (hasDescriptors) {
31281
- define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
31282
- } else {
31283
- define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
31707
+ // eslint-disable-next-line no-extra-parens
31708
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
31709
+
31710
+ var $Object = Object;
31711
+ var $getPrototypeOf = $Object.getPrototypeOf;
31712
+
31713
+ /** @type {import('./get')} */
31714
+ get = desc && typeof desc.get === 'function'
31715
+ ? callBind([desc.get])
31716
+ : typeof $getPrototypeOf === 'function'
31717
+ ? /** @type {import('./get')} */ function getDunder(value) {
31718
+ // eslint-disable-next-line eqeqeq
31719
+ return $getPrototypeOf(value == null ? value : $Object(value));
31284
31720
  }
31285
- }
31286
- return fn;
31287
- };
31288
- return setFunctionLength;
31721
+ : false;
31722
+ return get;
31289
31723
  }
31290
31724
 
31291
- var hasRequiredCallBind;
31292
-
31293
- function requireCallBind () {
31294
- if (hasRequiredCallBind) return callBind.exports;
31295
- hasRequiredCallBind = 1;
31296
- (function (module) {
31725
+ var getProto;
31726
+ var hasRequiredGetProto;
31297
31727
 
31298
- var bind = requireFunctionBind();
31299
- var GetIntrinsic = requireGetIntrinsic();
31300
- var setFunctionLength = requireSetFunctionLength();
31728
+ function requireGetProto () {
31729
+ if (hasRequiredGetProto) return getProto;
31730
+ hasRequiredGetProto = 1;
31301
31731
 
31302
- var $TypeError = requireType();
31303
- var $apply = GetIntrinsic('%Function.prototype.apply%');
31304
- var $call = GetIntrinsic('%Function.prototype.call%');
31305
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
31732
+ var reflectGetProto = requireReflect_getPrototypeOf();
31733
+ var originalGetProto = requireObject_getPrototypeOf();
31306
31734
 
31307
- var $defineProperty = requireEsDefineProperty();
31308
- var $max = GetIntrinsic('%Math.max%');
31735
+ var getDunderProto = requireGet();
31309
31736
 
31310
- module.exports = function callBind(originalFunction) {
31311
- if (typeof originalFunction !== 'function') {
31312
- throw new $TypeError('a function is required');
31737
+ /** @type {import('.')} */
31738
+ getProto = reflectGetProto
31739
+ ? function getProto(O) {
31740
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
31741
+ return reflectGetProto(O);
31742
+ }
31743
+ : originalGetProto
31744
+ ? function getProto(O) {
31745
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
31746
+ throw new TypeError('getProto: not an object');
31747
+ }
31748
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
31749
+ return originalGetProto(O);
31313
31750
  }
31314
- var func = $reflectApply(bind, $call, arguments);
31315
- return setFunctionLength(
31316
- func,
31317
- 1 + $max(0, originalFunction.length - (arguments.length - 1)),
31318
- true
31319
- );
31320
- };
31751
+ : getDunderProto
31752
+ ? function getProto(O) {
31753
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
31754
+ return getDunderProto(O);
31755
+ }
31756
+ : null;
31757
+ return getProto;
31758
+ }
31321
31759
 
31322
- var applyBind = function applyBind() {
31323
- return $reflectApply(bind, $apply, arguments);
31324
- };
31760
+ var hasown;
31761
+ var hasRequiredHasown;
31325
31762
 
31326
- if ($defineProperty) {
31327
- $defineProperty(module.exports, 'apply', { value: applyBind });
31328
- } else {
31329
- module.exports.apply = applyBind;
31330
- }
31331
- } (callBind));
31332
- return callBind.exports;
31763
+ function requireHasown () {
31764
+ if (hasRequiredHasown) return hasown;
31765
+ hasRequiredHasown = 1;
31766
+
31767
+ var call = Function.prototype.call;
31768
+ var $hasOwn = Object.prototype.hasOwnProperty;
31769
+ var bind = requireFunctionBind();
31770
+
31771
+ /** @type {import('.')} */
31772
+ hasown = bind.call(call, $hasOwn);
31773
+ return hasown;
31333
31774
  }
31334
31775
 
31335
- var callBound;
31336
- var hasRequiredCallBound;
31776
+ var getIntrinsic;
31777
+ var hasRequiredGetIntrinsic;
31337
31778
 
31338
- function requireCallBound () {
31339
- if (hasRequiredCallBound) return callBound;
31340
- hasRequiredCallBound = 1;
31779
+ function requireGetIntrinsic () {
31780
+ if (hasRequiredGetIntrinsic) return getIntrinsic;
31781
+ hasRequiredGetIntrinsic = 1;
31341
31782
 
31342
- var GetIntrinsic = requireGetIntrinsic();
31783
+ var undefined$1;
31784
+
31785
+ var $Object = requireEsObjectAtoms();
31343
31786
 
31344
- var callBind = requireCallBind();
31787
+ var $Error = requireEsErrors();
31788
+ var $EvalError = require_eval();
31789
+ var $RangeError = requireRange();
31790
+ var $ReferenceError = requireRef();
31791
+ var $SyntaxError = requireSyntax();
31792
+ var $TypeError = requireType();
31793
+ var $URIError = requireUri();
31345
31794
 
31346
- var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
31795
+ var abs = requireAbs();
31796
+ var floor = requireFloor();
31797
+ var max = requireMax();
31798
+ var min = requireMin();
31799
+ var pow = requirePow();
31800
+ var round = requireRound();
31801
+ var sign = requireSign();
31347
31802
 
31348
- callBound = function callBoundIntrinsic(name, allowMissing) {
31349
- var intrinsic = GetIntrinsic(name, !!allowMissing);
31350
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
31351
- return callBind(intrinsic);
31352
- }
31353
- return intrinsic;
31803
+ var $Function = Function;
31804
+
31805
+ // eslint-disable-next-line consistent-return
31806
+ var getEvalledConstructor = function (expressionSyntax) {
31807
+ try {
31808
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
31809
+ } catch (e) {}
31354
31810
  };
31355
- return callBound;
31356
- }
31357
31811
 
31358
- var util_inspect;
31359
- var hasRequiredUtil_inspect;
31812
+ var $gOPD = requireGopd();
31813
+ var $defineProperty = requireEsDefineProperty();
31360
31814
 
31361
- function requireUtil_inspect () {
31362
- if (hasRequiredUtil_inspect) return util_inspect;
31363
- hasRequiredUtil_inspect = 1;
31364
- util_inspect = require$$1$1.inspect;
31365
- return util_inspect;
31366
- }
31815
+ var throwTypeError = function () {
31816
+ throw new $TypeError();
31817
+ };
31818
+ var ThrowTypeError = $gOPD
31819
+ ? (function () {
31820
+ try {
31821
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
31822
+ arguments.callee; // IE 8 does not throw here
31823
+ return throwTypeError;
31824
+ } catch (calleeThrows) {
31825
+ try {
31826
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
31827
+ return $gOPD(arguments, 'callee').get;
31828
+ } catch (gOPDthrows) {
31829
+ return throwTypeError;
31830
+ }
31831
+ }
31832
+ }())
31833
+ : throwTypeError;
31367
31834
 
31368
- var objectInspect;
31369
- var hasRequiredObjectInspect;
31835
+ var hasSymbols = requireHasSymbols()();
31370
31836
 
31371
- function requireObjectInspect () {
31372
- if (hasRequiredObjectInspect) return objectInspect;
31373
- hasRequiredObjectInspect = 1;
31374
- var hasMap = typeof Map === 'function' && Map.prototype;
31375
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
31376
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
31377
- var mapForEach = hasMap && Map.prototype.forEach;
31378
- var hasSet = typeof Set === 'function' && Set.prototype;
31379
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
31380
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
31381
- var setForEach = hasSet && Set.prototype.forEach;
31382
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
31383
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
31384
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
31385
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
31386
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
31387
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
31388
- var booleanValueOf = Boolean.prototype.valueOf;
31389
- var objectToString = Object.prototype.toString;
31390
- var functionToString = Function.prototype.toString;
31391
- var $match = String.prototype.match;
31392
- var $slice = String.prototype.slice;
31393
- var $replace = String.prototype.replace;
31394
- var $toUpperCase = String.prototype.toUpperCase;
31395
- var $toLowerCase = String.prototype.toLowerCase;
31396
- var $test = RegExp.prototype.test;
31397
- var $concat = Array.prototype.concat;
31398
- var $join = Array.prototype.join;
31399
- var $arrSlice = Array.prototype.slice;
31400
- var $floor = Math.floor;
31401
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
31402
- var gOPS = Object.getOwnPropertySymbols;
31403
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
31404
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
31405
- // ie, `has-tostringtag/shams
31406
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
31407
- ? Symbol.toStringTag
31408
- : null;
31409
- var isEnumerable = Object.prototype.propertyIsEnumerable;
31837
+ var getProto = requireGetProto();
31838
+ var $ObjectGPO = requireObject_getPrototypeOf();
31839
+ var $ReflectGPO = requireReflect_getPrototypeOf();
31410
31840
 
31411
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
31412
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
31413
- ? function (O) {
31414
- return O.__proto__; // eslint-disable-line no-proto
31415
- }
31416
- : null
31417
- );
31841
+ var $apply = requireFunctionApply();
31842
+ var $call = requireFunctionCall();
31418
31843
 
31419
- function addNumericSeparator(num, str) {
31420
- if (
31421
- num === Infinity
31422
- || num === -Infinity
31423
- || num !== num
31424
- || (num && num > -1000 && num < 1000)
31425
- || $test.call(/e/, str)
31426
- ) {
31427
- return str;
31428
- }
31429
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
31430
- if (typeof num === 'number') {
31431
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
31432
- if (int !== num) {
31433
- var intStr = String(int);
31434
- var dec = $slice.call(str, intStr.length + 1);
31435
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
31436
- }
31437
- }
31438
- return $replace.call(str, sepRegex, '$&_');
31439
- }
31844
+ var needsEval = {};
31440
31845
 
31441
- var utilInspect = requireUtil_inspect();
31442
- var inspectCustom = utilInspect.custom;
31443
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
31846
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
31444
31847
 
31445
- objectInspect = function inspect_(obj, options, depth, seen) {
31446
- var opts = options || {};
31848
+ var INTRINSICS = {
31849
+ __proto__: null,
31850
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
31851
+ '%Array%': Array,
31852
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
31853
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
31854
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
31855
+ '%AsyncFunction%': needsEval,
31856
+ '%AsyncGenerator%': needsEval,
31857
+ '%AsyncGeneratorFunction%': needsEval,
31858
+ '%AsyncIteratorPrototype%': needsEval,
31859
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
31860
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
31861
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
31862
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
31863
+ '%Boolean%': Boolean,
31864
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
31865
+ '%Date%': Date,
31866
+ '%decodeURI%': decodeURI,
31867
+ '%decodeURIComponent%': decodeURIComponent,
31868
+ '%encodeURI%': encodeURI,
31869
+ '%encodeURIComponent%': encodeURIComponent,
31870
+ '%Error%': $Error,
31871
+ '%eval%': eval, // eslint-disable-line no-eval
31872
+ '%EvalError%': $EvalError,
31873
+ '%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
31874
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
31875
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
31876
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
31877
+ '%Function%': $Function,
31878
+ '%GeneratorFunction%': needsEval,
31879
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
31880
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
31881
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
31882
+ '%isFinite%': isFinite,
31883
+ '%isNaN%': isNaN,
31884
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
31885
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
31886
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
31887
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
31888
+ '%Math%': Math,
31889
+ '%Number%': Number,
31890
+ '%Object%': $Object,
31891
+ '%Object.getOwnPropertyDescriptor%': $gOPD,
31892
+ '%parseFloat%': parseFloat,
31893
+ '%parseInt%': parseInt,
31894
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
31895
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
31896
+ '%RangeError%': $RangeError,
31897
+ '%ReferenceError%': $ReferenceError,
31898
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
31899
+ '%RegExp%': RegExp,
31900
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
31901
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
31902
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
31903
+ '%String%': String,
31904
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
31905
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
31906
+ '%SyntaxError%': $SyntaxError,
31907
+ '%ThrowTypeError%': ThrowTypeError,
31908
+ '%TypedArray%': TypedArray,
31909
+ '%TypeError%': $TypeError,
31910
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
31911
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
31912
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
31913
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
31914
+ '%URIError%': $URIError,
31915
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
31916
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
31917
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
31918
+
31919
+ '%Function.prototype.call%': $call,
31920
+ '%Function.prototype.apply%': $apply,
31921
+ '%Object.defineProperty%': $defineProperty,
31922
+ '%Object.getPrototypeOf%': $ObjectGPO,
31923
+ '%Math.abs%': abs,
31924
+ '%Math.floor%': floor,
31925
+ '%Math.max%': max,
31926
+ '%Math.min%': min,
31927
+ '%Math.pow%': pow,
31928
+ '%Math.round%': round,
31929
+ '%Math.sign%': sign,
31930
+ '%Reflect.getPrototypeOf%': $ReflectGPO
31931
+ };
31447
31932
 
31448
- if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
31449
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
31450
- }
31451
- if (
31452
- has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
31453
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
31454
- : opts.maxStringLength !== null
31455
- )
31456
- ) {
31457
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
31458
- }
31459
- var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
31460
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
31461
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
31462
- }
31933
+ if (getProto) {
31934
+ try {
31935
+ null.error; // eslint-disable-line no-unused-expressions
31936
+ } catch (e) {
31937
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
31938
+ var errorProto = getProto(getProto(e));
31939
+ INTRINSICS['%Error.prototype%'] = errorProto;
31940
+ }
31941
+ }
31463
31942
 
31464
- if (
31465
- has(opts, 'indent')
31466
- && opts.indent !== null
31467
- && opts.indent !== '\t'
31468
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
31469
- ) {
31470
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
31471
- }
31472
- if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
31473
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
31474
- }
31475
- var numericSeparator = opts.numericSeparator;
31943
+ var doEval = function doEval(name) {
31944
+ var value;
31945
+ if (name === '%AsyncFunction%') {
31946
+ value = getEvalledConstructor('async function () {}');
31947
+ } else if (name === '%GeneratorFunction%') {
31948
+ value = getEvalledConstructor('function* () {}');
31949
+ } else if (name === '%AsyncGeneratorFunction%') {
31950
+ value = getEvalledConstructor('async function* () {}');
31951
+ } else if (name === '%AsyncGenerator%') {
31952
+ var fn = doEval('%AsyncGeneratorFunction%');
31953
+ if (fn) {
31954
+ value = fn.prototype;
31955
+ }
31956
+ } else if (name === '%AsyncIteratorPrototype%') {
31957
+ var gen = doEval('%AsyncGenerator%');
31958
+ if (gen && getProto) {
31959
+ value = getProto(gen.prototype);
31960
+ }
31961
+ }
31476
31962
 
31477
- if (typeof obj === 'undefined') {
31478
- return 'undefined';
31479
- }
31480
- if (obj === null) {
31481
- return 'null';
31482
- }
31483
- if (typeof obj === 'boolean') {
31484
- return obj ? 'true' : 'false';
31485
- }
31963
+ INTRINSICS[name] = value;
31486
31964
 
31487
- if (typeof obj === 'string') {
31488
- return inspectString(obj, opts);
31489
- }
31490
- if (typeof obj === 'number') {
31491
- if (obj === 0) {
31492
- return Infinity / obj > 0 ? '0' : '-0';
31493
- }
31494
- var str = String(obj);
31495
- return numericSeparator ? addNumericSeparator(obj, str) : str;
31496
- }
31497
- if (typeof obj === 'bigint') {
31498
- var bigIntStr = String(obj) + 'n';
31499
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
31500
- }
31965
+ return value;
31966
+ };
31501
31967
 
31502
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
31503
- if (typeof depth === 'undefined') { depth = 0; }
31504
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
31505
- return isArray(obj) ? '[Array]' : '[Object]';
31506
- }
31968
+ var LEGACY_ALIASES = {
31969
+ __proto__: null,
31970
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
31971
+ '%ArrayPrototype%': ['Array', 'prototype'],
31972
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
31973
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
31974
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
31975
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
31976
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
31977
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
31978
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
31979
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
31980
+ '%DataViewPrototype%': ['DataView', 'prototype'],
31981
+ '%DatePrototype%': ['Date', 'prototype'],
31982
+ '%ErrorPrototype%': ['Error', 'prototype'],
31983
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
31984
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
31985
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
31986
+ '%FunctionPrototype%': ['Function', 'prototype'],
31987
+ '%Generator%': ['GeneratorFunction', 'prototype'],
31988
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
31989
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
31990
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
31991
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
31992
+ '%JSONParse%': ['JSON', 'parse'],
31993
+ '%JSONStringify%': ['JSON', 'stringify'],
31994
+ '%MapPrototype%': ['Map', 'prototype'],
31995
+ '%NumberPrototype%': ['Number', 'prototype'],
31996
+ '%ObjectPrototype%': ['Object', 'prototype'],
31997
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
31998
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
31999
+ '%PromisePrototype%': ['Promise', 'prototype'],
32000
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
32001
+ '%Promise_all%': ['Promise', 'all'],
32002
+ '%Promise_reject%': ['Promise', 'reject'],
32003
+ '%Promise_resolve%': ['Promise', 'resolve'],
32004
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
32005
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
32006
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
32007
+ '%SetPrototype%': ['Set', 'prototype'],
32008
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
32009
+ '%StringPrototype%': ['String', 'prototype'],
32010
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
32011
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
32012
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
32013
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
32014
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
32015
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
32016
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
32017
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
32018
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
32019
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
32020
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
32021
+ };
31507
32022
 
31508
- var indent = getIndent(opts, depth);
32023
+ var bind = requireFunctionBind();
32024
+ var hasOwn = requireHasown();
32025
+ var $concat = bind.call($call, Array.prototype.concat);
32026
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
32027
+ var $replace = bind.call($call, String.prototype.replace);
32028
+ var $strSlice = bind.call($call, String.prototype.slice);
32029
+ var $exec = bind.call($call, RegExp.prototype.exec);
31509
32030
 
31510
- if (typeof seen === 'undefined') {
31511
- seen = [];
31512
- } else if (indexOf(seen, obj) >= 0) {
31513
- return '[Circular]';
31514
- }
32031
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
32032
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
32033
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
32034
+ var stringToPath = function stringToPath(string) {
32035
+ var first = $strSlice(string, 0, 1);
32036
+ var last = $strSlice(string, -1);
32037
+ if (first === '%' && last !== '%') {
32038
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
32039
+ } else if (last === '%' && first !== '%') {
32040
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
32041
+ }
32042
+ var result = [];
32043
+ $replace(string, rePropName, function (match, number, quote, subString) {
32044
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
32045
+ });
32046
+ return result;
32047
+ };
32048
+ /* end adaptation */
31515
32049
 
31516
- function inspect(value, from, noIndent) {
31517
- if (from) {
31518
- seen = $arrSlice.call(seen);
31519
- seen.push(from);
31520
- }
31521
- if (noIndent) {
31522
- var newOpts = {
31523
- depth: opts.depth
31524
- };
31525
- if (has(opts, 'quoteStyle')) {
31526
- newOpts.quoteStyle = opts.quoteStyle;
31527
- }
31528
- return inspect_(value, newOpts, depth + 1, seen);
31529
- }
31530
- return inspect_(value, opts, depth + 1, seen);
31531
- }
32050
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
32051
+ var intrinsicName = name;
32052
+ var alias;
32053
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
32054
+ alias = LEGACY_ALIASES[intrinsicName];
32055
+ intrinsicName = '%' + alias[0] + '%';
32056
+ }
31532
32057
 
31533
- if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
31534
- var name = nameOf(obj);
31535
- var keys = arrObjKeys(obj, inspect);
31536
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
31537
- }
31538
- if (isSymbol(obj)) {
31539
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
31540
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
31541
- }
31542
- if (isElement(obj)) {
31543
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
31544
- var attrs = obj.attributes || [];
31545
- for (var i = 0; i < attrs.length; i++) {
31546
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
31547
- }
31548
- s += '>';
31549
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
31550
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
31551
- return s;
31552
- }
31553
- if (isArray(obj)) {
31554
- if (obj.length === 0) { return '[]'; }
31555
- var xs = arrObjKeys(obj, inspect);
31556
- if (indent && !singleLineValues(xs)) {
31557
- return '[' + indentedJoin(xs, indent) + ']';
31558
- }
31559
- return '[ ' + $join.call(xs, ', ') + ' ]';
31560
- }
31561
- if (isError(obj)) {
31562
- var parts = arrObjKeys(obj, inspect);
31563
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
31564
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
31565
- }
31566
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
31567
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
31568
- }
31569
- if (typeof obj === 'object' && customInspect) {
31570
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
31571
- return utilInspect(obj, { depth: maxDepth - depth });
31572
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
31573
- return obj.inspect();
31574
- }
31575
- }
31576
- if (isMap(obj)) {
31577
- var mapParts = [];
31578
- if (mapForEach) {
31579
- mapForEach.call(obj, function (value, key) {
31580
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
31581
- });
31582
- }
31583
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
31584
- }
31585
- if (isSet(obj)) {
31586
- var setParts = [];
31587
- if (setForEach) {
31588
- setForEach.call(obj, function (value) {
31589
- setParts.push(inspect(value, obj));
31590
- });
31591
- }
31592
- return collectionOf('Set', setSize.call(obj), setParts, indent);
31593
- }
31594
- if (isWeakMap(obj)) {
31595
- return weakCollectionOf('WeakMap');
31596
- }
31597
- if (isWeakSet(obj)) {
31598
- return weakCollectionOf('WeakSet');
31599
- }
31600
- if (isWeakRef(obj)) {
31601
- return weakCollectionOf('WeakRef');
31602
- }
31603
- if (isNumber(obj)) {
31604
- return markBoxed(inspect(Number(obj)));
31605
- }
31606
- if (isBigInt(obj)) {
31607
- return markBoxed(inspect(bigIntValueOf.call(obj)));
31608
- }
31609
- if (isBoolean(obj)) {
31610
- return markBoxed(booleanValueOf.call(obj));
31611
- }
31612
- if (isString(obj)) {
31613
- return markBoxed(inspect(String(obj)));
31614
- }
31615
- // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
31616
- /* eslint-env browser */
31617
- if (typeof window !== 'undefined' && obj === window) {
31618
- return '{ [object Window] }';
31619
- }
31620
- if (
31621
- (typeof globalThis !== 'undefined' && obj === globalThis)
31622
- || (typeof commonjsGlobal !== 'undefined' && obj === commonjsGlobal)
31623
- ) {
31624
- return '{ [object globalThis] }';
31625
- }
31626
- if (!isDate(obj) && !isRegExp(obj)) {
31627
- var ys = arrObjKeys(obj, inspect);
31628
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
31629
- var protoTag = obj instanceof Object ? '' : 'null prototype';
31630
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
31631
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
31632
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
31633
- if (ys.length === 0) { return tag + '{}'; }
31634
- if (indent) {
31635
- return tag + '{' + indentedJoin(ys, indent) + '}';
31636
- }
31637
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
31638
- }
31639
- return String(obj);
32058
+ if (hasOwn(INTRINSICS, intrinsicName)) {
32059
+ var value = INTRINSICS[intrinsicName];
32060
+ if (value === needsEval) {
32061
+ value = doEval(intrinsicName);
32062
+ }
32063
+ if (typeof value === 'undefined' && !allowMissing) {
32064
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
32065
+ }
32066
+
32067
+ return {
32068
+ alias: alias,
32069
+ name: intrinsicName,
32070
+ value: value
32071
+ };
32072
+ }
32073
+
32074
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
31640
32075
  };
31641
32076
 
31642
- function wrapQuotes(s, defaultStyle, opts) {
31643
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
31644
- return quoteChar + s + quoteChar;
31645
- }
32077
+ getIntrinsic = function GetIntrinsic(name, allowMissing) {
32078
+ if (typeof name !== 'string' || name.length === 0) {
32079
+ throw new $TypeError('intrinsic name must be a non-empty string');
32080
+ }
32081
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
32082
+ throw new $TypeError('"allowMissing" argument must be a boolean');
32083
+ }
31646
32084
 
31647
- function quote(s) {
31648
- return $replace.call(String(s), /"/g, '&quot;');
31649
- }
32085
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
32086
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
32087
+ }
32088
+ var parts = stringToPath(name);
32089
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
31650
32090
 
31651
- function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
31652
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
31653
- function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
31654
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
31655
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
31656
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
31657
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
32091
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
32092
+ var intrinsicRealName = intrinsic.name;
32093
+ var value = intrinsic.value;
32094
+ var skipFurtherCaching = false;
31658
32095
 
31659
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
31660
- function isSymbol(obj) {
31661
- if (hasShammedSymbols) {
31662
- return obj && typeof obj === 'object' && obj instanceof Symbol;
31663
- }
31664
- if (typeof obj === 'symbol') {
31665
- return true;
31666
- }
31667
- if (!obj || typeof obj !== 'object' || !symToString) {
31668
- return false;
31669
- }
31670
- try {
31671
- symToString.call(obj);
31672
- return true;
31673
- } catch (e) {}
31674
- return false;
31675
- }
32096
+ var alias = intrinsic.alias;
32097
+ if (alias) {
32098
+ intrinsicBaseName = alias[0];
32099
+ $spliceApply(parts, $concat([0, 1], alias));
32100
+ }
31676
32101
 
31677
- function isBigInt(obj) {
31678
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
31679
- return false;
31680
- }
31681
- try {
31682
- bigIntValueOf.call(obj);
31683
- return true;
31684
- } catch (e) {}
31685
- return false;
31686
- }
32102
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
32103
+ var part = parts[i];
32104
+ var first = $strSlice(part, 0, 1);
32105
+ var last = $strSlice(part, -1);
32106
+ if (
32107
+ (
32108
+ (first === '"' || first === "'" || first === '`')
32109
+ || (last === '"' || last === "'" || last === '`')
32110
+ )
32111
+ && first !== last
32112
+ ) {
32113
+ throw new $SyntaxError('property names with quotes must have matching quotes');
32114
+ }
32115
+ if (part === 'constructor' || !isOwn) {
32116
+ skipFurtherCaching = true;
32117
+ }
31687
32118
 
31688
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
31689
- function has(obj, key) {
31690
- return hasOwn.call(obj, key);
31691
- }
32119
+ intrinsicBaseName += '.' + part;
32120
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
31692
32121
 
31693
- function toStr(obj) {
31694
- return objectToString.call(obj);
31695
- }
32122
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
32123
+ value = INTRINSICS[intrinsicRealName];
32124
+ } else if (value != null) {
32125
+ if (!(part in value)) {
32126
+ if (!allowMissing) {
32127
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
32128
+ }
32129
+ return void 0;
32130
+ }
32131
+ if ($gOPD && (i + 1) >= parts.length) {
32132
+ var desc = $gOPD(value, part);
32133
+ isOwn = !!desc;
31696
32134
 
31697
- function nameOf(f) {
31698
- if (f.name) { return f.name; }
31699
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
31700
- if (m) { return m[1]; }
31701
- return null;
31702
- }
32135
+ // By convention, when a data property is converted to an accessor
32136
+ // property to emulate a data property that does not suffer from
32137
+ // the override mistake, that accessor's getter is marked with
32138
+ // an `originalValue` property. Here, when we detect this, we
32139
+ // uphold the illusion by pretending to see that original data
32140
+ // property, i.e., returning the value rather than the getter
32141
+ // itself.
32142
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
32143
+ value = desc.get;
32144
+ } else {
32145
+ value = value[part];
32146
+ }
32147
+ } else {
32148
+ isOwn = hasOwn(value, part);
32149
+ value = value[part];
32150
+ }
31703
32151
 
31704
- function indexOf(xs, x) {
31705
- if (xs.indexOf) { return xs.indexOf(x); }
31706
- for (var i = 0, l = xs.length; i < l; i++) {
31707
- if (xs[i] === x) { return i; }
31708
- }
31709
- return -1;
31710
- }
32152
+ if (isOwn && !skipFurtherCaching) {
32153
+ INTRINSICS[intrinsicRealName] = value;
32154
+ }
32155
+ }
32156
+ }
32157
+ return value;
32158
+ };
32159
+ return getIntrinsic;
32160
+ }
31711
32161
 
31712
- function isMap(x) {
31713
- if (!mapSize || !x || typeof x !== 'object') {
31714
- return false;
31715
- }
31716
- try {
31717
- mapSize.call(x);
31718
- try {
31719
- setSize.call(x);
31720
- } catch (s) {
31721
- return true;
31722
- }
31723
- return x instanceof Map; // core-js workaround, pre-v2.5.0
31724
- } catch (e) {}
31725
- return false;
31726
- }
32162
+ var callBound;
32163
+ var hasRequiredCallBound;
31727
32164
 
31728
- function isWeakMap(x) {
31729
- if (!weakMapHas || !x || typeof x !== 'object') {
31730
- return false;
31731
- }
31732
- try {
31733
- weakMapHas.call(x, weakMapHas);
31734
- try {
31735
- weakSetHas.call(x, weakSetHas);
31736
- } catch (s) {
31737
- return true;
31738
- }
31739
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
31740
- } catch (e) {}
31741
- return false;
31742
- }
32165
+ function requireCallBound () {
32166
+ if (hasRequiredCallBound) return callBound;
32167
+ hasRequiredCallBound = 1;
31743
32168
 
31744
- function isWeakRef(x) {
31745
- if (!weakRefDeref || !x || typeof x !== 'object') {
31746
- return false;
31747
- }
31748
- try {
31749
- weakRefDeref.call(x);
31750
- return true;
31751
- } catch (e) {}
31752
- return false;
31753
- }
32169
+ var GetIntrinsic = requireGetIntrinsic();
31754
32170
 
31755
- function isSet(x) {
31756
- if (!setSize || !x || typeof x !== 'object') {
31757
- return false;
31758
- }
31759
- try {
31760
- setSize.call(x);
31761
- try {
31762
- mapSize.call(x);
31763
- } catch (m) {
31764
- return true;
31765
- }
31766
- return x instanceof Set; // core-js workaround, pre-v2.5.0
31767
- } catch (e) {}
31768
- return false;
31769
- }
32171
+ var callBindBasic = requireCallBindApplyHelpers();
31770
32172
 
31771
- function isWeakSet(x) {
31772
- if (!weakSetHas || !x || typeof x !== 'object') {
31773
- return false;
31774
- }
31775
- try {
31776
- weakSetHas.call(x, weakSetHas);
31777
- try {
31778
- weakMapHas.call(x, weakMapHas);
31779
- } catch (s) {
31780
- return true;
31781
- }
31782
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
31783
- } catch (e) {}
31784
- return false;
31785
- }
32173
+ /** @type {(thisArg: string, searchString: string, position?: number) => number} */
32174
+ var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
31786
32175
 
31787
- function isElement(x) {
31788
- if (!x || typeof x !== 'object') { return false; }
31789
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
31790
- return true;
31791
- }
31792
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
31793
- }
32176
+ /** @type {import('.')} */
32177
+ callBound = function callBoundIntrinsic(name, allowMissing) {
32178
+ /* eslint no-extra-parens: 0 */
31794
32179
 
31795
- function inspectString(str, opts) {
31796
- if (str.length > opts.maxStringLength) {
31797
- var remaining = str.length - opts.maxStringLength;
31798
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
31799
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
31800
- }
31801
- // eslint-disable-next-line no-control-regex
31802
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
31803
- return wrapQuotes(s, 'single', opts);
31804
- }
32180
+ var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
32181
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
32182
+ return callBindBasic(/** @type {const} */ ([intrinsic]));
32183
+ }
32184
+ return intrinsic;
32185
+ };
32186
+ return callBound;
32187
+ }
31805
32188
 
31806
- function lowbyte(c) {
31807
- var n = c.charCodeAt(0);
31808
- var x = {
31809
- 8: 'b',
31810
- 9: 't',
31811
- 10: 'n',
31812
- 12: 'f',
31813
- 13: 'r'
31814
- }[n];
31815
- if (x) { return '\\' + x; }
31816
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
31817
- }
32189
+ var sideChannelMap;
32190
+ var hasRequiredSideChannelMap;
31818
32191
 
31819
- function markBoxed(str) {
31820
- return 'Object(' + str + ')';
31821
- }
32192
+ function requireSideChannelMap () {
32193
+ if (hasRequiredSideChannelMap) return sideChannelMap;
32194
+ hasRequiredSideChannelMap = 1;
31822
32195
 
31823
- function weakCollectionOf(type) {
31824
- return type + ' { ? }';
31825
- }
32196
+ var GetIntrinsic = requireGetIntrinsic();
32197
+ var callBound = requireCallBound();
32198
+ var inspect = requireObjectInspect();
31826
32199
 
31827
- function collectionOf(type, size, entries, indent) {
31828
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
31829
- return type + ' (' + size + ') {' + joinedEntries + '}';
31830
- }
32200
+ var $TypeError = requireType();
32201
+ var $Map = GetIntrinsic('%Map%', true);
31831
32202
 
31832
- function singleLineValues(xs) {
31833
- for (var i = 0; i < xs.length; i++) {
31834
- if (indexOf(xs[i], '\n') >= 0) {
31835
- return false;
31836
- }
31837
- }
31838
- return true;
31839
- }
32203
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
32204
+ var $mapGet = callBound('Map.prototype.get', true);
32205
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
32206
+ var $mapSet = callBound('Map.prototype.set', true);
32207
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
32208
+ var $mapHas = callBound('Map.prototype.has', true);
32209
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
32210
+ var $mapDelete = callBound('Map.prototype.delete', true);
32211
+ /** @type {<K, V>(thisArg: Map<K, V>) => number} */
32212
+ var $mapSize = callBound('Map.prototype.size', true);
31840
32213
 
31841
- function getIndent(opts, depth) {
31842
- var baseIndent;
31843
- if (opts.indent === '\t') {
31844
- baseIndent = '\t';
31845
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
31846
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
31847
- } else {
31848
- return null;
31849
- }
31850
- return {
31851
- base: baseIndent,
31852
- prev: $join.call(Array(depth + 1), baseIndent)
31853
- };
31854
- }
32214
+ /** @type {import('.')} */
32215
+ sideChannelMap = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
32216
+ /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
32217
+ /** @typedef {Parameters<Channel['get']>[0]} K */
32218
+ /** @typedef {Parameters<Channel['set']>[1]} V */
31855
32219
 
31856
- function indentedJoin(xs, indent) {
31857
- if (xs.length === 0) { return ''; }
31858
- var lineJoiner = '\n' + indent.prev + indent.base;
31859
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
31860
- }
32220
+ /** @type {Map<K, V> | undefined} */ var $m;
31861
32221
 
31862
- function arrObjKeys(obj, inspect) {
31863
- var isArr = isArray(obj);
31864
- var xs = [];
31865
- if (isArr) {
31866
- xs.length = obj.length;
31867
- for (var i = 0; i < obj.length; i++) {
31868
- xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
31869
- }
31870
- }
31871
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
31872
- var symMap;
31873
- if (hasShammedSymbols) {
31874
- symMap = {};
31875
- for (var k = 0; k < syms.length; k++) {
31876
- symMap['$' + syms[k]] = syms[k];
31877
- }
31878
- }
32222
+ /** @type {Channel} */
32223
+ var channel = {
32224
+ assert: function (key) {
32225
+ if (!channel.has(key)) {
32226
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
32227
+ }
32228
+ },
32229
+ 'delete': function (key) {
32230
+ if ($m) {
32231
+ var result = $mapDelete($m, key);
32232
+ if ($mapSize($m) === 0) {
32233
+ $m = void 0;
32234
+ }
32235
+ return result;
32236
+ }
32237
+ return false;
32238
+ },
32239
+ get: function (key) { // eslint-disable-line consistent-return
32240
+ if ($m) {
32241
+ return $mapGet($m, key);
32242
+ }
32243
+ },
32244
+ has: function (key) {
32245
+ if ($m) {
32246
+ return $mapHas($m, key);
32247
+ }
32248
+ return false;
32249
+ },
32250
+ set: function (key, value) {
32251
+ if (!$m) {
32252
+ // @ts-expect-error TS can't handle narrowing a variable inside a closure
32253
+ $m = new $Map();
32254
+ }
32255
+ $mapSet($m, key, value);
32256
+ }
32257
+ };
31879
32258
 
31880
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
31881
- if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
31882
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
31883
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
31884
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
31885
- continue; // eslint-disable-line no-restricted-syntax, no-continue
31886
- } else if ($test.call(/[^\w$]/, key)) {
31887
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
31888
- } else {
31889
- xs.push(key + ': ' + inspect(obj[key], obj));
31890
- }
31891
- }
31892
- if (typeof gOPS === 'function') {
31893
- for (var j = 0; j < syms.length; j++) {
31894
- if (isEnumerable.call(obj, syms[j])) {
31895
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
31896
- }
31897
- }
31898
- }
31899
- return xs;
31900
- }
31901
- return objectInspect;
32259
+ // @ts-expect-error TODO: figure out why TS is erroring here
32260
+ return channel;
32261
+ };
32262
+ return sideChannelMap;
31902
32263
  }
31903
32264
 
31904
- var sideChannel;
31905
- var hasRequiredSideChannel;
32265
+ var sideChannelWeakmap;
32266
+ var hasRequiredSideChannelWeakmap;
31906
32267
 
31907
- function requireSideChannel () {
31908
- if (hasRequiredSideChannel) return sideChannel;
31909
- hasRequiredSideChannel = 1;
32268
+ function requireSideChannelWeakmap () {
32269
+ if (hasRequiredSideChannelWeakmap) return sideChannelWeakmap;
32270
+ hasRequiredSideChannelWeakmap = 1;
31910
32271
 
31911
32272
  var GetIntrinsic = requireGetIntrinsic();
31912
32273
  var callBound = requireCallBound();
31913
32274
  var inspect = requireObjectInspect();
32275
+ var getSideChannelMap = requireSideChannelMap();
31914
32276
 
31915
32277
  var $TypeError = requireType();
31916
32278
  var $WeakMap = GetIntrinsic('%WeakMap%', true);
31917
- var $Map = GetIntrinsic('%Map%', true);
31918
32279
 
32280
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
31919
32281
  var $weakMapGet = callBound('WeakMap.prototype.get', true);
32282
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
31920
32283
  var $weakMapSet = callBound('WeakMap.prototype.set', true);
32284
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
31921
32285
  var $weakMapHas = callBound('WeakMap.prototype.has', true);
31922
- var $mapGet = callBound('Map.prototype.get', true);
31923
- var $mapSet = callBound('Map.prototype.set', true);
31924
- var $mapHas = callBound('Map.prototype.has', true);
32286
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
32287
+ var $weakMapDelete = callBound('WeakMap.prototype.delete', true);
31925
32288
 
31926
- /*
31927
- * This function traverses the list returning the node corresponding to the given key.
31928
- *
31929
- * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
31930
- */
31931
- /** @type {import('.').listGetNode} */
31932
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
31933
- /** @type {typeof list | NonNullable<(typeof list)['next']>} */
31934
- var prev = list;
31935
- /** @type {(typeof list)['next']} */
31936
- var curr;
31937
- for (; (curr = prev.next) !== null; prev = curr) {
31938
- if (curr.key === key) {
31939
- prev.next = curr.next;
31940
- // eslint-disable-next-line no-extra-parens
31941
- curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
31942
- list.next = curr; // eslint-disable-line no-param-reassign
31943
- return curr;
31944
- }
31945
- }
31946
- };
32289
+ /** @type {import('.')} */
32290
+ sideChannelWeakmap = $WeakMap
32291
+ ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {
32292
+ /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
32293
+ /** @typedef {Parameters<Channel['get']>[0]} K */
32294
+ /** @typedef {Parameters<Channel['set']>[1]} V */
32295
+
32296
+ /** @type {WeakMap<K & object, V> | undefined} */ var $wm;
32297
+ /** @type {Channel | undefined} */ var $m;
32298
+
32299
+ /** @type {Channel} */
32300
+ var channel = {
32301
+ assert: function (key) {
32302
+ if (!channel.has(key)) {
32303
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
32304
+ }
32305
+ },
32306
+ 'delete': function (key) {
32307
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
32308
+ if ($wm) {
32309
+ return $weakMapDelete($wm, key);
32310
+ }
32311
+ } else if (getSideChannelMap) {
32312
+ if ($m) {
32313
+ return $m['delete'](key);
32314
+ }
32315
+ }
32316
+ return false;
32317
+ },
32318
+ get: function (key) {
32319
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
32320
+ if ($wm) {
32321
+ return $weakMapGet($wm, key);
32322
+ }
32323
+ }
32324
+ return $m && $m.get(key);
32325
+ },
32326
+ has: function (key) {
32327
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
32328
+ if ($wm) {
32329
+ return $weakMapHas($wm, key);
32330
+ }
32331
+ }
32332
+ return !!$m && $m.has(key);
32333
+ },
32334
+ set: function (key, value) {
32335
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
32336
+ if (!$wm) {
32337
+ $wm = new $WeakMap();
32338
+ }
32339
+ $weakMapSet($wm, key, value);
32340
+ } else if (getSideChannelMap) {
32341
+ if (!$m) {
32342
+ $m = getSideChannelMap();
32343
+ }
32344
+ // eslint-disable-next-line no-extra-parens
32345
+ /** @type {NonNullable<typeof $m>} */ ($m).set(key, value);
32346
+ }
32347
+ }
32348
+ };
31947
32349
 
31948
- /** @type {import('.').listGet} */
31949
- var listGet = function (objects, key) {
31950
- var node = listGetNode(objects, key);
31951
- return node && node.value;
31952
- };
31953
- /** @type {import('.').listSet} */
31954
- var listSet = function (objects, key, value) {
31955
- var node = listGetNode(objects, key);
31956
- if (node) {
31957
- node.value = value;
31958
- } else {
31959
- // Prepend the new node to the beginning of the list
31960
- objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
31961
- key: key,
31962
- next: objects.next,
31963
- value: value
31964
- });
32350
+ // @ts-expect-error TODO: figure out why this is erroring
32351
+ return channel;
31965
32352
  }
31966
- };
31967
- /** @type {import('.').listHas} */
31968
- var listHas = function (objects, key) {
31969
- return !!listGetNode(objects, key);
31970
- };
32353
+ : getSideChannelMap;
32354
+ return sideChannelWeakmap;
32355
+ }
32356
+
32357
+ var sideChannel;
32358
+ var hasRequiredSideChannel;
32359
+
32360
+ function requireSideChannel () {
32361
+ if (hasRequiredSideChannel) return sideChannel;
32362
+ hasRequiredSideChannel = 1;
32363
+
32364
+ var $TypeError = requireType();
32365
+ var inspect = requireObjectInspect();
32366
+ var getSideChannelList = requireSideChannelList();
32367
+ var getSideChannelMap = requireSideChannelMap();
32368
+ var getSideChannelWeakMap = requireSideChannelWeakmap();
32369
+
32370
+ var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
31971
32371
 
31972
32372
  /** @type {import('.')} */
31973
32373
  sideChannel = function getSideChannel() {
31974
- /** @type {WeakMap<object, unknown>} */ var $wm;
31975
- /** @type {Map<object, unknown>} */ var $m;
31976
- /** @type {import('.').RootNode<unknown>} */ var $o;
32374
+ /** @typedef {ReturnType<typeof getSideChannel>} Channel */
31977
32375
 
31978
- /** @type {import('.').Channel} */
32376
+ /** @type {Channel | undefined} */ var $channelData;
32377
+
32378
+ /** @type {Channel} */
31979
32379
  var channel = {
31980
32380
  assert: function (key) {
31981
32381
  if (!channel.has(key)) {
31982
32382
  throw new $TypeError('Side channel does not contain ' + inspect(key));
31983
32383
  }
31984
32384
  },
31985
- get: function (key) { // eslint-disable-line consistent-return
31986
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
31987
- if ($wm) {
31988
- return $weakMapGet($wm, key);
31989
- }
31990
- } else if ($Map) {
31991
- if ($m) {
31992
- return $mapGet($m, key);
31993
- }
31994
- } else {
31995
- if ($o) { // eslint-disable-line no-lonely-if
31996
- return listGet($o, key);
31997
- }
31998
- }
32385
+ 'delete': function (key) {
32386
+ return !!$channelData && $channelData['delete'](key);
32387
+ },
32388
+ get: function (key) {
32389
+ return $channelData && $channelData.get(key);
31999
32390
  },
32000
32391
  has: function (key) {
32001
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
32002
- if ($wm) {
32003
- return $weakMapHas($wm, key);
32004
- }
32005
- } else if ($Map) {
32006
- if ($m) {
32007
- return $mapHas($m, key);
32008
- }
32009
- } else {
32010
- if ($o) { // eslint-disable-line no-lonely-if
32011
- return listHas($o, key);
32012
- }
32013
- }
32014
- return false;
32392
+ return !!$channelData && $channelData.has(key);
32015
32393
  },
32016
32394
  set: function (key, value) {
32017
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
32018
- if (!$wm) {
32019
- $wm = new $WeakMap();
32020
- }
32021
- $weakMapSet($wm, key, value);
32022
- } else if ($Map) {
32023
- if (!$m) {
32024
- $m = new $Map();
32025
- }
32026
- $mapSet($m, key, value);
32027
- } else {
32028
- if (!$o) {
32029
- // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
32030
- $o = { key: {}, next: null };
32031
- }
32032
- listSet($o, key, value);
32395
+ if (!$channelData) {
32396
+ $channelData = makeChannel();
32033
32397
  }
32398
+
32399
+ $channelData.set(key, value);
32034
32400
  }
32035
32401
  };
32402
+ // @ts-expect-error TODO: figure out why this is erroring
32036
32403
  return channel;
32037
32404
  };
32038
32405
  return sideChannel;
@@ -32198,6 +32565,10 @@ function requireUtils () {
32198
32565
  }
32199
32566
  };
32200
32567
 
32568
+ var limit = 1024;
32569
+
32570
+ /* eslint operator-linebreak: [2, "before"] */
32571
+
32201
32572
  var encode = function encode(str, defaultEncoder, charset, kind, format) {
32202
32573
  // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
32203
32574
  // It has been adapted here for stricter adherence to RFC 3986
@@ -32219,45 +32590,54 @@ function requireUtils () {
32219
32590
  }
32220
32591
 
32221
32592
  var out = '';
32222
- for (var i = 0; i < string.length; ++i) {
32223
- var c = string.charCodeAt(i);
32224
-
32225
- if (
32226
- c === 0x2D // -
32227
- || c === 0x2E // .
32228
- || c === 0x5F // _
32229
- || c === 0x7E // ~
32230
- || (c >= 0x30 && c <= 0x39) // 0-9
32231
- || (c >= 0x41 && c <= 0x5A) // a-z
32232
- || (c >= 0x61 && c <= 0x7A) // A-Z
32233
- || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
32234
- ) {
32235
- out += string.charAt(i);
32236
- continue;
32237
- }
32593
+ for (var j = 0; j < string.length; j += limit) {
32594
+ var segment = string.length >= limit ? string.slice(j, j + limit) : string;
32595
+ var arr = [];
32596
+
32597
+ for (var i = 0; i < segment.length; ++i) {
32598
+ var c = segment.charCodeAt(i);
32599
+ if (
32600
+ c === 0x2D // -
32601
+ || c === 0x2E // .
32602
+ || c === 0x5F // _
32603
+ || c === 0x7E // ~
32604
+ || (c >= 0x30 && c <= 0x39) // 0-9
32605
+ || (c >= 0x41 && c <= 0x5A) // a-z
32606
+ || (c >= 0x61 && c <= 0x7A) // A-Z
32607
+ || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
32608
+ ) {
32609
+ arr[arr.length] = segment.charAt(i);
32610
+ continue;
32611
+ }
32238
32612
 
32239
- if (c < 0x80) {
32240
- out = out + hexTable[c];
32241
- continue;
32242
- }
32613
+ if (c < 0x80) {
32614
+ arr[arr.length] = hexTable[c];
32615
+ continue;
32616
+ }
32243
32617
 
32244
- if (c < 0x800) {
32245
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
32246
- continue;
32247
- }
32618
+ if (c < 0x800) {
32619
+ arr[arr.length] = hexTable[0xC0 | (c >> 6)]
32620
+ + hexTable[0x80 | (c & 0x3F)];
32621
+ continue;
32622
+ }
32248
32623
 
32249
- if (c < 0xD800 || c >= 0xE000) {
32250
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
32251
- continue;
32624
+ if (c < 0xD800 || c >= 0xE000) {
32625
+ arr[arr.length] = hexTable[0xE0 | (c >> 12)]
32626
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
32627
+ + hexTable[0x80 | (c & 0x3F)];
32628
+ continue;
32629
+ }
32630
+
32631
+ i += 1;
32632
+ c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
32633
+
32634
+ arr[arr.length] = hexTable[0xF0 | (c >> 18)]
32635
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
32636
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
32637
+ + hexTable[0x80 | (c & 0x3F)];
32252
32638
  }
32253
32639
 
32254
- i += 1;
32255
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
32256
- /* eslint operator-linebreak: [2, "before"] */
32257
- out += hexTable[0xF0 | (c >> 18)]
32258
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
32259
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
32260
- + hexTable[0x80 | (c & 0x3F)];
32640
+ out += arr.join('');
32261
32641
  }
32262
32642
 
32263
32643
  return out;
@@ -32355,7 +32735,6 @@ function requireStringify () {
32355
32735
  };
32356
32736
 
32357
32737
  var isArray = Array.isArray;
32358
- var split = String.prototype.split;
32359
32738
  var push = Array.prototype.push;
32360
32739
  var pushToArray = function (arr, valueOrArray) {
32361
32740
  push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
@@ -32367,10 +32746,13 @@ function requireStringify () {
32367
32746
  var defaults = {
32368
32747
  addQueryPrefix: false,
32369
32748
  allowDots: false,
32749
+ allowEmptyArrays: false,
32750
+ arrayFormat: 'indices',
32370
32751
  charset: 'utf-8',
32371
32752
  charsetSentinel: false,
32372
32753
  delimiter: '&',
32373
32754
  encode: true,
32755
+ encodeDotInKeys: false,
32374
32756
  encoder: utils.encode,
32375
32757
  encodeValuesOnly: false,
32376
32758
  format: defaultFormat,
@@ -32399,8 +32781,10 @@ function requireStringify () {
32399
32781
  prefix,
32400
32782
  generateArrayPrefix,
32401
32783
  commaRoundTrip,
32784
+ allowEmptyArrays,
32402
32785
  strictNullHandling,
32403
32786
  skipNulls,
32787
+ encodeDotInKeys,
32404
32788
  encoder,
32405
32789
  filter,
32406
32790
  sort,
@@ -32417,7 +32801,7 @@ function requireStringify () {
32417
32801
  var tmpSc = sideChannel;
32418
32802
  var step = 0;
32419
32803
  var findFlag = false;
32420
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
32804
+ while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
32421
32805
  // Where object last appeared in the ref tree
32422
32806
  var pos = tmpSc.get(object);
32423
32807
  step += 1;
@@ -32457,14 +32841,6 @@ function requireStringify () {
32457
32841
  if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
32458
32842
  if (encoder) {
32459
32843
  var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
32460
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
32461
- var valuesArray = split.call(String(obj), ',');
32462
- var valuesJoined = '';
32463
- for (var i = 0; i < valuesArray.length; ++i) {
32464
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
32465
- }
32466
- return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
32467
- }
32468
32844
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
32469
32845
  }
32470
32846
  return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -32479,7 +32855,10 @@ function requireStringify () {
32479
32855
  var objKeys;
32480
32856
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
32481
32857
  // we need to join elements in
32482
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
32858
+ if (encodeValuesOnly && encoder) {
32859
+ obj = utils.maybeMap(obj, encoder);
32860
+ }
32861
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void 0 }];
32483
32862
  } else if (isArray(filter)) {
32484
32863
  objKeys = filter;
32485
32864
  } else {
@@ -32487,7 +32866,13 @@ function requireStringify () {
32487
32866
  objKeys = sort ? keys.sort(sort) : keys;
32488
32867
  }
32489
32868
 
32490
- var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
32869
+ var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
32870
+
32871
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
32872
+
32873
+ if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
32874
+ return adjustedPrefix + '[]';
32875
+ }
32491
32876
 
32492
32877
  for (var j = 0; j < objKeys.length; ++j) {
32493
32878
  var key = objKeys[j];
@@ -32497,9 +32882,10 @@ function requireStringify () {
32497
32882
  continue;
32498
32883
  }
32499
32884
 
32885
+ var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
32500
32886
  var keyPrefix = isArray(obj)
32501
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
32502
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
32887
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
32888
+ : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
32503
32889
 
32504
32890
  sideChannel.set(object, step);
32505
32891
  var valueSideChannel = getSideChannel();
@@ -32509,9 +32895,11 @@ function requireStringify () {
32509
32895
  keyPrefix,
32510
32896
  generateArrayPrefix,
32511
32897
  commaRoundTrip,
32898
+ allowEmptyArrays,
32512
32899
  strictNullHandling,
32513
32900
  skipNulls,
32514
- encoder,
32901
+ encodeDotInKeys,
32902
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
32515
32903
  filter,
32516
32904
  sort,
32517
32905
  allowDots,
@@ -32532,6 +32920,14 @@ function requireStringify () {
32532
32920
  return defaults;
32533
32921
  }
32534
32922
 
32923
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
32924
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
32925
+ }
32926
+
32927
+ if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
32928
+ throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
32929
+ }
32930
+
32535
32931
  if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
32536
32932
  throw new TypeError('Encoder has to be a function.');
32537
32933
  }
@@ -32555,13 +32951,32 @@ function requireStringify () {
32555
32951
  filter = opts.filter;
32556
32952
  }
32557
32953
 
32954
+ var arrayFormat;
32955
+ if (opts.arrayFormat in arrayPrefixGenerators) {
32956
+ arrayFormat = opts.arrayFormat;
32957
+ } else if ('indices' in opts) {
32958
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
32959
+ } else {
32960
+ arrayFormat = defaults.arrayFormat;
32961
+ }
32962
+
32963
+ if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
32964
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
32965
+ }
32966
+
32967
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
32968
+
32558
32969
  return {
32559
32970
  addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
32560
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
32971
+ allowDots: allowDots,
32972
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
32973
+ arrayFormat: arrayFormat,
32561
32974
  charset: charset,
32562
32975
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
32976
+ commaRoundTrip: opts.commaRoundTrip,
32563
32977
  delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
32564
32978
  encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
32979
+ encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
32565
32980
  encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
32566
32981
  encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
32567
32982
  filter: filter,
@@ -32595,20 +33010,8 @@ function requireStringify () {
32595
33010
  return '';
32596
33011
  }
32597
33012
 
32598
- var arrayFormat;
32599
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
32600
- arrayFormat = opts.arrayFormat;
32601
- } else if (opts && 'indices' in opts) {
32602
- arrayFormat = opts.indices ? 'indices' : 'repeat';
32603
- } else {
32604
- arrayFormat = 'indices';
32605
- }
32606
-
32607
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
32608
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
32609
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
32610
- }
32611
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
33013
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
33014
+ var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
32612
33015
 
32613
33016
  if (!objKeys) {
32614
33017
  objKeys = Object.keys(obj);
@@ -32630,8 +33033,10 @@ function requireStringify () {
32630
33033
  key,
32631
33034
  generateArrayPrefix,
32632
33035
  commaRoundTrip,
33036
+ options.allowEmptyArrays,
32633
33037
  options.strictNullHandling,
32634
33038
  options.skipNulls,
33039
+ options.encodeDotInKeys,
32635
33040
  options.encode ? options.encoder : null,
32636
33041
  options.filter,
32637
33042
  options.sort,
@@ -32677,20 +33082,24 @@ function requireParse () {
32677
33082
 
32678
33083
  var defaults = {
32679
33084
  allowDots: false,
33085
+ allowEmptyArrays: false,
32680
33086
  allowPrototypes: false,
32681
33087
  allowSparse: false,
32682
33088
  arrayLimit: 20,
32683
33089
  charset: 'utf-8',
32684
33090
  charsetSentinel: false,
32685
33091
  comma: false,
33092
+ decodeDotInKeys: false,
32686
33093
  decoder: utils.decode,
32687
33094
  delimiter: '&',
32688
33095
  depth: 5,
33096
+ duplicates: 'combine',
32689
33097
  ignoreQueryPrefix: false,
32690
33098
  interpretNumericEntities: false,
32691
33099
  parameterLimit: 1000,
32692
33100
  parseArrays: true,
32693
33101
  plainObjects: false,
33102
+ strictDepth: false,
32694
33103
  strictNullHandling: false
32695
33104
  };
32696
33105
 
@@ -32719,8 +33128,10 @@ function requireParse () {
32719
33128
  var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
32720
33129
 
32721
33130
  var parseValues = function parseQueryStringValues(str, options) {
32722
- var obj = {};
33131
+ var obj = { __proto__: null };
33132
+
32723
33133
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
33134
+ cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
32724
33135
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
32725
33136
  var parts = cleanStr.split(options.delimiter, limit);
32726
33137
  var skipIndex = -1; // Keep track of where the utf8 sentinel was found
@@ -32772,9 +33183,10 @@ function requireParse () {
32772
33183
  val = isArray(val) ? [val] : val;
32773
33184
  }
32774
33185
 
32775
- if (has.call(obj, key)) {
33186
+ var existing = has.call(obj, key);
33187
+ if (existing && options.duplicates === 'combine') {
32776
33188
  obj[key] = utils.combine(obj[key], val);
32777
- } else {
33189
+ } else if (!existing || options.duplicates === 'last') {
32778
33190
  obj[key] = val;
32779
33191
  }
32780
33192
  }
@@ -32790,24 +33202,27 @@ function requireParse () {
32790
33202
  var root = chain[i];
32791
33203
 
32792
33204
  if (root === '[]' && options.parseArrays) {
32793
- obj = [].concat(leaf);
33205
+ obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
33206
+ ? []
33207
+ : [].concat(leaf);
32794
33208
  } else {
32795
33209
  obj = options.plainObjects ? Object.create(null) : {};
32796
33210
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
32797
- var index = parseInt(cleanRoot, 10);
32798
- if (!options.parseArrays && cleanRoot === '') {
33211
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
33212
+ var index = parseInt(decodedRoot, 10);
33213
+ if (!options.parseArrays && decodedRoot === '') {
32799
33214
  obj = { 0: leaf };
32800
33215
  } else if (
32801
33216
  !isNaN(index)
32802
- && root !== cleanRoot
32803
- && String(index) === cleanRoot
33217
+ && root !== decodedRoot
33218
+ && String(index) === decodedRoot
32804
33219
  && index >= 0
32805
33220
  && (options.parseArrays && index <= options.arrayLimit)
32806
33221
  ) {
32807
33222
  obj = [];
32808
33223
  obj[index] = leaf;
32809
- } else if (cleanRoot !== '__proto__') {
32810
- obj[cleanRoot] = leaf;
33224
+ } else if (decodedRoot !== '__proto__') {
33225
+ obj[decodedRoot] = leaf;
32811
33226
  }
32812
33227
  }
32813
33228
 
@@ -32862,9 +33277,12 @@ function requireParse () {
32862
33277
  keys.push(segment[1]);
32863
33278
  }
32864
33279
 
32865
- // If there's a remainder, just add whatever is left
33280
+ // If there's a remainder, check strictDepth option for throw, else just add whatever is left
32866
33281
 
32867
33282
  if (segment) {
33283
+ if (options.strictDepth === true) {
33284
+ throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
33285
+ }
32868
33286
  keys.push('[' + key.slice(segment.index) + ']');
32869
33287
  }
32870
33288
 
@@ -32876,7 +33294,15 @@ function requireParse () {
32876
33294
  return defaults;
32877
33295
  }
32878
33296
 
32879
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
33297
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
33298
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
33299
+ }
33300
+
33301
+ if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
33302
+ throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
33303
+ }
33304
+
33305
+ if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
32880
33306
  throw new TypeError('Decoder has to be a function.');
32881
33307
  }
32882
33308
 
@@ -32885,23 +33311,35 @@ function requireParse () {
32885
33311
  }
32886
33312
  var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
32887
33313
 
33314
+ var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
33315
+
33316
+ if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
33317
+ throw new TypeError('The duplicates option must be either combine, first, or last');
33318
+ }
33319
+
33320
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
33321
+
32888
33322
  return {
32889
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
33323
+ allowDots: allowDots,
33324
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
32890
33325
  allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
32891
33326
  allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
32892
33327
  arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
32893
33328
  charset: charset,
32894
33329
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
32895
33330
  comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
33331
+ decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
32896
33332
  decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
32897
33333
  delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
32898
33334
  // eslint-disable-next-line no-implicit-coercion, no-extra-parens
32899
33335
  depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
33336
+ duplicates: duplicates,
32900
33337
  ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
32901
33338
  interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
32902
33339
  parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
32903
33340
  parseArrays: opts.parseArrays !== false,
32904
33341
  plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
33342
+ strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
32905
33343
  strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
32906
33344
  };
32907
33345
  };
@@ -33015,6 +33453,9 @@ function requireUrlencoded () {
33015
33453
  : opts.limit;
33016
33454
  var type = opts.type || 'application/x-www-form-urlencoded';
33017
33455
  var verify = opts.verify || false;
33456
+ var depth = typeof opts.depth !== 'number'
33457
+ ? Number(opts.depth || 32)
33458
+ : opts.depth;
33018
33459
 
33019
33460
  if (verify !== false && typeof verify !== 'function') {
33020
33461
  throw new TypeError('option verify must be function')
@@ -33078,7 +33519,8 @@ function requireUrlencoded () {
33078
33519
  encoding: charset,
33079
33520
  inflate: inflate,
33080
33521
  limit: limit,
33081
- verify: verify
33522
+ verify: verify,
33523
+ depth: depth
33082
33524
  });
33083
33525
  }
33084
33526
  }
@@ -33093,12 +33535,20 @@ function requireUrlencoded () {
33093
33535
  var parameterLimit = options.parameterLimit !== undefined
33094
33536
  ? options.parameterLimit
33095
33537
  : 1000;
33538
+
33539
+ var depth = typeof options.depth !== 'number'
33540
+ ? Number(options.depth || 32)
33541
+ : options.depth;
33096
33542
  var parse = parser('qs');
33097
33543
 
33098
33544
  if (isNaN(parameterLimit) || parameterLimit < 1) {
33099
33545
  throw new TypeError('option parameterLimit must be a positive number')
33100
33546
  }
33101
33547
 
33548
+ if (isNaN(depth) || depth < 0) {
33549
+ throw new TypeError('option depth must be a zero or a positive number')
33550
+ }
33551
+
33102
33552
  if (isFinite(parameterLimit)) {
33103
33553
  parameterLimit = parameterLimit | 0;
33104
33554
  }
@@ -33116,12 +33566,23 @@ function requireUrlencoded () {
33116
33566
  var arrayLimit = Math.max(100, paramCount);
33117
33567
 
33118
33568
  debug('parse extended urlencoding');
33119
- return parse(body, {
33120
- allowPrototypes: true,
33121
- arrayLimit: arrayLimit,
33122
- depth: Infinity,
33123
- parameterLimit: parameterLimit
33124
- })
33569
+ try {
33570
+ return parse(body, {
33571
+ allowPrototypes: true,
33572
+ arrayLimit: arrayLimit,
33573
+ depth: depth,
33574
+ strictDepth: true,
33575
+ parameterLimit: parameterLimit
33576
+ })
33577
+ } catch (err) {
33578
+ if (err instanceof RangeError) {
33579
+ throw createError(400, 'The input exceeded the depth', {
33580
+ type: 'querystring.parse.rangeError'
33581
+ })
33582
+ } else {
33583
+ throw err
33584
+ }
33585
+ }
33125
33586
  }
33126
33587
  }
33127
33588