@powerlines/plugin-automd 0.1.341 → 0.1.343

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.
Files changed (113) hide show
  1. package/README.md +14 -16
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -3
  3. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  4. package/dist/index.cjs +26 -27
  5. package/dist/index.d.cts +0 -1
  6. package/dist/index.d.cts.map +1 -1
  7. package/dist/index.d.mts +0 -1
  8. package/dist/index.d.mts.map +1 -1
  9. package/dist/index.mjs +5 -6
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/types/plugin.d.cts.map +1 -1
  12. package/dist/types/plugin.d.mts +1 -1
  13. package/dist/types/plugin.d.mts.map +1 -1
  14. package/dist/types/toc.d.cts.map +1 -1
  15. package/dist/types/toc.d.mts.map +1 -1
  16. package/package.json +20 -18
  17. package/dist/_virtual/rolldown_runtime.mjs +0 -32
  18. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -78
  19. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -78
  20. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
  21. package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.cjs +0 -5089
  22. package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs +0 -5089
  23. package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs.map +0 -1
  24. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.cjs +0 -654
  25. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.mjs +0 -652
  26. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.mjs.map +0 -1
  27. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.cjs +0 -23
  28. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +0 -23
  29. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +0 -1
  30. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs +0 -10
  31. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +0 -11
  32. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +0 -1
  33. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.cjs +0 -388
  34. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +0 -388
  35. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +0 -1
  36. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.cjs +0 -11
  37. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +0 -12
  38. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +0 -1
  39. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
  40. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -46
  41. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +0 -1
  42. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +0 -204
  43. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +0 -203
  44. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs.map +0 -1
  45. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
  46. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1008
  47. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +0 -1
  48. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +0 -128
  49. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +0 -124
  50. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs.map +0 -1
  51. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs +0 -41464
  52. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs +0 -41462
  53. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs.map +0 -1
  54. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +0 -4387
  55. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +0 -4385
  56. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs.map +0 -1
  57. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +0 -26
  58. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +0 -27
  59. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs.map +0 -1
  60. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +0 -370
  61. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +0 -368
  62. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs.map +0 -1
  63. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +0 -939
  64. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -940
  65. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +0 -1
  66. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +0 -67
  67. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +0 -65
  68. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.cjs +0 -1350
  70. package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.mjs +0 -1343
  71. package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.mjs.map +0 -1
  72. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -179
  73. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -178
  74. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -20
  76. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -17
  77. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +0 -1
  78. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3975
  79. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3962
  80. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +0 -1
  81. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +0 -16
  82. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -15
  83. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs.map +0 -1
  84. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +0 -36
  85. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +0 -34
  86. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs.map +0 -1
  87. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs +0 -227
  88. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs +0 -226
  89. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs.map +0 -1
  90. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -139
  91. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -134
  92. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -78
  94. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -78
  95. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +0 -1
  96. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs +0 -72
  97. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs +0 -70
  98. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.cjs +0 -181
  100. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs +0 -179
  101. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs.map +0 -1
  102. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +0 -12337
  103. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +0 -12338
  104. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +0 -19
  106. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +0 -19
  107. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs.map +0 -1
  108. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +0 -71
  109. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +0 -72
  110. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs.map +0 -1
  111. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +0 -110
  112. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +0 -101
  113. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs.map +0 -1
