msw 0.0.0-fetch.rc-17 → 0.0.0-fetch.rc-19

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/lib/iife/index.js CHANGED
@@ -21,13 +21,6 @@ var MockServiceWorker = (() => {
21
21
  return a;
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
25
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
26
- }) : x)(function(x) {
27
- if (typeof require !== "undefined")
28
- return require.apply(this, arguments);
29
- throw new Error('Dynamic require of "' + x + '" is not supported');
30
- });
31
24
  var __objRest = (source, exclude) => {
32
25
  var target = {};
33
26
  for (var prop in source)
@@ -57,6 +50,28 @@ var MockServiceWorker = (() => {
57
50
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
58
51
  return value;
59
52
  };
53
+ var __accessCheck = (obj, member, msg) => {
54
+ if (!member.has(obj))
55
+ throw TypeError("Cannot " + msg);
56
+ };
57
+ var __privateGet = (obj, member, getter) => {
58
+ __accessCheck(obj, member, "read from private field");
59
+ return getter ? getter.call(obj) : member.get(obj);
60
+ };
61
+ var __privateAdd = (obj, member, value) => {
62
+ if (member.has(obj))
63
+ throw TypeError("Cannot add the same private member more than once");
64
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
65
+ };
66
+ var __privateSet = (obj, member, value, setter) => {
67
+ __accessCheck(obj, member, "write to private field");
68
+ setter ? setter.call(obj, value) : member.set(obj, value);
69
+ return value;
70
+ };
71
+ var __privateMethod = (obj, member, method) => {
72
+ __accessCheck(obj, member, "access private method");
73
+ return method;
74
+ };
60
75
  var __async = (__this, __arguments, generator) => {
61
76
  return new Promise((resolve, reject) => {
62
77
  var fulfilled = (value) => {
@@ -88,7 +103,6 @@ var MockServiceWorker = (() => {
88
103
  MAX_SERVER_RESPONSE_TIME: () => MAX_SERVER_RESPONSE_TIME,
89
104
  MIN_SERVER_RESPONSE_TIME: () => MIN_SERVER_RESPONSE_TIME,
90
105
  NODE_SERVER_RESPONSE_TIME: () => NODE_SERVER_RESPONSE_TIME,
91
- NetworkError: () => NetworkError,
92
106
  RequestHandler: () => RequestHandler,
93
107
  SET_TIMEOUT_MAX_ALLOWED_INT: () => SET_TIMEOUT_MAX_ALLOWED_INT,
94
108
  SetupApi: () => SetupApi,
@@ -621,7 +635,195 @@ var MockServiceWorker = (() => {
621
635
  return [now.getHours(), now.getMinutes(), now.getSeconds()].map(String).map((chunk) => chunk.slice(0, 2)).map((chunk) => chunk.padStart(2, "0")).join(":");
622
636
  }
623
637
 
624
- // node_modules/.pnpm/headers-polyfill@3.1.2/node_modules/headers-polyfill/lib/index.mjs
638
+ // node_modules/.pnpm/headers-polyfill@3.2.3/node_modules/headers-polyfill/lib/index.mjs
639
+ var __create = Object.create;
640
+ var __defProp2 = Object.defineProperty;
641
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
642
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
643
+ var __getProtoOf = Object.getPrototypeOf;
644
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
645
+ var __commonJS = (cb, mod) => function __require() {
646
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
647
+ };
648
+ var __copyProps2 = (to, from, except, desc) => {
649
+ if (from && typeof from === "object" || typeof from === "function") {
650
+ for (let key of __getOwnPropNames2(from))
651
+ if (!__hasOwnProp2.call(to, key) && key !== except)
652
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
653
+ }
654
+ return to;
655
+ };
656
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
657
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
658
+ mod
659
+ ));
660
+ var require_set_cookie = __commonJS({
661
+ "node_modules/set-cookie-parser/lib/set-cookie.js"(exports, module) {
662
+ "use strict";
663
+ var defaultParseOptions = {
664
+ decodeValues: true,
665
+ map: false,
666
+ silent: false
667
+ };
668
+ function isNonEmptyString(str) {
669
+ return typeof str === "string" && !!str.trim();
670
+ }
671
+ function parseString(setCookieValue, options) {
672
+ var parts = setCookieValue.split(";").filter(isNonEmptyString);
673
+ var nameValuePairStr = parts.shift();
674
+ var parsed = parseNameValuePair(nameValuePairStr);
675
+ var name = parsed.name;
676
+ var value = parsed.value;
677
+ options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
678
+ try {
679
+ value = options.decodeValues ? decodeURIComponent(value) : value;
680
+ } catch (e) {
681
+ console.error(
682
+ "set-cookie-parser encountered an error while decoding a cookie with value '" + value + "'. Set options.decodeValues to false to disable this feature.",
683
+ e
684
+ );
685
+ }
686
+ var cookie = {
687
+ name,
688
+ value
689
+ };
690
+ parts.forEach(function(part) {
691
+ var sides = part.split("=");
692
+ var key = sides.shift().trimLeft().toLowerCase();
693
+ var value2 = sides.join("=");
694
+ if (key === "expires") {
695
+ cookie.expires = new Date(value2);
696
+ } else if (key === "max-age") {
697
+ cookie.maxAge = parseInt(value2, 10);
698
+ } else if (key === "secure") {
699
+ cookie.secure = true;
700
+ } else if (key === "httponly") {
701
+ cookie.httpOnly = true;
702
+ } else if (key === "samesite") {
703
+ cookie.sameSite = value2;
704
+ } else {
705
+ cookie[key] = value2;
706
+ }
707
+ });
708
+ return cookie;
709
+ }
710
+ function parseNameValuePair(nameValuePairStr) {
711
+ var name = "";
712
+ var value = "";
713
+ var nameValueArr = nameValuePairStr.split("=");
714
+ if (nameValueArr.length > 1) {
715
+ name = nameValueArr.shift();
716
+ value = nameValueArr.join("=");
717
+ } else {
718
+ value = nameValuePairStr;
719
+ }
720
+ return { name, value };
721
+ }
722
+ function parse3(input, options) {
723
+ options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
724
+ if (!input) {
725
+ if (!options.map) {
726
+ return [];
727
+ } else {
728
+ return {};
729
+ }
730
+ }
731
+ if (input.headers) {
732
+ if (typeof input.headers.getSetCookie === "function") {
733
+ input = input.headers.getSetCookie();
734
+ } else if (input.headers["set-cookie"]) {
735
+ input = input.headers["set-cookie"];
736
+ } else {
737
+ var sch = input.headers[Object.keys(input.headers).find(function(key) {
738
+ return key.toLowerCase() === "set-cookie";
739
+ })];
740
+ if (!sch && input.headers.cookie && !options.silent) {
741
+ console.warn(
742
+ "Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
743
+ );
744
+ }
745
+ input = sch;
746
+ }
747
+ }
748
+ if (!Array.isArray(input)) {
749
+ input = [input];
750
+ }
751
+ options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
752
+ if (!options.map) {
753
+ return input.filter(isNonEmptyString).map(function(str) {
754
+ return parseString(str, options);
755
+ });
756
+ } else {
757
+ var cookies = {};
758
+ return input.filter(isNonEmptyString).reduce(function(cookies2, str) {
759
+ var cookie = parseString(str, options);
760
+ cookies2[cookie.name] = cookie;
761
+ return cookies2;
762
+ }, cookies);
763
+ }
764
+ }
765
+ function splitCookiesString2(cookiesString) {
766
+ if (Array.isArray(cookiesString)) {
767
+ return cookiesString;
768
+ }
769
+ if (typeof cookiesString !== "string") {
770
+ return [];
771
+ }
772
+ var cookiesStrings = [];
773
+ var pos = 0;
774
+ var start;
775
+ var ch;
776
+ var lastComma;
777
+ var nextStart;
778
+ var cookiesSeparatorFound;
779
+ function skipWhitespace() {
780
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
781
+ pos += 1;
782
+ }
783
+ return pos < cookiesString.length;
784
+ }
785
+ function notSpecialChar() {
786
+ ch = cookiesString.charAt(pos);
787
+ return ch !== "=" && ch !== ";" && ch !== ",";
788
+ }
789
+ while (pos < cookiesString.length) {
790
+ start = pos;
791
+ cookiesSeparatorFound = false;
792
+ while (skipWhitespace()) {
793
+ ch = cookiesString.charAt(pos);
794
+ if (ch === ",") {
795
+ lastComma = pos;
796
+ pos += 1;
797
+ skipWhitespace();
798
+ nextStart = pos;
799
+ while (pos < cookiesString.length && notSpecialChar()) {
800
+ pos += 1;
801
+ }
802
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
803
+ cookiesSeparatorFound = true;
804
+ pos = nextStart;
805
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
806
+ start = pos;
807
+ } else {
808
+ pos = lastComma + 1;
809
+ }
810
+ } else {
811
+ pos += 1;
812
+ }
813
+ }
814
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
815
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
816
+ }
817
+ }
818
+ return cookiesStrings;
819
+ }
820
+ module.exports = parse3;
821
+ module.exports.parse = parse3;
822
+ module.exports.parseString = parseString;
823
+ module.exports.splitCookiesString = splitCookiesString2;
824
+ }
825
+ });
826
+ var import_set_cookie_parser = __toESM(require_set_cookie());
625
827
  var HEADERS_INVALID_CHARACTERS = /[^a-z0-9\-#$%&'*+.^_`|~]/i;
626
828
  function normalizeHeaderName(name) {
627
829
  if (typeof name !== "string") {
@@ -640,6 +842,7 @@ var MockServiceWorker = (() => {
640
842
  }
641
843
  var NORMALIZED_HEADERS = Symbol("normalizedHeaders");
642
844
  var RAW_HEADER_NAMES = Symbol("rawHeaderNames");
845
+ var HEADER_VALUE_DELIMITER = ", ";
643
846
  var _a;
644
847
  var _b;
645
848
  var HeadersPolyfill = class {
@@ -653,12 +856,18 @@ var MockServiceWorker = (() => {
653
856
  }, this);
654
857
  } else if (Array.isArray(init)) {
655
858
  init.forEach(([name, value]) => {
656
- this.append(name, Array.isArray(value) ? value.join(", ") : value);
859
+ this.append(
860
+ name,
861
+ Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value
862
+ );
657
863
  });
658
864
  } else if (init) {
659
865
  Object.getOwnPropertyNames(init).forEach((name) => {
660
866
  const value = init[name];
661
- this.append(name, Array.isArray(value) ? value.join(", ") : value);
867
+ this.append(
868
+ name,
869
+ Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value
870
+ );
662
871
  });
663
872
  }
664
873
  }
@@ -681,7 +890,8 @@ var MockServiceWorker = (() => {
681
890
  }
682
891
  }
683
892
  get(name) {
684
- return this[NORMALIZED_HEADERS][normalizeHeaderName(name)] || null;
893
+ var _a3;
894
+ return (_a3 = this[NORMALIZED_HEADERS][normalizeHeaderName(name)]) != null ? _a3 : null;
685
895
  }
686
896
  set(name, value) {
687
897
  const normalizedName = normalizeHeaderName(name);
@@ -721,23 +931,17 @@ var MockServiceWorker = (() => {
721
931
  }
722
932
  }
723
933
  }
934
+ getSetCookie() {
935
+ const setCookieHeader = this.get("set-cookie");
936
+ if (setCookieHeader === null) {
937
+ return [];
938
+ }
939
+ if (setCookieHeader === "") {
940
+ return [""];
941
+ }
942
+ return (0, import_set_cookie_parser.splitCookiesString)(setCookieHeader);
943
+ }
724
944
  };
725
- function headersToList(headers) {
726
- const headersList = [];
727
- headers.forEach((value, name) => {
728
- const resolvedValue = value.includes(",") ? value.split(",").map((value2) => value2.trim()) : value;
729
- headersList.push([name, resolvedValue]);
730
- });
731
- return headersList;
732
- }
733
- function headersToString(headers) {
734
- const list = headersToList(headers);
735
- const lines = list.map(([name, value]) => {
736
- const values = [].concat(value);
737
- return `${name}: ${values.join(", ")}`;
738
- });
739
- return lines.join("\r\n");
740
- }
741
945
  var singleValueHeaders = ["user-agent"];
742
946
  function headersToObject(headers) {
743
947
  const headersObject = {};
@@ -791,32 +995,32 @@ var MockServiceWorker = (() => {
791
995
  }
792
996
 
793
997
  // node_modules/.pnpm/@bundled-es-modules+statuses@1.0.1/node_modules/@bundled-es-modules/statuses/index-esm.js
794
- var __create = Object.create;
795
- var __defProp2 = Object.defineProperty;
796
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
797
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
798
- var __getProtoOf = Object.getPrototypeOf;
799
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
800
- var __commonJS = (cb, mod) => function __require3() {
801
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
998
+ var __create2 = Object.create;
999
+ var __defProp3 = Object.defineProperty;
1000
+ var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1001
+ var __getOwnPropNames3 = Object.getOwnPropertyNames;
1002
+ var __getProtoOf2 = Object.getPrototypeOf;
1003
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1004
+ var __commonJS2 = (cb, mod) => function __require() {
1005
+ return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
802
1006
  };
803
- var __copyProps2 = (to, from, except, desc) => {
1007
+ var __copyProps3 = (to, from, except, desc) => {
804
1008
  if (from && typeof from === "object" || typeof from === "function") {
805
- for (let key of __getOwnPropNames2(from))
806
- if (!__hasOwnProp2.call(to, key) && key !== except)
807
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1009
+ for (let key of __getOwnPropNames3(from))
1010
+ if (!__hasOwnProp3.call(to, key) && key !== except)
1011
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
808
1012
  }
809
1013
  return to;
810
1014
  };
811
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
1015
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps3(
812
1016
  // If the importer is in node compatibility mode or this is not an ESM
813
1017
  // file that has been converted to a CommonJS file using a Babel-
814
1018
  // compatible transform (i.e. "__esModule" has not been set), then set
815
1019
  // "default" to the CommonJS "module.exports" for node compatibility.
816
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
1020
+ isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
817
1021
  mod
818
1022
  ));
819
- var require_codes = __commonJS({
1023
+ var require_codes = __commonJS2({
820
1024
  "node_modules/statuses/codes.json"(exports, module) {
821
1025
  module.exports = {
822
1026
  "100": "Continue",
@@ -885,7 +1089,7 @@ var MockServiceWorker = (() => {
885
1089
  };
886
1090
  }
887
1091
  });
888
- var require_statuses = __commonJS({
1092
+ var require_statuses = __commonJS2({
889
1093
  "node_modules/statuses/index.js"(exports, module) {
890
1094
  "use strict";
891
1095
  var codes = require_codes();
@@ -954,7 +1158,7 @@ var MockServiceWorker = (() => {
954
1158
  }
955
1159
  }
956
1160
  });
957
- var import_statuses = __toESM(require_statuses(), 1);
1161
+ var import_statuses = __toESM2(require_statuses(), 1);
958
1162
  var source_default = import_statuses.default;
959
1163
 
960
1164
  // src/core/utils/logging/serializeResponse.ts
@@ -1063,7 +1267,7 @@ var MockServiceWorker = (() => {
1063
1267
  options = {};
1064
1268
  }
1065
1269
  var tokens = lexer(str);
1066
- var _a2 = options.prefixes, prefixes = _a2 === void 0 ? "./" : _a2;
1270
+ var _a3 = options.prefixes, prefixes = _a3 === void 0 ? "./" : _a3;
1067
1271
  var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?");
1068
1272
  var result = [];
1069
1273
  var key = 0;
@@ -1077,7 +1281,7 @@ var MockServiceWorker = (() => {
1077
1281
  var value2 = tryConsume(type);
1078
1282
  if (value2 !== void 0)
1079
1283
  return value2;
1080
- var _a3 = tokens[i], nextType = _a3.type, index = _a3.index;
1284
+ var _a4 = tokens[i], nextType = _a4.type, index = _a4.index;
1081
1285
  throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type));
1082
1286
  };
1083
1287
  var consumeText = function() {
@@ -1149,9 +1353,9 @@ var MockServiceWorker = (() => {
1149
1353
  if (options === void 0) {
1150
1354
  options = {};
1151
1355
  }
1152
- var _a2 = options.decode, decode = _a2 === void 0 ? function(x) {
1356
+ var _a3 = options.decode, decode = _a3 === void 0 ? function(x) {
1153
1357
  return x;
1154
- } : _a2;
1358
+ } : _a3;
1155
1359
  return function(pathname) {
1156
1360
  var m = re.exec(pathname);
1157
1361
  if (!m)
@@ -1214,7 +1418,7 @@ var MockServiceWorker = (() => {
1214
1418
  if (options === void 0) {
1215
1419
  options = {};
1216
1420
  }
1217
- var _a2 = options.strict, strict = _a2 === void 0 ? false : _a2, _b2 = options.start, start = _b2 === void 0 ? true : _b2, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function(x) {
1421
+ var _a3 = options.strict, strict = _a3 === void 0 ? false : _a3, _b2 = options.start, start = _b2 === void 0 ? true : _b2, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function(x) {
1218
1422
  return x;
1219
1423
  } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f;
1220
1424
  var endsWithRe = "[".concat(escapeString(endsWith), "]|$");
@@ -1289,10 +1493,10 @@ var MockServiceWorker = (() => {
1289
1493
  }
1290
1494
 
1291
1495
  // node_modules/.pnpm/@open-draft+logger@0.3.0/node_modules/@open-draft/logger/lib/index.mjs
1292
- var __defProp3 = Object.defineProperty;
1496
+ var __defProp4 = Object.defineProperty;
1293
1497
  var __export2 = (target, all) => {
1294
1498
  for (var name in all)
1295
- __defProp3(target, name, { get: all[name], enumerable: true });
1499
+ __defProp4(target, name, { get: all[name], enumerable: true });
1296
1500
  };
1297
1501
  var colors_exports = {};
1298
1502
  __export2(colors_exports, {
@@ -1536,11 +1740,11 @@ var MockServiceWorker = (() => {
1536
1740
  console.error(message3, ...positionals);
1537
1741
  }
1538
1742
  function getVariable(variableName) {
1539
- var _a2;
1743
+ var _a3;
1540
1744
  if (IS_NODE) {
1541
1745
  return process.env[variableName];
1542
1746
  }
1543
- return (_a2 = globalThis[variableName]) == null ? void 0 : _a2.toString();
1747
+ return (_a3 = globalThis[variableName]) == null ? void 0 : _a3.toString();
1544
1748
  }
1545
1749
  function isDefinedAndNotEquals(value, expected) {
1546
1750
  return value !== void 0 && value !== expected;
@@ -1561,14 +1765,7 @@ var MockServiceWorker = (() => {
1561
1765
  return message3.toString();
1562
1766
  }
1563
1767
 
1564
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-Y5QA6OEZ.mjs
1565
- var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
1566
- get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
1567
- }) : x)(function(x) {
1568
- if (typeof __require !== "undefined")
1569
- return __require.apply(this, arguments);
1570
- throw new Error('Dynamic require of "' + x + '" is not supported');
1571
- });
1768
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-RGYCLCLK.mjs
1572
1769
  function nextTick(callback) {
1573
1770
  setTimeout(callback, 0);
1574
1771
  }
@@ -1624,6 +1821,11 @@ var MockServiceWorker = (() => {
1624
1821
  });
1625
1822
  return super.emit(eventName, ...data);
1626
1823
  }
1824
+ /**
1825
+ * Returns a promise that resolves when all the listeners for the given event
1826
+ * has been called. Awaits asynchronous listeners.
1827
+ * If the event has no listeners, resolves immediately.
1828
+ */
1627
1829
  untilIdle(eventName, filter = () => true) {
1628
1830
  return __async(this, null, function* () {
1629
1831
  const listenersQueue = this.queue.get(eventName) || [];
@@ -1667,6 +1869,11 @@ var MockServiceWorker = (() => {
1667
1869
  this.readyState = "ACTIVE";
1668
1870
  logger.info("set state to:", this.readyState);
1669
1871
  }
1872
+ /**
1873
+ * Deactivate this event emitter.
1874
+ * Deactivated emitter can no longer emit and listen to events
1875
+ * and needs to be activated again in order to do so.
1876
+ */
1670
1877
  deactivate() {
1671
1878
  const logger = this.logger.extend("deactivate");
1672
1879
  logger.info("removing all listeners...");
@@ -1679,7 +1886,10 @@ var MockServiceWorker = (() => {
1679
1886
  }
1680
1887
  };
1681
1888
  function getGlobalSymbol(symbol) {
1682
- return globalThis[symbol] || void 0;
1889
+ return (
1890
+ // @ts-ignore https://github.com/Microsoft/TypeScript/issues/24587
1891
+ globalThis[symbol] || void 0
1892
+ );
1683
1893
  }
1684
1894
  function setGlobalSymbol(symbol, value) {
1685
1895
  globalThis[symbol] = value;
@@ -1697,9 +1907,17 @@ var MockServiceWorker = (() => {
1697
1907
  this.emitter.setMaxListeners(0);
1698
1908
  this.logger.info("constructing the interceptor...");
1699
1909
  }
1910
+ /**
1911
+ * Determine if this interceptor can be applied
1912
+ * in the current environment.
1913
+ */
1700
1914
  checkEnvironment() {
1701
1915
  return true;
1702
1916
  }
1917
+ /**
1918
+ * Apply this interceptor to the current process.
1919
+ * Returns an already running interceptor instance if it's present.
1920
+ */
1703
1921
  apply() {
1704
1922
  const logger = this.logger.extend("apply");
1705
1923
  logger.info("applying the interceptor...");
@@ -1734,8 +1952,16 @@ var MockServiceWorker = (() => {
1734
1952
  this.setInstance();
1735
1953
  this.readyState = "APPLIED";
1736
1954
  }
1955
+ /**
1956
+ * Setup the module augments and stubs necessary for this interceptor.
1957
+ * This method is not run if there's a running interceptor instance
1958
+ * to prevent instantiating an interceptor multiple times.
1959
+ */
1737
1960
  setup() {
1738
1961
  }
1962
+ /**
1963
+ * Listen to the interceptor's public events.
1964
+ */
1739
1965
  on(eventName, listener) {
1740
1966
  const logger = this.logger.extend("on");
1741
1967
  if (this.readyState === "DISPOSING" || this.readyState === "DISPOSED") {
@@ -1745,6 +1971,9 @@ var MockServiceWorker = (() => {
1745
1971
  logger.info('adding "%s" event listener:', eventName, listener.name);
1746
1972
  this.emitter.on(eventName, listener);
1747
1973
  }
1974
+ /**
1975
+ * Disposes of any side-effects this interceptor has introduced.
1976
+ */
1748
1977
  dispose() {
1749
1978
  const logger = this.logger.extend("dispose");
1750
1979
  if (this.readyState === "DISPOSED") {
@@ -1772,9 +2001,9 @@ var MockServiceWorker = (() => {
1772
2001
  this.readyState = "DISPOSED";
1773
2002
  }
1774
2003
  getInstance() {
1775
- var _a2;
2004
+ var _a3;
1776
2005
  const instance = getGlobalSymbol(this.symbol);
1777
- this.logger.info("retrieved global instance:", (_a2 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a2.name);
2006
+ this.logger.info("retrieved global instance:", (_a3 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a3.name);
1778
2007
  return instance;
1779
2008
  }
1780
2009
  setInstance() {
@@ -1787,7 +2016,7 @@ var MockServiceWorker = (() => {
1787
2016
  }
1788
2017
  };
1789
2018
 
1790
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-NUSH7ACE.mjs
2019
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-VS3GJPUE.mjs
1791
2020
  var BatchInterceptor = class extends Interceptor {
1792
2021
  constructor(options) {
1793
2022
  BatchInterceptor.symbol = Symbol(options.name);
@@ -1811,15 +2040,13 @@ var MockServiceWorker = (() => {
1811
2040
  }
1812
2041
  };
1813
2042
 
1814
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-LTX5IGCQ.mjs
1815
- var TextEncoder = typeof globalThis.TextEncoder === "undefined" ? __require2("util").TextEncoder : globalThis.TextEncoder;
1816
- var TextDecoder = typeof globalThis.TextDecoder === "undefined" ? __require2("util").TextDecoder : globalThis.TextDecoder;
2043
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-7II4SWKS.mjs
1817
2044
  var encoder = new TextEncoder();
1818
2045
 
1819
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-GFH37L5D.mjs
2046
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-GFH37L5D.mjs
1820
2047
  var IS_PATCHED_MODULE = Symbol("isPatchedModule");
1821
2048
 
1822
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/index.mjs
2049
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/index.mjs
1823
2050
  function getCleanUrl(url, isAbsolute = true) {
1824
2051
  return [isAbsolute && url.origin, url.pathname].filter(Boolean).join("");
1825
2052
  }
@@ -1897,32 +2124,32 @@ var MockServiceWorker = (() => {
1897
2124
  }
1898
2125
 
1899
2126
  // node_modules/.pnpm/@bundled-es-modules+cookie@2.0.0/node_modules/@bundled-es-modules/cookie/index-esm.js
1900
- var __create2 = Object.create;
1901
- var __defProp4 = Object.defineProperty;
1902
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1903
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1904
- var __getProtoOf2 = Object.getPrototypeOf;
1905
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1906
- var __commonJS2 = (cb, mod) => function __require3() {
1907
- return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
2127
+ var __create3 = Object.create;
2128
+ var __defProp5 = Object.defineProperty;
2129
+ var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
2130
+ var __getOwnPropNames4 = Object.getOwnPropertyNames;
2131
+ var __getProtoOf3 = Object.getPrototypeOf;
2132
+ var __hasOwnProp4 = Object.prototype.hasOwnProperty;
2133
+ var __commonJS3 = (cb, mod) => function __require() {
2134
+ return mod || (0, cb[__getOwnPropNames4(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1908
2135
  };
1909
- var __copyProps3 = (to, from, except, desc) => {
2136
+ var __copyProps4 = (to, from, except, desc) => {
1910
2137
  if (from && typeof from === "object" || typeof from === "function") {
1911
- for (let key of __getOwnPropNames3(from))
1912
- if (!__hasOwnProp3.call(to, key) && key !== except)
1913
- __defProp4(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
2138
+ for (let key of __getOwnPropNames4(from))
2139
+ if (!__hasOwnProp4.call(to, key) && key !== except)
2140
+ __defProp5(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc4(from, key)) || desc.enumerable });
1914
2141
  }
1915
2142
  return to;
1916
2143
  };
1917
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps3(
2144
+ var __toESM3 = (mod, isNodeMode, target) => (target = mod != null ? __create3(__getProtoOf3(mod)) : {}, __copyProps4(
1918
2145
  // If the importer is in node compatibility mode or this is not an ESM
1919
2146
  // file that has been converted to a CommonJS file using a Babel-
1920
2147
  // compatible transform (i.e. "__esModule" has not been set), then set
1921
2148
  // "default" to the CommonJS "module.exports" for node compatibility.
1922
- isNodeMode || !mod || !mod.__esModule ? __defProp4(target, "default", { value: mod, enumerable: true }) : target,
2149
+ isNodeMode || !mod || !mod.__esModule ? __defProp5(target, "default", { value: mod, enumerable: true }) : target,
1923
2150
  mod
1924
2151
  ));
1925
- var require_cookie = __commonJS2({
2152
+ var require_cookie = __commonJS3({
1926
2153
  "node_modules/cookie/index.js"(exports) {
1927
2154
  "use strict";
1928
2155
  exports.parse = parse3;
@@ -2062,32 +2289,32 @@ var MockServiceWorker = (() => {
2062
2289
  }
2063
2290
  }
2064
2291
  });
2065
- var import_cookie = __toESM2(require_cookie(), 1);
2292
+ var import_cookie = __toESM3(require_cookie(), 1);
2066
2293
  var source_default2 = import_cookie.default;
2067
2294
 
2068
2295
  // node_modules/.pnpm/@mswjs+cookies@1.0.0/node_modules/@mswjs/cookies/lib/index.mjs
2069
- var __create3 = Object.create;
2070
- var __defProp5 = Object.defineProperty;
2071
- var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
2072
- var __getOwnPropNames4 = Object.getOwnPropertyNames;
2073
- var __getProtoOf3 = Object.getPrototypeOf;
2074
- var __hasOwnProp4 = Object.prototype.hasOwnProperty;
2075
- var __commonJS3 = (cb, mod) => function __require3() {
2076
- return mod || (0, cb[__getOwnPropNames4(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
2296
+ var __create4 = Object.create;
2297
+ var __defProp6 = Object.defineProperty;
2298
+ var __getOwnPropDesc5 = Object.getOwnPropertyDescriptor;
2299
+ var __getOwnPropNames5 = Object.getOwnPropertyNames;
2300
+ var __getProtoOf4 = Object.getPrototypeOf;
2301
+ var __hasOwnProp5 = Object.prototype.hasOwnProperty;
2302
+ var __commonJS4 = (cb, mod) => function __require() {
2303
+ return mod || (0, cb[__getOwnPropNames5(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
2077
2304
  };
2078
- var __copyProps4 = (to, from, except, desc) => {
2305
+ var __copyProps5 = (to, from, except, desc) => {
2079
2306
  if (from && typeof from === "object" || typeof from === "function") {
2080
- for (let key of __getOwnPropNames4(from))
2081
- if (!__hasOwnProp4.call(to, key) && key !== except)
2082
- __defProp5(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc4(from, key)) || desc.enumerable });
2307
+ for (let key of __getOwnPropNames5(from))
2308
+ if (!__hasOwnProp5.call(to, key) && key !== except)
2309
+ __defProp6(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc5(from, key)) || desc.enumerable });
2083
2310
  }
2084
2311
  return to;
2085
2312
  };
2086
- var __toESM3 = (mod, isNodeMode, target) => (target = mod != null ? __create3(__getProtoOf3(mod)) : {}, __copyProps4(
2087
- isNodeMode || !mod || !mod.__esModule ? __defProp5(target, "default", { value: mod, enumerable: true }) : target,
2313
+ var __toESM4 = (mod, isNodeMode, target) => (target = mod != null ? __create4(__getProtoOf4(mod)) : {}, __copyProps5(
2314
+ isNodeMode || !mod || !mod.__esModule ? __defProp6(target, "default", { value: mod, enumerable: true }) : target,
2088
2315
  mod
2089
2316
  ));
2090
- var require_set_cookie = __commonJS3({
2317
+ var require_set_cookie2 = __commonJS4({
2091
2318
  "node_modules/set-cookie-parser/lib/set-cookie.js"(exports, module) {
2092
2319
  "use strict";
2093
2320
  var defaultParseOptions = {
@@ -2228,7 +2455,7 @@ var MockServiceWorker = (() => {
2228
2455
  module.exports.splitCookiesString = splitCookiesString;
2229
2456
  }
2230
2457
  });
2231
- var import_set_cookie_parser = __toESM3(require_set_cookie());
2458
+ var import_set_cookie_parser2 = __toESM4(require_set_cookie2());
2232
2459
  var PERSISTENCY_KEY = "MSW_COOKIE_STORE";
2233
2460
  function supportsLocalStorage() {
2234
2461
  try {
@@ -2258,9 +2485,9 @@ var MockServiceWorker = (() => {
2258
2485
  return;
2259
2486
  }
2260
2487
  const now = Date.now();
2261
- const parsedResponseCookies = (0, import_set_cookie_parser.parse)(responseCookies).map(
2262
- (_a2) => {
2263
- var _b2 = _a2, { maxAge } = _b2, cookie = __objRest(_b2, ["maxAge"]);
2488
+ const parsedResponseCookies = (0, import_set_cookie_parser2.parse)(responseCookies).map(
2489
+ (_a3) => {
2490
+ var _b2 = _a3, { maxAge } = _b2, cookie = __objRest(_b2, ["maxAge"]);
2264
2491
  return __spreadProps(__spreadValues({}, cookie), {
2265
2492
  expires: maxAge === void 0 ? cookie.expires : new Date(now + maxAge * 1e3),
2266
2493
  maxAge
@@ -2281,7 +2508,7 @@ var MockServiceWorker = (() => {
2281
2508
  if (typeof document === "undefined") {
2282
2509
  return originCookies;
2283
2510
  }
2284
- const documentCookies = (0, import_set_cookie_parser.parse)(document.cookie);
2511
+ const documentCookies = (0, import_set_cookie_parser2.parse)(document.cookie);
2285
2512
  documentCookies.forEach((cookie) => {
2286
2513
  originCookies.set(cookie.name, cookie);
2287
2514
  });
@@ -2319,8 +2546,8 @@ var MockServiceWorker = (() => {
2319
2546
  this.store.set(
2320
2547
  origin,
2321
2548
  new Map(
2322
- cookies.map((_a2) => {
2323
- var [token, _b2] = _a2, _c = _b2, { expires } = _c, cookie = __objRest(_c, ["expires"]);
2549
+ cookies.map((_a3) => {
2550
+ var [token, _b2] = _a3, _c = _b2, { expires } = _c, cookie = __objRest(_c, ["expires"]);
2324
2551
  return [
2325
2552
  token,
2326
2553
  expires === void 0 ? cookie : __spreadProps(__spreadValues({}, cookie), { expires: new Date(expires) })
@@ -2392,11 +2619,11 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
2392
2619
  }
2393
2620
  }
2394
2621
  function getAllRequestCookies(request) {
2395
- var _a2;
2622
+ var _a3;
2396
2623
  const requestCookiesString = request.headers.get("cookie");
2397
2624
  const cookiesFromHeaders = requestCookiesString ? source_default2.parse(requestCookiesString) : {};
2398
2625
  store.hydrate();
2399
- const cookiesFromStore = Array.from((_a2 = store.get(request)) == null ? void 0 : _a2.entries()).reduce(
2626
+ const cookiesFromStore = Array.from((_a3 = store.get(request)) == null ? void 0 : _a3.entries()).reduce(
2400
2627
  (cookies, [name, { value }]) => {
2401
2628
  return Object.assign(cookies, { [name.trim()]: value });
2402
2629
  },
@@ -2476,9 +2703,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
2476
2703
  return this.info.method instanceof RegExp ? this.info.method.test(actualMethod) : isStringEqual(this.info.method, actualMethod);
2477
2704
  }
2478
2705
  extendInfo(_request, parsedResult) {
2479
- var _a2;
2706
+ var _a3;
2480
2707
  return {
2481
- params: ((_a2 = parsedResult.match) == null ? void 0 : _a2.params) || {},
2708
+ params: ((_a3 = parsedResult.match) == null ? void 0 : _a3.params) || {},
2482
2709
  cookies: parsedResult.cookies
2483
2710
  };
2484
2711
  }
@@ -4991,7 +5218,7 @@ spurious results.`);
4991
5218
 
4992
5219
  // src/core/utils/internal/parseMultipartData.ts
4993
5220
  function parseContentHeaders(headersString) {
4994
- var _a2, _b2;
5221
+ var _a3, _b2;
4995
5222
  const headers = stringToHeaders(headersString);
4996
5223
  const contentType = headers.get("content-type") || "text/plain";
4997
5224
  const disposition = headers.get("content-disposition");
@@ -5003,7 +5230,7 @@ spurious results.`);
5003
5230
  acc[name2] = rest.join("=");
5004
5231
  return acc;
5005
5232
  }, {});
5006
- const name = (_a2 = directives.name) == null ? void 0 : _a2.slice(1, -1);
5233
+ const name = (_a3 = directives.name) == null ? void 0 : _a3.slice(1, -1);
5007
5234
  const filename = (_b2 = directives.filename) == null ? void 0 : _b2.slice(1, -1);
5008
5235
  return {
5009
5236
  name,
@@ -5050,13 +5277,13 @@ spurious results.`);
5050
5277
 
5051
5278
  // src/core/utils/internal/parseGraphQLRequest.ts
5052
5279
  function parseDocumentNode(node) {
5053
- var _a2;
5280
+ var _a3;
5054
5281
  const operationDef = node.definitions.find((definition) => {
5055
5282
  return definition.kind === "OperationDefinition";
5056
5283
  });
5057
5284
  return {
5058
5285
  operationType: operationDef == null ? void 0 : operationDef.operation,
5059
- operationName: (_a2 = operationDef == null ? void 0 : operationDef.name) == null ? void 0 : _a2.value
5286
+ operationName: (_a3 = operationDef == null ? void 0 : operationDef.name) == null ? void 0 : _a3.value
5060
5287
  };
5061
5288
  }
5062
5289
  function parseQuery(query) {
@@ -5090,7 +5317,7 @@ spurious results.`);
5090
5317
  }
5091
5318
  function getGraphQLInput(request) {
5092
5319
  return __async(this, null, function* () {
5093
- var _a2;
5320
+ var _a3;
5094
5321
  switch (request.method) {
5095
5322
  case "GET": {
5096
5323
  const url = new URL(request.url);
@@ -5103,7 +5330,7 @@ spurious results.`);
5103
5330
  }
5104
5331
  case "POST": {
5105
5332
  const requestClone = request.clone();
5106
- if ((_a2 = request.headers.get("content-type")) == null ? void 0 : _a2.includes("multipart/form-data")) {
5333
+ if ((_a3 = request.headers.get("content-type")) == null ? void 0 : _a3.includes("multipart/form-data")) {
5107
5334
  const responseJson = parseMultipartData(
5108
5335
  yield requestClone.text(),
5109
5336
  request.headers
@@ -5346,32 +5573,32 @@ Consider naming this operation or using "graphql.operation()" request handler to
5346
5573
  });
5347
5574
 
5348
5575
  // node_modules/.pnpm/@bundled-es-modules+js-levenshtein@2.0.1/node_modules/@bundled-es-modules/js-levenshtein/index-esm.js
5349
- var __create4 = Object.create;
5350
- var __defProp6 = Object.defineProperty;
5351
- var __getOwnPropDesc5 = Object.getOwnPropertyDescriptor;
5352
- var __getOwnPropNames5 = Object.getOwnPropertyNames;
5353
- var __getProtoOf4 = Object.getPrototypeOf;
5354
- var __hasOwnProp5 = Object.prototype.hasOwnProperty;
5355
- var __commonJS4 = (cb, mod) => function __require3() {
5356
- return mod || (0, cb[__getOwnPropNames5(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5576
+ var __create5 = Object.create;
5577
+ var __defProp7 = Object.defineProperty;
5578
+ var __getOwnPropDesc6 = Object.getOwnPropertyDescriptor;
5579
+ var __getOwnPropNames6 = Object.getOwnPropertyNames;
5580
+ var __getProtoOf5 = Object.getPrototypeOf;
5581
+ var __hasOwnProp6 = Object.prototype.hasOwnProperty;
5582
+ var __commonJS5 = (cb, mod) => function __require() {
5583
+ return mod || (0, cb[__getOwnPropNames6(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5357
5584
  };
5358
- var __copyProps5 = (to, from, except, desc) => {
5585
+ var __copyProps6 = (to, from, except, desc) => {
5359
5586
  if (from && typeof from === "object" || typeof from === "function") {
5360
- for (let key of __getOwnPropNames5(from))
5361
- if (!__hasOwnProp5.call(to, key) && key !== except)
5362
- __defProp6(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc5(from, key)) || desc.enumerable });
5587
+ for (let key of __getOwnPropNames6(from))
5588
+ if (!__hasOwnProp6.call(to, key) && key !== except)
5589
+ __defProp7(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc6(from, key)) || desc.enumerable });
5363
5590
  }
5364
5591
  return to;
5365
5592
  };
5366
- var __toESM4 = (mod, isNodeMode, target) => (target = mod != null ? __create4(__getProtoOf4(mod)) : {}, __copyProps5(
5593
+ var __toESM5 = (mod, isNodeMode, target) => (target = mod != null ? __create5(__getProtoOf5(mod)) : {}, __copyProps6(
5367
5594
  // If the importer is in node compatibility mode or this is not an ESM
5368
5595
  // file that has been converted to a CommonJS file using a Babel-
5369
5596
  // compatible transform (i.e. "__esModule" has not been set), then set
5370
5597
  // "default" to the CommonJS "module.exports" for node compatibility.
5371
- isNodeMode || !mod || !mod.__esModule ? __defProp6(target, "default", { value: mod, enumerable: true }) : target,
5598
+ isNodeMode || !mod || !mod.__esModule ? __defProp7(target, "default", { value: mod, enumerable: true }) : target,
5372
5599
  mod
5373
5600
  ));
5374
- var require_js_levenshtein = __commonJS4({
5601
+ var require_js_levenshtein = __commonJS5({
5375
5602
  "node_modules/js-levenshtein/index.js"(exports, module) {
5376
5603
  "use strict";
5377
5604
  module.exports = function() {
@@ -5455,7 +5682,7 @@ Consider naming this operation or using "graphql.operation()" request handler to
5455
5682
  }();
5456
5683
  }
5457
5684
  });
5458
- var import_js_levenshtein = __toESM4(require_js_levenshtein(), 1);
5685
+ var import_js_levenshtein = __toESM5(require_js_levenshtein(), 1);
5459
5686
  var source_default3 = import_js_levenshtein.default;
5460
5687
 
5461
5688
  // src/core/utils/request/onUnhandledRequest.ts
@@ -5603,11 +5830,11 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
5603
5830
  // src/core/utils/handleRequest.ts
5604
5831
  function handleRequest(request, requestId, handlers, options, emitter, handleRequestOptions) {
5605
5832
  return __async(this, null, function* () {
5606
- var _a2, _b2, _c, _d, _e, _f;
5833
+ var _a3, _b2, _c, _d, _e, _f;
5607
5834
  emitter.emit("request:start", { request, requestId });
5608
5835
  if (request.headers.get("x-msw-intention") === "bypass") {
5609
5836
  emitter.emit("request:end", { request, requestId });
5610
- (_a2 = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _a2.call(handleRequestOptions, request);
5837
+ (_a3 = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _a3.call(handleRequestOptions, request);
5611
5838
  return;
5612
5839
  }
5613
5840
  const lookupResult = yield until(() => {
@@ -5670,7 +5897,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
5670
5897
  });
5671
5898
  }
5672
5899
  function decorateResponse(response, init) {
5673
- var _a2;
5900
+ var _a3;
5674
5901
  if (init.type) {
5675
5902
  Object.defineProperty(response, "type", {
5676
5903
  value: init.type,
@@ -5679,7 +5906,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
5679
5906
  });
5680
5907
  }
5681
5908
  if (typeof document !== "undefined") {
5682
- const responseCookies = ((_a2 = init.headers.get("Set-Cookie")) == null ? void 0 : _a2.split(",")) || [];
5909
+ const responseCookies = ((_a3 = init.headers.get("Set-Cookie")) == null ? void 0 : _a3.split(",")) || [];
5683
5910
  for (const cookieString of responseCookies) {
5684
5911
  document.cookie = cookieString;
5685
5912
  }
@@ -5867,14 +6094,6 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
5867
6094
  });
5868
6095
  }
5869
6096
 
5870
- // src/core/NetworkError.ts
5871
- var NetworkError = class extends Error {
5872
- constructor(message3) {
5873
- super(message3);
5874
- this.name = "NetworkError";
5875
- }
5876
- };
5877
-
5878
6097
  // src/core/index.ts
5879
6098
  checkGlobals();
5880
6099
 
@@ -5984,7 +6203,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
5984
6203
  // src/browser/setupWorker/start/utils/enableMocking.ts
5985
6204
  function enableMocking(context, options) {
5986
6205
  return __async(this, null, function* () {
5987
- var _a2, _b2;
6206
+ var _a3, _b2;
5988
6207
  context.workerChannel.send("MOCK_ACTIVATE");
5989
6208
  yield context.events.once("MOCKING_ENABLED");
5990
6209
  if (context.isMockingEnabled) {
@@ -5996,7 +6215,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
5996
6215
  context.isMockingEnabled = true;
5997
6216
  printStartMessage({
5998
6217
  quiet: options.quiet,
5999
- workerScope: (_a2 = context.registration) == null ? void 0 : _a2.scope,
6218
+ workerScope: (_a3 = context.registration) == null ? void 0 : _a3.scope,
6000
6219
  workerUrl: (_b2 = context.worker) == null ? void 0 : _b2.scriptURL
6001
6220
  });
6002
6221
  });
@@ -6053,7 +6272,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
6053
6272
  const request = parseWorkerRequest(message3.payload);
6054
6273
  const requestCloneForLogs = request.clone();
6055
6274
  try {
6056
- let _a2;
6275
+ let _a3;
6057
6276
  yield handleRequest(
6058
6277
  request,
6059
6278
  requestId,
@@ -6088,13 +6307,6 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
6088
6307
  }
6089
6308
  );
6090
6309
  } catch (error3) {
6091
- if (error3 instanceof NetworkError) {
6092
- messageChannel.postMessage("NETWORK_ERROR", {
6093
- name: error3.name,
6094
- message: error3.message
6095
- });
6096
- return;
6097
- }
6098
6310
  if (error3 instanceof Error) {
6099
6311
  devUtils.error(
6100
6312
  `Uncaught exception in the request handler for "%s %s":
@@ -6130,9 +6342,9 @@ This exception has been gracefully handled as a 500 response, however, it's stro
6130
6342
  const { payload: actualChecksum } = yield context.events.once(
6131
6343
  "INTEGRITY_CHECK_RESPONSE"
6132
6344
  );
6133
- if (actualChecksum !== "42fb047ce943b9103a6ed499f86548c4") {
6345
+ if (actualChecksum !== "e2d8525b2d1bdadf89a15ae5a2619512") {
6134
6346
  throw new Error(
6135
- `Currently active Service Worker (${actualChecksum}) is behind the latest published one (${"42fb047ce943b9103a6ed499f86548c4"}).`
6347
+ `Currently active Service Worker (${actualChecksum}) is behind the latest published one (${"e2d8525b2d1bdadf89a15ae5a2619512"}).`
6136
6348
  );
6137
6349
  }
6138
6350
  return serviceWorker;
@@ -6159,9 +6371,9 @@ This exception has been gracefully handled as a 500 response, however, it's stro
6159
6371
  // src/browser/setupWorker/start/createResponseListener.ts
6160
6372
  function createResponseListener(context) {
6161
6373
  return (_, message3) => {
6162
- var _a2;
6374
+ var _a3;
6163
6375
  const { payload: responseJson } = message3;
6164
- if ((_a2 = responseJson.type) == null ? void 0 : _a2.includes("opaque")) {
6376
+ if ((_a3 = responseJson.type) == null ? void 0 : _a3.includes("opaque")) {
6165
6377
  return;
6166
6378
  }
6167
6379
  const response = responseJson.status === 0 ? Response.error() : new Response(responseJson.body, responseJson);
@@ -6294,7 +6506,7 @@ If this message still persists after updating, please report an issue: https://g
6294
6506
  // src/browser/setupWorker/stop/createStop.ts
6295
6507
  var createStop = (context) => {
6296
6508
  return function stop() {
6297
- var _a2;
6509
+ var _a3;
6298
6510
  if (!context.isMockingEnabled) {
6299
6511
  devUtils.warn(
6300
6512
  'Found a redundant "worker.stop()" call. Note that stopping the worker while mocking already stopped has no effect. Consider removing this "worker.stop()" call.'
@@ -6304,7 +6516,7 @@ If this message still persists after updating, please report an issue: https://g
6304
6516
  context.workerChannel.send("MOCK_DEACTIVATE");
6305
6517
  context.isMockingEnabled = false;
6306
6518
  window.clearInterval(context.keepAliveInterval);
6307
- printStopMessage({ quiet: (_a2 = context.startOptions) == null ? void 0 : _a2.quiet });
6519
+ printStopMessage({ quiet: (_a3 = context.startOptions) == null ? void 0 : _a3.quiet });
6308
6520
  };
6309
6521
  };
6310
6522
 
@@ -6344,7 +6556,7 @@ If this message still persists after updating, please report an issue: https://g
6344
6556
  }
6345
6557
  };
6346
6558
 
6347
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-RT3ATOJH.mjs
6559
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-RT3ATOJH.mjs
6348
6560
  function uuidv4() {
6349
6561
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
6350
6562
  const r = Math.random() * 16 | 0;
@@ -6362,9 +6574,9 @@ If this message still persists after updating, please report an issue: https://g
6362
6574
  clearTimeout(autoResolveTimeout);
6363
6575
  });
6364
6576
  const fn = function(...args) {
6365
- var _a2;
6577
+ var _a3;
6366
6578
  if (options.maxCalls && calledTimes >= options.maxCalls) {
6367
- (_a2 = options.maxCallsCallback) == null ? void 0 : _a2.call(options);
6579
+ (_a3 = options.maxCallsCallback) == null ? void 0 : _a3.call(options);
6368
6580
  }
6369
6581
  remoteResolve(args);
6370
6582
  calledTimes++;
@@ -6397,11 +6609,7 @@ If this message still persists after updating, please report an issue: https://g
6397
6609
  return request;
6398
6610
  }
6399
6611
 
6400
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-MW6NCDWE.mjs
6401
- var __getOwnPropNames6 = Object.getOwnPropertyNames;
6402
- var __commonJS5 = (cb, mod) => function __require3() {
6403
- return mod || (0, cb[__getOwnPropNames6(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
6404
- };
6612
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-GXJLJMOT.mjs
6405
6613
  var IS_PATCHED_MODULE2 = Symbol("isPatchedModule");
6406
6614
  function nextTick2(callback) {
6407
6615
  setTimeout(callback, 0);
@@ -6458,6 +6666,11 @@ If this message still persists after updating, please report an issue: https://g
6458
6666
  });
6459
6667
  return super.emit(eventName, ...data);
6460
6668
  }
6669
+ /**
6670
+ * Returns a promise that resolves when all the listeners for the given event
6671
+ * has been called. Awaits asynchronous listeners.
6672
+ * If the event has no listeners, resolves immediately.
6673
+ */
6461
6674
  untilIdle(eventName, filter = () => true) {
6462
6675
  return __async(this, null, function* () {
6463
6676
  const listenersQueue = this.queue.get(eventName) || [];
@@ -6501,6 +6714,11 @@ If this message still persists after updating, please report an issue: https://g
6501
6714
  this.readyState = "ACTIVE";
6502
6715
  logger.info("set state to:", this.readyState);
6503
6716
  }
6717
+ /**
6718
+ * Deactivate this event emitter.
6719
+ * Deactivated emitter can no longer emit and listen to events
6720
+ * and needs to be activated again in order to do so.
6721
+ */
6504
6722
  deactivate() {
6505
6723
  const logger = this.logger.extend("deactivate");
6506
6724
  logger.info("removing all listeners...");
@@ -6513,7 +6731,10 @@ If this message still persists after updating, please report an issue: https://g
6513
6731
  }
6514
6732
  };
6515
6733
  function getGlobalSymbol2(symbol) {
6516
- return globalThis[symbol] || void 0;
6734
+ return (
6735
+ // @ts-ignore https://github.com/Microsoft/TypeScript/issues/24587
6736
+ globalThis[symbol] || void 0
6737
+ );
6517
6738
  }
6518
6739
  function setGlobalSymbol2(symbol, value) {
6519
6740
  globalThis[symbol] = value;
@@ -6531,9 +6752,17 @@ If this message still persists after updating, please report an issue: https://g
6531
6752
  this.emitter.setMaxListeners(0);
6532
6753
  this.logger.info("constructing the interceptor...");
6533
6754
  }
6755
+ /**
6756
+ * Determine if this interceptor can be applied
6757
+ * in the current environment.
6758
+ */
6534
6759
  checkEnvironment() {
6535
6760
  return true;
6536
6761
  }
6762
+ /**
6763
+ * Apply this interceptor to the current process.
6764
+ * Returns an already running interceptor instance if it's present.
6765
+ */
6537
6766
  apply() {
6538
6767
  const logger = this.logger.extend("apply");
6539
6768
  logger.info("applying the interceptor...");
@@ -6568,8 +6797,16 @@ If this message still persists after updating, please report an issue: https://g
6568
6797
  this.setInstance();
6569
6798
  this.readyState = "APPLIED";
6570
6799
  }
6800
+ /**
6801
+ * Setup the module augments and stubs necessary for this interceptor.
6802
+ * This method is not run if there's a running interceptor instance
6803
+ * to prevent instantiating an interceptor multiple times.
6804
+ */
6571
6805
  setup() {
6572
6806
  }
6807
+ /**
6808
+ * Listen to the interceptor's public events.
6809
+ */
6573
6810
  on(eventName, listener) {
6574
6811
  const logger = this.logger.extend("on");
6575
6812
  if (this.readyState === "DISPOSING" || this.readyState === "DISPOSED") {
@@ -6579,6 +6816,9 @@ If this message still persists after updating, please report an issue: https://g
6579
6816
  logger.info('adding "%s" event listener:', eventName, listener.name);
6580
6817
  this.emitter.on(eventName, listener);
6581
6818
  }
6819
+ /**
6820
+ * Disposes of any side-effects this interceptor has introduced.
6821
+ */
6582
6822
  dispose() {
6583
6823
  const logger = this.logger.extend("dispose");
6584
6824
  if (this.readyState === "DISPOSED") {
@@ -6606,9 +6846,9 @@ If this message still persists after updating, please report an issue: https://g
6606
6846
  this.readyState = "DISPOSED";
6607
6847
  }
6608
6848
  getInstance() {
6609
- var _a2;
6849
+ var _a3;
6610
6850
  const instance = getGlobalSymbol2(this.symbol);
6611
- this.logger.info("retrieved global instance:", (_a2 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a2.name);
6851
+ this.logger.info("retrieved global instance:", (_a3 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a3.name);
6612
6852
  return instance;
6613
6853
  }
6614
6854
  setInstance() {
@@ -6621,7 +6861,74 @@ If this message still persists after updating, please report an issue: https://g
6621
6861
  }
6622
6862
  };
6623
6863
 
6624
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-AKTXHQ7X.mjs
6864
+ // node_modules/.pnpm/@open-draft+deferred-promise@2.2.0/node_modules/@open-draft/deferred-promise/build/index.mjs
6865
+ function createDeferredExecutor() {
6866
+ const executor = (resolve, reject) => {
6867
+ executor.state = "pending";
6868
+ executor.resolve = (data) => {
6869
+ if (executor.state !== "pending") {
6870
+ return;
6871
+ }
6872
+ executor.result = data;
6873
+ const onFulfilled = (value) => {
6874
+ executor.state = "fulfilled";
6875
+ return value;
6876
+ };
6877
+ return resolve(
6878
+ data instanceof Promise ? data : Promise.resolve(data).then(onFulfilled)
6879
+ );
6880
+ };
6881
+ executor.reject = (reason) => {
6882
+ if (executor.state !== "pending") {
6883
+ return;
6884
+ }
6885
+ queueMicrotask(() => {
6886
+ executor.state = "rejected";
6887
+ });
6888
+ return reject(executor.rejectionReason = reason);
6889
+ };
6890
+ };
6891
+ return executor;
6892
+ }
6893
+ var _executor, _decorate, decorate_fn, _a2;
6894
+ var DeferredPromise = (_a2 = class extends Promise {
6895
+ constructor(executor = null) {
6896
+ const deferredExecutor = createDeferredExecutor();
6897
+ super((originalResolve, originalReject) => {
6898
+ deferredExecutor(originalResolve, originalReject);
6899
+ executor == null ? void 0 : executor(deferredExecutor.resolve, deferredExecutor.reject);
6900
+ });
6901
+ __privateAdd(this, _decorate);
6902
+ __privateAdd(this, _executor, void 0);
6903
+ __publicField(this, "resolve");
6904
+ __publicField(this, "reject");
6905
+ __privateSet(this, _executor, deferredExecutor);
6906
+ this.resolve = __privateGet(this, _executor).resolve;
6907
+ this.reject = __privateGet(this, _executor).reject;
6908
+ }
6909
+ get state() {
6910
+ return __privateGet(this, _executor).state;
6911
+ }
6912
+ get rejectionReason() {
6913
+ return __privateGet(this, _executor).rejectionReason;
6914
+ }
6915
+ then(onFulfilled, onRejected) {
6916
+ return __privateMethod(this, _decorate, decorate_fn).call(this, super.then(onFulfilled, onRejected));
6917
+ }
6918
+ catch(onRejected) {
6919
+ return __privateMethod(this, _decorate, decorate_fn).call(this, super.catch(onRejected));
6920
+ }
6921
+ finally(onfinally) {
6922
+ return __privateMethod(this, _decorate, decorate_fn).call(this, super.finally(onfinally));
6923
+ }
6924
+ }, _executor = new WeakMap(), _decorate = new WeakSet(), decorate_fn = function(promise) {
6925
+ return Object.defineProperties(promise, {
6926
+ resolve: { configurable: true, value: this.resolve },
6927
+ reject: { configurable: true, value: this.reject }
6928
+ });
6929
+ }, _a2);
6930
+
6931
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-VMXB5F2J.mjs
6625
6932
  var _FetchInterceptor = class extends Interceptor2 {
6626
6933
  constructor() {
6627
6934
  super(_FetchInterceptor.symbol);
@@ -6636,7 +6943,7 @@ If this message still persists after updating, please report an issue: https://g
6636
6943
  'Failed to patch the "fetch" module: already patched.'
6637
6944
  );
6638
6945
  globalThis.fetch = (input, init) => __async(this, null, function* () {
6639
- var _a2;
6946
+ var _a3;
6640
6947
  const requestId = uuidv4();
6641
6948
  const request = new Request(input, init);
6642
6949
  this.logger.info("[%s] %s", request.method, request.url);
@@ -6650,27 +6957,43 @@ If this message still persists after updating, please report an issue: https://g
6650
6957
  requestId
6651
6958
  });
6652
6959
  this.logger.info("awaiting for the mocked response...");
6960
+ const signal = interactiveRequest.signal;
6961
+ const requestAborted = new DeferredPromise();
6962
+ signal.addEventListener(
6963
+ "abort",
6964
+ () => {
6965
+ requestAborted.reject(signal.reason);
6966
+ },
6967
+ { once: true }
6968
+ );
6653
6969
  const resolverResult = yield until(() => __async(this, null, function* () {
6654
- yield this.emitter.untilIdle(
6970
+ const allListenersResolved = this.emitter.untilIdle(
6655
6971
  "request",
6656
6972
  ({ args: [{ requestId: pendingRequestId }] }) => {
6657
6973
  return pendingRequestId === requestId;
6658
6974
  }
6659
6975
  );
6976
+ yield Promise.race([requestAborted, allListenersResolved]);
6660
6977
  this.logger.info("all request listeners have been resolved!");
6661
6978
  const [mockedResponse2] = yield interactiveRequest.respondWith.invoked();
6662
6979
  this.logger.info("event.respondWith called with:", mockedResponse2);
6663
6980
  return mockedResponse2;
6664
6981
  }));
6982
+ if (requestAborted.state === "rejected") {
6983
+ return Promise.reject(requestAborted.rejectionReason);
6984
+ }
6665
6985
  if (resolverResult.error) {
6666
- const error3 = Object.assign(new TypeError("Failed to fetch"), {
6667
- cause: resolverResult.error
6668
- });
6669
- return Promise.reject(error3);
6986
+ return Promise.reject(createNetworkError(resolverResult.error));
6670
6987
  }
6671
6988
  const mockedResponse = resolverResult.data;
6672
- if (mockedResponse && !((_a2 = request.signal) == null ? void 0 : _a2.aborted)) {
6989
+ if (mockedResponse && !((_a3 = request.signal) == null ? void 0 : _a3.aborted)) {
6673
6990
  this.logger.info("received mocked response:", mockedResponse);
6991
+ if (mockedResponse.type === "error") {
6992
+ this.logger.info(
6993
+ "received a network error response, rejecting the request promise..."
6994
+ );
6995
+ return Promise.reject(createNetworkError(mockedResponse));
6996
+ }
6674
6997
  const responseClone = mockedResponse.clone();
6675
6998
  this.emitter.emit("response", {
6676
6999
  response: responseClone,
@@ -6719,2142 +7042,83 @@ If this message still persists after updating, please report an issue: https://g
6719
7042
  };
6720
7043
  var FetchInterceptor = _FetchInterceptor;
6721
7044
  FetchInterceptor.symbol = Symbol("fetch");
7045
+ function createNetworkError(cause) {
7046
+ return Object.assign(new TypeError("Failed to fetch"), {
7047
+ cause
7048
+ });
7049
+ }
6722
7050
 
6723
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-MQA5WAD4.mjs
6724
- var require_shams = __commonJS5({
6725
- "node_modules/has-symbols/shams.js"(exports, module) {
6726
- "use strict";
6727
- module.exports = function hasSymbols() {
6728
- if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
6729
- return false;
6730
- }
6731
- if (typeof Symbol.iterator === "symbol") {
6732
- return true;
6733
- }
6734
- var obj = {};
6735
- var sym = Symbol("test");
6736
- var symObj = Object(sym);
6737
- if (typeof sym === "string") {
6738
- return false;
6739
- }
6740
- if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
6741
- return false;
6742
- }
6743
- if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
6744
- return false;
6745
- }
6746
- var symVal = 42;
6747
- obj[sym] = symVal;
6748
- for (sym in obj) {
6749
- return false;
6750
- }
6751
- if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
6752
- return false;
6753
- }
6754
- if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
6755
- return false;
6756
- }
6757
- var syms = Object.getOwnPropertySymbols(obj);
6758
- if (syms.length !== 1 || syms[0] !== sym) {
6759
- return false;
6760
- }
6761
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
6762
- return false;
6763
- }
6764
- if (typeof Object.getOwnPropertyDescriptor === "function") {
6765
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
6766
- if (descriptor.value !== symVal || descriptor.enumerable !== true) {
6767
- return false;
6768
- }
6769
- }
6770
- return true;
6771
- };
7051
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-7II4SWKS.mjs
7052
+ var encoder2 = new TextEncoder();
7053
+ function encodeBuffer2(text) {
7054
+ return encoder2.encode(text);
7055
+ }
7056
+ function decodeBuffer2(buffer, encoding) {
7057
+ const decoder = new TextDecoder(encoding);
7058
+ return decoder.decode(buffer);
7059
+ }
7060
+ function toArrayBuffer(array) {
7061
+ return array.buffer.slice(
7062
+ array.byteOffset,
7063
+ array.byteOffset + array.byteLength
7064
+ );
7065
+ }
7066
+
7067
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-ANLPTCZ5.mjs
7068
+ function concatArrayBuffer(left, right) {
7069
+ const result = new Uint8Array(left.byteLength + right.byteLength);
7070
+ result.set(left, 0);
7071
+ result.set(right, left.byteLength);
7072
+ return result;
7073
+ }
7074
+ var EventPolyfill = class {
7075
+ constructor(type, options) {
7076
+ this.AT_TARGET = 0;
7077
+ this.BUBBLING_PHASE = 0;
7078
+ this.CAPTURING_PHASE = 0;
7079
+ this.NONE = 0;
7080
+ this.type = "";
7081
+ this.srcElement = null;
7082
+ this.currentTarget = null;
7083
+ this.eventPhase = 0;
7084
+ this.isTrusted = true;
7085
+ this.composed = false;
7086
+ this.cancelable = true;
7087
+ this.defaultPrevented = false;
7088
+ this.bubbles = true;
7089
+ this.lengthComputable = true;
7090
+ this.loaded = 0;
7091
+ this.total = 0;
7092
+ this.cancelBubble = false;
7093
+ this.returnValue = true;
7094
+ this.type = type;
7095
+ this.target = (options == null ? void 0 : options.target) || null;
7096
+ this.currentTarget = (options == null ? void 0 : options.currentTarget) || null;
7097
+ this.timeStamp = Date.now();
6772
7098
  }
6773
- });
6774
- var require_shams2 = __commonJS5({
6775
- "node_modules/has-tostringtag/shams.js"(exports, module) {
6776
- "use strict";
6777
- var hasSymbols = require_shams();
6778
- module.exports = function hasToStringTagShams() {
6779
- return hasSymbols() && !!Symbol.toStringTag;
6780
- };
7099
+ composedPath() {
7100
+ return [];
6781
7101
  }
6782
- });
6783
- var require_shams3 = __commonJS5({
6784
- "node_modules/call-bind/node_modules/has-symbols/shams.js"(exports, module) {
6785
- "use strict";
6786
- module.exports = function hasSymbols() {
6787
- if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
6788
- return false;
6789
- }
6790
- if (typeof Symbol.iterator === "symbol") {
6791
- return true;
6792
- }
6793
- var obj = {};
6794
- var sym = Symbol("test");
6795
- var symObj = Object(sym);
6796
- if (typeof sym === "string") {
6797
- return false;
6798
- }
6799
- if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
6800
- return false;
6801
- }
6802
- if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
6803
- return false;
6804
- }
6805
- var symVal = 42;
6806
- obj[sym] = symVal;
6807
- for (sym in obj) {
6808
- return false;
6809
- }
6810
- if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
6811
- return false;
6812
- }
6813
- if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
6814
- return false;
6815
- }
6816
- var syms = Object.getOwnPropertySymbols(obj);
6817
- if (syms.length !== 1 || syms[0] !== sym) {
6818
- return false;
6819
- }
6820
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
6821
- return false;
6822
- }
6823
- if (typeof Object.getOwnPropertyDescriptor === "function") {
6824
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
6825
- if (descriptor.value !== symVal || descriptor.enumerable !== true) {
6826
- return false;
6827
- }
6828
- }
6829
- return true;
6830
- };
7102
+ initEvent(type, bubbles, cancelable) {
7103
+ this.type = type;
7104
+ this.bubbles = !!bubbles;
7105
+ this.cancelable = !!cancelable;
6831
7106
  }
6832
- });
6833
- var require_has_symbols = __commonJS5({
6834
- "node_modules/call-bind/node_modules/has-symbols/index.js"(exports, module) {
6835
- "use strict";
6836
- var origSymbol = typeof Symbol !== "undefined" && Symbol;
6837
- var hasSymbolSham = require_shams3();
6838
- module.exports = function hasNativeSymbols() {
6839
- if (typeof origSymbol !== "function") {
6840
- return false;
6841
- }
6842
- if (typeof Symbol !== "function") {
6843
- return false;
6844
- }
6845
- if (typeof origSymbol("foo") !== "symbol") {
6846
- return false;
6847
- }
6848
- if (typeof Symbol("bar") !== "symbol") {
6849
- return false;
6850
- }
6851
- return hasSymbolSham();
6852
- };
7107
+ preventDefault() {
7108
+ this.defaultPrevented = true;
6853
7109
  }
6854
- });
6855
- var require_implementation = __commonJS5({
6856
- "node_modules/function-bind/implementation.js"(exports, module) {
6857
- "use strict";
6858
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
6859
- var slice = Array.prototype.slice;
6860
- var toStr = Object.prototype.toString;
6861
- var funcType = "[object Function]";
6862
- module.exports = function bind(that) {
6863
- var target = this;
6864
- if (typeof target !== "function" || toStr.call(target) !== funcType) {
6865
- throw new TypeError(ERROR_MESSAGE + target);
6866
- }
6867
- var args = slice.call(arguments, 1);
6868
- var bound;
6869
- var binder = function() {
6870
- if (this instanceof bound) {
6871
- var result = target.apply(
6872
- this,
6873
- args.concat(slice.call(arguments))
6874
- );
6875
- if (Object(result) === result) {
6876
- return result;
6877
- }
6878
- return this;
6879
- } else {
6880
- return target.apply(
6881
- that,
6882
- args.concat(slice.call(arguments))
6883
- );
6884
- }
6885
- };
6886
- var boundLength = Math.max(0, target.length - args.length);
6887
- var boundArgs = [];
6888
- for (var i = 0; i < boundLength; i++) {
6889
- boundArgs.push("$" + i);
6890
- }
6891
- bound = Function("binder", "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }")(binder);
6892
- if (target.prototype) {
6893
- var Empty = function Empty2() {
6894
- };
6895
- Empty.prototype = target.prototype;
6896
- bound.prototype = new Empty();
6897
- Empty.prototype = null;
6898
- }
6899
- return bound;
6900
- };
7110
+ stopPropagation() {
6901
7111
  }
6902
- });
6903
- var require_function_bind = __commonJS5({
6904
- "node_modules/function-bind/index.js"(exports, module) {
6905
- "use strict";
6906
- var implementation = require_implementation();
6907
- module.exports = Function.prototype.bind || implementation;
7112
+ stopImmediatePropagation() {
6908
7113
  }
6909
- });
6910
- var require_src = __commonJS5({
6911
- "node_modules/has/src/index.js"(exports, module) {
6912
- "use strict";
6913
- var bind = require_function_bind();
6914
- module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
6915
- }
6916
- });
6917
- var require_get_intrinsic = __commonJS5({
6918
- "node_modules/call-bind/node_modules/get-intrinsic/index.js"(exports, module) {
6919
- "use strict";
6920
- var undefined2;
6921
- var $SyntaxError = SyntaxError;
6922
- var $Function = Function;
6923
- var $TypeError = TypeError;
6924
- var getEvalledConstructor = function(expressionSyntax) {
6925
- try {
6926
- return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
6927
- } catch (e) {
6928
- }
6929
- };
6930
- var $gOPD = Object.getOwnPropertyDescriptor;
6931
- if ($gOPD) {
6932
- try {
6933
- $gOPD({}, "");
6934
- } catch (e) {
6935
- $gOPD = null;
6936
- }
6937
- }
6938
- var throwTypeError = function() {
6939
- throw new $TypeError();
6940
- };
6941
- var ThrowTypeError = $gOPD ? function() {
6942
- try {
6943
- arguments.callee;
6944
- return throwTypeError;
6945
- } catch (calleeThrows) {
6946
- try {
6947
- return $gOPD(arguments, "callee").get;
6948
- } catch (gOPDthrows) {
6949
- return throwTypeError;
6950
- }
6951
- }
6952
- }() : throwTypeError;
6953
- var hasSymbols = require_has_symbols()();
6954
- var getProto = Object.getPrototypeOf || function(x) {
6955
- return x.__proto__;
6956
- };
6957
- var needsEval = {};
6958
- var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array);
6959
- var INTRINSICS = {
6960
- "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
6961
- "%Array%": Array,
6962
- "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
6963
- "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2,
6964
- "%AsyncFromSyncIteratorPrototype%": undefined2,
6965
- "%AsyncFunction%": needsEval,
6966
- "%AsyncGenerator%": needsEval,
6967
- "%AsyncGeneratorFunction%": needsEval,
6968
- "%AsyncIteratorPrototype%": needsEval,
6969
- "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
6970
- "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
6971
- "%Boolean%": Boolean,
6972
- "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
6973
- "%Date%": Date,
6974
- "%decodeURI%": decodeURI,
6975
- "%decodeURIComponent%": decodeURIComponent,
6976
- "%encodeURI%": encodeURI,
6977
- "%encodeURIComponent%": encodeURIComponent,
6978
- "%Error%": Error,
6979
- "%eval%": eval,
6980
- "%EvalError%": EvalError,
6981
- "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
6982
- "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
6983
- "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
6984
- "%Function%": $Function,
6985
- "%GeneratorFunction%": needsEval,
6986
- "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
6987
- "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
6988
- "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
6989
- "%isFinite%": isFinite,
6990
- "%isNaN%": isNaN,
6991
- "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2,
6992
- "%JSON%": typeof JSON === "object" ? JSON : undefined2,
6993
- "%Map%": typeof Map === "undefined" ? undefined2 : Map,
6994
- "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
6995
- "%Math%": Math,
6996
- "%Number%": Number,
6997
- "%Object%": Object,
6998
- "%parseFloat%": parseFloat,
6999
- "%parseInt%": parseInt,
7000
- "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
7001
- "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
7002
- "%RangeError%": RangeError,
7003
- "%ReferenceError%": ReferenceError,
7004
- "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
7005
- "%RegExp%": RegExp,
7006
- "%Set%": typeof Set === "undefined" ? undefined2 : Set,
7007
- "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
7008
- "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
7009
- "%String%": String,
7010
- "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2,
7011
- "%Symbol%": hasSymbols ? Symbol : undefined2,
7012
- "%SyntaxError%": $SyntaxError,
7013
- "%ThrowTypeError%": ThrowTypeError,
7014
- "%TypedArray%": TypedArray,
7015
- "%TypeError%": $TypeError,
7016
- "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
7017
- "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
7018
- "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
7019
- "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
7020
- "%URIError%": URIError,
7021
- "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
7022
- "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
7023
- "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
7024
- };
7025
- var doEval = function doEval2(name) {
7026
- var value;
7027
- if (name === "%AsyncFunction%") {
7028
- value = getEvalledConstructor("async function () {}");
7029
- } else if (name === "%GeneratorFunction%") {
7030
- value = getEvalledConstructor("function* () {}");
7031
- } else if (name === "%AsyncGeneratorFunction%") {
7032
- value = getEvalledConstructor("async function* () {}");
7033
- } else if (name === "%AsyncGenerator%") {
7034
- var fn = doEval2("%AsyncGeneratorFunction%");
7035
- if (fn) {
7036
- value = fn.prototype;
7037
- }
7038
- } else if (name === "%AsyncIteratorPrototype%") {
7039
- var gen = doEval2("%AsyncGenerator%");
7040
- if (gen) {
7041
- value = getProto(gen.prototype);
7042
- }
7043
- }
7044
- INTRINSICS[name] = value;
7045
- return value;
7046
- };
7047
- var LEGACY_ALIASES = {
7048
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
7049
- "%ArrayPrototype%": ["Array", "prototype"],
7050
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
7051
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
7052
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
7053
- "%ArrayProto_values%": ["Array", "prototype", "values"],
7054
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
7055
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
7056
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
7057
- "%BooleanPrototype%": ["Boolean", "prototype"],
7058
- "%DataViewPrototype%": ["DataView", "prototype"],
7059
- "%DatePrototype%": ["Date", "prototype"],
7060
- "%ErrorPrototype%": ["Error", "prototype"],
7061
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
7062
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
7063
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
7064
- "%FunctionPrototype%": ["Function", "prototype"],
7065
- "%Generator%": ["GeneratorFunction", "prototype"],
7066
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
7067
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
7068
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
7069
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
7070
- "%JSONParse%": ["JSON", "parse"],
7071
- "%JSONStringify%": ["JSON", "stringify"],
7072
- "%MapPrototype%": ["Map", "prototype"],
7073
- "%NumberPrototype%": ["Number", "prototype"],
7074
- "%ObjectPrototype%": ["Object", "prototype"],
7075
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
7076
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
7077
- "%PromisePrototype%": ["Promise", "prototype"],
7078
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
7079
- "%Promise_all%": ["Promise", "all"],
7080
- "%Promise_reject%": ["Promise", "reject"],
7081
- "%Promise_resolve%": ["Promise", "resolve"],
7082
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
7083
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
7084
- "%RegExpPrototype%": ["RegExp", "prototype"],
7085
- "%SetPrototype%": ["Set", "prototype"],
7086
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
7087
- "%StringPrototype%": ["String", "prototype"],
7088
- "%SymbolPrototype%": ["Symbol", "prototype"],
7089
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
7090
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
7091
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
7092
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
7093
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
7094
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
7095
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
7096
- "%URIErrorPrototype%": ["URIError", "prototype"],
7097
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
7098
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
7099
- };
7100
- var bind = require_function_bind();
7101
- var hasOwn = require_src();
7102
- var $concat = bind.call(Function.call, Array.prototype.concat);
7103
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
7104
- var $replace = bind.call(Function.call, String.prototype.replace);
7105
- var $strSlice = bind.call(Function.call, String.prototype.slice);
7106
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
7107
- var reEscapeChar = /\\(\\)?/g;
7108
- var stringToPath = function stringToPath2(string) {
7109
- var first = $strSlice(string, 0, 1);
7110
- var last = $strSlice(string, -1);
7111
- if (first === "%" && last !== "%") {
7112
- throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
7113
- } else if (last === "%" && first !== "%") {
7114
- throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
7115
- }
7116
- var result = [];
7117
- $replace(string, rePropName, function(match2, number, quote, subString) {
7118
- result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match2;
7119
- });
7120
- return result;
7121
- };
7122
- var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
7123
- var intrinsicName = name;
7124
- var alias;
7125
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
7126
- alias = LEGACY_ALIASES[intrinsicName];
7127
- intrinsicName = "%" + alias[0] + "%";
7128
- }
7129
- if (hasOwn(INTRINSICS, intrinsicName)) {
7130
- var value = INTRINSICS[intrinsicName];
7131
- if (value === needsEval) {
7132
- value = doEval(intrinsicName);
7133
- }
7134
- if (typeof value === "undefined" && !allowMissing) {
7135
- throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
7136
- }
7137
- return {
7138
- alias,
7139
- name: intrinsicName,
7140
- value
7141
- };
7142
- }
7143
- throw new $SyntaxError("intrinsic " + name + " does not exist!");
7144
- };
7145
- module.exports = function GetIntrinsic(name, allowMissing) {
7146
- if (typeof name !== "string" || name.length === 0) {
7147
- throw new $TypeError("intrinsic name must be a non-empty string");
7148
- }
7149
- if (arguments.length > 1 && typeof allowMissing !== "boolean") {
7150
- throw new $TypeError('"allowMissing" argument must be a boolean');
7151
- }
7152
- var parts = stringToPath(name);
7153
- var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
7154
- var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
7155
- var intrinsicRealName = intrinsic.name;
7156
- var value = intrinsic.value;
7157
- var skipFurtherCaching = false;
7158
- var alias = intrinsic.alias;
7159
- if (alias) {
7160
- intrinsicBaseName = alias[0];
7161
- $spliceApply(parts, $concat([0, 1], alias));
7162
- }
7163
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
7164
- var part = parts[i];
7165
- var first = $strSlice(part, 0, 1);
7166
- var last = $strSlice(part, -1);
7167
- if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
7168
- throw new $SyntaxError("property names with quotes must have matching quotes");
7169
- }
7170
- if (part === "constructor" || !isOwn) {
7171
- skipFurtherCaching = true;
7172
- }
7173
- intrinsicBaseName += "." + part;
7174
- intrinsicRealName = "%" + intrinsicBaseName + "%";
7175
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
7176
- value = INTRINSICS[intrinsicRealName];
7177
- } else if (value != null) {
7178
- if (!(part in value)) {
7179
- if (!allowMissing) {
7180
- throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
7181
- }
7182
- return void 0;
7183
- }
7184
- if ($gOPD && i + 1 >= parts.length) {
7185
- var desc = $gOPD(value, part);
7186
- isOwn = !!desc;
7187
- if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
7188
- value = desc.get;
7189
- } else {
7190
- value = value[part];
7191
- }
7192
- } else {
7193
- isOwn = hasOwn(value, part);
7194
- value = value[part];
7195
- }
7196
- if (isOwn && !skipFurtherCaching) {
7197
- INTRINSICS[intrinsicRealName] = value;
7198
- }
7199
- }
7200
- }
7201
- return value;
7202
- };
7203
- }
7204
- });
7205
- var require_call_bind = __commonJS5({
7206
- "node_modules/call-bind/index.js"(exports, module) {
7207
- "use strict";
7208
- var bind = require_function_bind();
7209
- var GetIntrinsic = require_get_intrinsic();
7210
- var $apply = GetIntrinsic("%Function.prototype.apply%");
7211
- var $call = GetIntrinsic("%Function.prototype.call%");
7212
- var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
7213
- var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
7214
- var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
7215
- var $max = GetIntrinsic("%Math.max%");
7216
- if ($defineProperty) {
7217
- try {
7218
- $defineProperty({}, "a", { value: 1 });
7219
- } catch (e) {
7220
- $defineProperty = null;
7221
- }
7222
- }
7223
- module.exports = function callBind(originalFunction) {
7224
- var func = $reflectApply(bind, $call, arguments);
7225
- if ($gOPD && $defineProperty) {
7226
- var desc = $gOPD(func, "length");
7227
- if (desc.configurable) {
7228
- $defineProperty(
7229
- func,
7230
- "length",
7231
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
7232
- );
7233
- }
7234
- }
7235
- return func;
7236
- };
7237
- var applyBind = function applyBind2() {
7238
- return $reflectApply(bind, $apply, arguments);
7239
- };
7240
- if ($defineProperty) {
7241
- $defineProperty(module.exports, "apply", { value: applyBind });
7242
- } else {
7243
- module.exports.apply = applyBind;
7244
- }
7245
- }
7246
- });
7247
- var require_callBound = __commonJS5({
7248
- "node_modules/call-bind/callBound.js"(exports, module) {
7249
- "use strict";
7250
- var GetIntrinsic = require_get_intrinsic();
7251
- var callBind = require_call_bind();
7252
- var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
7253
- module.exports = function callBoundIntrinsic(name, allowMissing) {
7254
- var intrinsic = GetIntrinsic(name, !!allowMissing);
7255
- if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
7256
- return callBind(intrinsic);
7257
- }
7258
- return intrinsic;
7259
- };
7260
- }
7261
- });
7262
- var require_is_arguments = __commonJS5({
7263
- "node_modules/is-arguments/index.js"(exports, module) {
7264
- "use strict";
7265
- var hasToStringTag = require_shams2()();
7266
- var callBound = require_callBound();
7267
- var $toString = callBound("Object.prototype.toString");
7268
- var isStandardArguments = function isArguments(value) {
7269
- if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
7270
- return false;
7271
- }
7272
- return $toString(value) === "[object Arguments]";
7273
- };
7274
- var isLegacyArguments = function isArguments(value) {
7275
- if (isStandardArguments(value)) {
7276
- return true;
7277
- }
7278
- return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]";
7279
- };
7280
- var supportsStandardArguments = function() {
7281
- return isStandardArguments(arguments);
7282
- }();
7283
- isStandardArguments.isLegacyArguments = isLegacyArguments;
7284
- module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
7285
- }
7286
- });
7287
- var require_is_generator_function = __commonJS5({
7288
- "node_modules/is-generator-function/index.js"(exports, module) {
7289
- "use strict";
7290
- var toStr = Object.prototype.toString;
7291
- var fnToStr = Function.prototype.toString;
7292
- var isFnRegex = /^\s*(?:function)?\*/;
7293
- var hasToStringTag = require_shams2()();
7294
- var getProto = Object.getPrototypeOf;
7295
- var getGeneratorFunc = function() {
7296
- if (!hasToStringTag) {
7297
- return false;
7298
- }
7299
- try {
7300
- return Function("return function*() {}")();
7301
- } catch (e) {
7302
- }
7303
- };
7304
- var GeneratorFunction;
7305
- module.exports = function isGeneratorFunction(fn) {
7306
- if (typeof fn !== "function") {
7307
- return false;
7308
- }
7309
- if (isFnRegex.test(fnToStr.call(fn))) {
7310
- return true;
7311
- }
7312
- if (!hasToStringTag) {
7313
- var str = toStr.call(fn);
7314
- return str === "[object GeneratorFunction]";
7315
- }
7316
- if (!getProto) {
7317
- return false;
7318
- }
7319
- if (typeof GeneratorFunction === "undefined") {
7320
- var generatorFunc = getGeneratorFunc();
7321
- GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;
7322
- }
7323
- return getProto(fn) === GeneratorFunction;
7324
- };
7325
- }
7326
- });
7327
- var require_is_callable = __commonJS5({
7328
- "node_modules/is-callable/index.js"(exports, module) {
7329
- "use strict";
7330
- var fnToStr = Function.prototype.toString;
7331
- var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply;
7332
- var badArrayLike;
7333
- var isCallableMarker;
7334
- if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") {
7335
- try {
7336
- badArrayLike = Object.defineProperty({}, "length", {
7337
- get: function() {
7338
- throw isCallableMarker;
7339
- }
7340
- });
7341
- isCallableMarker = {};
7342
- reflectApply(function() {
7343
- throw 42;
7344
- }, null, badArrayLike);
7345
- } catch (_) {
7346
- if (_ !== isCallableMarker) {
7347
- reflectApply = null;
7348
- }
7349
- }
7350
- } else {
7351
- reflectApply = null;
7352
- }
7353
- var constructorRegex = /^\s*class\b/;
7354
- var isES6ClassFn = function isES6ClassFunction(value) {
7355
- try {
7356
- var fnStr = fnToStr.call(value);
7357
- return constructorRegex.test(fnStr);
7358
- } catch (e) {
7359
- return false;
7360
- }
7361
- };
7362
- var tryFunctionObject = function tryFunctionToStr(value) {
7363
- try {
7364
- if (isES6ClassFn(value)) {
7365
- return false;
7366
- }
7367
- fnToStr.call(value);
7368
- return true;
7369
- } catch (e) {
7370
- return false;
7371
- }
7372
- };
7373
- var toStr = Object.prototype.toString;
7374
- var fnClass = "[object Function]";
7375
- var genClass = "[object GeneratorFunction]";
7376
- var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag;
7377
- var documentDotAll = typeof document === "object" && typeof document.all === "undefined" && document.all !== void 0 ? document.all : {};
7378
- module.exports = reflectApply ? function isCallable(value) {
7379
- if (value === documentDotAll) {
7380
- return true;
7381
- }
7382
- if (!value) {
7383
- return false;
7384
- }
7385
- if (typeof value !== "function" && typeof value !== "object") {
7386
- return false;
7387
- }
7388
- if (typeof value === "function" && !value.prototype) {
7389
- return true;
7390
- }
7391
- try {
7392
- reflectApply(value, null, badArrayLike);
7393
- } catch (e) {
7394
- if (e !== isCallableMarker) {
7395
- return false;
7396
- }
7397
- }
7398
- return !isES6ClassFn(value);
7399
- } : function isCallable(value) {
7400
- if (value === documentDotAll) {
7401
- return true;
7402
- }
7403
- if (!value) {
7404
- return false;
7405
- }
7406
- if (typeof value !== "function" && typeof value !== "object") {
7407
- return false;
7408
- }
7409
- if (typeof value === "function" && !value.prototype) {
7410
- return true;
7411
- }
7412
- if (hasToStringTag) {
7413
- return tryFunctionObject(value);
7414
- }
7415
- if (isES6ClassFn(value)) {
7416
- return false;
7417
- }
7418
- var strClass = toStr.call(value);
7419
- return strClass === fnClass || strClass === genClass;
7420
- };
7421
- }
7422
- });
7423
- var require_for_each = __commonJS5({
7424
- "node_modules/for-each/index.js"(exports, module) {
7425
- "use strict";
7426
- var isCallable = require_is_callable();
7427
- var toStr = Object.prototype.toString;
7428
- var hasOwnProperty = Object.prototype.hasOwnProperty;
7429
- var forEachArray = function forEachArray2(array, iterator, receiver) {
7430
- for (var i = 0, len = array.length; i < len; i++) {
7431
- if (hasOwnProperty.call(array, i)) {
7432
- if (receiver == null) {
7433
- iterator(array[i], i, array);
7434
- } else {
7435
- iterator.call(receiver, array[i], i, array);
7436
- }
7437
- }
7438
- }
7439
- };
7440
- var forEachString = function forEachString2(string, iterator, receiver) {
7441
- for (var i = 0, len = string.length; i < len; i++) {
7442
- if (receiver == null) {
7443
- iterator(string.charAt(i), i, string);
7444
- } else {
7445
- iterator.call(receiver, string.charAt(i), i, string);
7446
- }
7447
- }
7448
- };
7449
- var forEachObject = function forEachObject2(object, iterator, receiver) {
7450
- for (var k in object) {
7451
- if (hasOwnProperty.call(object, k)) {
7452
- if (receiver == null) {
7453
- iterator(object[k], k, object);
7454
- } else {
7455
- iterator.call(receiver, object[k], k, object);
7456
- }
7457
- }
7458
- }
7459
- };
7460
- var forEach = function forEach2(list, iterator, thisArg) {
7461
- if (!isCallable(iterator)) {
7462
- throw new TypeError("iterator must be a function");
7463
- }
7464
- var receiver;
7465
- if (arguments.length >= 3) {
7466
- receiver = thisArg;
7467
- }
7468
- if (toStr.call(list) === "[object Array]") {
7469
- forEachArray(list, iterator, receiver);
7470
- } else if (typeof list === "string") {
7471
- forEachString(list, iterator, receiver);
7472
- } else {
7473
- forEachObject(list, iterator, receiver);
7474
- }
7475
- };
7476
- module.exports = forEach;
7477
- }
7478
- });
7479
- var require_available_typed_arrays = __commonJS5({
7480
- "node_modules/available-typed-arrays/index.js"(exports, module) {
7481
- "use strict";
7482
- var possibleNames = [
7483
- "BigInt64Array",
7484
- "BigUint64Array",
7485
- "Float32Array",
7486
- "Float64Array",
7487
- "Int16Array",
7488
- "Int32Array",
7489
- "Int8Array",
7490
- "Uint16Array",
7491
- "Uint32Array",
7492
- "Uint8Array",
7493
- "Uint8ClampedArray"
7494
- ];
7495
- var g = typeof globalThis === "undefined" ? global : globalThis;
7496
- module.exports = function availableTypedArrays() {
7497
- var out = [];
7498
- for (var i = 0; i < possibleNames.length; i++) {
7499
- if (typeof g[possibleNames[i]] === "function") {
7500
- out[out.length] = possibleNames[i];
7501
- }
7502
- }
7503
- return out;
7504
- };
7505
- }
7506
- });
7507
- var require_has_symbols2 = __commonJS5({
7508
- "node_modules/has-symbols/index.js"(exports, module) {
7509
- "use strict";
7510
- var origSymbol = typeof Symbol !== "undefined" && Symbol;
7511
- var hasSymbolSham = require_shams();
7512
- module.exports = function hasNativeSymbols() {
7513
- if (typeof origSymbol !== "function") {
7514
- return false;
7515
- }
7516
- if (typeof Symbol !== "function") {
7517
- return false;
7518
- }
7519
- if (typeof origSymbol("foo") !== "symbol") {
7520
- return false;
7521
- }
7522
- if (typeof Symbol("bar") !== "symbol") {
7523
- return false;
7524
- }
7525
- return hasSymbolSham();
7526
- };
7527
- }
7528
- });
7529
- var require_get_intrinsic2 = __commonJS5({
7530
- "node_modules/get-intrinsic/index.js"(exports, module) {
7531
- "use strict";
7532
- var undefined2;
7533
- var $SyntaxError = SyntaxError;
7534
- var $Function = Function;
7535
- var $TypeError = TypeError;
7536
- var getEvalledConstructor = function(expressionSyntax) {
7537
- try {
7538
- return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
7539
- } catch (e) {
7540
- }
7541
- };
7542
- var $gOPD = Object.getOwnPropertyDescriptor;
7543
- if ($gOPD) {
7544
- try {
7545
- $gOPD({}, "");
7546
- } catch (e) {
7547
- $gOPD = null;
7548
- }
7549
- }
7550
- var throwTypeError = function() {
7551
- throw new $TypeError();
7552
- };
7553
- var ThrowTypeError = $gOPD ? function() {
7554
- try {
7555
- arguments.callee;
7556
- return throwTypeError;
7557
- } catch (calleeThrows) {
7558
- try {
7559
- return $gOPD(arguments, "callee").get;
7560
- } catch (gOPDthrows) {
7561
- return throwTypeError;
7562
- }
7563
- }
7564
- }() : throwTypeError;
7565
- var hasSymbols = require_has_symbols2()();
7566
- var getProto = Object.getPrototypeOf || function(x) {
7567
- return x.__proto__;
7568
- };
7569
- var needsEval = {};
7570
- var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array);
7571
- var INTRINSICS = {
7572
- "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
7573
- "%Array%": Array,
7574
- "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
7575
- "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2,
7576
- "%AsyncFromSyncIteratorPrototype%": undefined2,
7577
- "%AsyncFunction%": needsEval,
7578
- "%AsyncGenerator%": needsEval,
7579
- "%AsyncGeneratorFunction%": needsEval,
7580
- "%AsyncIteratorPrototype%": needsEval,
7581
- "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
7582
- "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
7583
- "%Boolean%": Boolean,
7584
- "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
7585
- "%Date%": Date,
7586
- "%decodeURI%": decodeURI,
7587
- "%decodeURIComponent%": decodeURIComponent,
7588
- "%encodeURI%": encodeURI,
7589
- "%encodeURIComponent%": encodeURIComponent,
7590
- "%Error%": Error,
7591
- "%eval%": eval,
7592
- "%EvalError%": EvalError,
7593
- "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
7594
- "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
7595
- "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
7596
- "%Function%": $Function,
7597
- "%GeneratorFunction%": needsEval,
7598
- "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
7599
- "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
7600
- "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
7601
- "%isFinite%": isFinite,
7602
- "%isNaN%": isNaN,
7603
- "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2,
7604
- "%JSON%": typeof JSON === "object" ? JSON : undefined2,
7605
- "%Map%": typeof Map === "undefined" ? undefined2 : Map,
7606
- "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
7607
- "%Math%": Math,
7608
- "%Number%": Number,
7609
- "%Object%": Object,
7610
- "%parseFloat%": parseFloat,
7611
- "%parseInt%": parseInt,
7612
- "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
7613
- "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
7614
- "%RangeError%": RangeError,
7615
- "%ReferenceError%": ReferenceError,
7616
- "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
7617
- "%RegExp%": RegExp,
7618
- "%Set%": typeof Set === "undefined" ? undefined2 : Set,
7619
- "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
7620
- "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
7621
- "%String%": String,
7622
- "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2,
7623
- "%Symbol%": hasSymbols ? Symbol : undefined2,
7624
- "%SyntaxError%": $SyntaxError,
7625
- "%ThrowTypeError%": ThrowTypeError,
7626
- "%TypedArray%": TypedArray,
7627
- "%TypeError%": $TypeError,
7628
- "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
7629
- "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
7630
- "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
7631
- "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
7632
- "%URIError%": URIError,
7633
- "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
7634
- "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
7635
- "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
7636
- };
7637
- var doEval = function doEval2(name) {
7638
- var value;
7639
- if (name === "%AsyncFunction%") {
7640
- value = getEvalledConstructor("async function () {}");
7641
- } else if (name === "%GeneratorFunction%") {
7642
- value = getEvalledConstructor("function* () {}");
7643
- } else if (name === "%AsyncGeneratorFunction%") {
7644
- value = getEvalledConstructor("async function* () {}");
7645
- } else if (name === "%AsyncGenerator%") {
7646
- var fn = doEval2("%AsyncGeneratorFunction%");
7647
- if (fn) {
7648
- value = fn.prototype;
7649
- }
7650
- } else if (name === "%AsyncIteratorPrototype%") {
7651
- var gen = doEval2("%AsyncGenerator%");
7652
- if (gen) {
7653
- value = getProto(gen.prototype);
7654
- }
7655
- }
7656
- INTRINSICS[name] = value;
7657
- return value;
7658
- };
7659
- var LEGACY_ALIASES = {
7660
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
7661
- "%ArrayPrototype%": ["Array", "prototype"],
7662
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
7663
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
7664
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
7665
- "%ArrayProto_values%": ["Array", "prototype", "values"],
7666
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
7667
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
7668
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
7669
- "%BooleanPrototype%": ["Boolean", "prototype"],
7670
- "%DataViewPrototype%": ["DataView", "prototype"],
7671
- "%DatePrototype%": ["Date", "prototype"],
7672
- "%ErrorPrototype%": ["Error", "prototype"],
7673
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
7674
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
7675
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
7676
- "%FunctionPrototype%": ["Function", "prototype"],
7677
- "%Generator%": ["GeneratorFunction", "prototype"],
7678
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
7679
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
7680
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
7681
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
7682
- "%JSONParse%": ["JSON", "parse"],
7683
- "%JSONStringify%": ["JSON", "stringify"],
7684
- "%MapPrototype%": ["Map", "prototype"],
7685
- "%NumberPrototype%": ["Number", "prototype"],
7686
- "%ObjectPrototype%": ["Object", "prototype"],
7687
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
7688
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
7689
- "%PromisePrototype%": ["Promise", "prototype"],
7690
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
7691
- "%Promise_all%": ["Promise", "all"],
7692
- "%Promise_reject%": ["Promise", "reject"],
7693
- "%Promise_resolve%": ["Promise", "resolve"],
7694
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
7695
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
7696
- "%RegExpPrototype%": ["RegExp", "prototype"],
7697
- "%SetPrototype%": ["Set", "prototype"],
7698
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
7699
- "%StringPrototype%": ["String", "prototype"],
7700
- "%SymbolPrototype%": ["Symbol", "prototype"],
7701
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
7702
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
7703
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
7704
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
7705
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
7706
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
7707
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
7708
- "%URIErrorPrototype%": ["URIError", "prototype"],
7709
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
7710
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
7711
- };
7712
- var bind = require_function_bind();
7713
- var hasOwn = require_src();
7714
- var $concat = bind.call(Function.call, Array.prototype.concat);
7715
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
7716
- var $replace = bind.call(Function.call, String.prototype.replace);
7717
- var $strSlice = bind.call(Function.call, String.prototype.slice);
7718
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
7719
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
7720
- var reEscapeChar = /\\(\\)?/g;
7721
- var stringToPath = function stringToPath2(string) {
7722
- var first = $strSlice(string, 0, 1);
7723
- var last = $strSlice(string, -1);
7724
- if (first === "%" && last !== "%") {
7725
- throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
7726
- } else if (last === "%" && first !== "%") {
7727
- throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
7728
- }
7729
- var result = [];
7730
- $replace(string, rePropName, function(match2, number, quote, subString) {
7731
- result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match2;
7732
- });
7733
- return result;
7734
- };
7735
- var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
7736
- var intrinsicName = name;
7737
- var alias;
7738
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
7739
- alias = LEGACY_ALIASES[intrinsicName];
7740
- intrinsicName = "%" + alias[0] + "%";
7741
- }
7742
- if (hasOwn(INTRINSICS, intrinsicName)) {
7743
- var value = INTRINSICS[intrinsicName];
7744
- if (value === needsEval) {
7745
- value = doEval(intrinsicName);
7746
- }
7747
- if (typeof value === "undefined" && !allowMissing) {
7748
- throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
7749
- }
7750
- return {
7751
- alias,
7752
- name: intrinsicName,
7753
- value
7754
- };
7755
- }
7756
- throw new $SyntaxError("intrinsic " + name + " does not exist!");
7757
- };
7758
- module.exports = function GetIntrinsic(name, allowMissing) {
7759
- if (typeof name !== "string" || name.length === 0) {
7760
- throw new $TypeError("intrinsic name must be a non-empty string");
7761
- }
7762
- if (arguments.length > 1 && typeof allowMissing !== "boolean") {
7763
- throw new $TypeError('"allowMissing" argument must be a boolean');
7764
- }
7765
- if ($exec(/^%?[^%]*%?$/g, name) === null) {
7766
- throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
7767
- }
7768
- var parts = stringToPath(name);
7769
- var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
7770
- var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
7771
- var intrinsicRealName = intrinsic.name;
7772
- var value = intrinsic.value;
7773
- var skipFurtherCaching = false;
7774
- var alias = intrinsic.alias;
7775
- if (alias) {
7776
- intrinsicBaseName = alias[0];
7777
- $spliceApply(parts, $concat([0, 1], alias));
7778
- }
7779
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
7780
- var part = parts[i];
7781
- var first = $strSlice(part, 0, 1);
7782
- var last = $strSlice(part, -1);
7783
- if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
7784
- throw new $SyntaxError("property names with quotes must have matching quotes");
7785
- }
7786
- if (part === "constructor" || !isOwn) {
7787
- skipFurtherCaching = true;
7788
- }
7789
- intrinsicBaseName += "." + part;
7790
- intrinsicRealName = "%" + intrinsicBaseName + "%";
7791
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
7792
- value = INTRINSICS[intrinsicRealName];
7793
- } else if (value != null) {
7794
- if (!(part in value)) {
7795
- if (!allowMissing) {
7796
- throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
7797
- }
7798
- return void 0;
7799
- }
7800
- if ($gOPD && i + 1 >= parts.length) {
7801
- var desc = $gOPD(value, part);
7802
- isOwn = !!desc;
7803
- if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
7804
- value = desc.get;
7805
- } else {
7806
- value = value[part];
7807
- }
7808
- } else {
7809
- isOwn = hasOwn(value, part);
7810
- value = value[part];
7811
- }
7812
- if (isOwn && !skipFurtherCaching) {
7813
- INTRINSICS[intrinsicRealName] = value;
7814
- }
7815
- }
7816
- }
7817
- return value;
7818
- };
7819
- }
7820
- });
7821
- var require_getOwnPropertyDescriptor = __commonJS5({
7822
- "node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js"(exports, module) {
7823
- "use strict";
7824
- var GetIntrinsic = require_get_intrinsic2();
7825
- var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
7826
- if ($gOPD) {
7827
- try {
7828
- $gOPD([], "length");
7829
- } catch (e) {
7830
- $gOPD = null;
7831
- }
7832
- }
7833
- module.exports = $gOPD;
7834
- }
7835
- });
7836
- var require_is_typed_array = __commonJS5({
7837
- "node_modules/is-typed-array/index.js"(exports, module) {
7838
- "use strict";
7839
- var forEach = require_for_each();
7840
- var availableTypedArrays = require_available_typed_arrays();
7841
- var callBound = require_callBound();
7842
- var $toString = callBound("Object.prototype.toString");
7843
- var hasToStringTag = require_shams2()();
7844
- var g = typeof globalThis === "undefined" ? global : globalThis;
7845
- var typedArrays = availableTypedArrays();
7846
- var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) {
7847
- for (var i = 0; i < array.length; i += 1) {
7848
- if (array[i] === value) {
7849
- return i;
7850
- }
7851
- }
7852
- return -1;
7853
- };
7854
- var $slice = callBound("String.prototype.slice");
7855
- var toStrTags = {};
7856
- var gOPD = require_getOwnPropertyDescriptor();
7857
- var getPrototypeOf = Object.getPrototypeOf;
7858
- if (hasToStringTag && gOPD && getPrototypeOf) {
7859
- forEach(typedArrays, function(typedArray) {
7860
- var arr = new g[typedArray]();
7861
- if (Symbol.toStringTag in arr) {
7862
- var proto = getPrototypeOf(arr);
7863
- var descriptor = gOPD(proto, Symbol.toStringTag);
7864
- if (!descriptor) {
7865
- var superProto = getPrototypeOf(proto);
7866
- descriptor = gOPD(superProto, Symbol.toStringTag);
7867
- }
7868
- toStrTags[typedArray] = descriptor.get;
7869
- }
7870
- });
7871
- }
7872
- var tryTypedArrays = function tryAllTypedArrays(value) {
7873
- var anyTrue = false;
7874
- forEach(toStrTags, function(getter, typedArray) {
7875
- if (!anyTrue) {
7876
- try {
7877
- anyTrue = getter.call(value) === typedArray;
7878
- } catch (e) {
7879
- }
7880
- }
7881
- });
7882
- return anyTrue;
7883
- };
7884
- module.exports = function isTypedArray(value) {
7885
- if (!value || typeof value !== "object") {
7886
- return false;
7887
- }
7888
- if (!hasToStringTag || !(Symbol.toStringTag in value)) {
7889
- var tag = $slice($toString(value), 8, -1);
7890
- return $indexOf(typedArrays, tag) > -1;
7891
- }
7892
- if (!gOPD) {
7893
- return false;
7894
- }
7895
- return tryTypedArrays(value);
7896
- };
7897
- }
7898
- });
7899
- var require_which_typed_array = __commonJS5({
7900
- "node_modules/which-typed-array/index.js"(exports, module) {
7901
- "use strict";
7902
- var forEach = require_for_each();
7903
- var availableTypedArrays = require_available_typed_arrays();
7904
- var callBound = require_callBound();
7905
- var $toString = callBound("Object.prototype.toString");
7906
- var hasToStringTag = require_shams2()();
7907
- var g = typeof globalThis === "undefined" ? global : globalThis;
7908
- var typedArrays = availableTypedArrays();
7909
- var $slice = callBound("String.prototype.slice");
7910
- var toStrTags = {};
7911
- var gOPD = require_getOwnPropertyDescriptor();
7912
- var getPrototypeOf = Object.getPrototypeOf;
7913
- if (hasToStringTag && gOPD && getPrototypeOf) {
7914
- forEach(typedArrays, function(typedArray) {
7915
- if (typeof g[typedArray] === "function") {
7916
- var arr = new g[typedArray]();
7917
- if (Symbol.toStringTag in arr) {
7918
- var proto = getPrototypeOf(arr);
7919
- var descriptor = gOPD(proto, Symbol.toStringTag);
7920
- if (!descriptor) {
7921
- var superProto = getPrototypeOf(proto);
7922
- descriptor = gOPD(superProto, Symbol.toStringTag);
7923
- }
7924
- toStrTags[typedArray] = descriptor.get;
7925
- }
7926
- }
7927
- });
7928
- }
7929
- var tryTypedArrays = function tryAllTypedArrays(value) {
7930
- var foundName = false;
7931
- forEach(toStrTags, function(getter, typedArray) {
7932
- if (!foundName) {
7933
- try {
7934
- var name = getter.call(value);
7935
- if (name === typedArray) {
7936
- foundName = name;
7937
- }
7938
- } catch (e) {
7939
- }
7940
- }
7941
- });
7942
- return foundName;
7943
- };
7944
- var isTypedArray = require_is_typed_array();
7945
- module.exports = function whichTypedArray(value) {
7946
- if (!isTypedArray(value)) {
7947
- return false;
7948
- }
7949
- if (!hasToStringTag || !(Symbol.toStringTag in value)) {
7950
- return $slice($toString(value), 8, -1);
7951
- }
7952
- return tryTypedArrays(value);
7953
- };
7954
- }
7955
- });
7956
- var require_types = __commonJS5({
7957
- "node_modules/util/support/types.js"(exports) {
7958
- "use strict";
7959
- var isArgumentsObject = require_is_arguments();
7960
- var isGeneratorFunction = require_is_generator_function();
7961
- var whichTypedArray = require_which_typed_array();
7962
- var isTypedArray = require_is_typed_array();
7963
- function uncurryThis(f) {
7964
- return f.call.bind(f);
7965
- }
7966
- var BigIntSupported = typeof BigInt !== "undefined";
7967
- var SymbolSupported = typeof Symbol !== "undefined";
7968
- var ObjectToString = uncurryThis(Object.prototype.toString);
7969
- var numberValue = uncurryThis(Number.prototype.valueOf);
7970
- var stringValue = uncurryThis(String.prototype.valueOf);
7971
- var booleanValue = uncurryThis(Boolean.prototype.valueOf);
7972
- if (BigIntSupported) {
7973
- bigIntValue = uncurryThis(BigInt.prototype.valueOf);
7974
- }
7975
- var bigIntValue;
7976
- if (SymbolSupported) {
7977
- symbolValue = uncurryThis(Symbol.prototype.valueOf);
7978
- }
7979
- var symbolValue;
7980
- function checkBoxedPrimitive(value, prototypeValueOf) {
7981
- if (typeof value !== "object") {
7982
- return false;
7983
- }
7984
- try {
7985
- prototypeValueOf(value);
7986
- return true;
7987
- } catch (e) {
7988
- return false;
7989
- }
7990
- }
7991
- exports.isArgumentsObject = isArgumentsObject;
7992
- exports.isGeneratorFunction = isGeneratorFunction;
7993
- exports.isTypedArray = isTypedArray;
7994
- function isPromise(input) {
7995
- return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function";
7996
- }
7997
- exports.isPromise = isPromise;
7998
- function isArrayBufferView(value) {
7999
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
8000
- return ArrayBuffer.isView(value);
8001
- }
8002
- return isTypedArray(value) || isDataView(value);
8003
- }
8004
- exports.isArrayBufferView = isArrayBufferView;
8005
- function isUint8Array(value) {
8006
- return whichTypedArray(value) === "Uint8Array";
8007
- }
8008
- exports.isUint8Array = isUint8Array;
8009
- function isUint8ClampedArray(value) {
8010
- return whichTypedArray(value) === "Uint8ClampedArray";
8011
- }
8012
- exports.isUint8ClampedArray = isUint8ClampedArray;
8013
- function isUint16Array(value) {
8014
- return whichTypedArray(value) === "Uint16Array";
8015
- }
8016
- exports.isUint16Array = isUint16Array;
8017
- function isUint32Array(value) {
8018
- return whichTypedArray(value) === "Uint32Array";
8019
- }
8020
- exports.isUint32Array = isUint32Array;
8021
- function isInt8Array(value) {
8022
- return whichTypedArray(value) === "Int8Array";
8023
- }
8024
- exports.isInt8Array = isInt8Array;
8025
- function isInt16Array(value) {
8026
- return whichTypedArray(value) === "Int16Array";
8027
- }
8028
- exports.isInt16Array = isInt16Array;
8029
- function isInt32Array(value) {
8030
- return whichTypedArray(value) === "Int32Array";
8031
- }
8032
- exports.isInt32Array = isInt32Array;
8033
- function isFloat32Array(value) {
8034
- return whichTypedArray(value) === "Float32Array";
8035
- }
8036
- exports.isFloat32Array = isFloat32Array;
8037
- function isFloat64Array(value) {
8038
- return whichTypedArray(value) === "Float64Array";
8039
- }
8040
- exports.isFloat64Array = isFloat64Array;
8041
- function isBigInt64Array(value) {
8042
- return whichTypedArray(value) === "BigInt64Array";
8043
- }
8044
- exports.isBigInt64Array = isBigInt64Array;
8045
- function isBigUint64Array(value) {
8046
- return whichTypedArray(value) === "BigUint64Array";
8047
- }
8048
- exports.isBigUint64Array = isBigUint64Array;
8049
- function isMapToString(value) {
8050
- return ObjectToString(value) === "[object Map]";
8051
- }
8052
- isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map());
8053
- function isMap(value) {
8054
- if (typeof Map === "undefined") {
8055
- return false;
8056
- }
8057
- return isMapToString.working ? isMapToString(value) : value instanceof Map;
8058
- }
8059
- exports.isMap = isMap;
8060
- function isSetToString(value) {
8061
- return ObjectToString(value) === "[object Set]";
8062
- }
8063
- isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set());
8064
- function isSet(value) {
8065
- if (typeof Set === "undefined") {
8066
- return false;
8067
- }
8068
- return isSetToString.working ? isSetToString(value) : value instanceof Set;
8069
- }
8070
- exports.isSet = isSet;
8071
- function isWeakMapToString(value) {
8072
- return ObjectToString(value) === "[object WeakMap]";
8073
- }
8074
- isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap());
8075
- function isWeakMap(value) {
8076
- if (typeof WeakMap === "undefined") {
8077
- return false;
8078
- }
8079
- return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;
8080
- }
8081
- exports.isWeakMap = isWeakMap;
8082
- function isWeakSetToString(value) {
8083
- return ObjectToString(value) === "[object WeakSet]";
8084
- }
8085
- isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet());
8086
- function isWeakSet(value) {
8087
- return isWeakSetToString(value);
8088
- }
8089
- exports.isWeakSet = isWeakSet;
8090
- function isArrayBufferToString(value) {
8091
- return ObjectToString(value) === "[object ArrayBuffer]";
8092
- }
8093
- isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer());
8094
- function isArrayBuffer(value) {
8095
- if (typeof ArrayBuffer === "undefined") {
8096
- return false;
8097
- }
8098
- return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;
8099
- }
8100
- exports.isArrayBuffer = isArrayBuffer;
8101
- function isDataViewToString(value) {
8102
- return ObjectToString(value) === "[object DataView]";
8103
- }
8104
- isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));
8105
- function isDataView(value) {
8106
- if (typeof DataView === "undefined") {
8107
- return false;
8108
- }
8109
- return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;
8110
- }
8111
- exports.isDataView = isDataView;
8112
- var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0;
8113
- function isSharedArrayBufferToString(value) {
8114
- return ObjectToString(value) === "[object SharedArrayBuffer]";
8115
- }
8116
- function isSharedArrayBuffer(value) {
8117
- if (typeof SharedArrayBufferCopy === "undefined") {
8118
- return false;
8119
- }
8120
- if (typeof isSharedArrayBufferToString.working === "undefined") {
8121
- isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());
8122
- }
8123
- return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy;
8124
- }
8125
- exports.isSharedArrayBuffer = isSharedArrayBuffer;
8126
- function isAsyncFunction(value) {
8127
- return ObjectToString(value) === "[object AsyncFunction]";
8128
- }
8129
- exports.isAsyncFunction = isAsyncFunction;
8130
- function isMapIterator(value) {
8131
- return ObjectToString(value) === "[object Map Iterator]";
8132
- }
8133
- exports.isMapIterator = isMapIterator;
8134
- function isSetIterator(value) {
8135
- return ObjectToString(value) === "[object Set Iterator]";
8136
- }
8137
- exports.isSetIterator = isSetIterator;
8138
- function isGeneratorObject(value) {
8139
- return ObjectToString(value) === "[object Generator]";
8140
- }
8141
- exports.isGeneratorObject = isGeneratorObject;
8142
- function isWebAssemblyCompiledModule(value) {
8143
- return ObjectToString(value) === "[object WebAssembly.Module]";
8144
- }
8145
- exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
8146
- function isNumberObject(value) {
8147
- return checkBoxedPrimitive(value, numberValue);
8148
- }
8149
- exports.isNumberObject = isNumberObject;
8150
- function isStringObject(value) {
8151
- return checkBoxedPrimitive(value, stringValue);
8152
- }
8153
- exports.isStringObject = isStringObject;
8154
- function isBooleanObject(value) {
8155
- return checkBoxedPrimitive(value, booleanValue);
8156
- }
8157
- exports.isBooleanObject = isBooleanObject;
8158
- function isBigIntObject(value) {
8159
- return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
8160
- }
8161
- exports.isBigIntObject = isBigIntObject;
8162
- function isSymbolObject(value) {
8163
- return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
8164
- }
8165
- exports.isSymbolObject = isSymbolObject;
8166
- function isBoxedPrimitive(value) {
8167
- return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value);
8168
- }
8169
- exports.isBoxedPrimitive = isBoxedPrimitive;
8170
- function isAnyArrayBuffer(value) {
8171
- return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value));
8172
- }
8173
- exports.isAnyArrayBuffer = isAnyArrayBuffer;
8174
- ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method) {
8175
- Object.defineProperty(exports, method, {
8176
- enumerable: false,
8177
- value: function() {
8178
- throw new Error(method + " is not supported in userland");
8179
- }
8180
- });
8181
- });
8182
- }
8183
- });
8184
- var require_isBufferBrowser = __commonJS5({
8185
- "node_modules/util/support/isBufferBrowser.js"(exports, module) {
8186
- module.exports = function isBuffer(arg) {
8187
- return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function";
8188
- };
8189
- }
8190
- });
8191
- var require_inherits_browser = __commonJS5({
8192
- "node_modules/inherits/inherits_browser.js"(exports, module) {
8193
- if (typeof Object.create === "function") {
8194
- module.exports = function inherits(ctor, superCtor) {
8195
- if (superCtor) {
8196
- ctor.super_ = superCtor;
8197
- ctor.prototype = Object.create(superCtor.prototype, {
8198
- constructor: {
8199
- value: ctor,
8200
- enumerable: false,
8201
- writable: true,
8202
- configurable: true
8203
- }
8204
- });
8205
- }
8206
- };
8207
- } else {
8208
- module.exports = function inherits(ctor, superCtor) {
8209
- if (superCtor) {
8210
- ctor.super_ = superCtor;
8211
- var TempCtor = function() {
8212
- };
8213
- TempCtor.prototype = superCtor.prototype;
8214
- ctor.prototype = new TempCtor();
8215
- ctor.prototype.constructor = ctor;
8216
- }
8217
- };
8218
- }
8219
- }
8220
- });
8221
- var require_util = __commonJS5({
8222
- "node_modules/util/util.js"(exports) {
8223
- var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors2(obj) {
8224
- var keys = Object.keys(obj);
8225
- var descriptors = {};
8226
- for (var i = 0; i < keys.length; i++) {
8227
- descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
8228
- }
8229
- return descriptors;
8230
- };
8231
- var formatRegExp = /%[sdj%]/g;
8232
- exports.format = function(f) {
8233
- if (!isString(f)) {
8234
- var objects = [];
8235
- for (var i = 0; i < arguments.length; i++) {
8236
- objects.push(inspect2(arguments[i]));
8237
- }
8238
- return objects.join(" ");
8239
- }
8240
- var i = 1;
8241
- var args = arguments;
8242
- var len = args.length;
8243
- var str = String(f).replace(formatRegExp, function(x2) {
8244
- if (x2 === "%%")
8245
- return "%";
8246
- if (i >= len)
8247
- return x2;
8248
- switch (x2) {
8249
- case "%s":
8250
- return String(args[i++]);
8251
- case "%d":
8252
- return Number(args[i++]);
8253
- case "%j":
8254
- try {
8255
- return JSON.stringify(args[i++]);
8256
- } catch (_) {
8257
- return "[Circular]";
8258
- }
8259
- default:
8260
- return x2;
8261
- }
8262
- });
8263
- for (var x = args[i]; i < len; x = args[++i]) {
8264
- if (isNull(x) || !isObject2(x)) {
8265
- str += " " + x;
8266
- } else {
8267
- str += " " + inspect2(x);
8268
- }
8269
- }
8270
- return str;
8271
- };
8272
- exports.deprecate = function(fn, msg) {
8273
- if (typeof process !== "undefined" && process.noDeprecation === true) {
8274
- return fn;
8275
- }
8276
- if (typeof process === "undefined") {
8277
- return function() {
8278
- return exports.deprecate(fn, msg).apply(this, arguments);
8279
- };
8280
- }
8281
- var warned = false;
8282
- function deprecated() {
8283
- if (!warned) {
8284
- if (process.throwDeprecation) {
8285
- throw new Error(msg);
8286
- } else if (process.traceDeprecation) {
8287
- console.trace(msg);
8288
- } else {
8289
- console.error(msg);
8290
- }
8291
- warned = true;
8292
- }
8293
- return fn.apply(this, arguments);
8294
- }
8295
- return deprecated;
8296
- };
8297
- var debugs = {};
8298
- var debugEnvRegex = /^$/;
8299
- if (process.env.NODE_DEBUG) {
8300
- debugEnv = process.env.NODE_DEBUG;
8301
- debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
8302
- debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
8303
- }
8304
- var debugEnv;
8305
- exports.debuglog = function(set) {
8306
- set = set.toUpperCase();
8307
- if (!debugs[set]) {
8308
- if (debugEnvRegex.test(set)) {
8309
- var pid = process.pid;
8310
- debugs[set] = function() {
8311
- var msg = exports.format.apply(exports, arguments);
8312
- console.error("%s %d: %s", set, pid, msg);
8313
- };
8314
- } else {
8315
- debugs[set] = function() {
8316
- };
8317
- }
8318
- }
8319
- return debugs[set];
8320
- };
8321
- function inspect2(obj, opts) {
8322
- var ctx = {
8323
- seen: [],
8324
- stylize: stylizeNoColor
8325
- };
8326
- if (arguments.length >= 3)
8327
- ctx.depth = arguments[2];
8328
- if (arguments.length >= 4)
8329
- ctx.colors = arguments[3];
8330
- if (isBoolean(opts)) {
8331
- ctx.showHidden = opts;
8332
- } else if (opts) {
8333
- exports._extend(ctx, opts);
8334
- }
8335
- if (isUndefined(ctx.showHidden))
8336
- ctx.showHidden = false;
8337
- if (isUndefined(ctx.depth))
8338
- ctx.depth = 2;
8339
- if (isUndefined(ctx.colors))
8340
- ctx.colors = false;
8341
- if (isUndefined(ctx.customInspect))
8342
- ctx.customInspect = true;
8343
- if (ctx.colors)
8344
- ctx.stylize = stylizeWithColor;
8345
- return formatValue2(ctx, obj, ctx.depth);
8346
- }
8347
- exports.inspect = inspect2;
8348
- inspect2.colors = {
8349
- "bold": [1, 22],
8350
- "italic": [3, 23],
8351
- "underline": [4, 24],
8352
- "inverse": [7, 27],
8353
- "white": [37, 39],
8354
- "grey": [90, 39],
8355
- "black": [30, 39],
8356
- "blue": [34, 39],
8357
- "cyan": [36, 39],
8358
- "green": [32, 39],
8359
- "magenta": [35, 39],
8360
- "red": [31, 39],
8361
- "yellow": [33, 39]
8362
- };
8363
- inspect2.styles = {
8364
- "special": "cyan",
8365
- "number": "yellow",
8366
- "boolean": "yellow",
8367
- "undefined": "grey",
8368
- "null": "bold",
8369
- "string": "green",
8370
- "date": "magenta",
8371
- "regexp": "red"
8372
- };
8373
- function stylizeWithColor(str, styleType) {
8374
- var style = inspect2.styles[styleType];
8375
- if (style) {
8376
- return "\x1B[" + inspect2.colors[style][0] + "m" + str + "\x1B[" + inspect2.colors[style][1] + "m";
8377
- } else {
8378
- return str;
8379
- }
8380
- }
8381
- function stylizeNoColor(str, styleType) {
8382
- return str;
8383
- }
8384
- function arrayToHash(array) {
8385
- var hash = {};
8386
- array.forEach(function(val, idx) {
8387
- hash[val] = true;
8388
- });
8389
- return hash;
8390
- }
8391
- function formatValue2(ctx, value, recurseTimes) {
8392
- if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== exports.inspect && !(value.constructor && value.constructor.prototype === value)) {
8393
- var ret = value.inspect(recurseTimes, ctx);
8394
- if (!isString(ret)) {
8395
- ret = formatValue2(ctx, ret, recurseTimes);
8396
- }
8397
- return ret;
8398
- }
8399
- var primitive = formatPrimitive(ctx, value);
8400
- if (primitive) {
8401
- return primitive;
8402
- }
8403
- var keys = Object.keys(value);
8404
- var visibleKeys = arrayToHash(keys);
8405
- if (ctx.showHidden) {
8406
- keys = Object.getOwnPropertyNames(value);
8407
- }
8408
- if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
8409
- return formatError(value);
8410
- }
8411
- if (keys.length === 0) {
8412
- if (isFunction(value)) {
8413
- var name = value.name ? ": " + value.name : "";
8414
- return ctx.stylize("[Function" + name + "]", "special");
8415
- }
8416
- if (isRegExp(value)) {
8417
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
8418
- }
8419
- if (isDate(value)) {
8420
- return ctx.stylize(Date.prototype.toString.call(value), "date");
8421
- }
8422
- if (isError(value)) {
8423
- return formatError(value);
8424
- }
8425
- }
8426
- var base = "", array = false, braces = ["{", "}"];
8427
- if (isArray(value)) {
8428
- array = true;
8429
- braces = ["[", "]"];
8430
- }
8431
- if (isFunction(value)) {
8432
- var n = value.name ? ": " + value.name : "";
8433
- base = " [Function" + n + "]";
8434
- }
8435
- if (isRegExp(value)) {
8436
- base = " " + RegExp.prototype.toString.call(value);
8437
- }
8438
- if (isDate(value)) {
8439
- base = " " + Date.prototype.toUTCString.call(value);
8440
- }
8441
- if (isError(value)) {
8442
- base = " " + formatError(value);
8443
- }
8444
- if (keys.length === 0 && (!array || value.length == 0)) {
8445
- return braces[0] + base + braces[1];
8446
- }
8447
- if (recurseTimes < 0) {
8448
- if (isRegExp(value)) {
8449
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
8450
- } else {
8451
- return ctx.stylize("[Object]", "special");
8452
- }
8453
- }
8454
- ctx.seen.push(value);
8455
- var output;
8456
- if (array) {
8457
- output = formatArray2(ctx, value, recurseTimes, visibleKeys, keys);
8458
- } else {
8459
- output = keys.map(function(key) {
8460
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
8461
- });
8462
- }
8463
- ctx.seen.pop();
8464
- return reduceToSingleString(output, base, braces);
8465
- }
8466
- function formatPrimitive(ctx, value) {
8467
- if (isUndefined(value))
8468
- return ctx.stylize("undefined", "undefined");
8469
- if (isString(value)) {
8470
- var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
8471
- return ctx.stylize(simple, "string");
8472
- }
8473
- if (isNumber(value))
8474
- return ctx.stylize("" + value, "number");
8475
- if (isBoolean(value))
8476
- return ctx.stylize("" + value, "boolean");
8477
- if (isNull(value))
8478
- return ctx.stylize("null", "null");
8479
- }
8480
- function formatError(value) {
8481
- return "[" + Error.prototype.toString.call(value) + "]";
8482
- }
8483
- function formatArray2(ctx, value, recurseTimes, visibleKeys, keys) {
8484
- var output = [];
8485
- for (var i = 0, l = value.length; i < l; ++i) {
8486
- if (hasOwnProperty(value, String(i))) {
8487
- output.push(formatProperty(
8488
- ctx,
8489
- value,
8490
- recurseTimes,
8491
- visibleKeys,
8492
- String(i),
8493
- true
8494
- ));
8495
- } else {
8496
- output.push("");
8497
- }
8498
- }
8499
- keys.forEach(function(key) {
8500
- if (!key.match(/^\d+$/)) {
8501
- output.push(formatProperty(
8502
- ctx,
8503
- value,
8504
- recurseTimes,
8505
- visibleKeys,
8506
- key,
8507
- true
8508
- ));
8509
- }
8510
- });
8511
- return output;
8512
- }
8513
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
8514
- var name, str, desc;
8515
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
8516
- if (desc.get) {
8517
- if (desc.set) {
8518
- str = ctx.stylize("[Getter/Setter]", "special");
8519
- } else {
8520
- str = ctx.stylize("[Getter]", "special");
8521
- }
8522
- } else {
8523
- if (desc.set) {
8524
- str = ctx.stylize("[Setter]", "special");
8525
- }
8526
- }
8527
- if (!hasOwnProperty(visibleKeys, key)) {
8528
- name = "[" + key + "]";
8529
- }
8530
- if (!str) {
8531
- if (ctx.seen.indexOf(desc.value) < 0) {
8532
- if (isNull(recurseTimes)) {
8533
- str = formatValue2(ctx, desc.value, null);
8534
- } else {
8535
- str = formatValue2(ctx, desc.value, recurseTimes - 1);
8536
- }
8537
- if (str.indexOf("\n") > -1) {
8538
- if (array) {
8539
- str = str.split("\n").map(function(line) {
8540
- return " " + line;
8541
- }).join("\n").substr(2);
8542
- } else {
8543
- str = "\n" + str.split("\n").map(function(line) {
8544
- return " " + line;
8545
- }).join("\n");
8546
- }
8547
- }
8548
- } else {
8549
- str = ctx.stylize("[Circular]", "special");
8550
- }
8551
- }
8552
- if (isUndefined(name)) {
8553
- if (array && key.match(/^\d+$/)) {
8554
- return str;
8555
- }
8556
- name = JSON.stringify("" + key);
8557
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
8558
- name = name.substr(1, name.length - 2);
8559
- name = ctx.stylize(name, "name");
8560
- } else {
8561
- name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
8562
- name = ctx.stylize(name, "string");
8563
- }
8564
- }
8565
- return name + ": " + str;
8566
- }
8567
- function reduceToSingleString(output, base, braces) {
8568
- var numLinesEst = 0;
8569
- var length = output.reduce(function(prev, cur) {
8570
- numLinesEst++;
8571
- if (cur.indexOf("\n") >= 0)
8572
- numLinesEst++;
8573
- return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
8574
- }, 0);
8575
- if (length > 60) {
8576
- return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
8577
- }
8578
- return braces[0] + base + " " + output.join(", ") + " " + braces[1];
8579
- }
8580
- exports.types = require_types();
8581
- function isArray(ar) {
8582
- return Array.isArray(ar);
8583
- }
8584
- exports.isArray = isArray;
8585
- function isBoolean(arg) {
8586
- return typeof arg === "boolean";
8587
- }
8588
- exports.isBoolean = isBoolean;
8589
- function isNull(arg) {
8590
- return arg === null;
8591
- }
8592
- exports.isNull = isNull;
8593
- function isNullOrUndefined(arg) {
8594
- return arg == null;
8595
- }
8596
- exports.isNullOrUndefined = isNullOrUndefined;
8597
- function isNumber(arg) {
8598
- return typeof arg === "number";
8599
- }
8600
- exports.isNumber = isNumber;
8601
- function isString(arg) {
8602
- return typeof arg === "string";
8603
- }
8604
- exports.isString = isString;
8605
- function isSymbol(arg) {
8606
- return typeof arg === "symbol";
8607
- }
8608
- exports.isSymbol = isSymbol;
8609
- function isUndefined(arg) {
8610
- return arg === void 0;
8611
- }
8612
- exports.isUndefined = isUndefined;
8613
- function isRegExp(re) {
8614
- return isObject2(re) && objectToString(re) === "[object RegExp]";
8615
- }
8616
- exports.isRegExp = isRegExp;
8617
- exports.types.isRegExp = isRegExp;
8618
- function isObject2(arg) {
8619
- return typeof arg === "object" && arg !== null;
8620
- }
8621
- exports.isObject = isObject2;
8622
- function isDate(d) {
8623
- return isObject2(d) && objectToString(d) === "[object Date]";
8624
- }
8625
- exports.isDate = isDate;
8626
- exports.types.isDate = isDate;
8627
- function isError(e) {
8628
- return isObject2(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
8629
- }
8630
- exports.isError = isError;
8631
- exports.types.isNativeError = isError;
8632
- function isFunction(arg) {
8633
- return typeof arg === "function";
8634
- }
8635
- exports.isFunction = isFunction;
8636
- function isPrimitive(arg) {
8637
- return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
8638
- }
8639
- exports.isPrimitive = isPrimitive;
8640
- exports.isBuffer = require_isBufferBrowser();
8641
- function objectToString(o) {
8642
- return Object.prototype.toString.call(o);
8643
- }
8644
- function pad(n) {
8645
- return n < 10 ? "0" + n.toString(10) : n.toString(10);
8646
- }
8647
- var months = [
8648
- "Jan",
8649
- "Feb",
8650
- "Mar",
8651
- "Apr",
8652
- "May",
8653
- "Jun",
8654
- "Jul",
8655
- "Aug",
8656
- "Sep",
8657
- "Oct",
8658
- "Nov",
8659
- "Dec"
8660
- ];
8661
- function timestamp() {
8662
- var d = /* @__PURE__ */ new Date();
8663
- var time = [
8664
- pad(d.getHours()),
8665
- pad(d.getMinutes()),
8666
- pad(d.getSeconds())
8667
- ].join(":");
8668
- return [d.getDate(), months[d.getMonth()], time].join(" ");
8669
- }
8670
- exports.log = function() {
8671
- console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments));
8672
- };
8673
- exports.inherits = require_inherits_browser();
8674
- exports._extend = function(origin, add) {
8675
- if (!add || !isObject2(add))
8676
- return origin;
8677
- var keys = Object.keys(add);
8678
- var i = keys.length;
8679
- while (i--) {
8680
- origin[keys[i]] = add[keys[i]];
8681
- }
8682
- return origin;
8683
- };
8684
- function hasOwnProperty(obj, prop) {
8685
- return Object.prototype.hasOwnProperty.call(obj, prop);
8686
- }
8687
- var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
8688
- exports.promisify = function promisify(original) {
8689
- if (typeof original !== "function")
8690
- throw new TypeError('The "original" argument must be of type Function');
8691
- if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
8692
- var fn = original[kCustomPromisifiedSymbol];
8693
- if (typeof fn !== "function") {
8694
- throw new TypeError('The "util.promisify.custom" argument must be of type Function');
8695
- }
8696
- Object.defineProperty(fn, kCustomPromisifiedSymbol, {
8697
- value: fn,
8698
- enumerable: false,
8699
- writable: false,
8700
- configurable: true
8701
- });
8702
- return fn;
8703
- }
8704
- function fn() {
8705
- var promiseResolve, promiseReject;
8706
- var promise = new Promise(function(resolve, reject) {
8707
- promiseResolve = resolve;
8708
- promiseReject = reject;
8709
- });
8710
- var args = [];
8711
- for (var i = 0; i < arguments.length; i++) {
8712
- args.push(arguments[i]);
8713
- }
8714
- args.push(function(err, value) {
8715
- if (err) {
8716
- promiseReject(err);
8717
- } else {
8718
- promiseResolve(value);
8719
- }
8720
- });
8721
- try {
8722
- original.apply(this, args);
8723
- } catch (err) {
8724
- promiseReject(err);
8725
- }
8726
- return promise;
8727
- }
8728
- Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
8729
- if (kCustomPromisifiedSymbol)
8730
- Object.defineProperty(fn, kCustomPromisifiedSymbol, {
8731
- value: fn,
8732
- enumerable: false,
8733
- writable: false,
8734
- configurable: true
8735
- });
8736
- return Object.defineProperties(
8737
- fn,
8738
- getOwnPropertyDescriptors(original)
8739
- );
8740
- };
8741
- exports.promisify.custom = kCustomPromisifiedSymbol;
8742
- function callbackifyOnRejected(reason, cb) {
8743
- if (!reason) {
8744
- var newReason = new Error("Promise was rejected with a falsy value");
8745
- newReason.reason = reason;
8746
- reason = newReason;
8747
- }
8748
- return cb(reason);
8749
- }
8750
- function callbackify(original) {
8751
- if (typeof original !== "function") {
8752
- throw new TypeError('The "original" argument must be of type Function');
8753
- }
8754
- function callbackified() {
8755
- var args = [];
8756
- for (var i = 0; i < arguments.length; i++) {
8757
- args.push(arguments[i]);
8758
- }
8759
- var maybeCb = args.pop();
8760
- if (typeof maybeCb !== "function") {
8761
- throw new TypeError("The last argument must be of type Function");
8762
- }
8763
- var self = this;
8764
- var cb = function() {
8765
- return maybeCb.apply(self, arguments);
8766
- };
8767
- original.apply(this, args).then(
8768
- function(ret) {
8769
- process.nextTick(cb.bind(null, null, ret));
8770
- },
8771
- function(rej) {
8772
- process.nextTick(callbackifyOnRejected.bind(null, rej, cb));
8773
- }
8774
- );
8775
- }
8776
- Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
8777
- Object.defineProperties(
8778
- callbackified,
8779
- getOwnPropertyDescriptors(original)
8780
- );
8781
- return callbackified;
8782
- }
8783
- exports.callbackify = callbackify;
8784
- }
8785
- });
8786
- var TextEncoder2 = typeof globalThis.TextEncoder === "undefined" ? require_util().TextEncoder : globalThis.TextEncoder;
8787
- var TextDecoder2 = typeof globalThis.TextDecoder === "undefined" ? require_util().TextDecoder : globalThis.TextDecoder;
8788
- var encoder2 = new TextEncoder2();
8789
- function encodeBuffer2(text) {
8790
- return encoder2.encode(text);
8791
- }
8792
- function decodeBuffer2(buffer, encoding) {
8793
- const decoder = new TextDecoder2(encoding);
8794
- return decoder.decode(buffer);
8795
- }
8796
- function toArrayBuffer(array) {
8797
- return array.buffer.slice(
8798
- array.byteOffset,
8799
- array.byteOffset + array.byteLength
8800
- );
8801
- }
8802
-
8803
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-DWXGORCS.mjs
8804
- function concatArrayBuffer(left, right) {
8805
- const result = new Uint8Array(left.byteLength + right.byteLength);
8806
- result.set(left, 0);
8807
- result.set(right, left.byteLength);
8808
- return result;
8809
- }
8810
- var EventPolyfill = class {
8811
- constructor(type, options) {
8812
- this.AT_TARGET = 0;
8813
- this.BUBBLING_PHASE = 0;
8814
- this.CAPTURING_PHASE = 0;
8815
- this.NONE = 0;
8816
- this.type = "";
8817
- this.srcElement = null;
8818
- this.currentTarget = null;
8819
- this.eventPhase = 0;
8820
- this.isTrusted = true;
8821
- this.composed = false;
8822
- this.cancelable = true;
8823
- this.defaultPrevented = false;
8824
- this.bubbles = true;
8825
- this.lengthComputable = true;
8826
- this.loaded = 0;
8827
- this.total = 0;
8828
- this.cancelBubble = false;
8829
- this.returnValue = true;
8830
- this.type = type;
8831
- this.target = (options == null ? void 0 : options.target) || null;
8832
- this.currentTarget = (options == null ? void 0 : options.currentTarget) || null;
8833
- this.timeStamp = Date.now();
8834
- }
8835
- composedPath() {
8836
- return [];
8837
- }
8838
- initEvent(type, bubbles, cancelable) {
8839
- this.type = type;
8840
- this.bubbles = !!bubbles;
8841
- this.cancelable = !!cancelable;
8842
- }
8843
- preventDefault() {
8844
- this.defaultPrevented = true;
8845
- }
8846
- stopPropagation() {
8847
- }
8848
- stopImmediatePropagation() {
8849
- }
8850
- };
8851
- var ProgressEventPolyfill = class extends EventPolyfill {
8852
- constructor(type, init) {
8853
- super(type);
8854
- this.lengthComputable = (init == null ? void 0 : init.lengthComputable) || false;
8855
- this.composed = (init == null ? void 0 : init.composed) || false;
8856
- this.loaded = (init == null ? void 0 : init.loaded) || 0;
8857
- this.total = (init == null ? void 0 : init.total) || 0;
7114
+ };
7115
+ var ProgressEventPolyfill = class extends EventPolyfill {
7116
+ constructor(type, init) {
7117
+ super(type);
7118
+ this.lengthComputable = (init == null ? void 0 : init.lengthComputable) || false;
7119
+ this.composed = (init == null ? void 0 : init.composed) || false;
7120
+ this.loaded = (init == null ? void 0 : init.loaded) || 0;
7121
+ this.total = (init == null ? void 0 : init.total) || 0;
8858
7122
  }
8859
7123
  };
8860
7124
  var SUPPORTS_PROGRESS_EVENT = typeof ProgressEvent !== "undefined";
@@ -8964,14 +7228,32 @@ If this message still persists after updating, please report an issue: https://g
8964
7228
  return null;
8965
7229
  }
8966
7230
  }
8967
- function createResponse(request, responseBody) {
8968
- return new Response(responseBody, {
7231
+ var statusCodesWithoutBody = [204, 205, 304];
7232
+ function createResponse(request, body) {
7233
+ const responseBodyOrNull = statusCodesWithoutBody.includes(request.status) ? null : body;
7234
+ return new Response(responseBodyOrNull, {
8969
7235
  status: request.status,
8970
7236
  statusText: request.statusText,
8971
- headers: stringToHeaders(request.getAllResponseHeaders())
7237
+ headers: createHeadersFromXMLHttpReqestHeaders(
7238
+ request.getAllResponseHeaders()
7239
+ )
8972
7240
  });
8973
7241
  }
7242
+ function createHeadersFromXMLHttpReqestHeaders(headersString) {
7243
+ const headers = new Headers();
7244
+ const lines = headersString.split(/[\r\n]+/);
7245
+ for (const line of lines) {
7246
+ if (line.trim() === "") {
7247
+ continue;
7248
+ }
7249
+ const [name, ...parts] = line.split(": ");
7250
+ const value = parts.join(": ");
7251
+ headers.append(name, value);
7252
+ }
7253
+ return headers;
7254
+ }
8974
7255
  var IS_MOCKED_RESPONSE = Symbol("isMockedResponse");
7256
+ var IS_NODE2 = isNodeProcess();
8975
7257
  var XMLHttpRequestController = class {
8976
7258
  constructor(initialRequest, logger) {
8977
7259
  this.initialRequest = initialRequest;
@@ -8979,6 +7261,7 @@ If this message still persists after updating, please report an issue: https://g
8979
7261
  this.method = "GET";
8980
7262
  this.url = null;
8981
7263
  this.events = /* @__PURE__ */ new Map();
7264
+ this.requestId = uuidv4();
8982
7265
  this.requestHeaders = new Headers();
8983
7266
  this.responseBuffer = new Uint8Array();
8984
7267
  this.request = createProxy(initialRequest, {
@@ -8997,11 +7280,10 @@ If this message still persists after updating, please report an issue: https://g
8997
7280
  }
8998
7281
  },
8999
7282
  methodCall: ([methodName, args], invoke) => {
9000
- var _a2;
7283
+ var _a3;
9001
7284
  switch (methodName) {
9002
7285
  case "open": {
9003
7286
  const [method, url] = args;
9004
- this.requestId = uuidv4();
9005
7287
  if (typeof url === "undefined") {
9006
7288
  this.method = "GET";
9007
7289
  this.url = toAbsoluteUrl(method);
@@ -9034,6 +7316,11 @@ If this message still persists after updating, please report an issue: https://g
9034
7316
  if (typeof this.onResponse !== "undefined") {
9035
7317
  const fetchResponse = createResponse(
9036
7318
  this.request,
7319
+ /**
7320
+ * The `response` property is the right way to read
7321
+ * the ambiguous response body, as the request's "responseType" may differ.
7322
+ * @see https://xhr.spec.whatwg.org/#the-response-attribute
7323
+ */
9037
7324
  this.request.response
9038
7325
  );
9039
7326
  this.onResponse.call(this, {
@@ -9045,7 +7332,7 @@ If this message still persists after updating, please report an issue: https://g
9045
7332
  }
9046
7333
  });
9047
7334
  const fetchRequest = this.toFetchApiRequest();
9048
- const onceRequestSettled = ((_a2 = this.onRequest) == null ? void 0 : _a2.call(this, {
7335
+ const onceRequestSettled = ((_a3 = this.onRequest) == null ? void 0 : _a3.call(this, {
9049
7336
  request: fetchRequest,
9050
7337
  requestId: this.requestId
9051
7338
  })) || Promise.resolve();
@@ -9055,7 +7342,9 @@ If this message still persists after updating, please report an issue: https://g
9055
7342
  "request callback settled but request has not been handled (readystate %d), performing as-is...",
9056
7343
  this.request.readyState
9057
7344
  );
9058
- this.request.setRequestHeader("X-Request-Id", this.requestId);
7345
+ if (IS_NODE2) {
7346
+ this.request.setRequestHeader("X-Request-Id", this.requestId);
7347
+ }
9059
7348
  return invoke();
9060
7349
  }
9061
7350
  });
@@ -9074,6 +7363,10 @@ If this message still persists after updating, please report an issue: https://g
9074
7363
  this.events.set(eventName, nextEvents);
9075
7364
  this.logger.info('registered event "%s"', eventName, listener.name);
9076
7365
  }
7366
+ /**
7367
+ * Responds to the current request with the given
7368
+ * Fetch API `Response` instance.
7369
+ */
9077
7370
  respondWith(response) {
9078
7371
  this.logger.info(
9079
7372
  "responding with a mocked response: %d %s",
@@ -9109,7 +7402,10 @@ If this message still persists after updating, please report an issue: https://g
9109
7402
  this.logger.info("headers not received yet, returning empty string");
9110
7403
  return "";
9111
7404
  }
9112
- const allHeaders = headersToString(response.headers);
7405
+ const headersList = Array.from(response.headers.entries());
7406
+ const allHeaders = headersList.map(([headerName, headerValue]) => {
7407
+ return `${headerName}: ${headerValue}`;
7408
+ }).join("\r\n");
9113
7409
  this.logger.info("resolved all response headers to", allHeaders);
9114
7410
  return allHeaders;
9115
7411
  }
@@ -9132,7 +7428,12 @@ If this message still persists after updating, please report an issue: https://g
9132
7428
  get: () => this.responseXML
9133
7429
  }
9134
7430
  });
9135
- const totalResponseBodyLength = response.headers.has("Content-Length") ? Number(response.headers.get("Content-Length")) : void 0;
7431
+ const totalResponseBodyLength = response.headers.has("Content-Length") ? Number(response.headers.get("Content-Length")) : (
7432
+ /**
7433
+ * @todo Infer the response body length from the response body.
7434
+ */
7435
+ void 0
7436
+ );
9136
7437
  this.logger.info("calculated response body length", totalResponseBodyLength);
9137
7438
  this.trigger("loadstart", {
9138
7439
  loaded: 0,
@@ -9263,6 +7564,9 @@ If this message still persists after updating, please report an issue: https://g
9263
7564
  this.trigger("error");
9264
7565
  this.trigger("loadend");
9265
7566
  }
7567
+ /**
7568
+ * Transitions this request's `readyState` to the given one.
7569
+ */
9266
7570
  setReadyState(nextReadyState) {
9267
7571
  this.logger.info(
9268
7572
  "setReadyState: %d -> %d",
@@ -9280,6 +7584,9 @@ If this message still persists after updating, please report an issue: https://g
9280
7584
  this.trigger("readystatechange");
9281
7585
  }
9282
7586
  }
7587
+ /**
7588
+ * Triggers given event on the `XMLHttpRequest` instance.
7589
+ */
9283
7590
  trigger(eventName, options) {
9284
7591
  const callback = this.request[`on${eventName}`];
9285
7592
  const event = createEvent(this.request, eventName, options);
@@ -9299,11 +7606,17 @@ If this message still persists after updating, please report an issue: https://g
9299
7606
  }
9300
7607
  }
9301
7608
  }
7609
+ /**
7610
+ * Converts this `XMLHttpRequest` instance into a Fetch API `Request` instance.
7611
+ */
9302
7612
  toFetchApiRequest() {
9303
7613
  this.logger.info("converting request to a Fetch API Request...");
9304
7614
  const fetchRequest = new Request(this.url.href, {
9305
7615
  method: this.method,
9306
7616
  headers: this.requestHeaders,
7617
+ /**
7618
+ * @see https://xhr.spec.whatwg.org/#cross-origin-credentials
7619
+ */
9307
7620
  credentials: this.request.withCredentials ? "include" : "same-origin",
9308
7621
  body: ["GET", "HEAD"].includes(this.method) ? null : this.requestBody
9309
7622
  });
@@ -9337,6 +7650,7 @@ If this message still persists after updating, please report an issue: https://g
9337
7650
  }
9338
7651
  function define(target, property, value) {
9339
7652
  Reflect.defineProperty(target, property, {
7653
+ // Ensure writable properties to allow redefining readonly properties.
9340
7654
  writable: true,
9341
7655
  enumerable: true,
9342
7656
  value
@@ -9403,6 +7717,13 @@ If this message still persists after updating, please report an issue: https://g
9403
7717
  mockedResponse.status,
9404
7718
  mockedResponse.statusText
9405
7719
  );
7720
+ if (mockedResponse.type === "error") {
7721
+ this.logger.info(
7722
+ "received a network error response, rejecting the request promise..."
7723
+ );
7724
+ requestController.errorWith(new TypeError("Network error"));
7725
+ return;
7726
+ }
9406
7727
  return requestController.respondWith(mockedResponse);
9407
7728
  }
9408
7729
  this.logger.info(
@@ -9542,8 +7863,8 @@ If this message still persists after updating, please report an issue: https://g
9542
7863
  // src/browser/setupWorker/stop/createFallbackStop.ts
9543
7864
  function createFallbackStop(context) {
9544
7865
  return function stop() {
9545
- var _a2, _b2;
9546
- (_a2 = context.fallbackInterceptor) == null ? void 0 : _a2.dispose();
7866
+ var _a3, _b2;
7867
+ (_a3 = context.fallbackInterceptor) == null ? void 0 : _a3.dispose();
9547
7868
  printStopMessage({ quiet: (_b2 = context.startOptions) == null ? void 0 : _b2.quiet });
9548
7869
  };
9549
7870
  }
@@ -9589,8 +7910,8 @@ If this message still persists after updating, please report an issue: https://g
9589
7910
  });
9590
7911
  },
9591
7912
  send: (type) => {
9592
- var _a2;
9593
- (_a2 = this.context.worker) == null ? void 0 : _a2.postMessage(type);
7913
+ var _a3;
7914
+ (_a3 = this.context.worker) == null ? void 0 : _a3.postMessage(type);
9594
7915
  }
9595
7916
  },
9596
7917
  events: {