@@ -1,3975 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- const require_node_fetch_native_DfbY2q_x = require('./shared/node-fetch-native.DfbY2q-x.cjs');
3
- let node_fs = require("node:fs");
4
- let node_url = require("node:url");
5
- let node_path = require("node:path");
6
- let node_util = require("node:util");
7
- let node_http = require("node:http");
8
- node_http = require_rolldown_runtime.__toESM(node_http);
9
- let node_https = require("node:https");
10
- node_https = require_rolldown_runtime.__toESM(node_https);
11
- let node_zlib = require("node:zlib");
12
- node_zlib = require_rolldown_runtime.__toESM(node_zlib);
13
- let node_stream = require("node:stream");
14
- node_stream = require_rolldown_runtime.__toESM(node_stream);
15
- let node_buffer = require("node:buffer");
16
- let node_net = require("node:net");
17
-
18
- //#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs
19
- var Os = Object.defineProperty;
20
- var fi = (i) => {
21
- throw TypeError(i);
22
- };
23
- var n$1 = (i, o) => Os(i, "name", {
24
- value: o,
25
- configurable: !0
26
- });
27
- var ci = (i, o, a) => o.has(i) || fi("Cannot " + a);
28
- var O = (i, o, a) => (ci(i, o, "read from private field"), a ? a.call(i) : o.get(i)), be = (i, o, a) => o.has(i) ? fi("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(i) : o.set(i, a), X = (i, o, a, f$1) => (ci(i, o, "write to private field"), f$1 ? f$1.call(i, a) : o.set(i, a), a);
29
- var ve, zt, bt, Cr, ze, It, Ft, mt, ee, yt, He, Ve, gt;
30
- function Us(i) {
31
- if (!/^data:/i.test(i)) throw new TypeError("`uri` does not appear to be a Data URI (must begin with \"data:\")");
32
- i = i.replace(/\r?\n/g, "");
33
- const o = i.indexOf(",");
34
- if (o === -1 || o <= 4) throw new TypeError("malformed data: URI");
35
- const a = i.substring(5, o).split(";");
36
- let f$1 = "", l = !1;
37
- const p = a[0] || "text/plain";
38
- let h = p;
39
- for (let A = 1; A < a.length; A++) a[A] === "base64" ? l = !0 : a[A] && (h += `;${a[A]}`, a[A].indexOf("charset=") === 0 && (f$1 = a[A].substring(8)));
40
- !a[0] && !f$1.length && (h += ";charset=US-ASCII", f$1 = "US-ASCII");
41
- const S = l ? "base64" : "ascii", v = unescape(i.substring(o + 1)), w = Buffer.from(v, S);
42
- return w.type = p, w.typeFull = h, w.charset = f$1, w;
43
- }
44
- n$1(Us, "dataUriToBuffer");
45
- var pi = {}, kt = { exports: {} };
46
- /**
47
- * @license
48
- * web-streams-polyfill v3.3.3
49
- * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
50
- * This code is released under the MIT license.
51
- * SPDX-License-Identifier: MIT
52
- */ var xs = kt.exports, bi;
53
- function Ns() {
54
- return bi || (bi = 1, function(i, o) {
55
- (function(a, f$1) {
56
- f$1(o);
57
- })(xs, function(a) {
58
- function f$1() {}
59
- n$1(f$1, "noop");
60
- function l(e) {
61
- return typeof e == "object" && e !== null || typeof e == "function";
62
- }
63
- n$1(l, "typeIsObject");
64
- const p = f$1;
65
- function h(e, t) {
66
- try {
67
- Object.defineProperty(e, "name", {
68
- value: t,
69
- configurable: !0
70
- });
71
- } catch {}
72
- }
73
- n$1(h, "setFunctionName");
74
- const S = Promise, v = Promise.prototype.then, w = Promise.reject.bind(S);
75
- function A(e) {
76
- return new S(e);
77
- }
78
- n$1(A, "newPromise");
79
- function T(e) {
80
- return A((t) => t(e));
81
- }
82
- n$1(T, "promiseResolvedWith");
83
- function b(e) {
84
- return w(e);
85
- }
86
- n$1(b, "promiseRejectedWith");
87
- function q(e, t, r) {
88
- return v.call(e, t, r);
89
- }
90
- n$1(q, "PerformPromiseThen");
91
- function g(e, t, r) {
92
- q(q(e, t, r), void 0, p);
93
- }
94
- n$1(g, "uponPromise");
95
- function V(e, t) {
96
- g(e, t);
97
- }
98
- n$1(V, "uponFulfillment");
99
- function I(e, t) {
100
- g(e, void 0, t);
101
- }
102
- n$1(I, "uponRejection");
103
- function F(e, t, r) {
104
- return q(e, t, r);
105
- }
106
- n$1(F, "transformPromiseWith");
107
- function Q(e) {
108
- q(e, void 0, p);
109
- }
110
- n$1(Q, "setPromiseIsHandledToTrue");
111
- let ge = n$1((e) => {
112
- if (typeof queueMicrotask == "function") ge = queueMicrotask;
113
- else {
114
- const t = T(void 0);
115
- ge = n$1((r) => q(t, r), "_queueMicrotask");
116
- }
117
- return ge(e);
118
- }, "_queueMicrotask");
119
- function z(e, t, r) {
120
- if (typeof e != "function") throw new TypeError("Argument is not a function");
121
- return Function.prototype.apply.call(e, t, r);
122
- }
123
- n$1(z, "reflectCall");
124
- function j(e, t, r) {
125
- try {
126
- return T(z(e, t, r));
127
- } catch (s) {
128
- return b(s);
129
- }
130
- }
131
- n$1(j, "promiseCall");
132
- const U = 16384, bn = class bn$1 {
133
- constructor() {
134
- this._cursor = 0, this._size = 0, this._front = {
135
- _elements: [],
136
- _next: void 0
137
- }, this._back = this._front, this._cursor = 0, this._size = 0;
138
- }
139
- get length() {
140
- return this._size;
141
- }
142
- push(t) {
143
- const r = this._back;
144
- let s = r;
145
- r._elements.length === U - 1 && (s = {
146
- _elements: [],
147
- _next: void 0
148
- }), r._elements.push(t), s !== r && (this._back = s, r._next = s), ++this._size;
149
- }
150
- shift() {
151
- const t = this._front;
152
- let r = t;
153
- const s = this._cursor;
154
- let u = s + 1;
155
- const c = t._elements, d = c[s];
156
- return u === U && (r = t._next, u = 0), --this._size, this._cursor = u, t !== r && (this._front = r), c[s] = void 0, d;
157
- }
158
- forEach(t) {
159
- let r = this._cursor, s = this._front, u = s._elements;
160
- for (; (r !== u.length || s._next !== void 0) && !(r === u.length && (s = s._next, u = s._elements, r = 0, u.length === 0));) t(u[r]), ++r;
161
- }
162
- peek() {
163
- const t = this._front, r = this._cursor;
164
- return t._elements[r];
165
- }
166
- };
167
- n$1(bn, "SimpleQueue");
168
- let D = bn;
169
- const jt = Symbol("[[AbortSteps]]"), Qn = Symbol("[[ErrorSteps]]"), Ar = Symbol("[[CancelSteps]]"), Br = Symbol("[[PullSteps]]"), kr = Symbol("[[ReleaseSteps]]");
170
- function Yn(e, t) {
171
- e._ownerReadableStream = t, t._reader = e, t._state === "readable" ? qr(e) : t._state === "closed" ? xi(e) : Gn(e, t._storedError);
172
- }
173
- n$1(Yn, "ReadableStreamReaderGenericInitialize");
174
- function Wr(e, t) {
175
- const r = e._ownerReadableStream;
176
- return ie(r, t);
177
- }
178
- n$1(Wr, "ReadableStreamReaderGenericCancel");
179
- function _e(e) {
180
- const t = e._ownerReadableStream;
181
- t._state === "readable" ? Or(e, /* @__PURE__ */ new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : Ni(e, /* @__PURE__ */ new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), t._readableStreamController[kr](), t._reader = void 0, e._ownerReadableStream = void 0;
182
- }
183
- n$1(_e, "ReadableStreamReaderGenericRelease");
184
- function Lt(e) {
185
- return /* @__PURE__ */ new TypeError("Cannot " + e + " a stream using a released reader");
186
- }
187
- n$1(Lt, "readerLockException");
188
- function qr(e) {
189
- e._closedPromise = A((t, r) => {
190
- e._closedPromise_resolve = t, e._closedPromise_reject = r;
191
- });
192
- }
193
- n$1(qr, "defaultReaderClosedPromiseInitialize");
194
- function Gn(e, t) {
195
- qr(e), Or(e, t);
196
- }
197
- n$1(Gn, "defaultReaderClosedPromiseInitializeAsRejected");
198
- function xi(e) {
199
- qr(e), Zn(e);
200
- }
201
- n$1(xi, "defaultReaderClosedPromiseInitializeAsResolved");
202
- function Or(e, t) {
203
- e._closedPromise_reject !== void 0 && (Q(e._closedPromise), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);
204
- }
205
- n$1(Or, "defaultReaderClosedPromiseReject");
206
- function Ni(e, t) {
207
- Gn(e, t);
208
- }
209
- n$1(Ni, "defaultReaderClosedPromiseResetToRejected");
210
- function Zn(e) {
211
- e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);
212
- }
213
- n$1(Zn, "defaultReaderClosedPromiseResolve");
214
- const Kn = Number.isFinite || function(e) {
215
- return typeof e == "number" && isFinite(e);
216
- }, Hi = Math.trunc || function(e) {
217
- return e < 0 ? Math.ceil(e) : Math.floor(e);
218
- };
219
- function Vi(e) {
220
- return typeof e == "object" || typeof e == "function";
221
- }
222
- n$1(Vi, "isDictionary");
223
- function ue(e, t) {
224
- if (e !== void 0 && !Vi(e)) throw new TypeError(`${t} is not an object.`);
225
- }
226
- n$1(ue, "assertDictionary");
227
- function Z(e, t) {
228
- if (typeof e != "function") throw new TypeError(`${t} is not a function.`);
229
- }
230
- n$1(Z, "assertFunction");
231
- function Qi(e) {
232
- return typeof e == "object" && e !== null || typeof e == "function";
233
- }
234
- n$1(Qi, "isObject");
235
- function Jn(e, t) {
236
- if (!Qi(e)) throw new TypeError(`${t} is not an object.`);
237
- }
238
- n$1(Jn, "assertObject");
239
- function Se(e, t, r) {
240
- if (e === void 0) throw new TypeError(`Parameter ${t} is required in '${r}'.`);
241
- }
242
- n$1(Se, "assertRequiredArgument");
243
- function zr(e, t, r) {
244
- if (e === void 0) throw new TypeError(`${t} is required in '${r}'.`);
245
- }
246
- n$1(zr, "assertRequiredField");
247
- function Ir(e) {
248
- return Number(e);
249
- }
250
- n$1(Ir, "convertUnrestrictedDouble");
251
- function Xn(e) {
252
- return e === 0 ? 0 : e;
253
- }
254
- n$1(Xn, "censorNegativeZero");
255
- function Yi(e) {
256
- return Xn(Hi(e));
257
- }
258
- n$1(Yi, "integerPart");
259
- function Fr(e, t) {
260
- const s = Number.MAX_SAFE_INTEGER;
261
- let u = Number(e);
262
- if (u = Xn(u), !Kn(u)) throw new TypeError(`${t} is not a finite number`);
263
- if (u = Yi(u), u < 0 || u > s) throw new TypeError(`${t} is outside the accepted range of 0 to ${s}, inclusive`);
264
- return !Kn(u) || u === 0 ? 0 : u;
265
- }
266
- n$1(Fr, "convertUnsignedLongLongWithEnforceRange");
267
- function jr(e, t) {
268
- if (!We(e)) throw new TypeError(`${t} is not a ReadableStream.`);
269
- }
270
- n$1(jr, "assertReadableStream");
271
- function Qe(e) {
272
- return new fe(e);
273
- }
274
- n$1(Qe, "AcquireReadableStreamDefaultReader");
275
- function eo(e, t) {
276
- e._reader._readRequests.push(t);
277
- }
278
- n$1(eo, "ReadableStreamAddReadRequest");
279
- function Lr(e, t, r) {
280
- const u = e._reader._readRequests.shift();
281
- r ? u._closeSteps() : u._chunkSteps(t);
282
- }
283
- n$1(Lr, "ReadableStreamFulfillReadRequest");
284
- function $t(e) {
285
- return e._reader._readRequests.length;
286
- }
287
- n$1($t, "ReadableStreamGetNumReadRequests");
288
- function to(e) {
289
- const t = e._reader;
290
- return !(t === void 0 || !Ee(t));
291
- }
292
- n$1(to, "ReadableStreamHasDefaultReader");
293
- const mn = class mn$1 {
294
- constructor(t) {
295
- if (Se(t, 1, "ReadableStreamDefaultReader"), jr(t, "First parameter"), qe(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
296
- Yn(this, t), this._readRequests = new D();
297
- }
298
- get closed() {
299
- return Ee(this) ? this._closedPromise : b(Dt("closed"));
300
- }
301
- cancel(t = void 0) {
302
- return Ee(this) ? this._ownerReadableStream === void 0 ? b(Lt("cancel")) : Wr(this, t) : b(Dt("cancel"));
303
- }
304
- read() {
305
- if (!Ee(this)) return b(Dt("read"));
306
- if (this._ownerReadableStream === void 0) return b(Lt("read from"));
307
- let t, r;
308
- const s = A((c, d) => {
309
- t = c, r = d;
310
- });
311
- return _t(this, {
312
- _chunkSteps: n$1((c) => t({
313
- value: c,
314
- done: !1
315
- }), "_chunkSteps"),
316
- _closeSteps: n$1(() => t({
317
- value: void 0,
318
- done: !0
319
- }), "_closeSteps"),
320
- _errorSteps: n$1((c) => r(c), "_errorSteps")
321
- }), s;
322
- }
323
- releaseLock() {
324
- if (!Ee(this)) throw Dt("releaseLock");
325
- this._ownerReadableStream !== void 0 && Gi(this);
326
- }
327
- };
328
- n$1(mn, "ReadableStreamDefaultReader");
329
- let fe = mn;
330
- Object.defineProperties(fe.prototype, {
331
- cancel: { enumerable: !0 },
332
- read: { enumerable: !0 },
333
- releaseLock: { enumerable: !0 },
334
- closed: { enumerable: !0 }
335
- }), h(fe.prototype.cancel, "cancel"), h(fe.prototype.read, "read"), h(fe.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(fe.prototype, Symbol.toStringTag, {
336
- value: "ReadableStreamDefaultReader",
337
- configurable: !0
338
- });
339
- function Ee(e) {
340
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_readRequests") ? !1 : e instanceof fe;
341
- }
342
- n$1(Ee, "IsReadableStreamDefaultReader");
343
- function _t(e, t) {
344
- const r = e._ownerReadableStream;
345
- r._disturbed = !0, r._state === "closed" ? t._closeSteps() : r._state === "errored" ? t._errorSteps(r._storedError) : r._readableStreamController[Br](t);
346
- }
347
- n$1(_t, "ReadableStreamDefaultReaderRead");
348
- function Gi(e) {
349
- _e(e);
350
- ro(e, /* @__PURE__ */ new TypeError("Reader was released"));
351
- }
352
- n$1(Gi, "ReadableStreamDefaultReaderRelease");
353
- function ro(e, t) {
354
- const r = e._readRequests;
355
- e._readRequests = new D(), r.forEach((s) => {
356
- s._errorSteps(t);
357
- });
358
- }
359
- n$1(ro, "ReadableStreamDefaultReaderErrorReadRequests");
360
- function Dt(e) {
361
- return /* @__PURE__ */ new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`);
362
- }
363
- n$1(Dt, "defaultReaderBrandCheckException");
364
- const Zi = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype), yn = class yn$1 {
365
- constructor(t, r) {
366
- this._ongoingPromise = void 0, this._isFinished = !1, this._reader = t, this._preventCancel = r;
367
- }
368
- next() {
369
- const t = n$1(() => this._nextSteps(), "nextSteps");
370
- return this._ongoingPromise = this._ongoingPromise ? F(this._ongoingPromise, t, t) : t(), this._ongoingPromise;
371
- }
372
- return(t) {
373
- const r = n$1(() => this._returnSteps(t), "returnSteps");
374
- return this._ongoingPromise ? F(this._ongoingPromise, r, r) : r();
375
- }
376
- _nextSteps() {
377
- if (this._isFinished) return Promise.resolve({
378
- value: void 0,
379
- done: !0
380
- });
381
- const t = this._reader;
382
- let r, s;
383
- const u = A((d, m) => {
384
- r = d, s = m;
385
- });
386
- return _t(t, {
387
- _chunkSteps: n$1((d) => {
388
- this._ongoingPromise = void 0, ge(() => r({
389
- value: d,
390
- done: !1
391
- }));
392
- }, "_chunkSteps"),
393
- _closeSteps: n$1(() => {
394
- this._ongoingPromise = void 0, this._isFinished = !0, _e(t), r({
395
- value: void 0,
396
- done: !0
397
- });
398
- }, "_closeSteps"),
399
- _errorSteps: n$1((d) => {
400
- this._ongoingPromise = void 0, this._isFinished = !0, _e(t), s(d);
401
- }, "_errorSteps")
402
- }), u;
403
- }
404
- _returnSteps(t) {
405
- if (this._isFinished) return Promise.resolve({
406
- value: t,
407
- done: !0
408
- });
409
- this._isFinished = !0;
410
- const r = this._reader;
411
- if (!this._preventCancel) {
412
- const s = Wr(r, t);
413
- return _e(r), F(s, () => ({
414
- value: t,
415
- done: !0
416
- }));
417
- }
418
- return _e(r), T({
419
- value: t,
420
- done: !0
421
- });
422
- }
423
- };
424
- n$1(yn, "ReadableStreamAsyncIteratorImpl");
425
- let Mt = yn;
426
- const no = {
427
- next() {
428
- return oo(this) ? this._asyncIteratorImpl.next() : b(io("next"));
429
- },
430
- return(e) {
431
- return oo(this) ? this._asyncIteratorImpl.return(e) : b(io("return"));
432
- }
433
- };
434
- Object.setPrototypeOf(no, Zi);
435
- function Ki(e, t) {
436
- const s = new Mt(Qe(e), t), u = Object.create(no);
437
- return u._asyncIteratorImpl = s, u;
438
- }
439
- n$1(Ki, "AcquireReadableStreamAsyncIterator");
440
- function oo(e) {
441
- if (!l(e) || !Object.prototype.hasOwnProperty.call(e, "_asyncIteratorImpl")) return !1;
442
- try {
443
- return e._asyncIteratorImpl instanceof Mt;
444
- } catch {
445
- return !1;
446
- }
447
- }
448
- n$1(oo, "IsReadableStreamAsyncIterator");
449
- function io(e) {
450
- return /* @__PURE__ */ new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`);
451
- }
452
- n$1(io, "streamAsyncIteratorBrandCheckException");
453
- const ao = Number.isNaN || function(e) {
454
- return e !== e;
455
- };
456
- var $r, Dr, Mr;
457
- function St(e) {
458
- return e.slice();
459
- }
460
- n$1(St, "CreateArrayFromList");
461
- function so(e, t, r, s, u) {
462
- new Uint8Array(e).set(new Uint8Array(r, s, u), t);
463
- }
464
- n$1(so, "CopyDataBlockBytes");
465
- let we = n$1((e) => (typeof e.transfer == "function" ? we = n$1((t) => t.transfer(), "TransferArrayBuffer") : typeof structuredClone == "function" ? we = n$1((t) => structuredClone(t, { transfer: [t] }), "TransferArrayBuffer") : we = n$1((t) => t, "TransferArrayBuffer"), we(e)), "TransferArrayBuffer"), Ae = n$1((e) => (typeof e.detached == "boolean" ? Ae = n$1((t) => t.detached, "IsDetachedBuffer") : Ae = n$1((t) => t.byteLength === 0, "IsDetachedBuffer"), Ae(e)), "IsDetachedBuffer");
466
- function lo(e, t, r) {
467
- if (e.slice) return e.slice(t, r);
468
- const s = r - t, u = new ArrayBuffer(s);
469
- return so(u, 0, e, t, s), u;
470
- }
471
- n$1(lo, "ArrayBufferSlice");
472
- function Ut(e, t) {
473
- const r = e[t];
474
- if (r != null) {
475
- if (typeof r != "function") throw new TypeError(`${String(t)} is not a function`);
476
- return r;
477
- }
478
- }
479
- n$1(Ut, "GetMethod");
480
- function Ji(e) {
481
- const t = { [Symbol.iterator]: () => e.iterator }, r = async function* () {
482
- return yield* t;
483
- }();
484
- return {
485
- iterator: r,
486
- nextMethod: r.next,
487
- done: !1
488
- };
489
- }
490
- n$1(Ji, "CreateAsyncFromSyncIterator");
491
- const Ur = (Mr = ($r = Symbol.asyncIterator) !== null && $r !== void 0 ? $r : (Dr = Symbol.for) === null || Dr === void 0 ? void 0 : Dr.call(Symbol, "Symbol.asyncIterator")) !== null && Mr !== void 0 ? Mr : "@@asyncIterator";
492
- function uo(e, t = "sync", r) {
493
- if (r === void 0) if (t === "async") {
494
- if (r = Ut(e, Ur), r === void 0) return Ji(uo(e, "sync", Ut(e, Symbol.iterator)));
495
- } else r = Ut(e, Symbol.iterator);
496
- if (r === void 0) throw new TypeError("The object is not iterable");
497
- const s = z(r, e, []);
498
- if (!l(s)) throw new TypeError("The iterator method must return an object");
499
- return {
500
- iterator: s,
501
- nextMethod: s.next,
502
- done: !1
503
- };
504
- }
505
- n$1(uo, "GetIterator");
506
- function Xi(e) {
507
- const t = z(e.nextMethod, e.iterator, []);
508
- if (!l(t)) throw new TypeError("The iterator.next() method must return an object");
509
- return t;
510
- }
511
- n$1(Xi, "IteratorNext");
512
- function ea(e) {
513
- return !!e.done;
514
- }
515
- n$1(ea, "IteratorComplete");
516
- function ta(e) {
517
- return e.value;
518
- }
519
- n$1(ta, "IteratorValue");
520
- function ra(e) {
521
- return !(typeof e != "number" || ao(e) || e < 0);
522
- }
523
- n$1(ra, "IsNonNegativeNumber");
524
- function fo(e) {
525
- const t = lo(e.buffer, e.byteOffset, e.byteOffset + e.byteLength);
526
- return new Uint8Array(t);
527
- }
528
- n$1(fo, "CloneAsUint8Array");
529
- function xr(e) {
530
- const t = e._queue.shift();
531
- return e._queueTotalSize -= t.size, e._queueTotalSize < 0 && (e._queueTotalSize = 0), t.value;
532
- }
533
- n$1(xr, "DequeueValue");
534
- function Nr(e, t, r) {
535
- if (!ra(r) || r === Infinity) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");
536
- e._queue.push({
537
- value: t,
538
- size: r
539
- }), e._queueTotalSize += r;
540
- }
541
- n$1(Nr, "EnqueueValueWithSize");
542
- function na(e) {
543
- return e._queue.peek().value;
544
- }
545
- n$1(na, "PeekQueueValue");
546
- function Be(e) {
547
- e._queue = new D(), e._queueTotalSize = 0;
548
- }
549
- n$1(Be, "ResetQueue");
550
- function co(e) {
551
- return e === DataView;
552
- }
553
- n$1(co, "isDataViewConstructor");
554
- function oa(e) {
555
- return co(e.constructor);
556
- }
557
- n$1(oa, "isDataView");
558
- function ia(e) {
559
- return co(e) ? 1 : e.BYTES_PER_ELEMENT;
560
- }
561
- n$1(ia, "arrayBufferViewElementSize");
562
- const gn = class gn$1 {
563
- constructor() {
564
- throw new TypeError("Illegal constructor");
565
- }
566
- get view() {
567
- if (!Hr(this)) throw Zr("view");
568
- return this._view;
569
- }
570
- respond(t) {
571
- if (!Hr(this)) throw Zr("respond");
572
- if (Se(t, 1, "respond"), t = Fr(t, "First parameter"), this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
573
- if (Ae(this._view.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");
574
- Vt(this._associatedReadableByteStreamController, t);
575
- }
576
- respondWithNewView(t) {
577
- if (!Hr(this)) throw Zr("respondWithNewView");
578
- if (Se(t, 1, "respondWithNewView"), !ArrayBuffer.isView(t)) throw new TypeError("You can only respond with array buffer views");
579
- if (this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
580
- if (Ae(t.buffer)) throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");
581
- Qt(this._associatedReadableByteStreamController, t);
582
- }
583
- };
584
- n$1(gn, "ReadableStreamBYOBRequest");
585
- let Re = gn;
586
- Object.defineProperties(Re.prototype, {
587
- respond: { enumerable: !0 },
588
- respondWithNewView: { enumerable: !0 },
589
- view: { enumerable: !0 }
590
- }), h(Re.prototype.respond, "respond"), h(Re.prototype.respondWithNewView, "respondWithNewView"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Re.prototype, Symbol.toStringTag, {
591
- value: "ReadableStreamBYOBRequest",
592
- configurable: !0
593
- });
594
- const _n = class _n$1 {
595
- constructor() {
596
- throw new TypeError("Illegal constructor");
597
- }
598
- get byobRequest() {
599
- if (!Ie(this)) throw Rt("byobRequest");
600
- return Gr(this);
601
- }
602
- get desiredSize() {
603
- if (!Ie(this)) throw Rt("desiredSize");
604
- return Ro(this);
605
- }
606
- close() {
607
- if (!Ie(this)) throw Rt("close");
608
- if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
609
- const t = this._controlledReadableByteStream._state;
610
- if (t !== "readable") throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be closed`);
611
- wt(this);
612
- }
613
- enqueue(t) {
614
- if (!Ie(this)) throw Rt("enqueue");
615
- if (Se(t, 1, "enqueue"), !ArrayBuffer.isView(t)) throw new TypeError("chunk must be an array buffer view");
616
- if (t.byteLength === 0) throw new TypeError("chunk must have non-zero byteLength");
617
- if (t.buffer.byteLength === 0) throw new TypeError("chunk's buffer must have non-zero byteLength");
618
- if (this._closeRequested) throw new TypeError("stream is closed or draining");
619
- const r = this._controlledReadableByteStream._state;
620
- if (r !== "readable") throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);
621
- Ht(this, t);
622
- }
623
- error(t = void 0) {
624
- if (!Ie(this)) throw Rt("error");
625
- K(this, t);
626
- }
627
- [Ar](t) {
628
- ho(this), Be(this);
629
- const r = this._cancelAlgorithm(t);
630
- return Nt(this), r;
631
- }
632
- [Br](t) {
633
- const r = this._controlledReadableByteStream;
634
- if (this._queueTotalSize > 0) {
635
- wo(this, t);
636
- return;
637
- }
638
- const s = this._autoAllocateChunkSize;
639
- if (s !== void 0) {
640
- let u;
641
- try {
642
- u = new ArrayBuffer(s);
643
- } catch (d) {
644
- t._errorSteps(d);
645
- return;
646
- }
647
- const c = {
648
- buffer: u,
649
- bufferByteLength: s,
650
- byteOffset: 0,
651
- byteLength: s,
652
- bytesFilled: 0,
653
- minimumFill: 1,
654
- elementSize: 1,
655
- viewConstructor: Uint8Array,
656
- readerType: "default"
657
- };
658
- this._pendingPullIntos.push(c);
659
- }
660
- eo(r, t), Fe(this);
661
- }
662
- [kr]() {
663
- if (this._pendingPullIntos.length > 0) {
664
- const t = this._pendingPullIntos.peek();
665
- t.readerType = "none", this._pendingPullIntos = new D(), this._pendingPullIntos.push(t);
666
- }
667
- }
668
- };
669
- n$1(_n, "ReadableByteStreamController");
670
- let te = _n;
671
- Object.defineProperties(te.prototype, {
672
- close: { enumerable: !0 },
673
- enqueue: { enumerable: !0 },
674
- error: { enumerable: !0 },
675
- byobRequest: { enumerable: !0 },
676
- desiredSize: { enumerable: !0 }
677
- }), h(te.prototype.close, "close"), h(te.prototype.enqueue, "enqueue"), h(te.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(te.prototype, Symbol.toStringTag, {
678
- value: "ReadableByteStreamController",
679
- configurable: !0
680
- });
681
- function Ie(e) {
682
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledReadableByteStream") ? !1 : e instanceof te;
683
- }
684
- n$1(Ie, "IsReadableByteStreamController");
685
- function Hr(e) {
686
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_associatedReadableByteStreamController") ? !1 : e instanceof Re;
687
- }
688
- n$1(Hr, "IsReadableStreamBYOBRequest");
689
- function Fe(e) {
690
- if (!fa(e)) return;
691
- if (e._pulling) {
692
- e._pullAgain = !0;
693
- return;
694
- }
695
- e._pulling = !0;
696
- g(e._pullAlgorithm(), () => (e._pulling = !1, e._pullAgain && (e._pullAgain = !1, Fe(e)), null), (s) => (K(e, s), null));
697
- }
698
- n$1(Fe, "ReadableByteStreamControllerCallPullIfNeeded");
699
- function ho(e) {
700
- Qr(e), e._pendingPullIntos = new D();
701
- }
702
- n$1(ho, "ReadableByteStreamControllerClearPendingPullIntos");
703
- function Vr(e, t) {
704
- let r = !1;
705
- e._state === "closed" && (r = !0);
706
- const s = po(t);
707
- t.readerType === "default" ? Lr(e, s, r) : ma(e, s, r);
708
- }
709
- n$1(Vr, "ReadableByteStreamControllerCommitPullIntoDescriptor");
710
- function po(e) {
711
- const t = e.bytesFilled, r = e.elementSize;
712
- return new e.viewConstructor(e.buffer, e.byteOffset, t / r);
713
- }
714
- n$1(po, "ReadableByteStreamControllerConvertPullIntoDescriptor");
715
- function xt(e, t, r, s) {
716
- e._queue.push({
717
- buffer: t,
718
- byteOffset: r,
719
- byteLength: s
720
- }), e._queueTotalSize += s;
721
- }
722
- n$1(xt, "ReadableByteStreamControllerEnqueueChunkToQueue");
723
- function bo(e, t, r, s) {
724
- let u;
725
- try {
726
- u = lo(t, r, r + s);
727
- } catch (c) {
728
- throw K(e, c), c;
729
- }
730
- xt(e, u, 0, s);
731
- }
732
- n$1(bo, "ReadableByteStreamControllerEnqueueClonedChunkToQueue");
733
- function mo(e, t) {
734
- t.bytesFilled > 0 && bo(e, t.buffer, t.byteOffset, t.bytesFilled), Ye(e);
735
- }
736
- n$1(mo, "ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");
737
- function yo(e, t) {
738
- const r = Math.min(e._queueTotalSize, t.byteLength - t.bytesFilled), s = t.bytesFilled + r;
739
- let u = r, c = !1;
740
- const m = s - s % t.elementSize;
741
- m >= t.minimumFill && (u = m - t.bytesFilled, c = !0);
742
- const R = e._queue;
743
- for (; u > 0;) {
744
- const y = R.peek(), C = Math.min(u, y.byteLength), P = t.byteOffset + t.bytesFilled;
745
- so(t.buffer, P, y.buffer, y.byteOffset, C), y.byteLength === C ? R.shift() : (y.byteOffset += C, y.byteLength -= C), e._queueTotalSize -= C, go(e, C, t), u -= C;
746
- }
747
- return c;
748
- }
749
- n$1(yo, "ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");
750
- function go(e, t, r) {
751
- r.bytesFilled += t;
752
- }
753
- n$1(go, "ReadableByteStreamControllerFillHeadPullIntoDescriptor");
754
- function _o(e) {
755
- e._queueTotalSize === 0 && e._closeRequested ? (Nt(e), At(e._controlledReadableByteStream)) : Fe(e);
756
- }
757
- n$1(_o, "ReadableByteStreamControllerHandleQueueDrain");
758
- function Qr(e) {
759
- e._byobRequest !== null && (e._byobRequest._associatedReadableByteStreamController = void 0, e._byobRequest._view = null, e._byobRequest = null);
760
- }
761
- n$1(Qr, "ReadableByteStreamControllerInvalidateBYOBRequest");
762
- function Yr(e) {
763
- for (; e._pendingPullIntos.length > 0;) {
764
- if (e._queueTotalSize === 0) return;
765
- const t = e._pendingPullIntos.peek();
766
- yo(e, t) && (Ye(e), Vr(e._controlledReadableByteStream, t));
767
- }
768
- }
769
- n$1(Yr, "ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");
770
- function aa(e) {
771
- const t = e._controlledReadableByteStream._reader;
772
- for (; t._readRequests.length > 0;) {
773
- if (e._queueTotalSize === 0) return;
774
- wo(e, t._readRequests.shift());
775
- }
776
- }
777
- n$1(aa, "ReadableByteStreamControllerProcessReadRequestsUsingQueue");
778
- function sa(e, t, r, s) {
779
- const u = e._controlledReadableByteStream, c = t.constructor, d = ia(c), { byteOffset: m, byteLength: R } = t, y = r * d;
780
- let C;
781
- try {
782
- C = we(t.buffer);
783
- } catch (B) {
784
- s._errorSteps(B);
785
- return;
786
- }
787
- const P = {
788
- buffer: C,
789
- bufferByteLength: C.byteLength,
790
- byteOffset: m,
791
- byteLength: R,
792
- bytesFilled: 0,
793
- minimumFill: y,
794
- elementSize: d,
795
- viewConstructor: c,
796
- readerType: "byob"
797
- };
798
- if (e._pendingPullIntos.length > 0) {
799
- e._pendingPullIntos.push(P), Po(u, s);
800
- return;
801
- }
802
- if (u._state === "closed") {
803
- const B = new c(P.buffer, P.byteOffset, 0);
804
- s._closeSteps(B);
805
- return;
806
- }
807
- if (e._queueTotalSize > 0) {
808
- if (yo(e, P)) {
809
- const B = po(P);
810
- _o(e), s._chunkSteps(B);
811
- return;
812
- }
813
- if (e._closeRequested) {
814
- const B = /* @__PURE__ */ new TypeError("Insufficient bytes to fill elements in the given buffer");
815
- K(e, B), s._errorSteps(B);
816
- return;
817
- }
818
- }
819
- e._pendingPullIntos.push(P), Po(u, s), Fe(e);
820
- }
821
- n$1(sa, "ReadableByteStreamControllerPullInto");
822
- function la(e, t) {
823
- t.readerType === "none" && Ye(e);
824
- const r = e._controlledReadableByteStream;
825
- if (Kr(r)) for (; vo(r) > 0;) Vr(r, Ye(e));
826
- }
827
- n$1(la, "ReadableByteStreamControllerRespondInClosedState");
828
- function ua(e, t, r) {
829
- if (go(e, t, r), r.readerType === "none") {
830
- mo(e, r), Yr(e);
831
- return;
832
- }
833
- if (r.bytesFilled < r.minimumFill) return;
834
- Ye(e);
835
- const s = r.bytesFilled % r.elementSize;
836
- if (s > 0) {
837
- const u = r.byteOffset + r.bytesFilled;
838
- bo(e, r.buffer, u - s, s);
839
- }
840
- r.bytesFilled -= s, Vr(e._controlledReadableByteStream, r), Yr(e);
841
- }
842
- n$1(ua, "ReadableByteStreamControllerRespondInReadableState");
843
- function So(e, t) {
844
- const r = e._pendingPullIntos.peek();
845
- Qr(e), e._controlledReadableByteStream._state === "closed" ? la(e, r) : ua(e, t, r), Fe(e);
846
- }
847
- n$1(So, "ReadableByteStreamControllerRespondInternal");
848
- function Ye(e) {
849
- return e._pendingPullIntos.shift();
850
- }
851
- n$1(Ye, "ReadableByteStreamControllerShiftPendingPullInto");
852
- function fa(e) {
853
- const t = e._controlledReadableByteStream;
854
- return t._state !== "readable" || e._closeRequested || !e._started ? !1 : !!(to(t) && $t(t) > 0 || Kr(t) && vo(t) > 0 || Ro(e) > 0);
855
- }
856
- n$1(fa, "ReadableByteStreamControllerShouldCallPull");
857
- function Nt(e) {
858
- e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0;
859
- }
860
- n$1(Nt, "ReadableByteStreamControllerClearAlgorithms");
861
- function wt(e) {
862
- const t = e._controlledReadableByteStream;
863
- if (!(e._closeRequested || t._state !== "readable")) {
864
- if (e._queueTotalSize > 0) {
865
- e._closeRequested = !0;
866
- return;
867
- }
868
- if (e._pendingPullIntos.length > 0) {
869
- const r = e._pendingPullIntos.peek();
870
- if (r.bytesFilled % r.elementSize !== 0) {
871
- const s = /* @__PURE__ */ new TypeError("Insufficient bytes to fill elements in the given buffer");
872
- throw K(e, s), s;
873
- }
874
- }
875
- Nt(e), At(t);
876
- }
877
- }
878
- n$1(wt, "ReadableByteStreamControllerClose");
879
- function Ht(e, t) {
880
- const r = e._controlledReadableByteStream;
881
- if (e._closeRequested || r._state !== "readable") return;
882
- const { buffer: s, byteOffset: u, byteLength: c } = t;
883
- if (Ae(s)) throw new TypeError("chunk's buffer is detached and so cannot be enqueued");
884
- const d = we(s);
885
- if (e._pendingPullIntos.length > 0) {
886
- const m = e._pendingPullIntos.peek();
887
- if (Ae(m.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");
888
- Qr(e), m.buffer = we(m.buffer), m.readerType === "none" && mo(e, m);
889
- }
890
- if (to(r)) if (aa(e), $t(r) === 0) xt(e, d, u, c);
891
- else {
892
- e._pendingPullIntos.length > 0 && Ye(e);
893
- Lr(r, new Uint8Array(d, u, c), !1);
894
- }
895
- else Kr(r) ? (xt(e, d, u, c), Yr(e)) : xt(e, d, u, c);
896
- Fe(e);
897
- }
898
- n$1(Ht, "ReadableByteStreamControllerEnqueue");
899
- function K(e, t) {
900
- const r = e._controlledReadableByteStream;
901
- r._state === "readable" && (ho(e), Be(e), Nt(e), Zo(r, t));
902
- }
903
- n$1(K, "ReadableByteStreamControllerError");
904
- function wo(e, t) {
905
- const r = e._queue.shift();
906
- e._queueTotalSize -= r.byteLength, _o(e);
907
- const s = new Uint8Array(r.buffer, r.byteOffset, r.byteLength);
908
- t._chunkSteps(s);
909
- }
910
- n$1(wo, "ReadableByteStreamControllerFillReadRequestFromQueue");
911
- function Gr(e) {
912
- if (e._byobRequest === null && e._pendingPullIntos.length > 0) {
913
- const t = e._pendingPullIntos.peek(), r = new Uint8Array(t.buffer, t.byteOffset + t.bytesFilled, t.byteLength - t.bytesFilled), s = Object.create(Re.prototype);
914
- da(s, e, r), e._byobRequest = s;
915
- }
916
- return e._byobRequest;
917
- }
918
- n$1(Gr, "ReadableByteStreamControllerGetBYOBRequest");
919
- function Ro(e) {
920
- const t = e._controlledReadableByteStream._state;
921
- return t === "errored" ? null : t === "closed" ? 0 : e._strategyHWM - e._queueTotalSize;
922
- }
923
- n$1(Ro, "ReadableByteStreamControllerGetDesiredSize");
924
- function Vt(e, t) {
925
- const r = e._pendingPullIntos.peek();
926
- if (e._controlledReadableByteStream._state === "closed") {
927
- if (t !== 0) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");
928
- } else {
929
- if (t === 0) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");
930
- if (r.bytesFilled + t > r.byteLength) throw new RangeError("bytesWritten out of range");
931
- }
932
- r.buffer = we(r.buffer), So(e, t);
933
- }
934
- n$1(Vt, "ReadableByteStreamControllerRespond");
935
- function Qt(e, t) {
936
- const r = e._pendingPullIntos.peek();
937
- if (e._controlledReadableByteStream._state === "closed") {
938
- if (t.byteLength !== 0) throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream");
939
- } else if (t.byteLength === 0) throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");
940
- if (r.byteOffset + r.bytesFilled !== t.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");
941
- if (r.bufferByteLength !== t.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");
942
- if (r.bytesFilled + t.byteLength > r.byteLength) throw new RangeError("The region specified by view is larger than byobRequest");
943
- const u = t.byteLength;
944
- r.buffer = we(t.buffer), So(e, u);
945
- }
946
- n$1(Qt, "ReadableByteStreamControllerRespondWithNewView");
947
- function To(e, t, r, s, u, c, d) {
948
- t._controlledReadableByteStream = e, t._pullAgain = !1, t._pulling = !1, t._byobRequest = null, t._queue = t._queueTotalSize = void 0, Be(t), t._closeRequested = !1, t._started = !1, t._strategyHWM = c, t._pullAlgorithm = s, t._cancelAlgorithm = u, t._autoAllocateChunkSize = d, t._pendingPullIntos = new D(), e._readableStreamController = t;
949
- g(T(r()), () => (t._started = !0, Fe(t), null), (R) => (K(t, R), null));
950
- }
951
- n$1(To, "SetUpReadableByteStreamController");
952
- function ca(e, t, r) {
953
- const s = Object.create(te.prototype);
954
- let u, c, d;
955
- t.start !== void 0 ? u = n$1(() => t.start(s), "startAlgorithm") : u = n$1(() => {}, "startAlgorithm"), t.pull !== void 0 ? c = n$1(() => t.pull(s), "pullAlgorithm") : c = n$1(() => T(void 0), "pullAlgorithm"), t.cancel !== void 0 ? d = n$1((R) => t.cancel(R), "cancelAlgorithm") : d = n$1(() => T(void 0), "cancelAlgorithm");
956
- const m = t.autoAllocateChunkSize;
957
- if (m === 0) throw new TypeError("autoAllocateChunkSize must be greater than 0");
958
- To(e, s, u, c, d, r, m);
959
- }
960
- n$1(ca, "SetUpReadableByteStreamControllerFromUnderlyingSource");
961
- function da(e, t, r) {
962
- e._associatedReadableByteStreamController = t, e._view = r;
963
- }
964
- n$1(da, "SetUpReadableStreamBYOBRequest");
965
- function Zr(e) {
966
- return /* @__PURE__ */ new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`);
967
- }
968
- n$1(Zr, "byobRequestBrandCheckException");
969
- function Rt(e) {
970
- return /* @__PURE__ */ new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`);
971
- }
972
- n$1(Rt, "byteStreamControllerBrandCheckException");
973
- function ha(e, t) {
974
- ue(e, t);
975
- const r = e?.mode;
976
- return { mode: r === void 0 ? void 0 : pa(r, `${t} has member 'mode' that`) };
977
- }
978
- n$1(ha, "convertReaderOptions");
979
- function pa(e, t) {
980
- if (e = `${e}`, e !== "byob") throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);
981
- return e;
982
- }
983
- n$1(pa, "convertReadableStreamReaderMode");
984
- function ba(e, t) {
985
- var r;
986
- ue(e, t);
987
- return { min: Fr((r = e?.min) !== null && r !== void 0 ? r : 1, `${t} has member 'min' that`) };
988
- }
989
- n$1(ba, "convertByobReadOptions");
990
- function Co(e) {
991
- return new ce(e);
992
- }
993
- n$1(Co, "AcquireReadableStreamBYOBReader");
994
- function Po(e, t) {
995
- e._reader._readIntoRequests.push(t);
996
- }
997
- n$1(Po, "ReadableStreamAddReadIntoRequest");
998
- function ma(e, t, r) {
999
- const u = e._reader._readIntoRequests.shift();
1000
- r ? u._closeSteps(t) : u._chunkSteps(t);
1001
- }
1002
- n$1(ma, "ReadableStreamFulfillReadIntoRequest");
1003
- function vo(e) {
1004
- return e._reader._readIntoRequests.length;
1005
- }
1006
- n$1(vo, "ReadableStreamGetNumReadIntoRequests");
1007
- function Kr(e) {
1008
- const t = e._reader;
1009
- return !(t === void 0 || !je(t));
1010
- }
1011
- n$1(Kr, "ReadableStreamHasBYOBReader");
1012
- const Sn = class Sn$1 {
1013
- constructor(t) {
1014
- if (Se(t, 1, "ReadableStreamBYOBReader"), jr(t, "First parameter"), qe(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
1015
- if (!Ie(t._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");
1016
- Yn(this, t), this._readIntoRequests = new D();
1017
- }
1018
- get closed() {
1019
- return je(this) ? this._closedPromise : b(Yt("closed"));
1020
- }
1021
- cancel(t = void 0) {
1022
- return je(this) ? this._ownerReadableStream === void 0 ? b(Lt("cancel")) : Wr(this, t) : b(Yt("cancel"));
1023
- }
1024
- read(t, r = {}) {
1025
- if (!je(this)) return b(Yt("read"));
1026
- if (!ArrayBuffer.isView(t)) return b(/* @__PURE__ */ new TypeError("view must be an array buffer view"));
1027
- if (t.byteLength === 0) return b(/* @__PURE__ */ new TypeError("view must have non-zero byteLength"));
1028
- if (t.buffer.byteLength === 0) return b(/* @__PURE__ */ new TypeError("view's buffer must have non-zero byteLength"));
1029
- if (Ae(t.buffer)) return b(/* @__PURE__ */ new TypeError("view's buffer has been detached"));
1030
- let s;
1031
- try {
1032
- s = ba(r, "options");
1033
- } catch (y) {
1034
- return b(y);
1035
- }
1036
- const u = s.min;
1037
- if (u === 0) return b(/* @__PURE__ */ new TypeError("options.min must be greater than 0"));
1038
- if (oa(t)) {
1039
- if (u > t.byteLength) return b(/* @__PURE__ */ new RangeError("options.min must be less than or equal to view's byteLength"));
1040
- } else if (u > t.length) return b(/* @__PURE__ */ new RangeError("options.min must be less than or equal to view's length"));
1041
- if (this._ownerReadableStream === void 0) return b(Lt("read from"));
1042
- let c, d;
1043
- const m = A((y, C) => {
1044
- c = y, d = C;
1045
- });
1046
- return Eo(this, t, u, {
1047
- _chunkSteps: n$1((y) => c({
1048
- value: y,
1049
- done: !1
1050
- }), "_chunkSteps"),
1051
- _closeSteps: n$1((y) => c({
1052
- value: y,
1053
- done: !0
1054
- }), "_closeSteps"),
1055
- _errorSteps: n$1((y) => d(y), "_errorSteps")
1056
- }), m;
1057
- }
1058
- releaseLock() {
1059
- if (!je(this)) throw Yt("releaseLock");
1060
- this._ownerReadableStream !== void 0 && ya(this);
1061
- }
1062
- };
1063
- n$1(Sn, "ReadableStreamBYOBReader");
1064
- let ce = Sn;
1065
- Object.defineProperties(ce.prototype, {
1066
- cancel: { enumerable: !0 },
1067
- read: { enumerable: !0 },
1068
- releaseLock: { enumerable: !0 },
1069
- closed: { enumerable: !0 }
1070
- }), h(ce.prototype.cancel, "cancel"), h(ce.prototype.read, "read"), h(ce.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ce.prototype, Symbol.toStringTag, {
1071
- value: "ReadableStreamBYOBReader",
1072
- configurable: !0
1073
- });
1074
- function je(e) {
1075
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_readIntoRequests") ? !1 : e instanceof ce;
1076
- }
1077
- n$1(je, "IsReadableStreamBYOBReader");
1078
- function Eo(e, t, r, s) {
1079
- const u = e._ownerReadableStream;
1080
- u._disturbed = !0, u._state === "errored" ? s._errorSteps(u._storedError) : sa(u._readableStreamController, t, r, s);
1081
- }
1082
- n$1(Eo, "ReadableStreamBYOBReaderRead");
1083
- function ya(e) {
1084
- _e(e);
1085
- Ao(e, /* @__PURE__ */ new TypeError("Reader was released"));
1086
- }
1087
- n$1(ya, "ReadableStreamBYOBReaderRelease");
1088
- function Ao(e, t) {
1089
- const r = e._readIntoRequests;
1090
- e._readIntoRequests = new D(), r.forEach((s) => {
1091
- s._errorSteps(t);
1092
- });
1093
- }
1094
- n$1(Ao, "ReadableStreamBYOBReaderErrorReadIntoRequests");
1095
- function Yt(e) {
1096
- return /* @__PURE__ */ new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`);
1097
- }
1098
- n$1(Yt, "byobReaderBrandCheckException");
1099
- function Tt(e, t) {
1100
- const { highWaterMark: r } = e;
1101
- if (r === void 0) return t;
1102
- if (ao(r) || r < 0) throw new RangeError("Invalid highWaterMark");
1103
- return r;
1104
- }
1105
- n$1(Tt, "ExtractHighWaterMark");
1106
- function Gt(e) {
1107
- const { size: t } = e;
1108
- return t || (() => 1);
1109
- }
1110
- n$1(Gt, "ExtractSizeAlgorithm");
1111
- function Zt(e, t) {
1112
- ue(e, t);
1113
- const r = e?.highWaterMark, s = e?.size;
1114
- return {
1115
- highWaterMark: r === void 0 ? void 0 : Ir(r),
1116
- size: s === void 0 ? void 0 : ga(s, `${t} has member 'size' that`)
1117
- };
1118
- }
1119
- n$1(Zt, "convertQueuingStrategy");
1120
- function ga(e, t) {
1121
- return Z(e, t), (r) => Ir(e(r));
1122
- }
1123
- n$1(ga, "convertQueuingStrategySize");
1124
- function _a(e, t) {
1125
- ue(e, t);
1126
- const r = e?.abort, s = e?.close, u = e?.start, c = e?.type, d = e?.write;
1127
- return {
1128
- abort: r === void 0 ? void 0 : Sa(r, e, `${t} has member 'abort' that`),
1129
- close: s === void 0 ? void 0 : wa(s, e, `${t} has member 'close' that`),
1130
- start: u === void 0 ? void 0 : Ra(u, e, `${t} has member 'start' that`),
1131
- write: d === void 0 ? void 0 : Ta(d, e, `${t} has member 'write' that`),
1132
- type: c
1133
- };
1134
- }
1135
- n$1(_a, "convertUnderlyingSink");
1136
- function Sa(e, t, r) {
1137
- return Z(e, r), (s) => j(e, t, [s]);
1138
- }
1139
- n$1(Sa, "convertUnderlyingSinkAbortCallback");
1140
- function wa(e, t, r) {
1141
- return Z(e, r), () => j(e, t, []);
1142
- }
1143
- n$1(wa, "convertUnderlyingSinkCloseCallback");
1144
- function Ra(e, t, r) {
1145
- return Z(e, r), (s) => z(e, t, [s]);
1146
- }
1147
- n$1(Ra, "convertUnderlyingSinkStartCallback");
1148
- function Ta(e, t, r) {
1149
- return Z(e, r), (s, u) => j(e, t, [s, u]);
1150
- }
1151
- n$1(Ta, "convertUnderlyingSinkWriteCallback");
1152
- function Bo(e, t) {
1153
- if (!Ge(e)) throw new TypeError(`${t} is not a WritableStream.`);
1154
- }
1155
- n$1(Bo, "assertWritableStream");
1156
- function Ca(e) {
1157
- if (typeof e != "object" || e === null) return !1;
1158
- try {
1159
- return typeof e.aborted == "boolean";
1160
- } catch {
1161
- return !1;
1162
- }
1163
- }
1164
- n$1(Ca, "isAbortSignal");
1165
- const Pa = typeof AbortController == "function";
1166
- function va() {
1167
- if (Pa) return new AbortController();
1168
- }
1169
- n$1(va, "createAbortController");
1170
- const wn = class wn$1 {
1171
- constructor(t = {}, r = {}) {
1172
- t === void 0 ? t = null : Jn(t, "First parameter");
1173
- const s = Zt(r, "Second parameter"), u = _a(t, "First parameter");
1174
- if (Wo(this), u.type !== void 0) throw new RangeError("Invalid type is specified");
1175
- const d = Gt(s), m = Tt(s, 1);
1176
- Da(this, u, m, d);
1177
- }
1178
- get locked() {
1179
- if (!Ge(this)) throw tr("locked");
1180
- return Ze(this);
1181
- }
1182
- abort(t = void 0) {
1183
- return Ge(this) ? Ze(this) ? b(/* @__PURE__ */ new TypeError("Cannot abort a stream that already has a writer")) : Kt(this, t) : b(tr("abort"));
1184
- }
1185
- close() {
1186
- return Ge(this) ? Ze(this) ? b(/* @__PURE__ */ new TypeError("Cannot close a stream that already has a writer")) : he(this) ? b(/* @__PURE__ */ new TypeError("Cannot close an already-closing stream")) : qo(this) : b(tr("close"));
1187
- }
1188
- getWriter() {
1189
- if (!Ge(this)) throw tr("getWriter");
1190
- return ko(this);
1191
- }
1192
- };
1193
- n$1(wn, "WritableStream");
1194
- let de = wn;
1195
- Object.defineProperties(de.prototype, {
1196
- abort: { enumerable: !0 },
1197
- close: { enumerable: !0 },
1198
- getWriter: { enumerable: !0 },
1199
- locked: { enumerable: !0 }
1200
- }), h(de.prototype.abort, "abort"), h(de.prototype.close, "close"), h(de.prototype.getWriter, "getWriter"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(de.prototype, Symbol.toStringTag, {
1201
- value: "WritableStream",
1202
- configurable: !0
1203
- });
1204
- function ko(e) {
1205
- return new re(e);
1206
- }
1207
- n$1(ko, "AcquireWritableStreamDefaultWriter");
1208
- function Ea(e, t, r, s, u = 1, c = () => 1) {
1209
- const d = Object.create(de.prototype);
1210
- Wo(d);
1211
- return Lo(d, Object.create(ke.prototype), e, t, r, s, u, c), d;
1212
- }
1213
- n$1(Ea, "CreateWritableStream");
1214
- function Wo(e) {
1215
- e._state = "writable", e._storedError = void 0, e._writer = void 0, e._writableStreamController = void 0, e._writeRequests = new D(), e._inFlightWriteRequest = void 0, e._closeRequest = void 0, e._inFlightCloseRequest = void 0, e._pendingAbortRequest = void 0, e._backpressure = !1;
1216
- }
1217
- n$1(Wo, "InitializeWritableStream");
1218
- function Ge(e) {
1219
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_writableStreamController") ? !1 : e instanceof de;
1220
- }
1221
- n$1(Ge, "IsWritableStream");
1222
- function Ze(e) {
1223
- return e._writer !== void 0;
1224
- }
1225
- n$1(Ze, "IsWritableStreamLocked");
1226
- function Kt(e, t) {
1227
- var r;
1228
- if (e._state === "closed" || e._state === "errored") return T(void 0);
1229
- e._writableStreamController._abortReason = t, (r = e._writableStreamController._abortController) === null || r === void 0 || r.abort(t);
1230
- const s = e._state;
1231
- if (s === "closed" || s === "errored") return T(void 0);
1232
- if (e._pendingAbortRequest !== void 0) return e._pendingAbortRequest._promise;
1233
- let u = !1;
1234
- s === "erroring" && (u = !0, t = void 0);
1235
- const c = A((d, m) => {
1236
- e._pendingAbortRequest = {
1237
- _promise: void 0,
1238
- _resolve: d,
1239
- _reject: m,
1240
- _reason: t,
1241
- _wasAlreadyErroring: u
1242
- };
1243
- });
1244
- return e._pendingAbortRequest._promise = c, u || Xr(e, t), c;
1245
- }
1246
- n$1(Kt, "WritableStreamAbort");
1247
- function qo(e) {
1248
- const t = e._state;
1249
- if (t === "closed" || t === "errored") return b(/* @__PURE__ */ new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));
1250
- const r = A((u, c) => {
1251
- e._closeRequest = {
1252
- _resolve: u,
1253
- _reject: c
1254
- };
1255
- }), s = e._writer;
1256
- return s !== void 0 && e._backpressure && t === "writable" && ln(s), Ma(e._writableStreamController), r;
1257
- }
1258
- n$1(qo, "WritableStreamClose");
1259
- function Aa(e) {
1260
- return A((r, s) => {
1261
- const u = {
1262
- _resolve: r,
1263
- _reject: s
1264
- };
1265
- e._writeRequests.push(u);
1266
- });
1267
- }
1268
- n$1(Aa, "WritableStreamAddWriteRequest");
1269
- function Jr(e, t) {
1270
- if (e._state === "writable") {
1271
- Xr(e, t);
1272
- return;
1273
- }
1274
- en(e);
1275
- }
1276
- n$1(Jr, "WritableStreamDealWithRejection");
1277
- function Xr(e, t) {
1278
- const r = e._writableStreamController;
1279
- e._state = "erroring", e._storedError = t;
1280
- const s = e._writer;
1281
- s !== void 0 && zo(s, t), !Oa(e) && r._started && en(e);
1282
- }
1283
- n$1(Xr, "WritableStreamStartErroring");
1284
- function en(e) {
1285
- e._state = "errored", e._writableStreamController[Qn]();
1286
- const t = e._storedError;
1287
- if (e._writeRequests.forEach((u) => {
1288
- u._reject(t);
1289
- }), e._writeRequests = new D(), e._pendingAbortRequest === void 0) {
1290
- Jt(e);
1291
- return;
1292
- }
1293
- const r = e._pendingAbortRequest;
1294
- if (e._pendingAbortRequest = void 0, r._wasAlreadyErroring) {
1295
- r._reject(t), Jt(e);
1296
- return;
1297
- }
1298
- g(e._writableStreamController[jt](r._reason), () => (r._resolve(), Jt(e), null), (u) => (r._reject(u), Jt(e), null));
1299
- }
1300
- n$1(en, "WritableStreamFinishErroring");
1301
- function Ba(e) {
1302
- e._inFlightWriteRequest._resolve(void 0), e._inFlightWriteRequest = void 0;
1303
- }
1304
- n$1(Ba, "WritableStreamFinishInFlightWrite");
1305
- function ka(e, t) {
1306
- e._inFlightWriteRequest._reject(t), e._inFlightWriteRequest = void 0, Jr(e, t);
1307
- }
1308
- n$1(ka, "WritableStreamFinishInFlightWriteWithError");
1309
- function Wa(e) {
1310
- e._inFlightCloseRequest._resolve(void 0), e._inFlightCloseRequest = void 0, e._state === "erroring" && (e._storedError = void 0, e._pendingAbortRequest !== void 0 && (e._pendingAbortRequest._resolve(), e._pendingAbortRequest = void 0)), e._state = "closed";
1311
- const r = e._writer;
1312
- r !== void 0 && Uo(r);
1313
- }
1314
- n$1(Wa, "WritableStreamFinishInFlightClose");
1315
- function qa(e, t) {
1316
- e._inFlightCloseRequest._reject(t), e._inFlightCloseRequest = void 0, e._pendingAbortRequest !== void 0 && (e._pendingAbortRequest._reject(t), e._pendingAbortRequest = void 0), Jr(e, t);
1317
- }
1318
- n$1(qa, "WritableStreamFinishInFlightCloseWithError");
1319
- function he(e) {
1320
- return !(e._closeRequest === void 0 && e._inFlightCloseRequest === void 0);
1321
- }
1322
- n$1(he, "WritableStreamCloseQueuedOrInFlight");
1323
- function Oa(e) {
1324
- return !(e._inFlightWriteRequest === void 0 && e._inFlightCloseRequest === void 0);
1325
- }
1326
- n$1(Oa, "WritableStreamHasOperationMarkedInFlight");
1327
- function za(e) {
1328
- e._inFlightCloseRequest = e._closeRequest, e._closeRequest = void 0;
1329
- }
1330
- n$1(za, "WritableStreamMarkCloseRequestInFlight");
1331
- function Ia(e) {
1332
- e._inFlightWriteRequest = e._writeRequests.shift();
1333
- }
1334
- n$1(Ia, "WritableStreamMarkFirstWriteRequestInFlight");
1335
- function Jt(e) {
1336
- e._closeRequest !== void 0 && (e._closeRequest._reject(e._storedError), e._closeRequest = void 0);
1337
- const t = e._writer;
1338
- t !== void 0 && an(t, e._storedError);
1339
- }
1340
- n$1(Jt, "WritableStreamRejectCloseAndClosedPromiseIfNeeded");
1341
- function tn(e, t) {
1342
- const r = e._writer;
1343
- r !== void 0 && t !== e._backpressure && (t ? Ya(r) : ln(r)), e._backpressure = t;
1344
- }
1345
- n$1(tn, "WritableStreamUpdateBackpressure");
1346
- const Rn = class Rn$1 {
1347
- constructor(t) {
1348
- if (Se(t, 1, "WritableStreamDefaultWriter"), Bo(t, "First parameter"), Ze(t)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");
1349
- this._ownerWritableStream = t, t._writer = this;
1350
- const r = t._state;
1351
- if (r === "writable") !he(t) && t._backpressure ? nr(this) : xo(this), rr(this);
1352
- else if (r === "erroring") sn(this, t._storedError), rr(this);
1353
- else if (r === "closed") xo(this), Va(this);
1354
- else {
1355
- const s = t._storedError;
1356
- sn(this, s), Mo(this, s);
1357
- }
1358
- }
1359
- get closed() {
1360
- return Le(this) ? this._closedPromise : b($e("closed"));
1361
- }
1362
- get desiredSize() {
1363
- if (!Le(this)) throw $e("desiredSize");
1364
- if (this._ownerWritableStream === void 0) throw Pt("desiredSize");
1365
- return $a(this);
1366
- }
1367
- get ready() {
1368
- return Le(this) ? this._readyPromise : b($e("ready"));
1369
- }
1370
- abort(t = void 0) {
1371
- return Le(this) ? this._ownerWritableStream === void 0 ? b(Pt("abort")) : Fa(this, t) : b($e("abort"));
1372
- }
1373
- close() {
1374
- if (!Le(this)) return b($e("close"));
1375
- const t = this._ownerWritableStream;
1376
- return t === void 0 ? b(Pt("close")) : he(t) ? b(/* @__PURE__ */ new TypeError("Cannot close an already-closing stream")) : Oo(this);
1377
- }
1378
- releaseLock() {
1379
- if (!Le(this)) throw $e("releaseLock");
1380
- this._ownerWritableStream !== void 0 && Io(this);
1381
- }
1382
- write(t = void 0) {
1383
- return Le(this) ? this._ownerWritableStream === void 0 ? b(Pt("write to")) : Fo(this, t) : b($e("write"));
1384
- }
1385
- };
1386
- n$1(Rn, "WritableStreamDefaultWriter");
1387
- let re = Rn;
1388
- Object.defineProperties(re.prototype, {
1389
- abort: { enumerable: !0 },
1390
- close: { enumerable: !0 },
1391
- releaseLock: { enumerable: !0 },
1392
- write: { enumerable: !0 },
1393
- closed: { enumerable: !0 },
1394
- desiredSize: { enumerable: !0 },
1395
- ready: { enumerable: !0 }
1396
- }), h(re.prototype.abort, "abort"), h(re.prototype.close, "close"), h(re.prototype.releaseLock, "releaseLock"), h(re.prototype.write, "write"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(re.prototype, Symbol.toStringTag, {
1397
- value: "WritableStreamDefaultWriter",
1398
- configurable: !0
1399
- });
1400
- function Le(e) {
1401
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_ownerWritableStream") ? !1 : e instanceof re;
1402
- }
1403
- n$1(Le, "IsWritableStreamDefaultWriter");
1404
- function Fa(e, t) {
1405
- const r = e._ownerWritableStream;
1406
- return Kt(r, t);
1407
- }
1408
- n$1(Fa, "WritableStreamDefaultWriterAbort");
1409
- function Oo(e) {
1410
- const t = e._ownerWritableStream;
1411
- return qo(t);
1412
- }
1413
- n$1(Oo, "WritableStreamDefaultWriterClose");
1414
- function ja(e) {
1415
- const t = e._ownerWritableStream, r = t._state;
1416
- return he(t) || r === "closed" ? T(void 0) : r === "errored" ? b(t._storedError) : Oo(e);
1417
- }
1418
- n$1(ja, "WritableStreamDefaultWriterCloseWithErrorPropagation");
1419
- function La(e, t) {
1420
- e._closedPromiseState === "pending" ? an(e, t) : Qa(e, t);
1421
- }
1422
- n$1(La, "WritableStreamDefaultWriterEnsureClosedPromiseRejected");
1423
- function zo(e, t) {
1424
- e._readyPromiseState === "pending" ? No(e, t) : Ga(e, t);
1425
- }
1426
- n$1(zo, "WritableStreamDefaultWriterEnsureReadyPromiseRejected");
1427
- function $a(e) {
1428
- const t = e._ownerWritableStream, r = t._state;
1429
- return r === "errored" || r === "erroring" ? null : r === "closed" ? 0 : $o(t._writableStreamController);
1430
- }
1431
- n$1($a, "WritableStreamDefaultWriterGetDesiredSize");
1432
- function Io(e) {
1433
- const t = e._ownerWritableStream, r = /* @__PURE__ */ new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
1434
- zo(e, r), La(e, r), t._writer = void 0, e._ownerWritableStream = void 0;
1435
- }
1436
- n$1(Io, "WritableStreamDefaultWriterRelease");
1437
- function Fo(e, t) {
1438
- const r = e._ownerWritableStream, s = r._writableStreamController, u = Ua(s, t);
1439
- if (r !== e._ownerWritableStream) return b(Pt("write to"));
1440
- const c = r._state;
1441
- if (c === "errored") return b(r._storedError);
1442
- if (he(r) || c === "closed") return b(/* @__PURE__ */ new TypeError("The stream is closing or closed and cannot be written to"));
1443
- if (c === "erroring") return b(r._storedError);
1444
- const d = Aa(r);
1445
- return xa(s, t, u), d;
1446
- }
1447
- n$1(Fo, "WritableStreamDefaultWriterWrite");
1448
- const jo = {}, Tn = class Tn$1 {
1449
- constructor() {
1450
- throw new TypeError("Illegal constructor");
1451
- }
1452
- get abortReason() {
1453
- if (!rn(this)) throw on("abortReason");
1454
- return this._abortReason;
1455
- }
1456
- get signal() {
1457
- if (!rn(this)) throw on("signal");
1458
- if (this._abortController === void 0) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");
1459
- return this._abortController.signal;
1460
- }
1461
- error(t = void 0) {
1462
- if (!rn(this)) throw on("error");
1463
- this._controlledWritableStream._state === "writable" && Do(this, t);
1464
- }
1465
- [jt](t) {
1466
- const r = this._abortAlgorithm(t);
1467
- return Xt(this), r;
1468
- }
1469
- [Qn]() {
1470
- Be(this);
1471
- }
1472
- };
1473
- n$1(Tn, "WritableStreamDefaultController");
1474
- let ke = Tn;
1475
- Object.defineProperties(ke.prototype, {
1476
- abortReason: { enumerable: !0 },
1477
- signal: { enumerable: !0 },
1478
- error: { enumerable: !0 }
1479
- }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ke.prototype, Symbol.toStringTag, {
1480
- value: "WritableStreamDefaultController",
1481
- configurable: !0
1482
- });
1483
- function rn(e) {
1484
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledWritableStream") ? !1 : e instanceof ke;
1485
- }
1486
- n$1(rn, "IsWritableStreamDefaultController");
1487
- function Lo(e, t, r, s, u, c, d, m) {
1488
- t._controlledWritableStream = e, e._writableStreamController = t, t._queue = void 0, t._queueTotalSize = void 0, Be(t), t._abortReason = void 0, t._abortController = va(), t._started = !1, t._strategySizeAlgorithm = m, t._strategyHWM = d, t._writeAlgorithm = s, t._closeAlgorithm = u, t._abortAlgorithm = c;
1489
- tn(e, nn(t));
1490
- g(T(r()), () => (t._started = !0, er(t), null), (P) => (t._started = !0, Jr(e, P), null));
1491
- }
1492
- n$1(Lo, "SetUpWritableStreamDefaultController");
1493
- function Da(e, t, r, s) {
1494
- const u = Object.create(ke.prototype);
1495
- let c, d, m, R;
1496
- t.start !== void 0 ? c = n$1(() => t.start(u), "startAlgorithm") : c = n$1(() => {}, "startAlgorithm"), t.write !== void 0 ? d = n$1((y) => t.write(y, u), "writeAlgorithm") : d = n$1(() => T(void 0), "writeAlgorithm"), t.close !== void 0 ? m = n$1(() => t.close(), "closeAlgorithm") : m = n$1(() => T(void 0), "closeAlgorithm"), t.abort !== void 0 ? R = n$1((y) => t.abort(y), "abortAlgorithm") : R = n$1(() => T(void 0), "abortAlgorithm"), Lo(e, u, c, d, m, R, r, s);
1497
- }
1498
- n$1(Da, "SetUpWritableStreamDefaultControllerFromUnderlyingSink");
1499
- function Xt(e) {
1500
- e._writeAlgorithm = void 0, e._closeAlgorithm = void 0, e._abortAlgorithm = void 0, e._strategySizeAlgorithm = void 0;
1501
- }
1502
- n$1(Xt, "WritableStreamDefaultControllerClearAlgorithms");
1503
- function Ma(e) {
1504
- Nr(e, jo, 0), er(e);
1505
- }
1506
- n$1(Ma, "WritableStreamDefaultControllerClose");
1507
- function Ua(e, t) {
1508
- try {
1509
- return e._strategySizeAlgorithm(t);
1510
- } catch (r) {
1511
- return Ct(e, r), 1;
1512
- }
1513
- }
1514
- n$1(Ua, "WritableStreamDefaultControllerGetChunkSize");
1515
- function $o(e) {
1516
- return e._strategyHWM - e._queueTotalSize;
1517
- }
1518
- n$1($o, "WritableStreamDefaultControllerGetDesiredSize");
1519
- function xa(e, t, r) {
1520
- try {
1521
- Nr(e, t, r);
1522
- } catch (u) {
1523
- Ct(e, u);
1524
- return;
1525
- }
1526
- const s = e._controlledWritableStream;
1527
- if (!he(s) && s._state === "writable") tn(s, nn(e));
1528
- er(e);
1529
- }
1530
- n$1(xa, "WritableStreamDefaultControllerWrite");
1531
- function er(e) {
1532
- const t = e._controlledWritableStream;
1533
- if (!e._started || t._inFlightWriteRequest !== void 0) return;
1534
- if (t._state === "erroring") {
1535
- en(t);
1536
- return;
1537
- }
1538
- if (e._queue.length === 0) return;
1539
- const s = na(e);
1540
- s === jo ? Na(e) : Ha(e, s);
1541
- }
1542
- n$1(er, "WritableStreamDefaultControllerAdvanceQueueIfNeeded");
1543
- function Ct(e, t) {
1544
- e._controlledWritableStream._state === "writable" && Do(e, t);
1545
- }
1546
- n$1(Ct, "WritableStreamDefaultControllerErrorIfNeeded");
1547
- function Na(e) {
1548
- const t = e._controlledWritableStream;
1549
- za(t), xr(e);
1550
- const r = e._closeAlgorithm();
1551
- Xt(e), g(r, () => (Wa(t), null), (s) => (qa(t, s), null));
1552
- }
1553
- n$1(Na, "WritableStreamDefaultControllerProcessClose");
1554
- function Ha(e, t) {
1555
- const r = e._controlledWritableStream;
1556
- Ia(r);
1557
- g(e._writeAlgorithm(t), () => {
1558
- Ba(r);
1559
- const u = r._state;
1560
- if (xr(e), !he(r) && u === "writable") tn(r, nn(e));
1561
- return er(e), null;
1562
- }, (u) => (r._state === "writable" && Xt(e), ka(r, u), null));
1563
- }
1564
- n$1(Ha, "WritableStreamDefaultControllerProcessWrite");
1565
- function nn(e) {
1566
- return $o(e) <= 0;
1567
- }
1568
- n$1(nn, "WritableStreamDefaultControllerGetBackpressure");
1569
- function Do(e, t) {
1570
- const r = e._controlledWritableStream;
1571
- Xt(e), Xr(r, t);
1572
- }
1573
- n$1(Do, "WritableStreamDefaultControllerError");
1574
- function tr(e) {
1575
- return /* @__PURE__ */ new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`);
1576
- }
1577
- n$1(tr, "streamBrandCheckException$2");
1578
- function on(e) {
1579
- return /* @__PURE__ */ new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`);
1580
- }
1581
- n$1(on, "defaultControllerBrandCheckException$2");
1582
- function $e(e) {
1583
- return /* @__PURE__ */ new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`);
1584
- }
1585
- n$1($e, "defaultWriterBrandCheckException");
1586
- function Pt(e) {
1587
- return /* @__PURE__ */ new TypeError("Cannot " + e + " a stream using a released writer");
1588
- }
1589
- n$1(Pt, "defaultWriterLockException");
1590
- function rr(e) {
1591
- e._closedPromise = A((t, r) => {
1592
- e._closedPromise_resolve = t, e._closedPromise_reject = r, e._closedPromiseState = "pending";
1593
- });
1594
- }
1595
- n$1(rr, "defaultWriterClosedPromiseInitialize");
1596
- function Mo(e, t) {
1597
- rr(e), an(e, t);
1598
- }
1599
- n$1(Mo, "defaultWriterClosedPromiseInitializeAsRejected");
1600
- function Va(e) {
1601
- rr(e), Uo(e);
1602
- }
1603
- n$1(Va, "defaultWriterClosedPromiseInitializeAsResolved");
1604
- function an(e, t) {
1605
- e._closedPromise_reject !== void 0 && (Q(e._closedPromise), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "rejected");
1606
- }
1607
- n$1(an, "defaultWriterClosedPromiseReject");
1608
- function Qa(e, t) {
1609
- Mo(e, t);
1610
- }
1611
- n$1(Qa, "defaultWriterClosedPromiseResetToRejected");
1612
- function Uo(e) {
1613
- e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "resolved");
1614
- }
1615
- n$1(Uo, "defaultWriterClosedPromiseResolve");
1616
- function nr(e) {
1617
- e._readyPromise = A((t, r) => {
1618
- e._readyPromise_resolve = t, e._readyPromise_reject = r;
1619
- }), e._readyPromiseState = "pending";
1620
- }
1621
- n$1(nr, "defaultWriterReadyPromiseInitialize");
1622
- function sn(e, t) {
1623
- nr(e), No(e, t);
1624
- }
1625
- n$1(sn, "defaultWriterReadyPromiseInitializeAsRejected");
1626
- function xo(e) {
1627
- nr(e), ln(e);
1628
- }
1629
- n$1(xo, "defaultWriterReadyPromiseInitializeAsResolved");
1630
- function No(e, t) {
1631
- e._readyPromise_reject !== void 0 && (Q(e._readyPromise), e._readyPromise_reject(t), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "rejected");
1632
- }
1633
- n$1(No, "defaultWriterReadyPromiseReject");
1634
- function Ya(e) {
1635
- nr(e);
1636
- }
1637
- n$1(Ya, "defaultWriterReadyPromiseReset");
1638
- function Ga(e, t) {
1639
- sn(e, t);
1640
- }
1641
- n$1(Ga, "defaultWriterReadyPromiseResetToRejected");
1642
- function ln(e) {
1643
- e._readyPromise_resolve !== void 0 && (e._readyPromise_resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "fulfilled");
1644
- }
1645
- n$1(ln, "defaultWriterReadyPromiseResolve");
1646
- function Za() {
1647
- if (typeof globalThis < "u") return globalThis;
1648
- if (typeof self < "u") return self;
1649
- if (typeof require_node_fetch_native_DfbY2q_x.n < "u") return require_node_fetch_native_DfbY2q_x.n;
1650
- }
1651
- n$1(Za, "getGlobals");
1652
- const un = Za();
1653
- function Ka(e) {
1654
- if (!(typeof e == "function" || typeof e == "object") || e.name !== "DOMException") return !1;
1655
- try {
1656
- return new e(), !0;
1657
- } catch {
1658
- return !1;
1659
- }
1660
- }
1661
- n$1(Ka, "isDOMExceptionConstructor");
1662
- function Ja() {
1663
- const e = un?.DOMException;
1664
- return Ka(e) ? e : void 0;
1665
- }
1666
- n$1(Ja, "getFromGlobal");
1667
- function Xa() {
1668
- const e = n$1(function(r, s) {
1669
- this.message = r || "", this.name = s || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
1670
- }, "DOMException");
1671
- return h(e, "DOMException"), e.prototype = Object.create(Error.prototype), Object.defineProperty(e.prototype, "constructor", {
1672
- value: e,
1673
- writable: !0,
1674
- configurable: !0
1675
- }), e;
1676
- }
1677
- n$1(Xa, "createPolyfill");
1678
- const es = Ja() || Xa();
1679
- function Ho(e, t, r, s, u, c) {
1680
- const d = Qe(e), m = ko(t);
1681
- e._disturbed = !0;
1682
- let R = !1, y = T(void 0);
1683
- return A((C, P) => {
1684
- let B;
1685
- if (c !== void 0) {
1686
- if (B = n$1(() => {
1687
- const _ = c.reason !== void 0 ? c.reason : new es("Aborted", "AbortError"), E = [];
1688
- s || E.push(() => t._state === "writable" ? Kt(t, _) : T(void 0)), u || E.push(() => e._state === "readable" ? ie(e, _) : T(void 0)), N(() => Promise.all(E.map((k) => k())), !0, _);
1689
- }, "abortAlgorithm"), c.aborted) {
1690
- B();
1691
- return;
1692
- }
1693
- c.addEventListener("abort", B);
1694
- }
1695
- function ae() {
1696
- return A((_, E) => {
1697
- function k(Y) {
1698
- Y ? _() : q(nt(), k, E);
1699
- }
1700
- n$1(k, "next"), k(!1);
1701
- });
1702
- }
1703
- n$1(ae, "pipeLoop");
1704
- function nt() {
1705
- return R ? T(!0) : q(m._readyPromise, () => A((_, E) => {
1706
- _t(d, {
1707
- _chunkSteps: n$1((k) => {
1708
- y = q(Fo(m, k), void 0, f$1), _(!1);
1709
- }, "_chunkSteps"),
1710
- _closeSteps: n$1(() => _(!0), "_closeSteps"),
1711
- _errorSteps: E
1712
- });
1713
- }));
1714
- }
1715
- if (n$1(nt, "pipeStep"), Te(e, d._closedPromise, (_) => (s ? J(!0, _) : N(() => Kt(t, _), !0, _), null)), Te(t, m._closedPromise, (_) => (u ? J(!0, _) : N(() => ie(e, _), !0, _), null)), x(e, d._closedPromise, () => (r ? J() : N(() => ja(m)), null)), he(t) || t._state === "closed") {
1716
- const _ = /* @__PURE__ */ new TypeError("the destination writable stream closed before all data could be piped to it");
1717
- u ? J(!0, _) : N(() => ie(e, _), !0, _);
1718
- }
1719
- Q(ae());
1720
- function Oe() {
1721
- const _ = y;
1722
- return q(y, () => _ !== y ? Oe() : void 0);
1723
- }
1724
- n$1(Oe, "waitForWritesToFinish");
1725
- function Te(_, E, k) {
1726
- _._state === "errored" ? k(_._storedError) : I(E, k);
1727
- }
1728
- n$1(Te, "isOrBecomesErrored");
1729
- function x(_, E, k) {
1730
- _._state === "closed" ? k() : V(E, k);
1731
- }
1732
- n$1(x, "isOrBecomesClosed");
1733
- function N(_, E, k) {
1734
- if (R) return;
1735
- R = !0, t._state === "writable" && !he(t) ? V(Oe(), Y) : Y();
1736
- function Y() {
1737
- return g(_(), () => Ce(E, k), (ot) => Ce(!0, ot)), null;
1738
- }
1739
- n$1(Y, "doTheRest");
1740
- }
1741
- n$1(N, "shutdownWithAction");
1742
- function J(_, E) {
1743
- R || (R = !0, t._state === "writable" && !he(t) ? V(Oe(), () => Ce(_, E)) : Ce(_, E));
1744
- }
1745
- n$1(J, "shutdown");
1746
- function Ce(_, E) {
1747
- return Io(m), _e(d), c !== void 0 && c.removeEventListener("abort", B), _ ? P(E) : C(void 0), null;
1748
- }
1749
- n$1(Ce, "finalize");
1750
- });
1751
- }
1752
- n$1(Ho, "ReadableStreamPipeTo");
1753
- const Cn = class Cn$1 {
1754
- constructor() {
1755
- throw new TypeError("Illegal constructor");
1756
- }
1757
- get desiredSize() {
1758
- if (!or(this)) throw ar("desiredSize");
1759
- return fn(this);
1760
- }
1761
- close() {
1762
- if (!or(this)) throw ar("close");
1763
- if (!Je(this)) throw new TypeError("The stream is not in a state that permits close");
1764
- De(this);
1765
- }
1766
- enqueue(t = void 0) {
1767
- if (!or(this)) throw ar("enqueue");
1768
- if (!Je(this)) throw new TypeError("The stream is not in a state that permits enqueue");
1769
- return Ke(this, t);
1770
- }
1771
- error(t = void 0) {
1772
- if (!or(this)) throw ar("error");
1773
- oe(this, t);
1774
- }
1775
- [Ar](t) {
1776
- Be(this);
1777
- const r = this._cancelAlgorithm(t);
1778
- return ir(this), r;
1779
- }
1780
- [Br](t) {
1781
- const r = this._controlledReadableStream;
1782
- if (this._queue.length > 0) {
1783
- const s = xr(this);
1784
- this._closeRequested && this._queue.length === 0 ? (ir(this), At(r)) : vt(this), t._chunkSteps(s);
1785
- } else eo(r, t), vt(this);
1786
- }
1787
- [kr]() {}
1788
- };
1789
- n$1(Cn, "ReadableStreamDefaultController");
1790
- let ne = Cn;
1791
- Object.defineProperties(ne.prototype, {
1792
- close: { enumerable: !0 },
1793
- enqueue: { enumerable: !0 },
1794
- error: { enumerable: !0 },
1795
- desiredSize: { enumerable: !0 }
1796
- }), h(ne.prototype.close, "close"), h(ne.prototype.enqueue, "enqueue"), h(ne.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ne.prototype, Symbol.toStringTag, {
1797
- value: "ReadableStreamDefaultController",
1798
- configurable: !0
1799
- });
1800
- function or(e) {
1801
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledReadableStream") ? !1 : e instanceof ne;
1802
- }
1803
- n$1(or, "IsReadableStreamDefaultController");
1804
- function vt(e) {
1805
- if (!Vo(e)) return;
1806
- if (e._pulling) {
1807
- e._pullAgain = !0;
1808
- return;
1809
- }
1810
- e._pulling = !0;
1811
- g(e._pullAlgorithm(), () => (e._pulling = !1, e._pullAgain && (e._pullAgain = !1, vt(e)), null), (s) => (oe(e, s), null));
1812
- }
1813
- n$1(vt, "ReadableStreamDefaultControllerCallPullIfNeeded");
1814
- function Vo(e) {
1815
- const t = e._controlledReadableStream;
1816
- return !Je(e) || !e._started ? !1 : !!(qe(t) && $t(t) > 0 || fn(e) > 0);
1817
- }
1818
- n$1(Vo, "ReadableStreamDefaultControllerShouldCallPull");
1819
- function ir(e) {
1820
- e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0, e._strategySizeAlgorithm = void 0;
1821
- }
1822
- n$1(ir, "ReadableStreamDefaultControllerClearAlgorithms");
1823
- function De(e) {
1824
- if (!Je(e)) return;
1825
- const t = e._controlledReadableStream;
1826
- e._closeRequested = !0, e._queue.length === 0 && (ir(e), At(t));
1827
- }
1828
- n$1(De, "ReadableStreamDefaultControllerClose");
1829
- function Ke(e, t) {
1830
- if (!Je(e)) return;
1831
- const r = e._controlledReadableStream;
1832
- if (qe(r) && $t(r) > 0) Lr(r, t, !1);
1833
- else {
1834
- let s;
1835
- try {
1836
- s = e._strategySizeAlgorithm(t);
1837
- } catch (u) {
1838
- throw oe(e, u), u;
1839
- }
1840
- try {
1841
- Nr(e, t, s);
1842
- } catch (u) {
1843
- throw oe(e, u), u;
1844
- }
1845
- }
1846
- vt(e);
1847
- }
1848
- n$1(Ke, "ReadableStreamDefaultControllerEnqueue");
1849
- function oe(e, t) {
1850
- const r = e._controlledReadableStream;
1851
- r._state === "readable" && (Be(e), ir(e), Zo(r, t));
1852
- }
1853
- n$1(oe, "ReadableStreamDefaultControllerError");
1854
- function fn(e) {
1855
- const t = e._controlledReadableStream._state;
1856
- return t === "errored" ? null : t === "closed" ? 0 : e._strategyHWM - e._queueTotalSize;
1857
- }
1858
- n$1(fn, "ReadableStreamDefaultControllerGetDesiredSize");
1859
- function ts(e) {
1860
- return !Vo(e);
1861
- }
1862
- n$1(ts, "ReadableStreamDefaultControllerHasBackpressure");
1863
- function Je(e) {
1864
- const t = e._controlledReadableStream._state;
1865
- return !e._closeRequested && t === "readable";
1866
- }
1867
- n$1(Je, "ReadableStreamDefaultControllerCanCloseOrEnqueue");
1868
- function Qo(e, t, r, s, u, c, d) {
1869
- t._controlledReadableStream = e, t._queue = void 0, t._queueTotalSize = void 0, Be(t), t._started = !1, t._closeRequested = !1, t._pullAgain = !1, t._pulling = !1, t._strategySizeAlgorithm = d, t._strategyHWM = c, t._pullAlgorithm = s, t._cancelAlgorithm = u, e._readableStreamController = t;
1870
- g(T(r()), () => (t._started = !0, vt(t), null), (R) => (oe(t, R), null));
1871
- }
1872
- n$1(Qo, "SetUpReadableStreamDefaultController");
1873
- function rs(e, t, r, s) {
1874
- const u = Object.create(ne.prototype);
1875
- let c, d, m;
1876
- t.start !== void 0 ? c = n$1(() => t.start(u), "startAlgorithm") : c = n$1(() => {}, "startAlgorithm"), t.pull !== void 0 ? d = n$1(() => t.pull(u), "pullAlgorithm") : d = n$1(() => T(void 0), "pullAlgorithm"), t.cancel !== void 0 ? m = n$1((R) => t.cancel(R), "cancelAlgorithm") : m = n$1(() => T(void 0), "cancelAlgorithm"), Qo(e, u, c, d, m, r, s);
1877
- }
1878
- n$1(rs, "SetUpReadableStreamDefaultControllerFromUnderlyingSource");
1879
- function ar(e) {
1880
- return /* @__PURE__ */ new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`);
1881
- }
1882
- n$1(ar, "defaultControllerBrandCheckException$1");
1883
- function ns(e, t) {
1884
- return Ie(e._readableStreamController) ? is(e) : os(e);
1885
- }
1886
- n$1(ns, "ReadableStreamTee");
1887
- function os(e, t) {
1888
- const r = Qe(e);
1889
- let s = !1, u = !1, c = !1, d = !1, m, R, y, C, P;
1890
- const B = A((x) => {
1891
- P = x;
1892
- });
1893
- function ae() {
1894
- return s ? (u = !0, T(void 0)) : (s = !0, _t(r, {
1895
- _chunkSteps: n$1((N) => {
1896
- ge(() => {
1897
- u = !1;
1898
- const J = N, Ce = N;
1899
- c || Ke(y._readableStreamController, J), d || Ke(C._readableStreamController, Ce), s = !1, u && ae();
1900
- });
1901
- }, "_chunkSteps"),
1902
- _closeSteps: n$1(() => {
1903
- s = !1, c || De(y._readableStreamController), d || De(C._readableStreamController), (!c || !d) && P(void 0);
1904
- }, "_closeSteps"),
1905
- _errorSteps: n$1(() => {
1906
- s = !1;
1907
- }, "_errorSteps")
1908
- }), T(void 0));
1909
- }
1910
- n$1(ae, "pullAlgorithm");
1911
- function nt(x) {
1912
- if (c = !0, m = x, d) {
1913
- const J = ie(e, St([m, R]));
1914
- P(J);
1915
- }
1916
- return B;
1917
- }
1918
- n$1(nt, "cancel1Algorithm");
1919
- function Oe(x) {
1920
- if (d = !0, R = x, c) {
1921
- const J = ie(e, St([m, R]));
1922
- P(J);
1923
- }
1924
- return B;
1925
- }
1926
- n$1(Oe, "cancel2Algorithm");
1927
- function Te() {}
1928
- return n$1(Te, "startAlgorithm"), y = Et(Te, ae, nt), C = Et(Te, ae, Oe), I(r._closedPromise, (x) => (oe(y._readableStreamController, x), oe(C._readableStreamController, x), (!c || !d) && P(void 0), null)), [y, C];
1929
- }
1930
- n$1(os, "ReadableStreamDefaultTee");
1931
- function is(e) {
1932
- let t = Qe(e), r = !1, s = !1, u = !1, c = !1, d = !1, m, R, y, C, P;
1933
- const B = A((_) => {
1934
- P = _;
1935
- });
1936
- function ae(_) {
1937
- I(_._closedPromise, (E) => (_ !== t || (K(y._readableStreamController, E), K(C._readableStreamController, E), (!c || !d) && P(void 0)), null));
1938
- }
1939
- n$1(ae, "forwardReaderError");
1940
- function nt() {
1941
- je(t) && (_e(t), t = Qe(e), ae(t)), _t(t, {
1942
- _chunkSteps: n$1((E) => {
1943
- ge(() => {
1944
- s = !1, u = !1;
1945
- const k = E;
1946
- let Y = E;
1947
- if (!c && !d) try {
1948
- Y = fo(E);
1949
- } catch (ot) {
1950
- K(y._readableStreamController, ot), K(C._readableStreamController, ot), P(ie(e, ot));
1951
- return;
1952
- }
1953
- c || Ht(y._readableStreamController, k), d || Ht(C._readableStreamController, Y), r = !1, s ? Te() : u && x();
1954
- });
1955
- }, "_chunkSteps"),
1956
- _closeSteps: n$1(() => {
1957
- r = !1, c || wt(y._readableStreamController), d || wt(C._readableStreamController), y._readableStreamController._pendingPullIntos.length > 0 && Vt(y._readableStreamController, 0), C._readableStreamController._pendingPullIntos.length > 0 && Vt(C._readableStreamController, 0), (!c || !d) && P(void 0);
1958
- }, "_closeSteps"),
1959
- _errorSteps: n$1(() => {
1960
- r = !1;
1961
- }, "_errorSteps")
1962
- });
1963
- }
1964
- n$1(nt, "pullWithDefaultReader");
1965
- function Oe(_, E) {
1966
- Ee(t) && (_e(t), t = Co(e), ae(t));
1967
- const k = E ? C : y, Y = E ? y : C;
1968
- Eo(t, _, 1, {
1969
- _chunkSteps: n$1((it) => {
1970
- ge(() => {
1971
- s = !1, u = !1;
1972
- const at = E ? d : c;
1973
- if (E ? c : d) at || Qt(k._readableStreamController, it);
1974
- else {
1975
- let ui;
1976
- try {
1977
- ui = fo(it);
1978
- } catch (kn) {
1979
- K(k._readableStreamController, kn), K(Y._readableStreamController, kn), P(ie(e, kn));
1980
- return;
1981
- }
1982
- at || Qt(k._readableStreamController, it), Ht(Y._readableStreamController, ui);
1983
- }
1984
- r = !1, s ? Te() : u && x();
1985
- });
1986
- }, "_chunkSteps"),
1987
- _closeSteps: n$1((it) => {
1988
- r = !1;
1989
- const at = E ? d : c, cr = E ? c : d;
1990
- at || wt(k._readableStreamController), cr || wt(Y._readableStreamController), it !== void 0 && (at || Qt(k._readableStreamController, it), !cr && Y._readableStreamController._pendingPullIntos.length > 0 && Vt(Y._readableStreamController, 0)), (!at || !cr) && P(void 0);
1991
- }, "_closeSteps"),
1992
- _errorSteps: n$1(() => {
1993
- r = !1;
1994
- }, "_errorSteps")
1995
- });
1996
- }
1997
- n$1(Oe, "pullWithBYOBReader");
1998
- function Te() {
1999
- if (r) return s = !0, T(void 0);
2000
- r = !0;
2001
- const _ = Gr(y._readableStreamController);
2002
- return _ === null ? nt() : Oe(_._view, !1), T(void 0);
2003
- }
2004
- n$1(Te, "pull1Algorithm");
2005
- function x() {
2006
- if (r) return u = !0, T(void 0);
2007
- r = !0;
2008
- const _ = Gr(C._readableStreamController);
2009
- return _ === null ? nt() : Oe(_._view, !0), T(void 0);
2010
- }
2011
- n$1(x, "pull2Algorithm");
2012
- function N(_) {
2013
- if (c = !0, m = _, d) {
2014
- const k = ie(e, St([m, R]));
2015
- P(k);
2016
- }
2017
- return B;
2018
- }
2019
- n$1(N, "cancel1Algorithm");
2020
- function J(_) {
2021
- if (d = !0, R = _, c) {
2022
- const k = ie(e, St([m, R]));
2023
- P(k);
2024
- }
2025
- return B;
2026
- }
2027
- n$1(J, "cancel2Algorithm");
2028
- function Ce() {}
2029
- return n$1(Ce, "startAlgorithm"), y = Go(Ce, Te, N), C = Go(Ce, x, J), ae(t), [y, C];
2030
- }
2031
- n$1(is, "ReadableByteStreamTee");
2032
- function as(e) {
2033
- return l(e) && typeof e.getReader < "u";
2034
- }
2035
- n$1(as, "isReadableStreamLike");
2036
- function ss(e) {
2037
- return as(e) ? us(e.getReader()) : ls(e);
2038
- }
2039
- n$1(ss, "ReadableStreamFrom");
2040
- function ls(e) {
2041
- let t;
2042
- const r = uo(e, "async"), s = f$1;
2043
- function u() {
2044
- let d;
2045
- try {
2046
- d = Xi(r);
2047
- } catch (R) {
2048
- return b(R);
2049
- }
2050
- return F(T(d), (R) => {
2051
- if (!l(R)) throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");
2052
- if (ea(R)) De(t._readableStreamController);
2053
- else {
2054
- const C = ta(R);
2055
- Ke(t._readableStreamController, C);
2056
- }
2057
- });
2058
- }
2059
- n$1(u, "pullAlgorithm");
2060
- function c(d) {
2061
- const m = r.iterator;
2062
- let R;
2063
- try {
2064
- R = Ut(m, "return");
2065
- } catch (P) {
2066
- return b(P);
2067
- }
2068
- if (R === void 0) return T(void 0);
2069
- let y;
2070
- try {
2071
- y = z(R, m, [d]);
2072
- } catch (P) {
2073
- return b(P);
2074
- }
2075
- return F(T(y), (P) => {
2076
- if (!l(P)) throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");
2077
- });
2078
- }
2079
- return n$1(c, "cancelAlgorithm"), t = Et(s, u, c, 0), t;
2080
- }
2081
- n$1(ls, "ReadableStreamFromIterable");
2082
- function us(e) {
2083
- let t;
2084
- const r = f$1;
2085
- function s() {
2086
- let c;
2087
- try {
2088
- c = e.read();
2089
- } catch (d) {
2090
- return b(d);
2091
- }
2092
- return F(c, (d) => {
2093
- if (!l(d)) throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");
2094
- if (d.done) De(t._readableStreamController);
2095
- else {
2096
- const m = d.value;
2097
- Ke(t._readableStreamController, m);
2098
- }
2099
- });
2100
- }
2101
- n$1(s, "pullAlgorithm");
2102
- function u(c) {
2103
- try {
2104
- return T(e.cancel(c));
2105
- } catch (d) {
2106
- return b(d);
2107
- }
2108
- }
2109
- return n$1(u, "cancelAlgorithm"), t = Et(r, s, u, 0), t;
2110
- }
2111
- n$1(us, "ReadableStreamFromDefaultReader");
2112
- function fs(e, t) {
2113
- ue(e, t);
2114
- const r = e, s = r?.autoAllocateChunkSize, u = r?.cancel, c = r?.pull, d = r?.start, m = r?.type;
2115
- return {
2116
- autoAllocateChunkSize: s === void 0 ? void 0 : Fr(s, `${t} has member 'autoAllocateChunkSize' that`),
2117
- cancel: u === void 0 ? void 0 : cs(u, r, `${t} has member 'cancel' that`),
2118
- pull: c === void 0 ? void 0 : ds(c, r, `${t} has member 'pull' that`),
2119
- start: d === void 0 ? void 0 : hs(d, r, `${t} has member 'start' that`),
2120
- type: m === void 0 ? void 0 : ps(m, `${t} has member 'type' that`)
2121
- };
2122
- }
2123
- n$1(fs, "convertUnderlyingDefaultOrByteSource");
2124
- function cs(e, t, r) {
2125
- return Z(e, r), (s) => j(e, t, [s]);
2126
- }
2127
- n$1(cs, "convertUnderlyingSourceCancelCallback");
2128
- function ds(e, t, r) {
2129
- return Z(e, r), (s) => j(e, t, [s]);
2130
- }
2131
- n$1(ds, "convertUnderlyingSourcePullCallback");
2132
- function hs(e, t, r) {
2133
- return Z(e, r), (s) => z(e, t, [s]);
2134
- }
2135
- n$1(hs, "convertUnderlyingSourceStartCallback");
2136
- function ps(e, t) {
2137
- if (e = `${e}`, e !== "bytes") throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);
2138
- return e;
2139
- }
2140
- n$1(ps, "convertReadableStreamType");
2141
- function bs(e, t) {
2142
- return ue(e, t), { preventCancel: !!e?.preventCancel };
2143
- }
2144
- n$1(bs, "convertIteratorOptions");
2145
- function Yo(e, t) {
2146
- ue(e, t);
2147
- const r = e?.preventAbort, s = e?.preventCancel, u = e?.preventClose, c = e?.signal;
2148
- return c !== void 0 && ms(c, `${t} has member 'signal' that`), {
2149
- preventAbort: !!r,
2150
- preventCancel: !!s,
2151
- preventClose: !!u,
2152
- signal: c
2153
- };
2154
- }
2155
- n$1(Yo, "convertPipeOptions");
2156
- function ms(e, t) {
2157
- if (!Ca(e)) throw new TypeError(`${t} is not an AbortSignal.`);
2158
- }
2159
- n$1(ms, "assertAbortSignal");
2160
- function ys(e, t) {
2161
- ue(e, t);
2162
- const r = e?.readable;
2163
- zr(r, "readable", "ReadableWritablePair"), jr(r, `${t} has member 'readable' that`);
2164
- const s = e?.writable;
2165
- return zr(s, "writable", "ReadableWritablePair"), Bo(s, `${t} has member 'writable' that`), {
2166
- readable: r,
2167
- writable: s
2168
- };
2169
- }
2170
- n$1(ys, "convertReadableWritablePair");
2171
- const Pn = class Pn$1 {
2172
- constructor(t = {}, r = {}) {
2173
- t === void 0 ? t = null : Jn(t, "First parameter");
2174
- const s = Zt(r, "Second parameter"), u = fs(t, "First parameter");
2175
- if (cn(this), u.type === "bytes") {
2176
- if (s.size !== void 0) throw new RangeError("The strategy for a byte stream cannot have a size function");
2177
- const c = Tt(s, 0);
2178
- ca(this, u, c);
2179
- } else {
2180
- const c = Gt(s), d = Tt(s, 1);
2181
- rs(this, u, d, c);
2182
- }
2183
- }
2184
- get locked() {
2185
- if (!We(this)) throw Me("locked");
2186
- return qe(this);
2187
- }
2188
- cancel(t = void 0) {
2189
- return We(this) ? qe(this) ? b(/* @__PURE__ */ new TypeError("Cannot cancel a stream that already has a reader")) : ie(this, t) : b(Me("cancel"));
2190
- }
2191
- getReader(t = void 0) {
2192
- if (!We(this)) throw Me("getReader");
2193
- return ha(t, "First parameter").mode === void 0 ? Qe(this) : Co(this);
2194
- }
2195
- pipeThrough(t, r = {}) {
2196
- if (!We(this)) throw Me("pipeThrough");
2197
- Se(t, 1, "pipeThrough");
2198
- const s = ys(t, "First parameter"), u = Yo(r, "Second parameter");
2199
- if (qe(this)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
2200
- if (Ze(s.writable)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");
2201
- return Q(Ho(this, s.writable, u.preventClose, u.preventAbort, u.preventCancel, u.signal)), s.readable;
2202
- }
2203
- pipeTo(t, r = {}) {
2204
- if (!We(this)) return b(Me("pipeTo"));
2205
- if (t === void 0) return b("Parameter 1 is required in 'pipeTo'.");
2206
- if (!Ge(t)) return b(/* @__PURE__ */ new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
2207
- let s;
2208
- try {
2209
- s = Yo(r, "Second parameter");
2210
- } catch (u) {
2211
- return b(u);
2212
- }
2213
- return qe(this) ? b(/* @__PURE__ */ new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : Ze(t) ? b(/* @__PURE__ */ new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : Ho(this, t, s.preventClose, s.preventAbort, s.preventCancel, s.signal);
2214
- }
2215
- tee() {
2216
- if (!We(this)) throw Me("tee");
2217
- return St(ns(this));
2218
- }
2219
- values(t = void 0) {
2220
- if (!We(this)) throw Me("values");
2221
- const r = bs(t, "First parameter");
2222
- return Ki(this, r.preventCancel);
2223
- }
2224
- [Ur](t) {
2225
- return this.values(t);
2226
- }
2227
- static from(t) {
2228
- return ss(t);
2229
- }
2230
- };
2231
- n$1(Pn, "ReadableStream");
2232
- let L = Pn;
2233
- Object.defineProperties(L, { from: { enumerable: !0 } }), Object.defineProperties(L.prototype, {
2234
- cancel: { enumerable: !0 },
2235
- getReader: { enumerable: !0 },
2236
- pipeThrough: { enumerable: !0 },
2237
- pipeTo: { enumerable: !0 },
2238
- tee: { enumerable: !0 },
2239
- values: { enumerable: !0 },
2240
- locked: { enumerable: !0 }
2241
- }), h(L.from, "from"), h(L.prototype.cancel, "cancel"), h(L.prototype.getReader, "getReader"), h(L.prototype.pipeThrough, "pipeThrough"), h(L.prototype.pipeTo, "pipeTo"), h(L.prototype.tee, "tee"), h(L.prototype.values, "values"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(L.prototype, Symbol.toStringTag, {
2242
- value: "ReadableStream",
2243
- configurable: !0
2244
- }), Object.defineProperty(L.prototype, Ur, {
2245
- value: L.prototype.values,
2246
- writable: !0,
2247
- configurable: !0
2248
- });
2249
- function Et(e, t, r, s = 1, u = () => 1) {
2250
- const c = Object.create(L.prototype);
2251
- cn(c);
2252
- return Qo(c, Object.create(ne.prototype), e, t, r, s, u), c;
2253
- }
2254
- n$1(Et, "CreateReadableStream");
2255
- function Go(e, t, r) {
2256
- const s = Object.create(L.prototype);
2257
- cn(s);
2258
- return To(s, Object.create(te.prototype), e, t, r, 0, void 0), s;
2259
- }
2260
- n$1(Go, "CreateReadableByteStream");
2261
- function cn(e) {
2262
- e._state = "readable", e._reader = void 0, e._storedError = void 0, e._disturbed = !1;
2263
- }
2264
- n$1(cn, "InitializeReadableStream");
2265
- function We(e) {
2266
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_readableStreamController") ? !1 : e instanceof L;
2267
- }
2268
- n$1(We, "IsReadableStream");
2269
- function qe(e) {
2270
- return e._reader !== void 0;
2271
- }
2272
- n$1(qe, "IsReadableStreamLocked");
2273
- function ie(e, t) {
2274
- if (e._disturbed = !0, e._state === "closed") return T(void 0);
2275
- if (e._state === "errored") return b(e._storedError);
2276
- At(e);
2277
- const r = e._reader;
2278
- if (r !== void 0 && je(r)) {
2279
- const u = r._readIntoRequests;
2280
- r._readIntoRequests = new D(), u.forEach((c) => {
2281
- c._closeSteps(void 0);
2282
- });
2283
- }
2284
- return F(e._readableStreamController[Ar](t), f$1);
2285
- }
2286
- n$1(ie, "ReadableStreamCancel");
2287
- function At(e) {
2288
- e._state = "closed";
2289
- const t = e._reader;
2290
- if (t !== void 0 && (Zn(t), Ee(t))) {
2291
- const r = t._readRequests;
2292
- t._readRequests = new D(), r.forEach((s) => {
2293
- s._closeSteps();
2294
- });
2295
- }
2296
- }
2297
- n$1(At, "ReadableStreamClose");
2298
- function Zo(e, t) {
2299
- e._state = "errored", e._storedError = t;
2300
- const r = e._reader;
2301
- r !== void 0 && (Or(r, t), Ee(r) ? ro(r, t) : Ao(r, t));
2302
- }
2303
- n$1(Zo, "ReadableStreamError");
2304
- function Me(e) {
2305
- return /* @__PURE__ */ new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`);
2306
- }
2307
- n$1(Me, "streamBrandCheckException$1");
2308
- function Ko(e, t) {
2309
- ue(e, t);
2310
- const r = e?.highWaterMark;
2311
- return zr(r, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: Ir(r) };
2312
- }
2313
- n$1(Ko, "convertQueuingStrategyInit");
2314
- const Jo = n$1((e) => e.byteLength, "byteLengthSizeFunction");
2315
- h(Jo, "size");
2316
- const vn = class vn$1 {
2317
- constructor(t) {
2318
- Se(t, 1, "ByteLengthQueuingStrategy"), t = Ko(t, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = t.highWaterMark;
2319
- }
2320
- get highWaterMark() {
2321
- if (!ei(this)) throw Xo("highWaterMark");
2322
- return this._byteLengthQueuingStrategyHighWaterMark;
2323
- }
2324
- get size() {
2325
- if (!ei(this)) throw Xo("size");
2326
- return Jo;
2327
- }
2328
- };
2329
- n$1(vn, "ByteLengthQueuingStrategy");
2330
- let Xe = vn;
2331
- Object.defineProperties(Xe.prototype, {
2332
- highWaterMark: { enumerable: !0 },
2333
- size: { enumerable: !0 }
2334
- }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Xe.prototype, Symbol.toStringTag, {
2335
- value: "ByteLengthQueuingStrategy",
2336
- configurable: !0
2337
- });
2338
- function Xo(e) {
2339
- return /* @__PURE__ */ new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`);
2340
- }
2341
- n$1(Xo, "byteLengthBrandCheckException");
2342
- function ei(e) {
2343
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_byteLengthQueuingStrategyHighWaterMark") ? !1 : e instanceof Xe;
2344
- }
2345
- n$1(ei, "IsByteLengthQueuingStrategy");
2346
- const ti = n$1(() => 1, "countSizeFunction");
2347
- h(ti, "size");
2348
- const En = class En$1 {
2349
- constructor(t) {
2350
- Se(t, 1, "CountQueuingStrategy"), t = Ko(t, "First parameter"), this._countQueuingStrategyHighWaterMark = t.highWaterMark;
2351
- }
2352
- get highWaterMark() {
2353
- if (!ni(this)) throw ri("highWaterMark");
2354
- return this._countQueuingStrategyHighWaterMark;
2355
- }
2356
- get size() {
2357
- if (!ni(this)) throw ri("size");
2358
- return ti;
2359
- }
2360
- };
2361
- n$1(En, "CountQueuingStrategy");
2362
- let et = En;
2363
- Object.defineProperties(et.prototype, {
2364
- highWaterMark: { enumerable: !0 },
2365
- size: { enumerable: !0 }
2366
- }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(et.prototype, Symbol.toStringTag, {
2367
- value: "CountQueuingStrategy",
2368
- configurable: !0
2369
- });
2370
- function ri(e) {
2371
- return /* @__PURE__ */ new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`);
2372
- }
2373
- n$1(ri, "countBrandCheckException");
2374
- function ni(e) {
2375
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_countQueuingStrategyHighWaterMark") ? !1 : e instanceof et;
2376
- }
2377
- n$1(ni, "IsCountQueuingStrategy");
2378
- function gs(e, t) {
2379
- ue(e, t);
2380
- const r = e?.cancel, s = e?.flush, u = e?.readableType, c = e?.start, d = e?.transform, m = e?.writableType;
2381
- return {
2382
- cancel: r === void 0 ? void 0 : Rs(r, e, `${t} has member 'cancel' that`),
2383
- flush: s === void 0 ? void 0 : _s(s, e, `${t} has member 'flush' that`),
2384
- readableType: u,
2385
- start: c === void 0 ? void 0 : Ss(c, e, `${t} has member 'start' that`),
2386
- transform: d === void 0 ? void 0 : ws(d, e, `${t} has member 'transform' that`),
2387
- writableType: m
2388
- };
2389
- }
2390
- n$1(gs, "convertTransformer");
2391
- function _s(e, t, r) {
2392
- return Z(e, r), (s) => j(e, t, [s]);
2393
- }
2394
- n$1(_s, "convertTransformerFlushCallback");
2395
- function Ss(e, t, r) {
2396
- return Z(e, r), (s) => z(e, t, [s]);
2397
- }
2398
- n$1(Ss, "convertTransformerStartCallback");
2399
- function ws(e, t, r) {
2400
- return Z(e, r), (s, u) => j(e, t, [s, u]);
2401
- }
2402
- n$1(ws, "convertTransformerTransformCallback");
2403
- function Rs(e, t, r) {
2404
- return Z(e, r), (s) => j(e, t, [s]);
2405
- }
2406
- n$1(Rs, "convertTransformerCancelCallback");
2407
- const An = class An$1 {
2408
- constructor(t = {}, r = {}, s = {}) {
2409
- t === void 0 && (t = null);
2410
- const u = Zt(r, "Second parameter"), c = Zt(s, "Third parameter"), d = gs(t, "First parameter");
2411
- if (d.readableType !== void 0) throw new RangeError("Invalid readableType specified");
2412
- if (d.writableType !== void 0) throw new RangeError("Invalid writableType specified");
2413
- const m = Tt(c, 0), R = Gt(c), y = Tt(u, 1), C = Gt(u);
2414
- let P;
2415
- const B = A((ae) => {
2416
- P = ae;
2417
- });
2418
- Ts(this, B, y, C, m, R), Ps(this, d), d.start !== void 0 ? P(d.start(this._transformStreamController)) : P(void 0);
2419
- }
2420
- get readable() {
2421
- if (!oi(this)) throw li("readable");
2422
- return this._readable;
2423
- }
2424
- get writable() {
2425
- if (!oi(this)) throw li("writable");
2426
- return this._writable;
2427
- }
2428
- };
2429
- n$1(An, "TransformStream");
2430
- let tt = An;
2431
- Object.defineProperties(tt.prototype, {
2432
- readable: { enumerable: !0 },
2433
- writable: { enumerable: !0 }
2434
- }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(tt.prototype, Symbol.toStringTag, {
2435
- value: "TransformStream",
2436
- configurable: !0
2437
- });
2438
- function Ts(e, t, r, s, u, c) {
2439
- function d() {
2440
- return t;
2441
- }
2442
- n$1(d, "startAlgorithm");
2443
- function m(B) {
2444
- return As(e, B);
2445
- }
2446
- n$1(m, "writeAlgorithm");
2447
- function R(B) {
2448
- return Bs(e, B);
2449
- }
2450
- n$1(R, "abortAlgorithm");
2451
- function y() {
2452
- return ks(e);
2453
- }
2454
- n$1(y, "closeAlgorithm"), e._writable = Ea(d, m, y, R, r, s);
2455
- function C() {
2456
- return Ws(e);
2457
- }
2458
- n$1(C, "pullAlgorithm");
2459
- function P(B) {
2460
- return qs(e, B);
2461
- }
2462
- n$1(P, "cancelAlgorithm"), e._readable = Et(d, C, P, u, c), e._backpressure = void 0, e._backpressureChangePromise = void 0, e._backpressureChangePromise_resolve = void 0, sr(e, !0), e._transformStreamController = void 0;
2463
- }
2464
- n$1(Ts, "InitializeTransformStream");
2465
- function oi(e) {
2466
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_transformStreamController") ? !1 : e instanceof tt;
2467
- }
2468
- n$1(oi, "IsTransformStream");
2469
- function ii(e, t) {
2470
- oe(e._readable._readableStreamController, t), dn(e, t);
2471
- }
2472
- n$1(ii, "TransformStreamError");
2473
- function dn(e, t) {
2474
- ur(e._transformStreamController), Ct(e._writable._writableStreamController, t), hn(e);
2475
- }
2476
- n$1(dn, "TransformStreamErrorWritableAndUnblockWrite");
2477
- function hn(e) {
2478
- e._backpressure && sr(e, !1);
2479
- }
2480
- n$1(hn, "TransformStreamUnblockWrite");
2481
- function sr(e, t) {
2482
- e._backpressureChangePromise !== void 0 && e._backpressureChangePromise_resolve(), e._backpressureChangePromise = A((r) => {
2483
- e._backpressureChangePromise_resolve = r;
2484
- }), e._backpressure = t;
2485
- }
2486
- n$1(sr, "TransformStreamSetBackpressure");
2487
- const Bn = class Bn$1 {
2488
- constructor() {
2489
- throw new TypeError("Illegal constructor");
2490
- }
2491
- get desiredSize() {
2492
- if (!lr(this)) throw fr("desiredSize");
2493
- const t = this._controlledTransformStream._readable._readableStreamController;
2494
- return fn(t);
2495
- }
2496
- enqueue(t = void 0) {
2497
- if (!lr(this)) throw fr("enqueue");
2498
- ai(this, t);
2499
- }
2500
- error(t = void 0) {
2501
- if (!lr(this)) throw fr("error");
2502
- vs(this, t);
2503
- }
2504
- terminate() {
2505
- if (!lr(this)) throw fr("terminate");
2506
- Es(this);
2507
- }
2508
- };
2509
- n$1(Bn, "TransformStreamDefaultController");
2510
- let pe = Bn;
2511
- Object.defineProperties(pe.prototype, {
2512
- enqueue: { enumerable: !0 },
2513
- error: { enumerable: !0 },
2514
- terminate: { enumerable: !0 },
2515
- desiredSize: { enumerable: !0 }
2516
- }), h(pe.prototype.enqueue, "enqueue"), h(pe.prototype.error, "error"), h(pe.prototype.terminate, "terminate"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(pe.prototype, Symbol.toStringTag, {
2517
- value: "TransformStreamDefaultController",
2518
- configurable: !0
2519
- });
2520
- function lr(e) {
2521
- return !l(e) || !Object.prototype.hasOwnProperty.call(e, "_controlledTransformStream") ? !1 : e instanceof pe;
2522
- }
2523
- n$1(lr, "IsTransformStreamDefaultController");
2524
- function Cs(e, t, r, s, u) {
2525
- t._controlledTransformStream = e, e._transformStreamController = t, t._transformAlgorithm = r, t._flushAlgorithm = s, t._cancelAlgorithm = u, t._finishPromise = void 0, t._finishPromise_resolve = void 0, t._finishPromise_reject = void 0;
2526
- }
2527
- n$1(Cs, "SetUpTransformStreamDefaultController");
2528
- function Ps(e, t) {
2529
- const r = Object.create(pe.prototype);
2530
- let s, u, c;
2531
- t.transform !== void 0 ? s = n$1((d) => t.transform(d, r), "transformAlgorithm") : s = n$1((d) => {
2532
- try {
2533
- return ai(r, d), T(void 0);
2534
- } catch (m) {
2535
- return b(m);
2536
- }
2537
- }, "transformAlgorithm"), t.flush !== void 0 ? u = n$1(() => t.flush(r), "flushAlgorithm") : u = n$1(() => T(void 0), "flushAlgorithm"), t.cancel !== void 0 ? c = n$1((d) => t.cancel(d), "cancelAlgorithm") : c = n$1(() => T(void 0), "cancelAlgorithm"), Cs(e, r, s, u, c);
2538
- }
2539
- n$1(Ps, "SetUpTransformStreamDefaultControllerFromTransformer");
2540
- function ur(e) {
2541
- e._transformAlgorithm = void 0, e._flushAlgorithm = void 0, e._cancelAlgorithm = void 0;
2542
- }
2543
- n$1(ur, "TransformStreamDefaultControllerClearAlgorithms");
2544
- function ai(e, t) {
2545
- const r = e._controlledTransformStream, s = r._readable._readableStreamController;
2546
- if (!Je(s)) throw new TypeError("Readable side is not in a state that permits enqueue");
2547
- try {
2548
- Ke(s, t);
2549
- } catch (c) {
2550
- throw dn(r, c), r._readable._storedError;
2551
- }
2552
- ts(s) !== r._backpressure && sr(r, !0);
2553
- }
2554
- n$1(ai, "TransformStreamDefaultControllerEnqueue");
2555
- function vs(e, t) {
2556
- ii(e._controlledTransformStream, t);
2557
- }
2558
- n$1(vs, "TransformStreamDefaultControllerError");
2559
- function si(e, t) {
2560
- return F(e._transformAlgorithm(t), void 0, (s) => {
2561
- throw ii(e._controlledTransformStream, s), s;
2562
- });
2563
- }
2564
- n$1(si, "TransformStreamDefaultControllerPerformTransform");
2565
- function Es(e) {
2566
- const t = e._controlledTransformStream, r = t._readable._readableStreamController;
2567
- De(r);
2568
- dn(t, /* @__PURE__ */ new TypeError("TransformStream terminated"));
2569
- }
2570
- n$1(Es, "TransformStreamDefaultControllerTerminate");
2571
- function As(e, t) {
2572
- const r = e._transformStreamController;
2573
- if (e._backpressure) {
2574
- const s = e._backpressureChangePromise;
2575
- return F(s, () => {
2576
- const u = e._writable;
2577
- if (u._state === "erroring") throw u._storedError;
2578
- return si(r, t);
2579
- });
2580
- }
2581
- return si(r, t);
2582
- }
2583
- n$1(As, "TransformStreamDefaultSinkWriteAlgorithm");
2584
- function Bs(e, t) {
2585
- const r = e._transformStreamController;
2586
- if (r._finishPromise !== void 0) return r._finishPromise;
2587
- const s = e._readable;
2588
- r._finishPromise = A((c, d) => {
2589
- r._finishPromise_resolve = c, r._finishPromise_reject = d;
2590
- });
2591
- const u = r._cancelAlgorithm(t);
2592
- return ur(r), g(u, () => (s._state === "errored" ? rt(r, s._storedError) : (oe(s._readableStreamController, t), pn(r)), null), (c) => (oe(s._readableStreamController, c), rt(r, c), null)), r._finishPromise;
2593
- }
2594
- n$1(Bs, "TransformStreamDefaultSinkAbortAlgorithm");
2595
- function ks(e) {
2596
- const t = e._transformStreamController;
2597
- if (t._finishPromise !== void 0) return t._finishPromise;
2598
- const r = e._readable;
2599
- t._finishPromise = A((u, c) => {
2600
- t._finishPromise_resolve = u, t._finishPromise_reject = c;
2601
- });
2602
- const s = t._flushAlgorithm();
2603
- return ur(t), g(s, () => (r._state === "errored" ? rt(t, r._storedError) : (De(r._readableStreamController), pn(t)), null), (u) => (oe(r._readableStreamController, u), rt(t, u), null)), t._finishPromise;
2604
- }
2605
- n$1(ks, "TransformStreamDefaultSinkCloseAlgorithm");
2606
- function Ws(e) {
2607
- return sr(e, !1), e._backpressureChangePromise;
2608
- }
2609
- n$1(Ws, "TransformStreamDefaultSourcePullAlgorithm");
2610
- function qs(e, t) {
2611
- const r = e._transformStreamController;
2612
- if (r._finishPromise !== void 0) return r._finishPromise;
2613
- const s = e._writable;
2614
- r._finishPromise = A((c, d) => {
2615
- r._finishPromise_resolve = c, r._finishPromise_reject = d;
2616
- });
2617
- const u = r._cancelAlgorithm(t);
2618
- return ur(r), g(u, () => (s._state === "errored" ? rt(r, s._storedError) : (Ct(s._writableStreamController, t), hn(e), pn(r)), null), (c) => (Ct(s._writableStreamController, c), hn(e), rt(r, c), null)), r._finishPromise;
2619
- }
2620
- n$1(qs, "TransformStreamDefaultSourceCancelAlgorithm");
2621
- function fr(e) {
2622
- return /* @__PURE__ */ new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`);
2623
- }
2624
- n$1(fr, "defaultControllerBrandCheckException");
2625
- function pn(e) {
2626
- e._finishPromise_resolve !== void 0 && (e._finishPromise_resolve(), e._finishPromise_resolve = void 0, e._finishPromise_reject = void 0);
2627
- }
2628
- n$1(pn, "defaultControllerFinishPromiseResolve");
2629
- function rt(e, t) {
2630
- e._finishPromise_reject !== void 0 && (Q(e._finishPromise), e._finishPromise_reject(t), e._finishPromise_resolve = void 0, e._finishPromise_reject = void 0);
2631
- }
2632
- n$1(rt, "defaultControllerFinishPromiseReject");
2633
- function li(e) {
2634
- return /* @__PURE__ */ new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`);
2635
- }
2636
- n$1(li, "streamBrandCheckException"), a.ByteLengthQueuingStrategy = Xe, a.CountQueuingStrategy = et, a.ReadableByteStreamController = te, a.ReadableStream = L, a.ReadableStreamBYOBReader = ce, a.ReadableStreamBYOBRequest = Re, a.ReadableStreamDefaultController = ne, a.ReadableStreamDefaultReader = fe, a.TransformStream = tt, a.TransformStreamDefaultController = pe, a.WritableStream = de, a.WritableStreamDefaultController = ke, a.WritableStreamDefaultWriter = re;
2637
- });
2638
- }(kt, kt.exports)), kt.exports;
2639
- }
2640
- n$1(Ns, "requirePonyfill_es2018");
2641
- var mi;
2642
- function Hs() {
2643
- if (mi) return pi;
2644
- mi = 1;
2645
- const i = 65536;
2646
- if (!globalThis.ReadableStream) try {
2647
- const o = require("node:process"), { emitWarning: a } = o;
2648
- try {
2649
- o.emitWarning = () => {}, Object.assign(globalThis, require("node:stream/web")), o.emitWarning = a;
2650
- } catch (f$1) {
2651
- throw o.emitWarning = a, f$1;
2652
- }
2653
- } catch {
2654
- Object.assign(globalThis, Ns());
2655
- }
2656
- try {
2657
- const { Blob: o } = require("node:buffer");
2658
- o && !o.prototype.stream && (o.prototype.stream = n$1(function(f$1) {
2659
- let l = 0;
2660
- const p = this;
2661
- return new ReadableStream({
2662
- type: "bytes",
2663
- async pull(h) {
2664
- const v = await p.slice(l, Math.min(p.size, l + i)).arrayBuffer();
2665
- l += v.byteLength, h.enqueue(new Uint8Array(v)), l === p.size && h.close();
2666
- }
2667
- });
2668
- }, "name"));
2669
- } catch {}
2670
- return pi;
2671
- }
2672
- n$1(Hs, "requireStreams"), Hs();
2673
- /*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */ const yi = 65536;
2674
- async function* Wn(i, o = !0) {
2675
- for (const a of i) if ("stream" in a) yield* a.stream();
2676
- else if (ArrayBuffer.isView(a)) if (o) {
2677
- let f$1 = a.byteOffset;
2678
- const l = a.byteOffset + a.byteLength;
2679
- for (; f$1 !== l;) {
2680
- const p = Math.min(l - f$1, yi), h = a.buffer.slice(f$1, f$1 + p);
2681
- f$1 += h.byteLength, yield new Uint8Array(h);
2682
- }
2683
- } else yield a;
2684
- else {
2685
- let f$1 = 0, l = a;
2686
- for (; f$1 !== l.size;) {
2687
- const h = await l.slice(f$1, Math.min(l.size, f$1 + yi)).arrayBuffer();
2688
- f$1 += h.byteLength, yield new Uint8Array(h);
2689
- }
2690
- }
2691
- }
2692
- n$1(Wn, "toIterator");
2693
- const gi = (ze = class {
2694
- constructor(o = [], a = {}) {
2695
- be(this, ve, []);
2696
- be(this, zt, "");
2697
- be(this, bt, 0);
2698
- be(this, Cr, "transparent");
2699
- if (typeof o != "object" || o === null) throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
2700
- if (typeof o[Symbol.iterator] != "function") throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");
2701
- if (typeof a != "object" && typeof a != "function") throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");
2702
- a === null && (a = {});
2703
- const f$1 = new TextEncoder();
2704
- for (const p of o) {
2705
- let h;
2706
- ArrayBuffer.isView(p) ? h = new Uint8Array(p.buffer.slice(p.byteOffset, p.byteOffset + p.byteLength)) : p instanceof ArrayBuffer ? h = new Uint8Array(p.slice(0)) : p instanceof ze ? h = p : h = f$1.encode(`${p}`), X(this, bt, O(this, bt) + (ArrayBuffer.isView(h) ? h.byteLength : h.size)), O(this, ve).push(h);
2707
- }
2708
- X(this, Cr, `${a.endings === void 0 ? "transparent" : a.endings}`);
2709
- const l = a.type === void 0 ? "" : String(a.type);
2710
- X(this, zt, /^[\x20-\x7E]*$/.test(l) ? l : "");
2711
- }
2712
- get size() {
2713
- return O(this, bt);
2714
- }
2715
- get type() {
2716
- return O(this, zt);
2717
- }
2718
- async text() {
2719
- const o = new TextDecoder();
2720
- let a = "";
2721
- for await (const f$1 of Wn(O(this, ve), !1)) a += o.decode(f$1, { stream: !0 });
2722
- return a += o.decode(), a;
2723
- }
2724
- async arrayBuffer() {
2725
- const o = new Uint8Array(this.size);
2726
- let a = 0;
2727
- for await (const f$1 of Wn(O(this, ve), !1)) o.set(f$1, a), a += f$1.length;
2728
- return o.buffer;
2729
- }
2730
- stream() {
2731
- const o = Wn(O(this, ve), !0);
2732
- return new globalThis.ReadableStream({
2733
- type: "bytes",
2734
- async pull(a) {
2735
- const f$1 = await o.next();
2736
- f$1.done ? a.close() : a.enqueue(f$1.value);
2737
- },
2738
- async cancel() {
2739
- await o.return();
2740
- }
2741
- });
2742
- }
2743
- slice(o = 0, a = this.size, f$1 = "") {
2744
- const { size: l } = this;
2745
- let p = o < 0 ? Math.max(l + o, 0) : Math.min(o, l), h = a < 0 ? Math.max(l + a, 0) : Math.min(a, l);
2746
- const S = Math.max(h - p, 0), v = O(this, ve), w = [];
2747
- let A = 0;
2748
- for (const b of v) {
2749
- if (A >= S) break;
2750
- const q = ArrayBuffer.isView(b) ? b.byteLength : b.size;
2751
- if (p && q <= p) p -= q, h -= q;
2752
- else {
2753
- let g;
2754
- ArrayBuffer.isView(b) ? (g = b.subarray(p, Math.min(q, h)), A += g.byteLength) : (g = b.slice(p, Math.min(q, h)), A += g.size), h -= q, w.push(g), p = 0;
2755
- }
2756
- }
2757
- const T = new ze([], { type: String(f$1).toLowerCase() });
2758
- return X(T, bt, S), X(T, ve, w), T;
2759
- }
2760
- get [Symbol.toStringTag]() {
2761
- return "Blob";
2762
- }
2763
- static [Symbol.hasInstance](o) {
2764
- return o && typeof o == "object" && typeof o.constructor == "function" && (typeof o.stream == "function" || typeof o.arrayBuffer == "function") && /^(Blob|File)$/.test(o[Symbol.toStringTag]);
2765
- }
2766
- }, ve = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), Cr = /* @__PURE__ */ new WeakMap(), n$1(ze, "Blob"), ze);
2767
- Object.defineProperties(gi.prototype, {
2768
- size: { enumerable: !0 },
2769
- type: { enumerable: !0 },
2770
- slice: { enumerable: !0 }
2771
- });
2772
- const ut = gi, qn = (mt = class extends ut {
2773
- constructor(a, f$1, l = {}) {
2774
- if (arguments.length < 2) throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
2775
- super(a, l);
2776
- be(this, It, 0);
2777
- be(this, Ft, "");
2778
- l === null && (l = {});
2779
- const p = l.lastModified === void 0 ? Date.now() : Number(l.lastModified);
2780
- Number.isNaN(p) || X(this, It, p), X(this, Ft, String(f$1));
2781
- }
2782
- get name() {
2783
- return O(this, Ft);
2784
- }
2785
- get lastModified() {
2786
- return O(this, It);
2787
- }
2788
- get [Symbol.toStringTag]() {
2789
- return "File";
2790
- }
2791
- static [Symbol.hasInstance](a) {
2792
- return !!a && a instanceof ut && /^(File)$/.test(a[Symbol.toStringTag]);
2793
- }
2794
- }, It = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), n$1(mt, "File"), mt);
2795
- /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */ var { toStringTag: Wt, iterator: Qs, hasInstance: Ys } = Symbol, _i = Math.random, Gs = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","), Si = n$1((i, o, a) => (i += "", /^(Blob|File)$/.test(o && o[Wt]) ? [(a = a !== void 0 ? a + "" : o[Wt] == "File" ? o.name : "blob", i), o.name !== a || o[Wt] == "blob" ? new qn([o], a, o) : o] : [i, o + ""]), "f"), On = n$1((i, o) => (o ? i : i.replace(/\r?\n|\r/g, `\r
2796
- `)).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "e$1"), Ue = n$1((i, o, a) => {
2797
- if (o.length < a) throw new TypeError(`Failed to execute '${i}' on 'FormData': ${a} arguments required, but only ${o.length} present.`);
2798
- }, "x");
2799
- const br = (yt = class {
2800
- constructor(...o) {
2801
- be(this, ee, []);
2802
- if (o.length) throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.");
2803
- }
2804
- get [Wt]() {
2805
- return "FormData";
2806
- }
2807
- [Qs]() {
2808
- return this.entries();
2809
- }
2810
- static [Ys](o) {
2811
- return o && typeof o == "object" && o[Wt] === "FormData" && !Gs.some((a) => typeof o[a] != "function");
2812
- }
2813
- append(...o) {
2814
- Ue("append", arguments, 2), O(this, ee).push(Si(...o));
2815
- }
2816
- delete(o) {
2817
- Ue("delete", arguments, 1), o += "", X(this, ee, O(this, ee).filter(([a]) => a !== o));
2818
- }
2819
- get(o) {
2820
- Ue("get", arguments, 1), o += "";
2821
- for (var a = O(this, ee), f$1 = a.length, l = 0; l < f$1; l++) if (a[l][0] === o) return a[l][1];
2822
- return null;
2823
- }
2824
- getAll(o, a) {
2825
- return Ue("getAll", arguments, 1), a = [], o += "", O(this, ee).forEach((f$1) => f$1[0] === o && a.push(f$1[1])), a;
2826
- }
2827
- has(o) {
2828
- return Ue("has", arguments, 1), o += "", O(this, ee).some((a) => a[0] === o);
2829
- }
2830
- forEach(o, a) {
2831
- Ue("forEach", arguments, 1);
2832
- for (var [f$1, l] of this) o.call(a, l, f$1, this);
2833
- }
2834
- set(...o) {
2835
- Ue("set", arguments, 2);
2836
- var a = [], f$1 = !0;
2837
- o = Si(...o), O(this, ee).forEach((l) => {
2838
- l[0] === o[0] ? f$1 && (f$1 = !a.push(o)) : a.push(l);
2839
- }), f$1 && a.push(o), X(this, ee, a);
2840
- }
2841
- *entries() {
2842
- yield* O(this, ee);
2843
- }
2844
- *keys() {
2845
- for (var [o] of this) yield o;
2846
- }
2847
- *values() {
2848
- for (var [, o] of this) yield o;
2849
- }
2850
- }, ee = /* @__PURE__ */ new WeakMap(), n$1(yt, "FormData"), yt);
2851
- function Zs(i, o = ut) {
2852
- var a = `${_i()}${_i()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), f$1 = [], l = `--${a}\r
2853
- Content-Disposition: form-data; name="`;
2854
- return i.forEach((p, h) => typeof p == "string" ? f$1.push(l + On(h) + `"\r
2855
- \r
2856
- ${p.replace(/\r(?!\n)|(?<!\r)\n/g, `\r
2857
- `)}\r
2858
- `) : f$1.push(l + On(h) + `"; filename="${On(p.name, 1)}"\r
2859
- Content-Type: ${p.type || "application/octet-stream"}\r
2860
- \r
2861
- `, p, `\r
2862
- `)), f$1.push(`--${a}--`), new o(f$1, { type: "multipart/form-data; boundary=" + a });
2863
- }
2864
- n$1(Zs, "formDataToBlob");
2865
- const Un = class Un$1 extends Error {
2866
- constructor(o, a) {
2867
- super(o), Error.captureStackTrace(this, this.constructor), this.type = a;
2868
- }
2869
- get name() {
2870
- return this.constructor.name;
2871
- }
2872
- get [Symbol.toStringTag]() {
2873
- return this.constructor.name;
2874
- }
2875
- };
2876
- n$1(Un, "FetchBaseError");
2877
- let ft = Un;
2878
- const xn = class xn$1 extends ft {
2879
- constructor(o, a, f$1) {
2880
- super(o, a), f$1 && (this.code = this.errno = f$1.code, this.erroredSysCall = f$1.syscall);
2881
- }
2882
- };
2883
- n$1(xn, "FetchError");
2884
- let G = xn;
2885
- const mr = Symbol.toStringTag, wi = n$1((i) => typeof i == "object" && typeof i.append == "function" && typeof i.delete == "function" && typeof i.get == "function" && typeof i.getAll == "function" && typeof i.has == "function" && typeof i.set == "function" && typeof i.sort == "function" && i[mr] === "URLSearchParams", "isURLSearchParameters"), yr = n$1((i) => i && typeof i == "object" && typeof i.arrayBuffer == "function" && typeof i.type == "string" && typeof i.stream == "function" && typeof i.constructor == "function" && /^(Blob|File)$/.test(i[mr]), "isBlob"), Ks = n$1((i) => typeof i == "object" && (i[mr] === "AbortSignal" || i[mr] === "EventTarget"), "isAbortSignal"), Js = n$1((i, o) => {
2886
- const a = new URL(o).hostname, f$1 = new URL(i).hostname;
2887
- return a === f$1 || a.endsWith(`.${f$1}`);
2888
- }, "isDomainOrSubdomain"), Xs = n$1((i, o) => {
2889
- return new URL(o).protocol === new URL(i).protocol;
2890
- }, "isSameProtocol"), el = (0, node_util.promisify)(node_stream.default.pipeline), H = Symbol("Body internals"), Nn = class Nn$1 {
2891
- constructor(o, { size: a = 0 } = {}) {
2892
- let f$1 = null;
2893
- o === null ? o = null : wi(o) ? o = node_buffer.Buffer.from(o.toString()) : yr(o) || node_buffer.Buffer.isBuffer(o) || (node_util.types.isAnyArrayBuffer(o) ? o = node_buffer.Buffer.from(o) : ArrayBuffer.isView(o) ? o = node_buffer.Buffer.from(o.buffer, o.byteOffset, o.byteLength) : o instanceof node_stream.default || (o instanceof br ? (o = Zs(o), f$1 = o.type.split("=")[1]) : o = node_buffer.Buffer.from(String(o))));
2894
- let l = o;
2895
- node_buffer.Buffer.isBuffer(o) ? l = node_stream.default.Readable.from(o) : yr(o) && (l = node_stream.default.Readable.from(o.stream())), this[H] = {
2896
- body: o,
2897
- stream: l,
2898
- boundary: f$1,
2899
- disturbed: !1,
2900
- error: null
2901
- }, this.size = a, o instanceof node_stream.default && o.on("error", (p) => {
2902
- const h = p instanceof ft ? p : new G(`Invalid response body while trying to fetch ${this.url}: ${p.message}`, "system", p);
2903
- this[H].error = h;
2904
- });
2905
- }
2906
- get body() {
2907
- return this[H].stream;
2908
- }
2909
- get bodyUsed() {
2910
- return this[H].disturbed;
2911
- }
2912
- async arrayBuffer() {
2913
- const { buffer: o, byteOffset: a, byteLength: f$1 } = await zn(this);
2914
- return o.slice(a, a + f$1);
2915
- }
2916
- async formData() {
2917
- const o = this.headers.get("content-type");
2918
- if (o.startsWith("application/x-www-form-urlencoded")) {
2919
- const f$1 = new br(), l = new URLSearchParams(await this.text());
2920
- for (const [p, h] of l) f$1.append(p, h);
2921
- return f$1;
2922
- }
2923
- const { toFormData: a } = await Promise.resolve().then(() => require("./chunks/multipart-parser.cjs"));
2924
- return a(this.body, o);
2925
- }
2926
- async blob() {
2927
- const o = this.headers && this.headers.get("content-type") || this[H].body && this[H].body.type || "";
2928
- return new ut([await this.arrayBuffer()], { type: o });
2929
- }
2930
- async json() {
2931
- const o = await this.text();
2932
- return JSON.parse(o);
2933
- }
2934
- async text() {
2935
- const o = await zn(this);
2936
- return new TextDecoder().decode(o);
2937
- }
2938
- buffer() {
2939
- return zn(this);
2940
- }
2941
- };
2942
- n$1(Nn, "Body");
2943
- let xe = Nn;
2944
- xe.prototype.buffer = (0, node_util.deprecate)(xe.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer"), Object.defineProperties(xe.prototype, {
2945
- body: { enumerable: !0 },
2946
- bodyUsed: { enumerable: !0 },
2947
- arrayBuffer: { enumerable: !0 },
2948
- blob: { enumerable: !0 },
2949
- json: { enumerable: !0 },
2950
- text: { enumerable: !0 },
2951
- data: { get: (0, node_util.deprecate)(() => {}, "data doesn't exist, use json(), text(), arrayBuffer(), or body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (response)") }
2952
- });
2953
- async function zn(i) {
2954
- if (i[H].disturbed) throw new TypeError(`body used already for: ${i.url}`);
2955
- if (i[H].disturbed = !0, i[H].error) throw i[H].error;
2956
- const { body: o } = i;
2957
- if (o === null) return node_buffer.Buffer.alloc(0);
2958
- if (!(o instanceof node_stream.default)) return node_buffer.Buffer.alloc(0);
2959
- const a = [];
2960
- let f$1 = 0;
2961
- try {
2962
- for await (const l of o) {
2963
- if (i.size > 0 && f$1 + l.length > i.size) {
2964
- const p = new G(`content size at ${i.url} over limit: ${i.size}`, "max-size");
2965
- throw o.destroy(p), p;
2966
- }
2967
- f$1 += l.length, a.push(l);
2968
- }
2969
- } catch (l) {
2970
- throw l instanceof ft ? l : new G(`Invalid response body while trying to fetch ${i.url}: ${l.message}`, "system", l);
2971
- }
2972
- if (o.readableEnded === !0 || o._readableState.ended === !0) try {
2973
- return a.every((l) => typeof l == "string") ? node_buffer.Buffer.from(a.join("")) : node_buffer.Buffer.concat(a, f$1);
2974
- } catch (l) {
2975
- throw new G(`Could not create Buffer from response body for ${i.url}: ${l.message}`, "system", l);
2976
- }
2977
- else throw new G(`Premature close of server response while trying to fetch ${i.url}`);
2978
- }
2979
- n$1(zn, "consumeBody");
2980
- const In = n$1((i, o) => {
2981
- let a, f$1, { body: l } = i[H];
2982
- if (i.bodyUsed) throw new Error("cannot clone body after it is used");
2983
- return l instanceof node_stream.default && typeof l.getBoundary != "function" && (a = new node_stream.PassThrough({ highWaterMark: o }), f$1 = new node_stream.PassThrough({ highWaterMark: o }), l.pipe(a), l.pipe(f$1), i[H].stream = a, l = f$1), l;
2984
- }, "clone"), tl = (0, node_util.deprecate)((i) => i.getBoundary(), "form-data doesn't follow the spec and requires special treatment. Use alternative package", "https://github.com/node-fetch/node-fetch/issues/1167"), Ri = n$1((i, o) => i === null ? null : typeof i == "string" ? "text/plain;charset=UTF-8" : wi(i) ? "application/x-www-form-urlencoded;charset=UTF-8" : yr(i) ? i.type || null : node_buffer.Buffer.isBuffer(i) || node_util.types.isAnyArrayBuffer(i) || ArrayBuffer.isView(i) ? null : i instanceof br ? `multipart/form-data; boundary=${o[H].boundary}` : i && typeof i.getBoundary == "function" ? `multipart/form-data;boundary=${tl(i)}` : i instanceof node_stream.default ? null : "text/plain;charset=UTF-8", "extractContentType"), rl = n$1((i) => {
2985
- const { body: o } = i[H];
2986
- return o === null ? 0 : yr(o) ? o.size : node_buffer.Buffer.isBuffer(o) ? o.length : o && typeof o.getLengthSync == "function" && o.hasKnownLength && o.hasKnownLength() ? o.getLengthSync() : null;
2987
- }, "getTotalBytes"), nl = n$1(async (i, { body: o }) => {
2988
- o === null ? i.end() : await el(o, i);
2989
- }, "writeToStream"), gr = typeof node_http.default.validateHeaderName == "function" ? node_http.default.validateHeaderName : (i) => {
2990
- if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(i)) {
2991
- const o = /* @__PURE__ */ new TypeError(`Header name must be a valid HTTP token [${i}]`);
2992
- throw Object.defineProperty(o, "code", { value: "ERR_INVALID_HTTP_TOKEN" }), o;
2993
- }
2994
- }, Fn = typeof node_http.default.validateHeaderValue == "function" ? node_http.default.validateHeaderValue : (i, o) => {
2995
- if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(o)) {
2996
- const a = /* @__PURE__ */ new TypeError(`Invalid character in header content ["${i}"]`);
2997
- throw Object.defineProperty(a, "code", { value: "ERR_INVALID_CHAR" }), a;
2998
- }
2999
- }, Pr = class Pr$1 extends URLSearchParams {
3000
- constructor(o) {
3001
- let a = [];
3002
- if (o instanceof Pr$1) {
3003
- const f$1 = o.raw();
3004
- for (const [l, p] of Object.entries(f$1)) a.push(...p.map((h) => [l, h]));
3005
- } else if (o != null) if (typeof o == "object" && !node_util.types.isBoxedPrimitive(o)) {
3006
- const f$1 = o[Symbol.iterator];
3007
- if (f$1 == null) a.push(...Object.entries(o));
3008
- else {
3009
- if (typeof f$1 != "function") throw new TypeError("Header pairs must be iterable");
3010
- a = [...o].map((l) => {
3011
- if (typeof l != "object" || node_util.types.isBoxedPrimitive(l)) throw new TypeError("Each header pair must be an iterable object");
3012
- return [...l];
3013
- }).map((l) => {
3014
- if (l.length !== 2) throw new TypeError("Each header pair must be a name/value tuple");
3015
- return [...l];
3016
- });
3017
- }
3018
- } else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");
3019
- return a = a.length > 0 ? a.map(([f$1, l]) => (gr(f$1), Fn(f$1, String(l)), [String(f$1).toLowerCase(), String(l)])) : void 0, super(a), new Proxy(this, { get(f$1, l, p) {
3020
- switch (l) {
3021
- case "append":
3022
- case "set": return (h, S) => (gr(h), Fn(h, String(S)), URLSearchParams.prototype[l].call(f$1, String(h).toLowerCase(), String(S)));
3023
- case "delete":
3024
- case "has":
3025
- case "getAll": return (h) => (gr(h), URLSearchParams.prototype[l].call(f$1, String(h).toLowerCase()));
3026
- case "keys": return () => (f$1.sort(), new Set(URLSearchParams.prototype.keys.call(f$1)).keys());
3027
- default: return Reflect.get(f$1, l, p);
3028
- }
3029
- } });
3030
- }
3031
- get [Symbol.toStringTag]() {
3032
- return this.constructor.name;
3033
- }
3034
- toString() {
3035
- return Object.prototype.toString.call(this);
3036
- }
3037
- get(o) {
3038
- const a = this.getAll(o);
3039
- if (a.length === 0) return null;
3040
- let f$1 = a.join(", ");
3041
- return /^content-encoding$/i.test(o) && (f$1 = f$1.toLowerCase()), f$1;
3042
- }
3043
- forEach(o, a = void 0) {
3044
- for (const f$1 of this.keys()) Reflect.apply(o, a, [
3045
- this.get(f$1),
3046
- f$1,
3047
- this
3048
- ]);
3049
- }
3050
- *values() {
3051
- for (const o of this.keys()) yield this.get(o);
3052
- }
3053
- *entries() {
3054
- for (const o of this.keys()) yield [o, this.get(o)];
3055
- }
3056
- [Symbol.iterator]() {
3057
- return this.entries();
3058
- }
3059
- raw() {
3060
- return [...this.keys()].reduce((o, a) => (o[a] = this.getAll(a), o), {});
3061
- }
3062
- [Symbol.for("nodejs.util.inspect.custom")]() {
3063
- return [...this.keys()].reduce((o, a) => {
3064
- const f$1 = this.getAll(a);
3065
- return a === "host" ? o[a] = f$1[0] : o[a] = f$1.length > 1 ? f$1 : f$1[0], o;
3066
- }, {});
3067
- }
3068
- };
3069
- n$1(Pr, "Headers");
3070
- let ye = Pr;
3071
- Object.defineProperties(ye.prototype, [
3072
- "get",
3073
- "entries",
3074
- "forEach",
3075
- "values"
3076
- ].reduce((i, o) => (i[o] = { enumerable: !0 }, i), {}));
3077
- function ol(i = []) {
3078
- return new ye(i.reduce((o, a, f$1, l) => (f$1 % 2 === 0 && o.push(l.slice(f$1, f$1 + 2)), o), []).filter(([o, a]) => {
3079
- try {
3080
- return gr(o), Fn(o, String(a)), !0;
3081
- } catch {
3082
- return !1;
3083
- }
3084
- }));
3085
- }
3086
- n$1(ol, "fromRawHeaders");
3087
- const il = new Set([
3088
- 301,
3089
- 302,
3090
- 303,
3091
- 307,
3092
- 308
3093
- ]), jn = n$1((i) => il.has(i), "isRedirect"), se = Symbol("Response internals"), Ne = class Ne$1 extends xe {
3094
- constructor(o = null, a = {}) {
3095
- super(o, a);
3096
- const f$1 = a.status != null ? a.status : 200, l = new ye(a.headers);
3097
- if (o !== null && !l.has("Content-Type")) {
3098
- const p = Ri(o, this);
3099
- p && l.append("Content-Type", p);
3100
- }
3101
- this[se] = {
3102
- type: "default",
3103
- url: a.url,
3104
- status: f$1,
3105
- statusText: a.statusText || "",
3106
- headers: l,
3107
- counter: a.counter,
3108
- highWaterMark: a.highWaterMark
3109
- };
3110
- }
3111
- get type() {
3112
- return this[se].type;
3113
- }
3114
- get url() {
3115
- return this[se].url || "";
3116
- }
3117
- get status() {
3118
- return this[se].status;
3119
- }
3120
- get ok() {
3121
- return this[se].status >= 200 && this[se].status < 300;
3122
- }
3123
- get redirected() {
3124
- return this[se].counter > 0;
3125
- }
3126
- get statusText() {
3127
- return this[se].statusText;
3128
- }
3129
- get headers() {
3130
- return this[se].headers;
3131
- }
3132
- get highWaterMark() {
3133
- return this[se].highWaterMark;
3134
- }
3135
- clone() {
3136
- return new Ne$1(In(this, this.highWaterMark), {
3137
- type: this.type,
3138
- url: this.url,
3139
- status: this.status,
3140
- statusText: this.statusText,
3141
- headers: this.headers,
3142
- ok: this.ok,
3143
- redirected: this.redirected,
3144
- size: this.size,
3145
- highWaterMark: this.highWaterMark
3146
- });
3147
- }
3148
- static redirect(o, a = 302) {
3149
- if (!jn(a)) throw new RangeError("Failed to execute \"redirect\" on \"response\": Invalid status code");
3150
- return new Ne$1(null, {
3151
- headers: { location: new URL(o).toString() },
3152
- status: a
3153
- });
3154
- }
3155
- static error() {
3156
- const o = new Ne$1(null, {
3157
- status: 0,
3158
- statusText: ""
3159
- });
3160
- return o[se].type = "error", o;
3161
- }
3162
- static json(o = void 0, a = {}) {
3163
- const f$1 = JSON.stringify(o);
3164
- if (f$1 === void 0) throw new TypeError("data is not JSON serializable");
3165
- const l = new ye(a && a.headers);
3166
- return l.has("content-type") || l.set("content-type", "application/json"), new Ne$1(f$1, {
3167
- ...a,
3168
- headers: l
3169
- });
3170
- }
3171
- get [Symbol.toStringTag]() {
3172
- return "Response";
3173
- }
3174
- };
3175
- n$1(Ne, "Response");
3176
- let le = Ne;
3177
- Object.defineProperties(le.prototype, {
3178
- type: { enumerable: !0 },
3179
- url: { enumerable: !0 },
3180
- status: { enumerable: !0 },
3181
- ok: { enumerable: !0 },
3182
- redirected: { enumerable: !0 },
3183
- statusText: { enumerable: !0 },
3184
- headers: { enumerable: !0 },
3185
- clone: { enumerable: !0 }
3186
- });
3187
- const al = n$1((i) => {
3188
- if (i.search) return i.search;
3189
- const o = i.href.length - 1, a = i.hash || (i.href[o] === "#" ? "#" : "");
3190
- return i.href[o - a.length] === "?" ? "?" : "";
3191
- }, "getSearch");
3192
- function Ti(i, o = !1) {
3193
- return i == null || (i = new URL(i), /^(about|blob|data):$/.test(i.protocol)) ? "no-referrer" : (i.username = "", i.password = "", i.hash = "", o && (i.pathname = "", i.search = ""), i);
3194
- }
3195
- n$1(Ti, "stripURLForUseAsAReferrer");
3196
- const Ci = new Set([
3197
- "",
3198
- "no-referrer",
3199
- "no-referrer-when-downgrade",
3200
- "same-origin",
3201
- "origin",
3202
- "strict-origin",
3203
- "origin-when-cross-origin",
3204
- "strict-origin-when-cross-origin",
3205
- "unsafe-url"
3206
- ]), sl = "strict-origin-when-cross-origin";
3207
- function ll(i) {
3208
- if (!Ci.has(i)) throw new TypeError(`Invalid referrerPolicy: ${i}`);
3209
- return i;
3210
- }
3211
- n$1(ll, "validateReferrerPolicy");
3212
- function ul(i) {
3213
- if (/^(http|ws)s:$/.test(i.protocol)) return !0;
3214
- const o = i.host.replace(/(^\[)|(]$)/g, ""), a = (0, node_net.isIP)(o);
3215
- return a === 4 && /^127\./.test(o) || a === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(o) ? !0 : i.host === "localhost" || i.host.endsWith(".localhost") ? !1 : i.protocol === "file:";
3216
- }
3217
- n$1(ul, "isOriginPotentiallyTrustworthy");
3218
- function ct(i) {
3219
- return /^about:(blank|srcdoc)$/.test(i) || i.protocol === "data:" || /^(blob|filesystem):$/.test(i.protocol) ? !0 : ul(i);
3220
- }
3221
- n$1(ct, "isUrlPotentiallyTrustworthy");
3222
- function fl(i, { referrerURLCallback: o, referrerOriginCallback: a } = {}) {
3223
- if (i.referrer === "no-referrer" || i.referrerPolicy === "") return null;
3224
- const f$1 = i.referrerPolicy;
3225
- if (i.referrer === "about:client") return "no-referrer";
3226
- const l = i.referrer;
3227
- let p = Ti(l), h = Ti(l, !0);
3228
- p.toString().length > 4096 && (p = h), o && (p = o(p)), a && (h = a(h));
3229
- const S = new URL(i.url);
3230
- switch (f$1) {
3231
- case "no-referrer": return "no-referrer";
3232
- case "origin": return h;
3233
- case "unsafe-url": return p;
3234
- case "strict-origin": return ct(p) && !ct(S) ? "no-referrer" : h.toString();
3235
- case "strict-origin-when-cross-origin": return p.origin === S.origin ? p : ct(p) && !ct(S) ? "no-referrer" : h;
3236
- case "same-origin": return p.origin === S.origin ? p : "no-referrer";
3237
- case "origin-when-cross-origin": return p.origin === S.origin ? p : h;
3238
- case "no-referrer-when-downgrade": return ct(p) && !ct(S) ? "no-referrer" : p;
3239
- default: throw new TypeError(`Invalid referrerPolicy: ${f$1}`);
3240
- }
3241
- }
3242
- n$1(fl, "determineRequestsReferrer");
3243
- function cl(i) {
3244
- const o = (i.get("referrer-policy") || "").split(/[,\s]+/);
3245
- let a = "";
3246
- for (const f$1 of o) f$1 && Ci.has(f$1) && (a = f$1);
3247
- return a;
3248
- }
3249
- n$1(cl, "parseReferrerPolicyFromHeader");
3250
- const $ = Symbol("Request internals"), qt = n$1((i) => typeof i == "object" && typeof i[$] == "object", "isRequest"), dl = (0, node_util.deprecate)(() => {}, ".data is not a valid RequestInit property, use .body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (request)"), vr = class vr$1 extends xe {
3251
- constructor(o, a = {}) {
3252
- let f$1;
3253
- if (qt(o) ? f$1 = new URL(o.url) : (f$1 = new URL(o), o = {}), f$1.username !== "" || f$1.password !== "") throw new TypeError(`${f$1} is an url with embedded credentials.`);
3254
- let l = a.method || o.method || "GET";
3255
- if (/^(delete|get|head|options|post|put)$/i.test(l) && (l = l.toUpperCase()), !qt(a) && "data" in a && dl(), (a.body != null || qt(o) && o.body !== null) && (l === "GET" || l === "HEAD")) throw new TypeError("Request with GET/HEAD method cannot have body");
3256
- const p = a.body ? a.body : qt(o) && o.body !== null ? In(o) : null;
3257
- super(p, { size: a.size || o.size || 0 });
3258
- const h = new ye(a.headers || o.headers || {});
3259
- if (p !== null && !h.has("Content-Type")) {
3260
- const w = Ri(p, this);
3261
- w && h.set("Content-Type", w);
3262
- }
3263
- let S = qt(o) ? o.signal : null;
3264
- if ("signal" in a && (S = a.signal), S != null && !Ks(S)) throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
3265
- let v = a.referrer == null ? o.referrer : a.referrer;
3266
- if (v === "") v = "no-referrer";
3267
- else if (v) {
3268
- const w = new URL(v);
3269
- v = /^about:(\/\/)?client$/.test(w) ? "client" : w;
3270
- } else v = void 0;
3271
- this[$] = {
3272
- method: l,
3273
- redirect: a.redirect || o.redirect || "follow",
3274
- headers: h,
3275
- parsedURL: f$1,
3276
- signal: S,
3277
- referrer: v
3278
- }, this.follow = a.follow === void 0 ? o.follow === void 0 ? 20 : o.follow : a.follow, this.compress = a.compress === void 0 ? o.compress === void 0 ? !0 : o.compress : a.compress, this.counter = a.counter || o.counter || 0, this.agent = a.agent || o.agent, this.highWaterMark = a.highWaterMark || o.highWaterMark || 16384, this.insecureHTTPParser = a.insecureHTTPParser || o.insecureHTTPParser || !1, this.referrerPolicy = a.referrerPolicy || o.referrerPolicy || "";
3279
- }
3280
- get method() {
3281
- return this[$].method;
3282
- }
3283
- get url() {
3284
- return (0, node_url.format)(this[$].parsedURL);
3285
- }
3286
- get headers() {
3287
- return this[$].headers;
3288
- }
3289
- get redirect() {
3290
- return this[$].redirect;
3291
- }
3292
- get signal() {
3293
- return this[$].signal;
3294
- }
3295
- get referrer() {
3296
- if (this[$].referrer === "no-referrer") return "";
3297
- if (this[$].referrer === "client") return "about:client";
3298
- if (this[$].referrer) return this[$].referrer.toString();
3299
- }
3300
- get referrerPolicy() {
3301
- return this[$].referrerPolicy;
3302
- }
3303
- set referrerPolicy(o) {
3304
- this[$].referrerPolicy = ll(o);
3305
- }
3306
- clone() {
3307
- return new vr$1(this);
3308
- }
3309
- get [Symbol.toStringTag]() {
3310
- return "Request";
3311
- }
3312
- };
3313
- n$1(vr, "Request");
3314
- let dt = vr;
3315
- Object.defineProperties(dt.prototype, {
3316
- method: { enumerable: !0 },
3317
- url: { enumerable: !0 },
3318
- headers: { enumerable: !0 },
3319
- redirect: { enumerable: !0 },
3320
- clone: { enumerable: !0 },
3321
- signal: { enumerable: !0 },
3322
- referrer: { enumerable: !0 },
3323
- referrerPolicy: { enumerable: !0 }
3324
- });
3325
- const hl = n$1((i) => {
3326
- const { parsedURL: o } = i[$], a = new ye(i[$].headers);
3327
- a.has("Accept") || a.set("Accept", "*/*");
3328
- let f$1 = null;
3329
- if (i.body === null && /^(post|put)$/i.test(i.method) && (f$1 = "0"), i.body !== null) {
3330
- const S = rl(i);
3331
- typeof S == "number" && !Number.isNaN(S) && (f$1 = String(S));
3332
- }
3333
- f$1 && a.set("Content-Length", f$1), i.referrerPolicy === "" && (i.referrerPolicy = sl), i.referrer && i.referrer !== "no-referrer" ? i[$].referrer = fl(i) : i[$].referrer = "no-referrer", i[$].referrer instanceof URL && a.set("Referer", i.referrer), a.has("User-Agent") || a.set("User-Agent", "node-fetch"), i.compress && !a.has("Accept-Encoding") && a.set("Accept-Encoding", "gzip, deflate, br");
3334
- let { agent: l } = i;
3335
- typeof l == "function" && (l = l(o));
3336
- const p = al(o);
3337
- return {
3338
- parsedURL: o,
3339
- options: {
3340
- path: o.pathname + p,
3341
- method: i.method,
3342
- headers: a[Symbol.for("nodejs.util.inspect.custom")](),
3343
- insecureHTTPParser: i.insecureHTTPParser,
3344
- agent: l
3345
- }
3346
- };
3347
- }, "getNodeRequestOptions"), Hn = class Hn$1 extends ft {
3348
- constructor(o, a = "aborted") {
3349
- super(o, a);
3350
- }
3351
- };
3352
- n$1(Hn, "AbortError");
3353
- let _r = Hn;
3354
- /*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */ var Ln, Pi;
3355
- function pl() {
3356
- if (Pi) return Ln;
3357
- if (Pi = 1, !globalThis.DOMException) try {
3358
- const { MessageChannel: i } = require("node:worker_threads"), o = new i().port1, a = /* @__PURE__ */ new ArrayBuffer();
3359
- o.postMessage(a, [a, a]);
3360
- } catch (i) {
3361
- i.constructor.name === "DOMException" && (globalThis.DOMException = i.constructor);
3362
- }
3363
- return Ln = globalThis.DOMException, Ln;
3364
- }
3365
- n$1(pl, "requireNodeDomexception");
3366
- const ml = require_node_fetch_native_DfbY2q_x.f(pl()), { stat: $n } = node_fs.promises, yl = n$1((i, o) => vi((0, node_fs.statSync)(i), i, o), "blobFromSync"), gl = n$1((i, o) => $n(i).then((a) => vi(a, i, o)), "blobFrom"), _l = n$1((i, o) => $n(i).then((a) => Ei(a, i, o)), "fileFrom"), Sl = n$1((i, o) => Ei((0, node_fs.statSync)(i), i, o), "fileFromSync"), vi = n$1((i, o, a = "") => new ut([new Sr({
3367
- path: o,
3368
- size: i.size,
3369
- lastModified: i.mtimeMs,
3370
- start: 0
3371
- })], { type: a }), "fromBlob"), Ei = n$1((i, o, a = "") => new qn([new Sr({
3372
- path: o,
3373
- size: i.size,
3374
- lastModified: i.mtimeMs,
3375
- start: 0
3376
- })], (0, node_path.basename)(o), {
3377
- type: a,
3378
- lastModified: i.mtimeMs
3379
- }), "fromFile"), Er = class Er$1 {
3380
- constructor(o) {
3381
- be(this, He);
3382
- be(this, Ve);
3383
- X(this, He, o.path), X(this, Ve, o.start), this.size = o.size, this.lastModified = o.lastModified;
3384
- }
3385
- slice(o, a) {
3386
- return new Er$1({
3387
- path: O(this, He),
3388
- lastModified: this.lastModified,
3389
- size: a - o,
3390
- start: O(this, Ve) + o
3391
- });
3392
- }
3393
- async *stream() {
3394
- const { mtimeMs: o } = await $n(O(this, He));
3395
- if (o > this.lastModified) throw new ml("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
3396
- yield* (0, node_fs.createReadStream)(O(this, He), {
3397
- start: O(this, Ve),
3398
- end: O(this, Ve) + this.size - 1
3399
- });
3400
- }
3401
- get [Symbol.toStringTag]() {
3402
- return "Blob";
3403
- }
3404
- };
3405
- He = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap(), n$1(Er, "BlobDataItem");
3406
- let Sr = Er;
3407
- const wl = new Set([
3408
- "data:",
3409
- "http:",
3410
- "https:"
3411
- ]);
3412
- async function Ai(i, o) {
3413
- return new Promise((a, f$1) => {
3414
- const l = new dt(i, o), { parsedURL: p, options: h } = hl(l);
3415
- if (!wl.has(p.protocol)) throw new TypeError(`node-fetch cannot load ${i}. URL scheme "${p.protocol.replace(/:$/, "")}" is not supported.`);
3416
- if (p.protocol === "data:") {
3417
- const g = Us(l.url);
3418
- a(new le(g, { headers: { "Content-Type": g.typeFull } }));
3419
- return;
3420
- }
3421
- const S = (p.protocol === "https:" ? node_https.default : node_http.default).request, { signal: v } = l;
3422
- let w = null;
3423
- const A = n$1(() => {
3424
- const g = new _r("The operation was aborted.");
3425
- f$1(g), l.body && l.body instanceof node_stream.default.Readable && l.body.destroy(g), !(!w || !w.body) && w.body.emit("error", g);
3426
- }, "abort");
3427
- if (v && v.aborted) {
3428
- A();
3429
- return;
3430
- }
3431
- const T = n$1(() => {
3432
- A(), q();
3433
- }, "abortAndFinalize"), b = S(p.toString(), h);
3434
- v && v.addEventListener("abort", T);
3435
- const q = n$1(() => {
3436
- b.abort(), v && v.removeEventListener("abort", T);
3437
- }, "finalize");
3438
- b.on("error", (g) => {
3439
- f$1(new G(`request to ${l.url} failed, reason: ${g.message}`, "system", g)), q();
3440
- }), Rl(b, (g) => {
3441
- w && w.body && w.body.destroy(g);
3442
- }), process.version < "v14" && b.on("socket", (g) => {
3443
- let V;
3444
- g.prependListener("end", () => {
3445
- V = g._eventsCount;
3446
- }), g.prependListener("close", (I) => {
3447
- if (w && V < g._eventsCount && !I) {
3448
- const F = /* @__PURE__ */ new Error("Premature close");
3449
- F.code = "ERR_STREAM_PREMATURE_CLOSE", w.body.emit("error", F);
3450
- }
3451
- });
3452
- }), b.on("response", (g) => {
3453
- b.setTimeout(0);
3454
- const V = ol(g.rawHeaders);
3455
- if (jn(g.statusCode)) {
3456
- const z = V.get("Location");
3457
- let j = null;
3458
- try {
3459
- j = z === null ? null : new URL(z, l.url);
3460
- } catch {
3461
- if (l.redirect !== "manual") {
3462
- f$1(new G(`uri requested responds with an invalid redirect URL: ${z}`, "invalid-redirect")), q();
3463
- return;
3464
- }
3465
- }
3466
- switch (l.redirect) {
3467
- case "error":
3468
- f$1(new G(`uri requested responds with a redirect, redirect mode is set to error: ${l.url}`, "no-redirect")), q();
3469
- return;
3470
- case "manual": break;
3471
- case "follow": {
3472
- if (j === null) break;
3473
- if (l.counter >= l.follow) {
3474
- f$1(new G(`maximum redirect reached at: ${l.url}`, "max-redirect")), q();
3475
- return;
3476
- }
3477
- const U = {
3478
- headers: new ye(l.headers),
3479
- follow: l.follow,
3480
- counter: l.counter + 1,
3481
- agent: l.agent,
3482
- compress: l.compress,
3483
- method: l.method,
3484
- body: In(l),
3485
- signal: l.signal,
3486
- size: l.size,
3487
- referrer: l.referrer,
3488
- referrerPolicy: l.referrerPolicy
3489
- };
3490
- if (!Js(l.url, j) || !Xs(l.url, j)) for (const jt of [
3491
- "authorization",
3492
- "www-authenticate",
3493
- "cookie",
3494
- "cookie2"
3495
- ]) U.headers.delete(jt);
3496
- if (g.statusCode !== 303 && l.body && o.body instanceof node_stream.default.Readable) {
3497
- f$1(new G("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), q();
3498
- return;
3499
- }
3500
- (g.statusCode === 303 || (g.statusCode === 301 || g.statusCode === 302) && l.method === "POST") && (U.method = "GET", U.body = void 0, U.headers.delete("content-length"));
3501
- const D = cl(V);
3502
- D && (U.referrerPolicy = D), a(Ai(new dt(j, U))), q();
3503
- return;
3504
- }
3505
- default: return f$1(/* @__PURE__ */ new TypeError(`Redirect option '${l.redirect}' is not a valid value of RequestRedirect`));
3506
- }
3507
- }
3508
- v && g.once("end", () => {
3509
- v.removeEventListener("abort", T);
3510
- });
3511
- let I = (0, node_stream.pipeline)(g, new node_stream.PassThrough(), (z) => {
3512
- z && f$1(z);
3513
- });
3514
- process.version < "v12.10" && g.on("aborted", T);
3515
- const F = {
3516
- url: l.url,
3517
- status: g.statusCode,
3518
- statusText: g.statusMessage,
3519
- headers: V,
3520
- size: l.size,
3521
- counter: l.counter,
3522
- highWaterMark: l.highWaterMark
3523
- }, Q = V.get("Content-Encoding");
3524
- if (!l.compress || l.method === "HEAD" || Q === null || g.statusCode === 204 || g.statusCode === 304) {
3525
- w = new le(I, F), a(w);
3526
- return;
3527
- }
3528
- const ge = {
3529
- flush: node_zlib.default.Z_SYNC_FLUSH,
3530
- finishFlush: node_zlib.default.Z_SYNC_FLUSH
3531
- };
3532
- if (Q === "gzip" || Q === "x-gzip") {
3533
- I = (0, node_stream.pipeline)(I, node_zlib.default.createGunzip(ge), (z) => {
3534
- z && f$1(z);
3535
- }), w = new le(I, F), a(w);
3536
- return;
3537
- }
3538
- if (Q === "deflate" || Q === "x-deflate") {
3539
- const z = (0, node_stream.pipeline)(g, new node_stream.PassThrough(), (j) => {
3540
- j && f$1(j);
3541
- });
3542
- z.once("data", (j) => {
3543
- (j[0] & 15) === 8 ? I = (0, node_stream.pipeline)(I, node_zlib.default.createInflate(), (U) => {
3544
- U && f$1(U);
3545
- }) : I = (0, node_stream.pipeline)(I, node_zlib.default.createInflateRaw(), (U) => {
3546
- U && f$1(U);
3547
- }), w = new le(I, F), a(w);
3548
- }), z.once("end", () => {
3549
- w || (w = new le(I, F), a(w));
3550
- });
3551
- return;
3552
- }
3553
- if (Q === "br") {
3554
- I = (0, node_stream.pipeline)(I, node_zlib.default.createBrotliDecompress(), (z) => {
3555
- z && f$1(z);
3556
- }), w = new le(I, F), a(w);
3557
- return;
3558
- }
3559
- w = new le(I, F), a(w);
3560
- }), nl(b, l).catch(f$1);
3561
- });
3562
- }
3563
- n$1(Ai, "fetch$1");
3564
- function Rl(i, o) {
3565
- const a = node_buffer.Buffer.from(`0\r
3566
- \r
3567
- `);
3568
- let f$1 = !1, l = !1, p;
3569
- i.on("response", (h) => {
3570
- const { headers: S } = h;
3571
- f$1 = S["transfer-encoding"] === "chunked" && !S["content-length"];
3572
- }), i.on("socket", (h) => {
3573
- const S = n$1(() => {
3574
- if (f$1 && !l) {
3575
- const w = /* @__PURE__ */ new Error("Premature close");
3576
- w.code = "ERR_STREAM_PREMATURE_CLOSE", o(w);
3577
- }
3578
- }, "onSocketClose"), v = n$1((w) => {
3579
- l = node_buffer.Buffer.compare(w.slice(-5), a) === 0, !l && p && (l = node_buffer.Buffer.compare(p.slice(-3), a.slice(0, 3)) === 0 && node_buffer.Buffer.compare(w.slice(-2), a.slice(3)) === 0), p = w;
3580
- }, "onData");
3581
- h.prependListener("close", S), h.on("data", v), i.on("close", () => {
3582
- h.removeListener("close", S), h.removeListener("data", v);
3583
- });
3584
- });
3585
- }
3586
- n$1(Rl, "fixResponseChunkedTransferBadEnding");
3587
- const Bi = /* @__PURE__ */ new WeakMap(), Dn = /* @__PURE__ */ new WeakMap();
3588
- function W(i) {
3589
- const o = Bi.get(i);
3590
- return console.assert(o != null, "'this' is expected an Event object, but got", i), o;
3591
- }
3592
- n$1(W, "pd");
3593
- function ki(i) {
3594
- if (i.passiveListener != null) {
3595
- typeof console < "u" && typeof console.error == "function" && console.error("Unable to preventDefault inside passive event listener invocation.", i.passiveListener);
3596
- return;
3597
- }
3598
- i.event.cancelable && (i.canceled = !0, typeof i.event.preventDefault == "function" && i.event.preventDefault());
3599
- }
3600
- n$1(ki, "setCancelFlag");
3601
- function ht(i, o) {
3602
- Bi.set(this, {
3603
- eventTarget: i,
3604
- event: o,
3605
- eventPhase: 2,
3606
- currentTarget: i,
3607
- canceled: !1,
3608
- stopped: !1,
3609
- immediateStopped: !1,
3610
- passiveListener: null,
3611
- timeStamp: o.timeStamp || Date.now()
3612
- }), Object.defineProperty(this, "isTrusted", {
3613
- value: !1,
3614
- enumerable: !0
3615
- });
3616
- const a = Object.keys(o);
3617
- for (let f$1 = 0; f$1 < a.length; ++f$1) {
3618
- const l = a[f$1];
3619
- l in this || Object.defineProperty(this, l, Wi(l));
3620
- }
3621
- }
3622
- n$1(ht, "Event"), ht.prototype = {
3623
- get type() {
3624
- return W(this).event.type;
3625
- },
3626
- get target() {
3627
- return W(this).eventTarget;
3628
- },
3629
- get currentTarget() {
3630
- return W(this).currentTarget;
3631
- },
3632
- composedPath() {
3633
- const i = W(this).currentTarget;
3634
- return i == null ? [] : [i];
3635
- },
3636
- get NONE() {
3637
- return 0;
3638
- },
3639
- get CAPTURING_PHASE() {
3640
- return 1;
3641
- },
3642
- get AT_TARGET() {
3643
- return 2;
3644
- },
3645
- get BUBBLING_PHASE() {
3646
- return 3;
3647
- },
3648
- get eventPhase() {
3649
- return W(this).eventPhase;
3650
- },
3651
- stopPropagation() {
3652
- const i = W(this);
3653
- i.stopped = !0, typeof i.event.stopPropagation == "function" && i.event.stopPropagation();
3654
- },
3655
- stopImmediatePropagation() {
3656
- const i = W(this);
3657
- i.stopped = !0, i.immediateStopped = !0, typeof i.event.stopImmediatePropagation == "function" && i.event.stopImmediatePropagation();
3658
- },
3659
- get bubbles() {
3660
- return !!W(this).event.bubbles;
3661
- },
3662
- get cancelable() {
3663
- return !!W(this).event.cancelable;
3664
- },
3665
- preventDefault() {
3666
- ki(W(this));
3667
- },
3668
- get defaultPrevented() {
3669
- return W(this).canceled;
3670
- },
3671
- get composed() {
3672
- return !!W(this).event.composed;
3673
- },
3674
- get timeStamp() {
3675
- return W(this).timeStamp;
3676
- },
3677
- get srcElement() {
3678
- return W(this).eventTarget;
3679
- },
3680
- get cancelBubble() {
3681
- return W(this).stopped;
3682
- },
3683
- set cancelBubble(i) {
3684
- if (!i) return;
3685
- const o = W(this);
3686
- o.stopped = !0, typeof o.event.cancelBubble == "boolean" && (o.event.cancelBubble = !0);
3687
- },
3688
- get returnValue() {
3689
- return !W(this).canceled;
3690
- },
3691
- set returnValue(i) {
3692
- i || ki(W(this));
3693
- },
3694
- initEvent() {}
3695
- }, Object.defineProperty(ht.prototype, "constructor", {
3696
- value: ht,
3697
- configurable: !0,
3698
- writable: !0
3699
- }), typeof window < "u" && typeof window.Event < "u" && (Object.setPrototypeOf(ht.prototype, window.Event.prototype), Dn.set(window.Event.prototype, ht));
3700
- function Wi(i) {
3701
- return {
3702
- get() {
3703
- return W(this).event[i];
3704
- },
3705
- set(o) {
3706
- W(this).event[i] = o;
3707
- },
3708
- configurable: !0,
3709
- enumerable: !0
3710
- };
3711
- }
3712
- n$1(Wi, "defineRedirectDescriptor");
3713
- function Tl(i) {
3714
- return {
3715
- value() {
3716
- const o = W(this).event;
3717
- return o[i].apply(o, arguments);
3718
- },
3719
- configurable: !0,
3720
- enumerable: !0
3721
- };
3722
- }
3723
- n$1(Tl, "defineCallDescriptor");
3724
- function Cl(i, o) {
3725
- const a = Object.keys(o);
3726
- if (a.length === 0) return i;
3727
- function f$1(l, p) {
3728
- i.call(this, l, p);
3729
- }
3730
- n$1(f$1, "CustomEvent"), f$1.prototype = Object.create(i.prototype, { constructor: {
3731
- value: f$1,
3732
- configurable: !0,
3733
- writable: !0
3734
- } });
3735
- for (let l = 0; l < a.length; ++l) {
3736
- const p = a[l];
3737
- if (!(p in i.prototype)) {
3738
- const S = typeof Object.getOwnPropertyDescriptor(o, p).value == "function";
3739
- Object.defineProperty(f$1.prototype, p, S ? Tl(p) : Wi(p));
3740
- }
3741
- }
3742
- return f$1;
3743
- }
3744
- n$1(Cl, "defineWrapper");
3745
- function qi(i) {
3746
- if (i == null || i === Object.prototype) return ht;
3747
- let o = Dn.get(i);
3748
- return o ?? (o = Cl(qi(Object.getPrototypeOf(i)), i), Dn.set(i, o)), o;
3749
- }
3750
- n$1(qi, "getWrapper");
3751
- function Pl(i, o) {
3752
- return new (qi(Object.getPrototypeOf(o)))(i, o);
3753
- }
3754
- n$1(Pl, "wrapEvent");
3755
- function vl(i) {
3756
- return W(i).immediateStopped;
3757
- }
3758
- n$1(vl, "isStopped");
3759
- function El(i, o) {
3760
- W(i).eventPhase = o;
3761
- }
3762
- n$1(El, "setEventPhase");
3763
- function Al(i, o) {
3764
- W(i).currentTarget = o;
3765
- }
3766
- n$1(Al, "setCurrentTarget");
3767
- function Oi(i, o) {
3768
- W(i).passiveListener = o;
3769
- }
3770
- n$1(Oi, "setPassiveListener");
3771
- const zi = /* @__PURE__ */ new WeakMap(), Ii = 1, Fi = 2, wr = 3;
3772
- function Rr(i) {
3773
- return i !== null && typeof i == "object";
3774
- }
3775
- n$1(Rr, "isObject");
3776
- function Ot(i) {
3777
- const o = zi.get(i);
3778
- if (o == null) throw new TypeError("'this' is expected an EventTarget object, but got another value.");
3779
- return o;
3780
- }
3781
- n$1(Ot, "getListeners");
3782
- function Bl(i) {
3783
- return {
3784
- get() {
3785
- let a = Ot(this).get(i);
3786
- for (; a != null;) {
3787
- if (a.listenerType === wr) return a.listener;
3788
- a = a.next;
3789
- }
3790
- return null;
3791
- },
3792
- set(o) {
3793
- typeof o != "function" && !Rr(o) && (o = null);
3794
- const a = Ot(this);
3795
- let f$1 = null, l = a.get(i);
3796
- for (; l != null;) l.listenerType === wr ? f$1 !== null ? f$1.next = l.next : l.next !== null ? a.set(i, l.next) : a.delete(i) : f$1 = l, l = l.next;
3797
- if (o !== null) {
3798
- const p = {
3799
- listener: o,
3800
- listenerType: wr,
3801
- passive: !1,
3802
- once: !1,
3803
- next: null
3804
- };
3805
- f$1 === null ? a.set(i, p) : f$1.next = p;
3806
- }
3807
- },
3808
- configurable: !0,
3809
- enumerable: !0
3810
- };
3811
- }
3812
- n$1(Bl, "defineEventAttributeDescriptor");
3813
- function ji(i, o) {
3814
- Object.defineProperty(i, `on${o}`, Bl(o));
3815
- }
3816
- n$1(ji, "defineEventAttribute");
3817
- function Li(i) {
3818
- function o() {
3819
- Pe.call(this);
3820
- }
3821
- n$1(o, "CustomEventTarget"), o.prototype = Object.create(Pe.prototype, { constructor: {
3822
- value: o,
3823
- configurable: !0,
3824
- writable: !0
3825
- } });
3826
- for (let a = 0; a < i.length; ++a) ji(o.prototype, i[a]);
3827
- return o;
3828
- }
3829
- n$1(Li, "defineCustomEventTarget");
3830
- function Pe() {
3831
- if (this instanceof Pe) {
3832
- zi.set(this, /* @__PURE__ */ new Map());
3833
- return;
3834
- }
3835
- if (arguments.length === 1 && Array.isArray(arguments[0])) return Li(arguments[0]);
3836
- if (arguments.length > 0) {
3837
- const i = new Array(arguments.length);
3838
- for (let o = 0; o < arguments.length; ++o) i[o] = arguments[o];
3839
- return Li(i);
3840
- }
3841
- throw new TypeError("Cannot call a class as a function");
3842
- }
3843
- n$1(Pe, "EventTarget"), Pe.prototype = {
3844
- addEventListener(i, o, a) {
3845
- if (o == null) return;
3846
- if (typeof o != "function" && !Rr(o)) throw new TypeError("'listener' should be a function or an object.");
3847
- const f$1 = Ot(this), l = Rr(a), h = (l ? !!a.capture : !!a) ? Ii : Fi, S = {
3848
- listener: o,
3849
- listenerType: h,
3850
- passive: l && !!a.passive,
3851
- once: l && !!a.once,
3852
- next: null
3853
- };
3854
- let v = f$1.get(i);
3855
- if (v === void 0) {
3856
- f$1.set(i, S);
3857
- return;
3858
- }
3859
- let w = null;
3860
- for (; v != null;) {
3861
- if (v.listener === o && v.listenerType === h) return;
3862
- w = v, v = v.next;
3863
- }
3864
- w.next = S;
3865
- },
3866
- removeEventListener(i, o, a) {
3867
- if (o == null) return;
3868
- const f$1 = Ot(this), p = (Rr(a) ? !!a.capture : !!a) ? Ii : Fi;
3869
- let h = null, S = f$1.get(i);
3870
- for (; S != null;) {
3871
- if (S.listener === o && S.listenerType === p) {
3872
- h !== null ? h.next = S.next : S.next !== null ? f$1.set(i, S.next) : f$1.delete(i);
3873
- return;
3874
- }
3875
- h = S, S = S.next;
3876
- }
3877
- },
3878
- dispatchEvent(i) {
3879
- if (i == null || typeof i.type != "string") throw new TypeError("\"event.type\" should be a string.");
3880
- const o = Ot(this), a = i.type;
3881
- let f$1 = o.get(a);
3882
- if (f$1 == null) return !0;
3883
- const l = Pl(this, i);
3884
- let p = null;
3885
- for (; f$1 != null;) {
3886
- if (f$1.once ? p !== null ? p.next = f$1.next : f$1.next !== null ? o.set(a, f$1.next) : o.delete(a) : p = f$1, Oi(l, f$1.passive ? f$1.listener : null), typeof f$1.listener == "function") try {
3887
- f$1.listener.call(this, l);
3888
- } catch (h) {
3889
- typeof console < "u" && typeof console.error == "function" && console.error(h);
3890
- }
3891
- else f$1.listenerType !== wr && typeof f$1.listener.handleEvent == "function" && f$1.listener.handleEvent(l);
3892
- if (vl(l)) break;
3893
- f$1 = f$1.next;
3894
- }
3895
- return Oi(l, null), El(l, 0), Al(l, null), !l.defaultPrevented;
3896
- }
3897
- }, Object.defineProperty(Pe.prototype, "constructor", {
3898
- value: Pe,
3899
- configurable: !0,
3900
- writable: !0
3901
- }), typeof window < "u" && typeof window.EventTarget < "u" && Object.setPrototypeOf(Pe.prototype, window.EventTarget.prototype);
3902
- const Vn = class Vn$1 extends Pe {
3903
- constructor() {
3904
- throw super(), /* @__PURE__ */ new TypeError("AbortSignal cannot be constructed directly");
3905
- }
3906
- get aborted() {
3907
- const o = Tr.get(this);
3908
- if (typeof o != "boolean") throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
3909
- return o;
3910
- }
3911
- };
3912
- n$1(Vn, "AbortSignal");
3913
- let pt = Vn;
3914
- ji(pt.prototype, "abort");
3915
- function kl() {
3916
- const i = Object.create(pt.prototype);
3917
- return Pe.call(i), Tr.set(i, !1), i;
3918
- }
3919
- n$1(kl, "createAbortSignal");
3920
- function Wl(i) {
3921
- Tr.get(i) === !1 && (Tr.set(i, !0), i.dispatchEvent({ type: "abort" }));
3922
- }
3923
- n$1(Wl, "abortSignal");
3924
- const Tr = /* @__PURE__ */ new WeakMap();
3925
- Object.defineProperties(pt.prototype, { aborted: { enumerable: !0 } }), typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol" && Object.defineProperty(pt.prototype, Symbol.toStringTag, {
3926
- configurable: !0,
3927
- value: "AbortSignal"
3928
- });
3929
- let Mn = (gt = class {
3930
- constructor() {
3931
- $i.set(this, kl());
3932
- }
3933
- get signal() {
3934
- return Di(this);
3935
- }
3936
- abort() {
3937
- Wl(Di(this));
3938
- }
3939
- }, n$1(gt, "AbortController"), gt);
3940
- const $i = /* @__PURE__ */ new WeakMap();
3941
- function Di(i) {
3942
- const o = $i.get(i);
3943
- if (o == null) throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${i === null ? "null" : typeof i}`);
3944
- return o;
3945
- }
3946
- n$1(Di, "getSignal"), Object.defineProperties(Mn.prototype, {
3947
- signal: { enumerable: !0 },
3948
- abort: { enumerable: !0 }
3949
- }), typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Mn.prototype, Symbol.toStringTag, {
3950
- configurable: !0,
3951
- value: "AbortController"
3952
- });
3953
- var ql = Object.defineProperty, Ol = n$1((i, o) => ql(i, "name", {
3954
- value: o,
3955
- configurable: !0
3956
- }), "e");
3957
- const Mi = Ai;
3958
- Ui();
3959
- function Ui() {
3960
- !globalThis.process?.versions?.node && !globalThis.process?.env?.DISABLE_NODE_FETCH_NATIVE_WARN && console.warn("[node-fetch-native] Node.js compatible build of `node-fetch-native` is being used in a non-Node.js environment. Please make sure you are using proper export conditions or report this issue to https://github.com/unjs/node-fetch-native. You can set `process.env.DISABLE_NODE_FETCH_NATIVE_WARN` to disable this warning.");
3961
- }
3962
- n$1(Ui, "s"), Ol(Ui, "checkNodeEnvironment");
3963
-
3964
- //#endregion
3965
- exports.G = G;
3966
- exports.Mi = Mi;
3967
- exports.Mn = Mn;
3968
- exports._r = _r;
3969
- exports.br = br;
3970
- exports.dt = dt;
3971
- exports.jn = jn;
3972
- exports.le = le;
3973
- exports.qn = qn;
3974
- exports.ut = ut;
3975
- exports.ye = ye;