@harbour-enterprises/superdoc 0.9.32 → 0.9.33

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 (44) hide show
  1. package/dist/chunks/{index-CqRwYOdx.cjs → index--PIRPKWt.cjs} +1 -1
  2. package/dist/chunks/{index-dZKHAFXF.es.js → index-B5GDfEJg.es.js} +1 -1
  3. package/dist/chunks/index-Bq_aNm9n.es.js +473 -0
  4. package/dist/chunks/index-DrgTIkvI.cjs +1 -0
  5. package/dist/chunks/{super-editor.es-lgNxT29a.es.js → super-editor.es-B8noCvT1.es.js} +6145 -6110
  6. package/dist/chunks/{super-editor.es-BMiw7kSz.cjs → super-editor.es-y2QD_ueu.cjs} +66 -66
  7. package/dist/chunks/{url-BxDGAI6E.es.js → url-BDmRlERW.es.js} +1 -1
  8. package/dist/chunks/{url-6Xu7gR4T.cjs → url-C5DCBLAS.cjs} +1 -1
  9. package/dist/chunks/xml-js-DMX8C2aY.es.js +2965 -0
  10. package/dist/chunks/xml-js-DN6JJ8Mw.cjs +10 -0
  11. package/dist/style.css +1 -1
  12. package/dist/super-editor/chunks/{converter-CvrsY4k6.js → converter-CdhiEvSA.js} +1443 -1398
  13. package/dist/super-editor/chunks/{docx-zipper-D_ju0cVd.js → docx-zipper-Cb4eXMOp.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-CZVXNGfc.js → editor-Czx51mKu.js} +1191 -1200
  15. package/dist/super-editor/chunks/{toolbar-DcnqpZm5.js → toolbar-BE-PZVKR.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  18. package/dist/super-editor/core/super-converter/v2/importer/tableImporter.d.ts +1 -1
  19. package/dist/super-editor/core/super-converter/v2/importer/tableImporter.d.ts.map +1 -1
  20. package/dist/super-editor/docx-zipper.es.js +2 -2
  21. package/dist/super-editor/editor.es.js +3 -3
  22. package/dist/super-editor/extensions/table/tableHelpers/createColGroup.d.ts +2 -0
  23. package/dist/super-editor/extensions/table/tableHelpers/createColGroup.d.ts.map +1 -1
  24. package/dist/super-editor/file-zipper.es.js +1 -1
  25. package/dist/super-editor/style.css +1 -1
  26. package/dist/super-editor/super-editor.es.js +36 -36
  27. package/dist/super-editor/tests/e2e/test-app/dist/assets/index-DX0vnkoa.d.ts +3 -0
  28. package/dist/super-editor/tests/e2e/test-app/dist/assets/index-DX0vnkoa.d.ts.map +1 -0
  29. package/dist/super-editor/tests/e2e/test-app/vite.config.d.ts +1 -1
  30. package/dist/super-editor/tests/export/export-helpers/export-helpers.d.ts.map +1 -1
  31. package/dist/super-editor/tests/export/tableExporter.test.d.ts +2 -0
  32. package/dist/super-editor/tests/export/tableExporter.test.d.ts.map +1 -0
  33. package/dist/super-editor/toolbar.es.js +2 -2
  34. package/dist/super-editor.cjs +1 -1
  35. package/dist/super-editor.es.js +3 -3
  36. package/dist/superdoc.cjs +3 -3
  37. package/dist/superdoc.es.js +6 -6
  38. package/dist/superdoc.umd.js +3419 -3385
  39. package/dist/superdoc.umd.js.map +1 -1
  40. package/package.json +1 -1
  41. package/dist/chunks/index-BXKGjuVW.cjs +0 -1
  42. package/dist/chunks/index-DjLrg1eZ.es.js +0 -1676
  43. package/dist/chunks/xml-js-BAML2_fM.es.js +0 -1757
  44. package/dist/chunks/xml-js-zhwNEV5e.cjs +0 -10
@@ -1,1676 +0,0 @@
1
- import { c as U, B as V, a as gt, g as wt } from "./jszip-DSGi1sNe.es.js";
2
- import { p as q } from "./vue-BDbTsTMu.es.js";
3
- import { e as rt, r as De, u as nt, i as Y, b as Rt, a as Be } from "./xml-js-BAML2_fM.es.js";
4
- import { u as mt } from "./url-BxDGAI6E.es.js";
5
- function Et(e, r) {
6
- for (var a = 0; a < r.length; a++) {
7
- const l = r[a];
8
- if (typeof l != "string" && !Array.isArray(l)) {
9
- for (const f in l)
10
- if (f !== "default" && !(f in e)) {
11
- const _ = Object.getOwnPropertyDescriptor(l, f);
12
- _ && Object.defineProperty(e, f, _.get ? _ : {
13
- enumerable: !0,
14
- get: () => l[f]
15
- });
16
- }
17
- }
18
- }
19
- return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
20
- }
21
- var qe = {}, it = { exports: {} }, Ie = {};
22
- (function(e) {
23
- e.fetch = f(U.fetch) && f(U.ReadableStream), e.writableStream = f(U.WritableStream), e.abortController = f(U.AbortController);
24
- var r;
25
- function a() {
26
- if (r !== void 0) return r;
27
- if (U.XMLHttpRequest) {
28
- r = new U.XMLHttpRequest();
29
- try {
30
- r.open("GET", U.XDomainRequest ? "/" : "https://example.com");
31
- } catch {
32
- r = null;
33
- }
34
- } else
35
- r = null;
36
- return r;
37
- }
38
- function l(_) {
39
- var h = a();
40
- if (!h) return !1;
41
- try {
42
- return h.responseType = _, h.responseType === _;
43
- } catch {
44
- }
45
- return !1;
46
- }
47
- e.arraybuffer = e.fetch || l("arraybuffer"), e.msstream = !e.fetch && l("ms-stream"), e.mozchunkedarraybuffer = !e.fetch && l("moz-chunked-arraybuffer"), e.overrideMimeType = e.fetch || (a() ? f(a().overrideMimeType) : !1);
48
- function f(_) {
49
- return typeof _ == "function";
50
- }
51
- r = null;
52
- })(Ie);
53
- var ce = {}, Ce = { exports: {} }, at = rt.EventEmitter, Se, We;
54
- function St() {
55
- if (We) return Se;
56
- We = 1;
57
- function e(w, E) {
58
- var y = Object.keys(w);
59
- if (Object.getOwnPropertySymbols) {
60
- var v = Object.getOwnPropertySymbols(w);
61
- E && (v = v.filter(function(A) {
62
- return Object.getOwnPropertyDescriptor(w, A).enumerable;
63
- })), y.push.apply(y, v);
64
- }
65
- return y;
66
- }
67
- function r(w) {
68
- for (var E = 1; E < arguments.length; E++) {
69
- var y = arguments[E] != null ? arguments[E] : {};
70
- E % 2 ? e(Object(y), !0).forEach(function(v) {
71
- a(w, v, y[v]);
72
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(w, Object.getOwnPropertyDescriptors(y)) : e(Object(y)).forEach(function(v) {
73
- Object.defineProperty(w, v, Object.getOwnPropertyDescriptor(y, v));
74
- });
75
- }
76
- return w;
77
- }
78
- function a(w, E, y) {
79
- return E = h(E), E in w ? Object.defineProperty(w, E, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : w[E] = y, w;
80
- }
81
- function l(w, E) {
82
- if (!(w instanceof E))
83
- throw new TypeError("Cannot call a class as a function");
84
- }
85
- function f(w, E) {
86
- for (var y = 0; y < E.length; y++) {
87
- var v = E[y];
88
- v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(w, h(v.key), v);
89
- }
90
- }
91
- function _(w, E, y) {
92
- return E && f(w.prototype, E), Object.defineProperty(w, "prototype", { writable: !1 }), w;
93
- }
94
- function h(w) {
95
- var E = c(w, "string");
96
- return typeof E == "symbol" ? E : String(E);
97
- }
98
- function c(w, E) {
99
- if (typeof w != "object" || w === null) return w;
100
- var y = w[Symbol.toPrimitive];
101
- if (y !== void 0) {
102
- var v = y.call(w, E);
103
- if (typeof v != "object") return v;
104
- throw new TypeError("@@toPrimitive must return a primitive value.");
105
- }
106
- return String(w);
107
- }
108
- var d = De, R = d.Buffer, P = nt, b = P.inspect, C = b && b.custom || "inspect";
109
- function j(w, E, y) {
110
- R.prototype.copy.call(w, E, y);
111
- }
112
- return Se = /* @__PURE__ */ function() {
113
- function w() {
114
- l(this, w), this.head = null, this.tail = null, this.length = 0;
115
- }
116
- return _(w, [{
117
- key: "push",
118
- value: function(y) {
119
- var v = {
120
- data: y,
121
- next: null
122
- };
123
- this.length > 0 ? this.tail.next = v : this.head = v, this.tail = v, ++this.length;
124
- }
125
- }, {
126
- key: "unshift",
127
- value: function(y) {
128
- var v = {
129
- data: y,
130
- next: this.head
131
- };
132
- this.length === 0 && (this.tail = v), this.head = v, ++this.length;
133
- }
134
- }, {
135
- key: "shift",
136
- value: function() {
137
- if (this.length !== 0) {
138
- var y = this.head.data;
139
- return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, y;
140
- }
141
- }
142
- }, {
143
- key: "clear",
144
- value: function() {
145
- this.head = this.tail = null, this.length = 0;
146
- }
147
- }, {
148
- key: "join",
149
- value: function(y) {
150
- if (this.length === 0) return "";
151
- for (var v = this.head, A = "" + v.data; v = v.next; ) A += y + v.data;
152
- return A;
153
- }
154
- }, {
155
- key: "concat",
156
- value: function(y) {
157
- if (this.length === 0) return R.alloc(0);
158
- for (var v = R.allocUnsafe(y >>> 0), A = this.head, S = 0; A; )
159
- j(A.data, v, S), S += A.data.length, A = A.next;
160
- return v;
161
- }
162
- // Consumes a specified amount of bytes or characters from the buffered data.
163
- }, {
164
- key: "consume",
165
- value: function(y, v) {
166
- var A;
167
- return y < this.head.data.length ? (A = this.head.data.slice(0, y), this.head.data = this.head.data.slice(y)) : y === this.head.data.length ? A = this.shift() : A = v ? this._getString(y) : this._getBuffer(y), A;
168
- }
169
- }, {
170
- key: "first",
171
- value: function() {
172
- return this.head.data;
173
- }
174
- // Consumes a specified amount of characters from the buffered data.
175
- }, {
176
- key: "_getString",
177
- value: function(y) {
178
- var v = this.head, A = 1, S = v.data;
179
- for (y -= S.length; v = v.next; ) {
180
- var g = v.data, T = y > g.length ? g.length : y;
181
- if (T === g.length ? S += g : S += g.slice(0, y), y -= T, y === 0) {
182
- T === g.length ? (++A, v.next ? this.head = v.next : this.head = this.tail = null) : (this.head = v, v.data = g.slice(T));
183
- break;
184
- }
185
- ++A;
186
- }
187
- return this.length -= A, S;
188
- }
189
- // Consumes a specified amount of bytes from the buffered data.
190
- }, {
191
- key: "_getBuffer",
192
- value: function(y) {
193
- var v = R.allocUnsafe(y), A = this.head, S = 1;
194
- for (A.data.copy(v), y -= A.data.length; A = A.next; ) {
195
- var g = A.data, T = y > g.length ? g.length : y;
196
- if (g.copy(v, v.length - y, 0, T), y -= T, y === 0) {
197
- T === g.length ? (++S, A.next ? this.head = A.next : this.head = this.tail = null) : (this.head = A, A.data = g.slice(T));
198
- break;
199
- }
200
- ++S;
201
- }
202
- return this.length -= S, v;
203
- }
204
- // Make sure the linked list only shows the minimal necessary information.
205
- }, {
206
- key: C,
207
- value: function(y, v) {
208
- return b(this, r(r({}, v), {}, {
209
- // Only inspect one level.
210
- depth: 0,
211
- // It should not recurse.
212
- customInspect: !1
213
- }));
214
- }
215
- }]), w;
216
- }(), Se;
217
- }
218
- function Tt(e, r) {
219
- var a = this, l = this._readableState && this._readableState.destroyed, f = this._writableState && this._writableState.destroyed;
220
- return l || f ? (r ? r(e) : e && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, q.nextTick(Ne, this, e)) : q.nextTick(Ne, this, e)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(e || null, function(_) {
221
- !r && _ ? a._writableState ? a._writableState.errorEmitted ? q.nextTick(de, a) : (a._writableState.errorEmitted = !0, q.nextTick(Fe, a, _)) : q.nextTick(Fe, a, _) : r ? (q.nextTick(de, a), r(_)) : q.nextTick(de, a);
222
- }), this);
223
- }
224
- function Fe(e, r) {
225
- Ne(e, r), de(e);
226
- }
227
- function de(e) {
228
- e._writableState && !e._writableState.emitClose || e._readableState && !e._readableState.emitClose || e.emit("close");
229
- }
230
- function Mt() {
231
- this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
232
- }
233
- function Ne(e, r) {
234
- e.emit("error", r);
235
- }
236
- function At(e, r) {
237
- var a = e._readableState, l = e._writableState;
238
- a && a.autoDestroy || l && l.autoDestroy ? e.destroy(r) : e.emit("error", r);
239
- }
240
- var ot = {
241
- destroy: Tt,
242
- undestroy: Mt,
243
- errorOrDestroy: At
244
- }, X = {};
245
- function Ot(e, r) {
246
- e.prototype = Object.create(r.prototype), e.prototype.constructor = e, e.__proto__ = r;
247
- }
248
- var ft = {};
249
- function B(e, r, a) {
250
- a || (a = Error);
251
- function l(_, h, c) {
252
- return typeof r == "string" ? r : r(_, h, c);
253
- }
254
- var f = /* @__PURE__ */ function(_) {
255
- Ot(h, _);
256
- function h(c, d, R) {
257
- return _.call(this, l(c, d, R)) || this;
258
- }
259
- return h;
260
- }(a);
261
- f.prototype.name = a.name, f.prototype.code = e, ft[e] = f;
262
- }
263
- function Ge(e, r) {
264
- if (Array.isArray(e)) {
265
- var a = e.length;
266
- return e = e.map(function(l) {
267
- return String(l);
268
- }), a > 2 ? "one of ".concat(r, " ").concat(e.slice(0, a - 1).join(", "), ", or ") + e[a - 1] : a === 2 ? "one of ".concat(r, " ").concat(e[0], " or ").concat(e[1]) : "of ".concat(r, " ").concat(e[0]);
269
- } else
270
- return "of ".concat(r, " ").concat(String(e));
271
- }
272
- function Pt(e, r, a) {
273
- return e.substr(0, r.length) === r;
274
- }
275
- function Lt(e, r, a) {
276
- return (a === void 0 || a > e.length) && (a = e.length), e.substring(a - r.length, a) === r;
277
- }
278
- function Ct(e, r, a) {
279
- return typeof a != "number" && (a = 0), a + r.length > e.length ? !1 : e.indexOf(r, a) !== -1;
280
- }
281
- B("ERR_INVALID_OPT_VALUE", function(e, r) {
282
- return 'The value "' + r + '" is invalid for option "' + e + '"';
283
- }, TypeError);
284
- B("ERR_INVALID_ARG_TYPE", function(e, r, a) {
285
- var l;
286
- typeof r == "string" && Pt(r, "not ") ? (l = "must not be", r = r.replace(/^not /, "")) : l = "must be";
287
- var f;
288
- if (Lt(e, " argument"))
289
- f = "The ".concat(e, " ").concat(l, " ").concat(Ge(r, "type"));
290
- else {
291
- var _ = Ct(e, ".") ? "property" : "argument";
292
- f = 'The "'.concat(e, '" ').concat(_, " ").concat(l, " ").concat(Ge(r, "type"));
293
- }
294
- return f += ". Received type ".concat(typeof a), f;
295
- }, TypeError);
296
- B("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
297
- B("ERR_METHOD_NOT_IMPLEMENTED", function(e) {
298
- return "The " + e + " method is not implemented";
299
- });
300
- B("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
301
- B("ERR_STREAM_DESTROYED", function(e) {
302
- return "Cannot call " + e + " after a stream was destroyed";
303
- });
304
- B("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
305
- B("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
306
- B("ERR_STREAM_WRITE_AFTER_END", "write after end");
307
- B("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
308
- B("ERR_UNKNOWN_ENCODING", function(e) {
309
- return "Unknown encoding: " + e;
310
- }, TypeError);
311
- B("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
312
- X.codes = ft;
313
- var Nt = X.codes.ERR_INVALID_OPT_VALUE;
314
- function Dt(e, r, a) {
315
- return e.highWaterMark != null ? e.highWaterMark : r ? e[a] : null;
316
- }
317
- function qt(e, r, a, l) {
318
- var f = Dt(r, l, a);
319
- if (f != null) {
320
- if (!(isFinite(f) && Math.floor(f) === f) || f < 0) {
321
- var _ = l ? a : "highWaterMark";
322
- throw new Nt(_, f);
323
- }
324
- return Math.floor(f);
325
- }
326
- return e.objectMode ? 16 : 16 * 1024;
327
- }
328
- var lt = {
329
- getHighWaterMark: qt
330
- }, Te, $e;
331
- function ut() {
332
- if ($e) return Te;
333
- $e = 1, Te = D;
334
- function e(o) {
335
- var i = this;
336
- this.next = null, this.entry = null, this.finish = function() {
337
- we(i, o);
338
- };
339
- }
340
- var r;
341
- D.WritableState = O;
342
- var a = {
343
- deprecate: Rt
344
- }, l = at, f = De.Buffer, _ = (typeof U < "u" ? U : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
345
- };
346
- function h(o) {
347
- return f.from(o);
348
- }
349
- function c(o) {
350
- return f.isBuffer(o) || o instanceof _;
351
- }
352
- var d = ot, R = lt, P = R.getHighWaterMark, b = X.codes, C = b.ERR_INVALID_ARG_TYPE, j = b.ERR_METHOD_NOT_IMPLEMENTED, w = b.ERR_MULTIPLE_CALLBACK, E = b.ERR_STREAM_CANNOT_PIPE, y = b.ERR_STREAM_DESTROYED, v = b.ERR_STREAM_NULL_VALUES, A = b.ERR_STREAM_WRITE_AFTER_END, S = b.ERR_UNKNOWN_ENCODING, g = d.errorOrDestroy;
353
- Y(D, l);
354
- function T() {
355
- }
356
- function O(o, i, s) {
357
- r = r || te(), o = o || {}, typeof s != "boolean" && (s = i instanceof r), this.objectMode = !!o.objectMode, s && (this.objectMode = this.objectMode || !!o.writableObjectMode), this.highWaterMark = P(this, o, "writableHighWaterMark", s), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
358
- var m = o.decodeStrings === !1;
359
- this.decodeStrings = !m, this.defaultEncoding = o.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(N) {
360
- ye(i, N);
361
- }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = o.emitClose !== !1, this.autoDestroy = !!o.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this);
362
- }
363
- O.prototype.getBuffer = function() {
364
- for (var i = this.bufferedRequest, s = []; i; )
365
- s.push(i), i = i.next;
366
- return s;
367
- }, function() {
368
- try {
369
- Object.defineProperty(O.prototype, "buffer", {
370
- get: a.deprecate(function() {
371
- return this.getBuffer();
372
- }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
373
- });
374
- } catch {
375
- }
376
- }();
377
- var H;
378
- typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (H = Function.prototype[Symbol.hasInstance], Object.defineProperty(D, Symbol.hasInstance, {
379
- value: function(i) {
380
- return H.call(this, i) ? !0 : this !== D ? !1 : i && i._writableState instanceof O;
381
- }
382
- })) : H = function(i) {
383
- return i instanceof this;
384
- };
385
- function D(o) {
386
- r = r || te();
387
- var i = this instanceof r;
388
- if (!i && !H.call(D, this)) return new D(o);
389
- this._writableState = new O(o, this, i), this.writable = !0, o && (typeof o.write == "function" && (this._write = o.write), typeof o.writev == "function" && (this._writev = o.writev), typeof o.destroy == "function" && (this._destroy = o.destroy), typeof o.final == "function" && (this._final = o.final)), l.call(this);
390
- }
391
- D.prototype.pipe = function() {
392
- g(this, new E());
393
- };
394
- function M(o, i) {
395
- var s = new A();
396
- g(o, s), q.nextTick(i, s);
397
- }
398
- function W(o, i, s, m) {
399
- var N;
400
- return s === null ? N = new v() : typeof s != "string" && !i.objectMode && (N = new C("chunk", ["string", "Buffer"], s)), N ? (g(o, N), q.nextTick(m, N), !1) : !0;
401
- }
402
- D.prototype.write = function(o, i, s) {
403
- var m = this._writableState, N = !1, t = !m.objectMode && c(o);
404
- return t && !f.isBuffer(o) && (o = h(o)), typeof i == "function" && (s = i, i = null), t ? i = "buffer" : i || (i = m.defaultEncoding), typeof s != "function" && (s = T), m.ending ? M(this, s) : (t || W(this, m, o, s)) && (m.pendingcb++, N = _e(this, m, t, o, i, s)), N;
405
- }, D.prototype.cork = function() {
406
- this._writableState.corked++;
407
- }, D.prototype.uncork = function() {
408
- var o = this._writableState;
409
- o.corked && (o.corked--, !o.writing && !o.corked && !o.bufferProcessing && o.bufferedRequest && J(this, o));
410
- }, D.prototype.setDefaultEncoding = function(i) {
411
- if (typeof i == "string" && (i = i.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((i + "").toLowerCase()) > -1)) throw new S(i);
412
- return this._writableState.defaultEncoding = i, this;
413
- }, Object.defineProperty(D.prototype, "writableBuffer", {
414
- // making it explicit this property is not enumerable
415
- // because otherwise some prototype manipulation in
416
- // userland will fail
417
- enumerable: !1,
418
- get: function() {
419
- return this._writableState && this._writableState.getBuffer();
420
- }
421
- });
422
- function re(o, i, s) {
423
- return !o.objectMode && o.decodeStrings !== !1 && typeof i == "string" && (i = f.from(i, s)), i;
424
- }
425
- Object.defineProperty(D.prototype, "writableHighWaterMark", {
426
- // making it explicit this property is not enumerable
427
- // because otherwise some prototype manipulation in
428
- // userland will fail
429
- enumerable: !1,
430
- get: function() {
431
- return this._writableState.highWaterMark;
432
- }
433
- });
434
- function _e(o, i, s, m, N, t) {
435
- if (!s) {
436
- var n = re(i, m, N);
437
- m !== n && (s = !0, N = "buffer", m = n);
438
- }
439
- var u = i.objectMode ? 1 : m.length;
440
- i.length += u;
441
- var p = i.length < i.highWaterMark;
442
- if (p || (i.needDrain = !0), i.writing || i.corked) {
443
- var k = i.lastBufferedRequest;
444
- i.lastBufferedRequest = {
445
- chunk: m,
446
- encoding: N,
447
- isBuf: s,
448
- callback: t,
449
- next: null
450
- }, k ? k.next = i.lastBufferedRequest : i.bufferedRequest = i.lastBufferedRequest, i.bufferedRequestCount += 1;
451
- } else
452
- z(o, i, !1, u, m, N, t);
453
- return p;
454
- }
455
- function z(o, i, s, m, N, t, n) {
456
- i.writelen = m, i.writecb = n, i.writing = !0, i.sync = !0, i.destroyed ? i.onwrite(new y("write")) : s ? o._writev(N, i.onwrite) : o._write(N, t, i.onwrite), i.sync = !1;
457
- }
458
- function be(o, i, s, m, N) {
459
- --i.pendingcb, s ? (q.nextTick(N, m), q.nextTick($, o, i), o._writableState.errorEmitted = !0, g(o, m)) : (N(m), o._writableState.errorEmitted = !0, g(o, m), $(o, i));
460
- }
461
- function ae(o) {
462
- o.writing = !1, o.writecb = null, o.length -= o.writelen, o.writelen = 0;
463
- }
464
- function ye(o, i) {
465
- var s = o._writableState, m = s.sync, N = s.writecb;
466
- if (typeof N != "function") throw new w();
467
- if (ae(s), i) be(o, s, m, i, N);
468
- else {
469
- var t = fe(s) || o.destroyed;
470
- !t && !s.corked && !s.bufferProcessing && s.bufferedRequest && J(o, s), m ? q.nextTick(G, o, s, t, N) : G(o, s, t, N);
471
- }
472
- }
473
- function G(o, i, s, m) {
474
- s || oe(o, i), i.pendingcb--, m(), $(o, i);
475
- }
476
- function oe(o, i) {
477
- i.length === 0 && i.needDrain && (i.needDrain = !1, o.emit("drain"));
478
- }
479
- function J(o, i) {
480
- i.bufferProcessing = !0;
481
- var s = i.bufferedRequest;
482
- if (o._writev && s && s.next) {
483
- var m = i.bufferedRequestCount, N = new Array(m), t = i.corkedRequestsFree;
484
- t.entry = s;
485
- for (var n = 0, u = !0; s; )
486
- N[n] = s, s.isBuf || (u = !1), s = s.next, n += 1;
487
- N.allBuffers = u, z(o, i, !0, i.length, N, "", t.finish), i.pendingcb++, i.lastBufferedRequest = null, t.next ? (i.corkedRequestsFree = t.next, t.next = null) : i.corkedRequestsFree = new e(i), i.bufferedRequestCount = 0;
488
- } else {
489
- for (; s; ) {
490
- var p = s.chunk, k = s.encoding, L = s.callback, I = i.objectMode ? 1 : p.length;
491
- if (z(o, i, !1, I, p, k, L), s = s.next, i.bufferedRequestCount--, i.writing)
492
- break;
493
- }
494
- s === null && (i.lastBufferedRequest = null);
495
- }
496
- i.bufferedRequest = s, i.bufferProcessing = !1;
497
- }
498
- D.prototype._write = function(o, i, s) {
499
- s(new j("_write()"));
500
- }, D.prototype._writev = null, D.prototype.end = function(o, i, s) {
501
- var m = this._writableState;
502
- return typeof o == "function" ? (s = o, o = null, i = null) : typeof i == "function" && (s = i, i = null), o != null && this.write(o, i), m.corked && (m.corked = 1, this.uncork()), m.ending || ge(this, m, s), this;
503
- }, Object.defineProperty(D.prototype, "writableLength", {
504
- // making it explicit this property is not enumerable
505
- // because otherwise some prototype manipulation in
506
- // userland will fail
507
- enumerable: !1,
508
- get: function() {
509
- return this._writableState.length;
510
- }
511
- });
512
- function fe(o) {
513
- return o.ending && o.length === 0 && o.bufferedRequest === null && !o.finished && !o.writing;
514
- }
515
- function ve(o, i) {
516
- o._final(function(s) {
517
- i.pendingcb--, s && g(o, s), i.prefinished = !0, o.emit("prefinish"), $(o, i);
518
- });
519
- }
520
- function le(o, i) {
521
- !i.prefinished && !i.finalCalled && (typeof o._final == "function" && !i.destroyed ? (i.pendingcb++, i.finalCalled = !0, q.nextTick(ve, o, i)) : (i.prefinished = !0, o.emit("prefinish")));
522
- }
523
- function $(o, i) {
524
- var s = fe(i);
525
- if (s && (le(o, i), i.pendingcb === 0 && (i.finished = !0, o.emit("finish"), i.autoDestroy))) {
526
- var m = o._readableState;
527
- (!m || m.autoDestroy && m.endEmitted) && o.destroy();
528
- }
529
- return s;
530
- }
531
- function ge(o, i, s) {
532
- i.ending = !0, $(o, i), s && (i.finished ? q.nextTick(s) : o.once("finish", s)), i.ended = !0, o.writable = !1;
533
- }
534
- function we(o, i, s) {
535
- var m = o.entry;
536
- for (o.entry = null; m; ) {
537
- var N = m.callback;
538
- i.pendingcb--, N(s), m = m.next;
539
- }
540
- i.corkedRequestsFree.next = o;
541
- }
542
- return Object.defineProperty(D.prototype, "destroyed", {
543
- // making it explicit this property is not enumerable
544
- // because otherwise some prototype manipulation in
545
- // userland will fail
546
- enumerable: !1,
547
- get: function() {
548
- return this._writableState === void 0 ? !1 : this._writableState.destroyed;
549
- },
550
- set: function(i) {
551
- this._writableState && (this._writableState.destroyed = i);
552
- }
553
- }), D.prototype.destroy = d.destroy, D.prototype._undestroy = d.undestroy, D.prototype._destroy = function(o, i) {
554
- i(o);
555
- }, Te;
556
- }
557
- var Me, Ve;
558
- function te() {
559
- if (Ve) return Me;
560
- Ve = 1;
561
- var e = Object.keys || function(R) {
562
- var P = [];
563
- for (var b in R) P.push(b);
564
- return P;
565
- };
566
- Me = h;
567
- var r = dt(), a = ut();
568
- Y(h, r);
569
- for (var l = e(a.prototype), f = 0; f < l.length; f++) {
570
- var _ = l[f];
571
- h.prototype[_] || (h.prototype[_] = a.prototype[_]);
572
- }
573
- function h(R) {
574
- if (!(this instanceof h)) return new h(R);
575
- r.call(this, R), a.call(this, R), this.allowHalfOpen = !0, R && (R.readable === !1 && (this.readable = !1), R.writable === !1 && (this.writable = !1), R.allowHalfOpen === !1 && (this.allowHalfOpen = !1, this.once("end", c)));
576
- }
577
- Object.defineProperty(h.prototype, "writableHighWaterMark", {
578
- // making it explicit this property is not enumerable
579
- // because otherwise some prototype manipulation in
580
- // userland will fail
581
- enumerable: !1,
582
- get: function() {
583
- return this._writableState.highWaterMark;
584
- }
585
- }), Object.defineProperty(h.prototype, "writableBuffer", {
586
- // making it explicit this property is not enumerable
587
- // because otherwise some prototype manipulation in
588
- // userland will fail
589
- enumerable: !1,
590
- get: function() {
591
- return this._writableState && this._writableState.getBuffer();
592
- }
593
- }), Object.defineProperty(h.prototype, "writableLength", {
594
- // making it explicit this property is not enumerable
595
- // because otherwise some prototype manipulation in
596
- // userland will fail
597
- enumerable: !1,
598
- get: function() {
599
- return this._writableState.length;
600
- }
601
- });
602
- function c() {
603
- this._writableState.ended || q.nextTick(d, this);
604
- }
605
- function d(R) {
606
- R.end();
607
- }
608
- return Object.defineProperty(h.prototype, "destroyed", {
609
- // making it explicit this property is not enumerable
610
- // because otherwise some prototype manipulation in
611
- // userland will fail
612
- enumerable: !1,
613
- get: function() {
614
- return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed;
615
- },
616
- set: function(P) {
617
- this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = P, this._writableState.destroyed = P);
618
- }
619
- }), Me;
620
- }
621
- var Ke = X.codes.ERR_STREAM_PREMATURE_CLOSE;
622
- function It(e) {
623
- var r = !1;
624
- return function() {
625
- if (!r) {
626
- r = !0;
627
- for (var a = arguments.length, l = new Array(a), f = 0; f < a; f++)
628
- l[f] = arguments[f];
629
- e.apply(this, l);
630
- }
631
- };
632
- }
633
- function kt() {
634
- }
635
- function jt(e) {
636
- return e.setHeader && typeof e.abort == "function";
637
- }
638
- function st(e, r, a) {
639
- if (typeof r == "function") return st(e, null, r);
640
- r || (r = {}), a = It(a || kt);
641
- var l = r.readable || r.readable !== !1 && e.readable, f = r.writable || r.writable !== !1 && e.writable, _ = function() {
642
- e.writable || c();
643
- }, h = e._writableState && e._writableState.finished, c = function() {
644
- f = !1, h = !0, l || a.call(e);
645
- }, d = e._readableState && e._readableState.endEmitted, R = function() {
646
- l = !1, d = !0, f || a.call(e);
647
- }, P = function(w) {
648
- a.call(e, w);
649
- }, b = function() {
650
- var w;
651
- if (l && !d)
652
- return (!e._readableState || !e._readableState.ended) && (w = new Ke()), a.call(e, w);
653
- if (f && !h)
654
- return (!e._writableState || !e._writableState.ended) && (w = new Ke()), a.call(e, w);
655
- }, C = function() {
656
- e.req.on("finish", c);
657
- };
658
- return jt(e) ? (e.on("complete", c), e.on("abort", b), e.req ? C() : e.on("request", C)) : f && !e._writableState && (e.on("end", _), e.on("close", _)), e.on("end", R), e.on("finish", c), r.error !== !1 && e.on("error", P), e.on("close", b), function() {
659
- e.removeListener("complete", c), e.removeListener("abort", b), e.removeListener("request", C), e.req && e.req.removeListener("finish", c), e.removeListener("end", _), e.removeListener("close", _), e.removeListener("finish", c), e.removeListener("end", R), e.removeListener("error", P), e.removeListener("close", b);
660
- };
661
- }
662
- var ke = st, Ae, Ye;
663
- function Ht() {
664
- if (Ye) return Ae;
665
- Ye = 1;
666
- var e;
667
- function r(S, g, T) {
668
- return g = a(g), g in S ? Object.defineProperty(S, g, { value: T, enumerable: !0, configurable: !0, writable: !0 }) : S[g] = T, S;
669
- }
670
- function a(S) {
671
- var g = l(S, "string");
672
- return typeof g == "symbol" ? g : String(g);
673
- }
674
- function l(S, g) {
675
- if (typeof S != "object" || S === null) return S;
676
- var T = S[Symbol.toPrimitive];
677
- if (T !== void 0) {
678
- var O = T.call(S, g);
679
- if (typeof O != "object") return O;
680
- throw new TypeError("@@toPrimitive must return a primitive value.");
681
- }
682
- return (g === "string" ? String : Number)(S);
683
- }
684
- var f = ke, _ = Symbol("lastResolve"), h = Symbol("lastReject"), c = Symbol("error"), d = Symbol("ended"), R = Symbol("lastPromise"), P = Symbol("handlePromise"), b = Symbol("stream");
685
- function C(S, g) {
686
- return {
687
- value: S,
688
- done: g
689
- };
690
- }
691
- function j(S) {
692
- var g = S[_];
693
- if (g !== null) {
694
- var T = S[b].read();
695
- T !== null && (S[R] = null, S[_] = null, S[h] = null, g(C(T, !1)));
696
- }
697
- }
698
- function w(S) {
699
- q.nextTick(j, S);
700
- }
701
- function E(S, g) {
702
- return function(T, O) {
703
- S.then(function() {
704
- if (g[d]) {
705
- T(C(void 0, !0));
706
- return;
707
- }
708
- g[P](T, O);
709
- }, O);
710
- };
711
- }
712
- var y = Object.getPrototypeOf(function() {
713
- }), v = Object.setPrototypeOf((e = {
714
- get stream() {
715
- return this[b];
716
- },
717
- next: function() {
718
- var g = this, T = this[c];
719
- if (T !== null)
720
- return Promise.reject(T);
721
- if (this[d])
722
- return Promise.resolve(C(void 0, !0));
723
- if (this[b].destroyed)
724
- return new Promise(function(M, W) {
725
- q.nextTick(function() {
726
- g[c] ? W(g[c]) : M(C(void 0, !0));
727
- });
728
- });
729
- var O = this[R], H;
730
- if (O)
731
- H = new Promise(E(O, this));
732
- else {
733
- var D = this[b].read();
734
- if (D !== null)
735
- return Promise.resolve(C(D, !1));
736
- H = new Promise(this[P]);
737
- }
738
- return this[R] = H, H;
739
- }
740
- }, r(e, Symbol.asyncIterator, function() {
741
- return this;
742
- }), r(e, "return", function() {
743
- var g = this;
744
- return new Promise(function(T, O) {
745
- g[b].destroy(null, function(H) {
746
- if (H) {
747
- O(H);
748
- return;
749
- }
750
- T(C(void 0, !0));
751
- });
752
- });
753
- }), e), y), A = function(g) {
754
- var T, O = Object.create(v, (T = {}, r(T, b, {
755
- value: g,
756
- writable: !0
757
- }), r(T, _, {
758
- value: null,
759
- writable: !0
760
- }), r(T, h, {
761
- value: null,
762
- writable: !0
763
- }), r(T, c, {
764
- value: null,
765
- writable: !0
766
- }), r(T, d, {
767
- value: g._readableState.endEmitted,
768
- writable: !0
769
- }), r(T, P, {
770
- value: function(D, M) {
771
- var W = O[b].read();
772
- W ? (O[R] = null, O[_] = null, O[h] = null, D(C(W, !1))) : (O[_] = D, O[h] = M);
773
- },
774
- writable: !0
775
- }), T));
776
- return O[R] = null, f(g, function(H) {
777
- if (H && H.code !== "ERR_STREAM_PREMATURE_CLOSE") {
778
- var D = O[h];
779
- D !== null && (O[R] = null, O[_] = null, O[h] = null, D(H)), O[c] = H;
780
- return;
781
- }
782
- var M = O[_];
783
- M !== null && (O[R] = null, O[_] = null, O[h] = null, M(C(void 0, !0))), O[d] = !0;
784
- }), g.on("readable", w.bind(null, O)), O;
785
- };
786
- return Ae = A, Ae;
787
- }
788
- var Oe, Xe;
789
- function Ut() {
790
- return Xe || (Xe = 1, Oe = function() {
791
- throw new Error("Readable.from is not available in the browser");
792
- }), Oe;
793
- }
794
- var Pe, ze;
795
- function dt() {
796
- if (ze) return Pe;
797
- ze = 1, Pe = M;
798
- var e;
799
- M.ReadableState = D, rt.EventEmitter;
800
- var r = function(n, u) {
801
- return n.listeners(u).length;
802
- }, a = at, l = De.Buffer, f = (typeof U < "u" ? U : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
803
- };
804
- function _(t) {
805
- return l.from(t);
806
- }
807
- function h(t) {
808
- return l.isBuffer(t) || t instanceof f;
809
- }
810
- var c = nt, d;
811
- c && c.debuglog ? d = c.debuglog("stream") : d = function() {
812
- };
813
- var R = St(), P = ot, b = lt, C = b.getHighWaterMark, j = X.codes, w = j.ERR_INVALID_ARG_TYPE, E = j.ERR_STREAM_PUSH_AFTER_EOF, y = j.ERR_METHOD_NOT_IMPLEMENTED, v = j.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, A, S, g;
814
- Y(M, a);
815
- var T = P.errorOrDestroy, O = ["error", "close", "destroy", "pause", "resume"];
816
- function H(t, n, u) {
817
- if (typeof t.prependListener == "function") return t.prependListener(n, u);
818
- !t._events || !t._events[n] ? t.on(n, u) : Array.isArray(t._events[n]) ? t._events[n].unshift(u) : t._events[n] = [u, t._events[n]];
819
- }
820
- function D(t, n, u) {
821
- e = e || te(), t = t || {}, typeof u != "boolean" && (u = n instanceof e), this.objectMode = !!t.objectMode, u && (this.objectMode = this.objectMode || !!t.readableObjectMode), this.highWaterMark = C(this, t, "readableHighWaterMark", u), this.buffer = new R(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = t.emitClose !== !1, this.autoDestroy = !!t.autoDestroy, this.destroyed = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (A || (A = Be().StringDecoder), this.decoder = new A(t.encoding), this.encoding = t.encoding);
822
- }
823
- function M(t) {
824
- if (e = e || te(), !(this instanceof M)) return new M(t);
825
- var n = this instanceof e;
826
- this._readableState = new D(t, this, n), this.readable = !0, t && (typeof t.read == "function" && (this._read = t.read), typeof t.destroy == "function" && (this._destroy = t.destroy)), a.call(this);
827
- }
828
- Object.defineProperty(M.prototype, "destroyed", {
829
- // making it explicit this property is not enumerable
830
- // because otherwise some prototype manipulation in
831
- // userland will fail
832
- enumerable: !1,
833
- get: function() {
834
- return this._readableState === void 0 ? !1 : this._readableState.destroyed;
835
- },
836
- set: function(n) {
837
- this._readableState && (this._readableState.destroyed = n);
838
- }
839
- }), M.prototype.destroy = P.destroy, M.prototype._undestroy = P.undestroy, M.prototype._destroy = function(t, n) {
840
- n(t);
841
- }, M.prototype.push = function(t, n) {
842
- var u = this._readableState, p;
843
- return u.objectMode ? p = !0 : typeof t == "string" && (n = n || u.defaultEncoding, n !== u.encoding && (t = l.from(t, n), n = ""), p = !0), W(this, t, n, !1, p);
844
- }, M.prototype.unshift = function(t) {
845
- return W(this, t, null, !0, !1);
846
- };
847
- function W(t, n, u, p, k) {
848
- d("readableAddChunk", n);
849
- var L = t._readableState;
850
- if (n === null)
851
- L.reading = !1, ye(t, L);
852
- else {
853
- var I;
854
- if (k || (I = _e(L, n)), I)
855
- T(t, I);
856
- else if (L.objectMode || n && n.length > 0)
857
- if (typeof n != "string" && !L.objectMode && Object.getPrototypeOf(n) !== l.prototype && (n = _(n)), p)
858
- L.endEmitted ? T(t, new v()) : re(t, L, n, !0);
859
- else if (L.ended)
860
- T(t, new E());
861
- else {
862
- if (L.destroyed)
863
- return !1;
864
- L.reading = !1, L.decoder && !u ? (n = L.decoder.write(n), L.objectMode || n.length !== 0 ? re(t, L, n, !1) : J(t, L)) : re(t, L, n, !1);
865
- }
866
- else p || (L.reading = !1, J(t, L));
867
- }
868
- return !L.ended && (L.length < L.highWaterMark || L.length === 0);
869
- }
870
- function re(t, n, u, p) {
871
- n.flowing && n.length === 0 && !n.sync ? (n.awaitDrain = 0, t.emit("data", u)) : (n.length += n.objectMode ? 1 : u.length, p ? n.buffer.unshift(u) : n.buffer.push(u), n.needReadable && G(t)), J(t, n);
872
- }
873
- function _e(t, n) {
874
- var u;
875
- return !h(n) && typeof n != "string" && n !== void 0 && !t.objectMode && (u = new w("chunk", ["string", "Buffer", "Uint8Array"], n)), u;
876
- }
877
- M.prototype.isPaused = function() {
878
- return this._readableState.flowing === !1;
879
- }, M.prototype.setEncoding = function(t) {
880
- A || (A = Be().StringDecoder);
881
- var n = new A(t);
882
- this._readableState.decoder = n, this._readableState.encoding = this._readableState.decoder.encoding;
883
- for (var u = this._readableState.buffer.head, p = ""; u !== null; )
884
- p += n.write(u.data), u = u.next;
885
- return this._readableState.buffer.clear(), p !== "" && this._readableState.buffer.push(p), this._readableState.length = p.length, this;
886
- };
887
- var z = 1073741824;
888
- function be(t) {
889
- return t >= z ? t = z : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;
890
- }
891
- function ae(t, n) {
892
- return t <= 0 || n.length === 0 && n.ended ? 0 : n.objectMode ? 1 : t !== t ? n.flowing && n.length ? n.buffer.head.data.length : n.length : (t > n.highWaterMark && (n.highWaterMark = be(t)), t <= n.length ? t : n.ended ? n.length : (n.needReadable = !0, 0));
893
- }
894
- M.prototype.read = function(t) {
895
- d("read", t), t = parseInt(t, 10);
896
- var n = this._readableState, u = t;
897
- if (t !== 0 && (n.emittedReadable = !1), t === 0 && n.needReadable && ((n.highWaterMark !== 0 ? n.length >= n.highWaterMark : n.length > 0) || n.ended))
898
- return d("read: emitReadable", n.length, n.ended), n.length === 0 && n.ended ? s(this) : G(this), null;
899
- if (t = ae(t, n), t === 0 && n.ended)
900
- return n.length === 0 && s(this), null;
901
- var p = n.needReadable;
902
- d("need readable", p), (n.length === 0 || n.length - t < n.highWaterMark) && (p = !0, d("length less than watermark", p)), n.ended || n.reading ? (p = !1, d("reading or ended", p)) : p && (d("do read"), n.reading = !0, n.sync = !0, n.length === 0 && (n.needReadable = !0), this._read(n.highWaterMark), n.sync = !1, n.reading || (t = ae(u, n)));
903
- var k;
904
- return t > 0 ? k = i(t, n) : k = null, k === null ? (n.needReadable = n.length <= n.highWaterMark, t = 0) : (n.length -= t, n.awaitDrain = 0), n.length === 0 && (n.ended || (n.needReadable = !0), u !== t && n.ended && s(this)), k !== null && this.emit("data", k), k;
905
- };
906
- function ye(t, n) {
907
- if (d("onEofChunk"), !n.ended) {
908
- if (n.decoder) {
909
- var u = n.decoder.end();
910
- u && u.length && (n.buffer.push(u), n.length += n.objectMode ? 1 : u.length);
911
- }
912
- n.ended = !0, n.sync ? G(t) : (n.needReadable = !1, n.emittedReadable || (n.emittedReadable = !0, oe(t)));
913
- }
914
- }
915
- function G(t) {
916
- var n = t._readableState;
917
- d("emitReadable", n.needReadable, n.emittedReadable), n.needReadable = !1, n.emittedReadable || (d("emitReadable", n.flowing), n.emittedReadable = !0, q.nextTick(oe, t));
918
- }
919
- function oe(t) {
920
- var n = t._readableState;
921
- d("emitReadable_", n.destroyed, n.length, n.ended), !n.destroyed && (n.length || n.ended) && (t.emit("readable"), n.emittedReadable = !1), n.needReadable = !n.flowing && !n.ended && n.length <= n.highWaterMark, o(t);
922
- }
923
- function J(t, n) {
924
- n.readingMore || (n.readingMore = !0, q.nextTick(fe, t, n));
925
- }
926
- function fe(t, n) {
927
- for (; !n.reading && !n.ended && (n.length < n.highWaterMark || n.flowing && n.length === 0); ) {
928
- var u = n.length;
929
- if (d("maybeReadMore read 0"), t.read(0), u === n.length)
930
- break;
931
- }
932
- n.readingMore = !1;
933
- }
934
- M.prototype._read = function(t) {
935
- T(this, new y("_read()"));
936
- }, M.prototype.pipe = function(t, n) {
937
- var u = this, p = this._readableState;
938
- switch (p.pipesCount) {
939
- case 0:
940
- p.pipes = t;
941
- break;
942
- case 1:
943
- p.pipes = [p.pipes, t];
944
- break;
945
- default:
946
- p.pipes.push(t);
947
- break;
948
- }
949
- p.pipesCount += 1, d("pipe count=%d opts=%j", p.pipesCount, n);
950
- var k = (!n || n.end !== !1) && t !== q.stdout && t !== q.stderr, L = k ? Q : ne;
951
- p.endEmitted ? q.nextTick(L) : u.once("end", L), t.on("unpipe", I);
952
- function I(Z, ee) {
953
- d("onunpipe"), Z === u && ee && ee.hasUnpiped === !1 && (ee.hasUnpiped = !0, vt());
954
- }
955
- function Q() {
956
- d("onend"), t.end();
957
- }
958
- var ue = ve(u);
959
- t.on("drain", ue);
960
- var Ue = !1;
961
- function vt() {
962
- d("cleanup"), t.removeListener("close", me), t.removeListener("finish", Ee), t.removeListener("drain", ue), t.removeListener("error", Re), t.removeListener("unpipe", I), u.removeListener("end", Q), u.removeListener("end", ne), u.removeListener("data", xe), Ue = !0, p.awaitDrain && (!t._writableState || t._writableState.needDrain) && ue();
963
- }
964
- u.on("data", xe);
965
- function xe(Z) {
966
- d("ondata");
967
- var ee = t.write(Z);
968
- d("dest.write", ee), ee === !1 && ((p.pipesCount === 1 && p.pipes === t || p.pipesCount > 1 && N(p.pipes, t) !== -1) && !Ue && (d("false write response, pause", p.awaitDrain), p.awaitDrain++), u.pause());
969
- }
970
- function Re(Z) {
971
- d("onerror", Z), ne(), t.removeListener("error", Re), r(t, "error") === 0 && T(t, Z);
972
- }
973
- H(t, "error", Re);
974
- function me() {
975
- t.removeListener("finish", Ee), ne();
976
- }
977
- t.once("close", me);
978
- function Ee() {
979
- d("onfinish"), t.removeListener("close", me), ne();
980
- }
981
- t.once("finish", Ee);
982
- function ne() {
983
- d("unpipe"), u.unpipe(t);
984
- }
985
- return t.emit("pipe", u), p.flowing || (d("pipe resume"), u.resume()), t;
986
- };
987
- function ve(t) {
988
- return function() {
989
- var u = t._readableState;
990
- d("pipeOnDrain", u.awaitDrain), u.awaitDrain && u.awaitDrain--, u.awaitDrain === 0 && r(t, "data") && (u.flowing = !0, o(t));
991
- };
992
- }
993
- M.prototype.unpipe = function(t) {
994
- var n = this._readableState, u = {
995
- hasUnpiped: !1
996
- };
997
- if (n.pipesCount === 0) return this;
998
- if (n.pipesCount === 1)
999
- return t && t !== n.pipes ? this : (t || (t = n.pipes), n.pipes = null, n.pipesCount = 0, n.flowing = !1, t && t.emit("unpipe", this, u), this);
1000
- if (!t) {
1001
- var p = n.pipes, k = n.pipesCount;
1002
- n.pipes = null, n.pipesCount = 0, n.flowing = !1;
1003
- for (var L = 0; L < k; L++) p[L].emit("unpipe", this, {
1004
- hasUnpiped: !1
1005
- });
1006
- return this;
1007
- }
1008
- var I = N(n.pipes, t);
1009
- return I === -1 ? this : (n.pipes.splice(I, 1), n.pipesCount -= 1, n.pipesCount === 1 && (n.pipes = n.pipes[0]), t.emit("unpipe", this, u), this);
1010
- }, M.prototype.on = function(t, n) {
1011
- var u = a.prototype.on.call(this, t, n), p = this._readableState;
1012
- return t === "data" ? (p.readableListening = this.listenerCount("readable") > 0, p.flowing !== !1 && this.resume()) : t === "readable" && !p.endEmitted && !p.readableListening && (p.readableListening = p.needReadable = !0, p.flowing = !1, p.emittedReadable = !1, d("on readable", p.length, p.reading), p.length ? G(this) : p.reading || q.nextTick($, this)), u;
1013
- }, M.prototype.addListener = M.prototype.on, M.prototype.removeListener = function(t, n) {
1014
- var u = a.prototype.removeListener.call(this, t, n);
1015
- return t === "readable" && q.nextTick(le, this), u;
1016
- }, M.prototype.removeAllListeners = function(t) {
1017
- var n = a.prototype.removeAllListeners.apply(this, arguments);
1018
- return (t === "readable" || t === void 0) && q.nextTick(le, this), n;
1019
- };
1020
- function le(t) {
1021
- var n = t._readableState;
1022
- n.readableListening = t.listenerCount("readable") > 0, n.resumeScheduled && !n.paused ? n.flowing = !0 : t.listenerCount("data") > 0 && t.resume();
1023
- }
1024
- function $(t) {
1025
- d("readable nexttick read 0"), t.read(0);
1026
- }
1027
- M.prototype.resume = function() {
1028
- var t = this._readableState;
1029
- return t.flowing || (d("resume"), t.flowing = !t.readableListening, ge(this, t)), t.paused = !1, this;
1030
- };
1031
- function ge(t, n) {
1032
- n.resumeScheduled || (n.resumeScheduled = !0, q.nextTick(we, t, n));
1033
- }
1034
- function we(t, n) {
1035
- d("resume", n.reading), n.reading || t.read(0), n.resumeScheduled = !1, t.emit("resume"), o(t), n.flowing && !n.reading && t.read(0);
1036
- }
1037
- M.prototype.pause = function() {
1038
- return d("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (d("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this;
1039
- };
1040
- function o(t) {
1041
- var n = t._readableState;
1042
- for (d("flow", n.flowing); n.flowing && t.read() !== null; ) ;
1043
- }
1044
- M.prototype.wrap = function(t) {
1045
- var n = this, u = this._readableState, p = !1;
1046
- t.on("end", function() {
1047
- if (d("wrapped end"), u.decoder && !u.ended) {
1048
- var I = u.decoder.end();
1049
- I && I.length && n.push(I);
1050
- }
1051
- n.push(null);
1052
- }), t.on("data", function(I) {
1053
- if (d("wrapped data"), u.decoder && (I = u.decoder.write(I)), !(u.objectMode && I == null) && !(!u.objectMode && (!I || !I.length))) {
1054
- var Q = n.push(I);
1055
- Q || (p = !0, t.pause());
1056
- }
1057
- });
1058
- for (var k in t)
1059
- this[k] === void 0 && typeof t[k] == "function" && (this[k] = /* @__PURE__ */ function(Q) {
1060
- return function() {
1061
- return t[Q].apply(t, arguments);
1062
- };
1063
- }(k));
1064
- for (var L = 0; L < O.length; L++)
1065
- t.on(O[L], this.emit.bind(this, O[L]));
1066
- return this._read = function(I) {
1067
- d("wrapped _read", I), p && (p = !1, t.resume());
1068
- }, this;
1069
- }, typeof Symbol == "function" && (M.prototype[Symbol.asyncIterator] = function() {
1070
- return S === void 0 && (S = Ht()), S(this);
1071
- }), Object.defineProperty(M.prototype, "readableHighWaterMark", {
1072
- // making it explicit this property is not enumerable
1073
- // because otherwise some prototype manipulation in
1074
- // userland will fail
1075
- enumerable: !1,
1076
- get: function() {
1077
- return this._readableState.highWaterMark;
1078
- }
1079
- }), Object.defineProperty(M.prototype, "readableBuffer", {
1080
- // making it explicit this property is not enumerable
1081
- // because otherwise some prototype manipulation in
1082
- // userland will fail
1083
- enumerable: !1,
1084
- get: function() {
1085
- return this._readableState && this._readableState.buffer;
1086
- }
1087
- }), Object.defineProperty(M.prototype, "readableFlowing", {
1088
- // making it explicit this property is not enumerable
1089
- // because otherwise some prototype manipulation in
1090
- // userland will fail
1091
- enumerable: !1,
1092
- get: function() {
1093
- return this._readableState.flowing;
1094
- },
1095
- set: function(n) {
1096
- this._readableState && (this._readableState.flowing = n);
1097
- }
1098
- }), M._fromList = i, Object.defineProperty(M.prototype, "readableLength", {
1099
- // making it explicit this property is not enumerable
1100
- // because otherwise some prototype manipulation in
1101
- // userland will fail
1102
- enumerable: !1,
1103
- get: function() {
1104
- return this._readableState.length;
1105
- }
1106
- });
1107
- function i(t, n) {
1108
- if (n.length === 0) return null;
1109
- var u;
1110
- return n.objectMode ? u = n.buffer.shift() : !t || t >= n.length ? (n.decoder ? u = n.buffer.join("") : n.buffer.length === 1 ? u = n.buffer.first() : u = n.buffer.concat(n.length), n.buffer.clear()) : u = n.buffer.consume(t, n.decoder), u;
1111
- }
1112
- function s(t) {
1113
- var n = t._readableState;
1114
- d("endReadable", n.endEmitted), n.endEmitted || (n.ended = !0, q.nextTick(m, n, t));
1115
- }
1116
- function m(t, n) {
1117
- if (d("endReadableNT", t.endEmitted, t.length), !t.endEmitted && t.length === 0 && (t.endEmitted = !0, n.readable = !1, n.emit("end"), t.autoDestroy)) {
1118
- var u = n._writableState;
1119
- (!u || u.autoDestroy && u.finished) && n.destroy();
1120
- }
1121
- }
1122
- typeof Symbol == "function" && (M.from = function(t, n) {
1123
- return g === void 0 && (g = Ut()), g(M, t, n);
1124
- });
1125
- function N(t, n) {
1126
- for (var u = 0, p = t.length; u < p; u++)
1127
- if (t[u] === n) return u;
1128
- return -1;
1129
- }
1130
- return Pe;
1131
- }
1132
- var ct = F, he = X.codes, xt = he.ERR_METHOD_NOT_IMPLEMENTED, Bt = he.ERR_MULTIPLE_CALLBACK, Wt = he.ERR_TRANSFORM_ALREADY_TRANSFORMING, Ft = he.ERR_TRANSFORM_WITH_LENGTH_0, pe = te();
1133
- Y(F, pe);
1134
- function Gt(e, r) {
1135
- var a = this._transformState;
1136
- a.transforming = !1;
1137
- var l = a.writecb;
1138
- if (l === null)
1139
- return this.emit("error", new Bt());
1140
- a.writechunk = null, a.writecb = null, r != null && this.push(r), l(e);
1141
- var f = this._readableState;
1142
- f.reading = !1, (f.needReadable || f.length < f.highWaterMark) && this._read(f.highWaterMark);
1143
- }
1144
- function F(e) {
1145
- if (!(this instanceof F)) return new F(e);
1146
- pe.call(this, e), this._transformState = {
1147
- afterTransform: Gt.bind(this),
1148
- needTransform: !1,
1149
- transforming: !1,
1150
- writecb: null,
1151
- writechunk: null,
1152
- writeencoding: null
1153
- }, this._readableState.needReadable = !0, this._readableState.sync = !1, e && (typeof e.transform == "function" && (this._transform = e.transform), typeof e.flush == "function" && (this._flush = e.flush)), this.on("prefinish", $t);
1154
- }
1155
- function $t() {
1156
- var e = this;
1157
- typeof this._flush == "function" && !this._readableState.destroyed ? this._flush(function(r, a) {
1158
- Je(e, r, a);
1159
- }) : Je(this, null, null);
1160
- }
1161
- F.prototype.push = function(e, r) {
1162
- return this._transformState.needTransform = !1, pe.prototype.push.call(this, e, r);
1163
- };
1164
- F.prototype._transform = function(e, r, a) {
1165
- a(new xt("_transform()"));
1166
- };
1167
- F.prototype._write = function(e, r, a) {
1168
- var l = this._transformState;
1169
- if (l.writecb = a, l.writechunk = e, l.writeencoding = r, !l.transforming) {
1170
- var f = this._readableState;
1171
- (l.needTransform || f.needReadable || f.length < f.highWaterMark) && this._read(f.highWaterMark);
1172
- }
1173
- };
1174
- F.prototype._read = function(e) {
1175
- var r = this._transformState;
1176
- r.writechunk !== null && !r.transforming ? (r.transforming = !0, this._transform(r.writechunk, r.writeencoding, r.afterTransform)) : r.needTransform = !0;
1177
- };
1178
- F.prototype._destroy = function(e, r) {
1179
- pe.prototype._destroy.call(this, e, function(a) {
1180
- r(a);
1181
- });
1182
- };
1183
- function Je(e, r, a) {
1184
- if (r) return e.emit("error", r);
1185
- if (a != null && e.push(a), e._writableState.length) throw new Ft();
1186
- if (e._transformState.transforming) throw new Wt();
1187
- return e.push(null);
1188
- }
1189
- var Vt = ie, ht = ct;
1190
- Y(ie, ht);
1191
- function ie(e) {
1192
- if (!(this instanceof ie)) return new ie(e);
1193
- ht.call(this, e);
1194
- }
1195
- ie.prototype._transform = function(e, r, a) {
1196
- a(null, e);
1197
- };
1198
- var Le;
1199
- function Kt(e) {
1200
- var r = !1;
1201
- return function() {
1202
- r || (r = !0, e.apply(void 0, arguments));
1203
- };
1204
- }
1205
- var pt = X.codes, Yt = pt.ERR_MISSING_ARGS, Xt = pt.ERR_STREAM_DESTROYED;
1206
- function Qe(e) {
1207
- if (e) throw e;
1208
- }
1209
- function zt(e) {
1210
- return e.setHeader && typeof e.abort == "function";
1211
- }
1212
- function Jt(e, r, a, l) {
1213
- l = Kt(l);
1214
- var f = !1;
1215
- e.on("close", function() {
1216
- f = !0;
1217
- }), Le === void 0 && (Le = ke), Le(e, {
1218
- readable: r,
1219
- writable: a
1220
- }, function(h) {
1221
- if (h) return l(h);
1222
- f = !0, l();
1223
- });
1224
- var _ = !1;
1225
- return function(h) {
1226
- if (!f && !_) {
1227
- if (_ = !0, zt(e)) return e.abort();
1228
- if (typeof e.destroy == "function") return e.destroy();
1229
- l(h || new Xt("pipe"));
1230
- }
1231
- };
1232
- }
1233
- function Ze(e) {
1234
- e();
1235
- }
1236
- function Qt(e, r) {
1237
- return e.pipe(r);
1238
- }
1239
- function Zt(e) {
1240
- return !e.length || typeof e[e.length - 1] != "function" ? Qe : e.pop();
1241
- }
1242
- function er() {
1243
- for (var e = arguments.length, r = new Array(e), a = 0; a < e; a++)
1244
- r[a] = arguments[a];
1245
- var l = Zt(r);
1246
- if (Array.isArray(r[0]) && (r = r[0]), r.length < 2)
1247
- throw new Yt("streams");
1248
- var f, _ = r.map(function(h, c) {
1249
- var d = c < r.length - 1, R = c > 0;
1250
- return Jt(h, d, R, function(P) {
1251
- f || (f = P), P && _.forEach(Ze), !d && (_.forEach(Ze), l(f));
1252
- });
1253
- });
1254
- return r.reduce(Qt);
1255
- }
1256
- var tr = er;
1257
- (function(e, r) {
1258
- r = e.exports = dt(), r.Stream = r, r.Readable = r, r.Writable = ut(), r.Duplex = te(), r.Transform = ct, r.PassThrough = Vt, r.finished = ke, r.pipeline = tr;
1259
- })(Ce, Ce.exports);
1260
- var _t = Ce.exports, et = Ie, rr = Y, bt = _t, se = ce.readyStates = {
1261
- UNSENT: 0,
1262
- OPENED: 1,
1263
- HEADERS_RECEIVED: 2,
1264
- LOADING: 3,
1265
- DONE: 4
1266
- }, je = ce.IncomingMessage = function(e, r, a, l) {
1267
- var f = this;
1268
- if (bt.Readable.call(f), f._mode = a, f.headers = {}, f.rawHeaders = [], f.trailers = {}, f.rawTrailers = [], f.on("end", function() {
1269
- q.nextTick(function() {
1270
- f.emit("close");
1271
- });
1272
- }), a === "fetch") {
1273
- let P = function() {
1274
- h.read().then(function(b) {
1275
- if (!f._destroyed) {
1276
- if (l(b.done), b.done) {
1277
- f.push(null);
1278
- return;
1279
- }
1280
- f.push(V.from(b.value)), P();
1281
- }
1282
- }).catch(function(b) {
1283
- l(!0), f._destroyed || f.emit("error", b);
1284
- });
1285
- };
1286
- if (f._fetchResponse = r, f.url = r.url, f.statusCode = r.status, f.statusMessage = r.statusText, r.headers.forEach(function(b, C) {
1287
- f.headers[C.toLowerCase()] = b, f.rawHeaders.push(C, b);
1288
- }), et.writableStream) {
1289
- var _ = new WritableStream({
1290
- write: function(b) {
1291
- return l(!1), new Promise(function(C, j) {
1292
- f._destroyed ? j() : f.push(V.from(b)) ? C() : f._resumeFetch = C;
1293
- });
1294
- },
1295
- close: function() {
1296
- l(!0), f._destroyed || f.push(null);
1297
- },
1298
- abort: function(b) {
1299
- l(!0), f._destroyed || f.emit("error", b);
1300
- }
1301
- });
1302
- try {
1303
- r.body.pipeTo(_).catch(function(b) {
1304
- l(!0), f._destroyed || f.emit("error", b);
1305
- });
1306
- return;
1307
- } catch {
1308
- }
1309
- }
1310
- var h = r.body.getReader();
1311
- P();
1312
- } else {
1313
- f._xhr = e, f._pos = 0, f.url = e.responseURL, f.statusCode = e.status, f.statusMessage = e.statusText;
1314
- var c = e.getAllResponseHeaders().split(/\r?\n/);
1315
- if (c.forEach(function(P) {
1316
- var b = P.match(/^([^:]+):\s*(.*)/);
1317
- if (b) {
1318
- var C = b[1].toLowerCase();
1319
- C === "set-cookie" ? (f.headers[C] === void 0 && (f.headers[C] = []), f.headers[C].push(b[2])) : f.headers[C] !== void 0 ? f.headers[C] += ", " + b[2] : f.headers[C] = b[2], f.rawHeaders.push(b[1], b[2]);
1320
- }
1321
- }), f._charset = "x-user-defined", !et.overrideMimeType) {
1322
- var d = f.rawHeaders["mime-type"];
1323
- if (d) {
1324
- var R = d.match(/;\s*charset=([^;])(;|$)/);
1325
- R && (f._charset = R[1].toLowerCase());
1326
- }
1327
- f._charset || (f._charset = "utf-8");
1328
- }
1329
- }
1330
- };
1331
- rr(je, bt.Readable);
1332
- je.prototype._read = function() {
1333
- var e = this, r = e._resumeFetch;
1334
- r && (e._resumeFetch = null, r());
1335
- };
1336
- je.prototype._onXHRProgress = function(e) {
1337
- var r = this, a = r._xhr, l = null;
1338
- switch (r._mode) {
1339
- case "text":
1340
- if (l = a.responseText, l.length > r._pos) {
1341
- var f = l.substr(r._pos);
1342
- if (r._charset === "x-user-defined") {
1343
- for (var _ = V.alloc(f.length), h = 0; h < f.length; h++)
1344
- _[h] = f.charCodeAt(h) & 255;
1345
- r.push(_);
1346
- } else
1347
- r.push(f, r._charset);
1348
- r._pos = l.length;
1349
- }
1350
- break;
1351
- case "arraybuffer":
1352
- if (a.readyState !== se.DONE || !a.response)
1353
- break;
1354
- l = a.response, r.push(V.from(new Uint8Array(l)));
1355
- break;
1356
- case "moz-chunked-arraybuffer":
1357
- if (l = a.response, a.readyState !== se.LOADING || !l)
1358
- break;
1359
- r.push(V.from(new Uint8Array(l)));
1360
- break;
1361
- case "ms-stream":
1362
- if (l = a.response, a.readyState !== se.LOADING)
1363
- break;
1364
- var c = new U.MSStreamReader();
1365
- c.onprogress = function() {
1366
- c.result.byteLength > r._pos && (r.push(V.from(new Uint8Array(c.result.slice(r._pos)))), r._pos = c.result.byteLength);
1367
- }, c.onload = function() {
1368
- e(!0), r.push(null);
1369
- }, c.readAsArrayBuffer(l);
1370
- break;
1371
- }
1372
- r._xhr.readyState === se.DONE && r._mode !== "ms-stream" && (e(!0), r.push(null));
1373
- };
1374
- var K = Ie, nr = Y, yt = ce, He = _t, ir = yt.IncomingMessage, tt = yt.readyStates;
1375
- function ar(e, r) {
1376
- return K.fetch && r ? "fetch" : K.mozchunkedarraybuffer ? "moz-chunked-arraybuffer" : K.msstream ? "ms-stream" : K.arraybuffer && e ? "arraybuffer" : "text";
1377
- }
1378
- var x = it.exports = function(e) {
1379
- var r = this;
1380
- He.Writable.call(r), r._opts = e, r._body = [], r._headers = {}, e.auth && r.setHeader("Authorization", "Basic " + V.from(e.auth).toString("base64")), Object.keys(e.headers).forEach(function(f) {
1381
- r.setHeader(f, e.headers[f]);
1382
- });
1383
- var a, l = !0;
1384
- if (e.mode === "disable-fetch" || "requestTimeout" in e && !K.abortController)
1385
- l = !1, a = !0;
1386
- else if (e.mode === "prefer-streaming")
1387
- a = !1;
1388
- else if (e.mode === "allow-wrong-content-type")
1389
- a = !K.overrideMimeType;
1390
- else if (!e.mode || e.mode === "default" || e.mode === "prefer-fast")
1391
- a = !0;
1392
- else
1393
- throw new Error("Invalid value for opts.mode");
1394
- r._mode = ar(a, l), r._fetchTimer = null, r._socketTimeout = null, r._socketTimer = null, r.on("finish", function() {
1395
- r._onFinish();
1396
- });
1397
- };
1398
- nr(x, He.Writable);
1399
- x.prototype.setHeader = function(e, r) {
1400
- var a = this, l = e.toLowerCase();
1401
- fr.indexOf(l) === -1 && (a._headers[l] = {
1402
- name: e,
1403
- value: r
1404
- });
1405
- };
1406
- x.prototype.getHeader = function(e) {
1407
- var r = this._headers[e.toLowerCase()];
1408
- return r ? r.value : null;
1409
- };
1410
- x.prototype.removeHeader = function(e) {
1411
- var r = this;
1412
- delete r._headers[e.toLowerCase()];
1413
- };
1414
- x.prototype._onFinish = function() {
1415
- var e = this;
1416
- if (!e._destroyed) {
1417
- var r = e._opts;
1418
- "timeout" in r && r.timeout !== 0 && e.setTimeout(r.timeout);
1419
- var a = e._headers, l = null;
1420
- r.method !== "GET" && r.method !== "HEAD" && (l = new Blob(e._body, {
1421
- type: (a["content-type"] || {}).value || ""
1422
- }));
1423
- var f = [];
1424
- if (Object.keys(a).forEach(function(d) {
1425
- var R = a[d].name, P = a[d].value;
1426
- Array.isArray(P) ? P.forEach(function(b) {
1427
- f.push([R, b]);
1428
- }) : f.push([R, P]);
1429
- }), e._mode === "fetch") {
1430
- var _ = null;
1431
- if (K.abortController) {
1432
- var h = new AbortController();
1433
- _ = h.signal, e._fetchAbortController = h, "requestTimeout" in r && r.requestTimeout !== 0 && (e._fetchTimer = U.setTimeout(function() {
1434
- e.emit("requestTimeout"), e._fetchAbortController && e._fetchAbortController.abort();
1435
- }, r.requestTimeout));
1436
- }
1437
- U.fetch(e._opts.url, {
1438
- method: e._opts.method,
1439
- headers: f,
1440
- body: l || void 0,
1441
- mode: "cors",
1442
- credentials: r.withCredentials ? "include" : "same-origin",
1443
- signal: _
1444
- }).then(function(d) {
1445
- e._fetchResponse = d, e._resetTimers(!1), e._connect();
1446
- }, function(d) {
1447
- e._resetTimers(!0), e._destroyed || e.emit("error", d);
1448
- });
1449
- } else {
1450
- var c = e._xhr = new U.XMLHttpRequest();
1451
- try {
1452
- c.open(e._opts.method, e._opts.url, !0);
1453
- } catch (d) {
1454
- q.nextTick(function() {
1455
- e.emit("error", d);
1456
- });
1457
- return;
1458
- }
1459
- "responseType" in c && (c.responseType = e._mode), "withCredentials" in c && (c.withCredentials = !!r.withCredentials), e._mode === "text" && "overrideMimeType" in c && c.overrideMimeType("text/plain; charset=x-user-defined"), "requestTimeout" in r && (c.timeout = r.requestTimeout, c.ontimeout = function() {
1460
- e.emit("requestTimeout");
1461
- }), f.forEach(function(d) {
1462
- c.setRequestHeader(d[0], d[1]);
1463
- }), e._response = null, c.onreadystatechange = function() {
1464
- switch (c.readyState) {
1465
- case tt.LOADING:
1466
- case tt.DONE:
1467
- e._onXHRProgress();
1468
- break;
1469
- }
1470
- }, e._mode === "moz-chunked-arraybuffer" && (c.onprogress = function() {
1471
- e._onXHRProgress();
1472
- }), c.onerror = function() {
1473
- e._destroyed || (e._resetTimers(!0), e.emit("error", new Error("XHR error")));
1474
- };
1475
- try {
1476
- c.send(l);
1477
- } catch (d) {
1478
- q.nextTick(function() {
1479
- e.emit("error", d);
1480
- });
1481
- return;
1482
- }
1483
- }
1484
- }
1485
- };
1486
- function or(e) {
1487
- try {
1488
- var r = e.status;
1489
- return r !== null && r !== 0;
1490
- } catch {
1491
- return !1;
1492
- }
1493
- }
1494
- x.prototype._onXHRProgress = function() {
1495
- var e = this;
1496
- e._resetTimers(!1), !(!or(e._xhr) || e._destroyed) && (e._response || e._connect(), e._response._onXHRProgress(e._resetTimers.bind(e)));
1497
- };
1498
- x.prototype._connect = function() {
1499
- var e = this;
1500
- e._destroyed || (e._response = new ir(e._xhr, e._fetchResponse, e._mode, e._resetTimers.bind(e)), e._response.on("error", function(r) {
1501
- e.emit("error", r);
1502
- }), e.emit("response", e._response));
1503
- };
1504
- x.prototype._write = function(e, r, a) {
1505
- var l = this;
1506
- l._body.push(e), a();
1507
- };
1508
- x.prototype._resetTimers = function(e) {
1509
- var r = this;
1510
- U.clearTimeout(r._socketTimer), r._socketTimer = null, e ? (U.clearTimeout(r._fetchTimer), r._fetchTimer = null) : r._socketTimeout && (r._socketTimer = U.setTimeout(function() {
1511
- r.emit("timeout");
1512
- }, r._socketTimeout));
1513
- };
1514
- x.prototype.abort = x.prototype.destroy = function(e) {
1515
- var r = this;
1516
- r._destroyed = !0, r._resetTimers(!0), r._response && (r._response._destroyed = !0), r._xhr ? r._xhr.abort() : r._fetchAbortController && r._fetchAbortController.abort(), e && r.emit("error", e);
1517
- };
1518
- x.prototype.end = function(e, r, a) {
1519
- var l = this;
1520
- typeof e == "function" && (a = e, e = void 0), He.Writable.prototype.end.call(l, e, r, a);
1521
- };
1522
- x.prototype.setTimeout = function(e, r) {
1523
- var a = this;
1524
- r && a.once("timeout", r), a._socketTimeout = e, a._resetTimers(!1);
1525
- };
1526
- x.prototype.flushHeaders = function() {
1527
- };
1528
- x.prototype.setNoDelay = function() {
1529
- };
1530
- x.prototype.setSocketKeepAlive = function() {
1531
- };
1532
- var fr = [
1533
- "accept-charset",
1534
- "accept-encoding",
1535
- "access-control-request-headers",
1536
- "access-control-request-method",
1537
- "connection",
1538
- "content-length",
1539
- "cookie",
1540
- "cookie2",
1541
- "date",
1542
- "dnt",
1543
- "expect",
1544
- "host",
1545
- "keep-alive",
1546
- "origin",
1547
- "referer",
1548
- "te",
1549
- "trailer",
1550
- "transfer-encoding",
1551
- "upgrade",
1552
- "via"
1553
- ], lr = it.exports, ur = dr, sr = Object.prototype.hasOwnProperty;
1554
- function dr() {
1555
- for (var e = {}, r = 0; r < arguments.length; r++) {
1556
- var a = arguments[r];
1557
- for (var l in a)
1558
- sr.call(a, l) && (e[l] = a[l]);
1559
- }
1560
- return e;
1561
- }
1562
- var cr = {
1563
- 100: "Continue",
1564
- 101: "Switching Protocols",
1565
- 102: "Processing",
1566
- 200: "OK",
1567
- 201: "Created",
1568
- 202: "Accepted",
1569
- 203: "Non-Authoritative Information",
1570
- 204: "No Content",
1571
- 205: "Reset Content",
1572
- 206: "Partial Content",
1573
- 207: "Multi-Status",
1574
- 208: "Already Reported",
1575
- 226: "IM Used",
1576
- 300: "Multiple Choices",
1577
- 301: "Moved Permanently",
1578
- 302: "Found",
1579
- 303: "See Other",
1580
- 304: "Not Modified",
1581
- 305: "Use Proxy",
1582
- 307: "Temporary Redirect",
1583
- 308: "Permanent Redirect",
1584
- 400: "Bad Request",
1585
- 401: "Unauthorized",
1586
- 402: "Payment Required",
1587
- 403: "Forbidden",
1588
- 404: "Not Found",
1589
- 405: "Method Not Allowed",
1590
- 406: "Not Acceptable",
1591
- 407: "Proxy Authentication Required",
1592
- 408: "Request Timeout",
1593
- 409: "Conflict",
1594
- 410: "Gone",
1595
- 411: "Length Required",
1596
- 412: "Precondition Failed",
1597
- 413: "Payload Too Large",
1598
- 414: "URI Too Long",
1599
- 415: "Unsupported Media Type",
1600
- 416: "Range Not Satisfiable",
1601
- 417: "Expectation Failed",
1602
- 418: "I'm a teapot",
1603
- 421: "Misdirected Request",
1604
- 422: "Unprocessable Entity",
1605
- 423: "Locked",
1606
- 424: "Failed Dependency",
1607
- 425: "Unordered Collection",
1608
- 426: "Upgrade Required",
1609
- 428: "Precondition Required",
1610
- 429: "Too Many Requests",
1611
- 431: "Request Header Fields Too Large",
1612
- 451: "Unavailable For Legal Reasons",
1613
- 500: "Internal Server Error",
1614
- 501: "Not Implemented",
1615
- 502: "Bad Gateway",
1616
- 503: "Service Unavailable",
1617
- 504: "Gateway Timeout",
1618
- 505: "HTTP Version Not Supported",
1619
- 506: "Variant Also Negotiates",
1620
- 507: "Insufficient Storage",
1621
- 508: "Loop Detected",
1622
- 509: "Bandwidth Limit Exceeded",
1623
- 510: "Not Extended",
1624
- 511: "Network Authentication Required"
1625
- };
1626
- const hr = /* @__PURE__ */ gt(mt);
1627
- (function(e) {
1628
- var r = lr, a = ce, l = ur, f = cr, _ = hr, h = e;
1629
- h.request = function(c, d) {
1630
- typeof c == "string" ? c = _.parse(c) : c = l(c);
1631
- var R = U.location.protocol.search(/^https?:$/) === -1 ? "http:" : "", P = c.protocol || R, b = c.hostname || c.host, C = c.port, j = c.path || "/";
1632
- b && b.indexOf(":") !== -1 && (b = "[" + b + "]"), c.url = (b ? P + "//" + b : "") + (C ? ":" + C : "") + j, c.method = (c.method || "GET").toUpperCase(), c.headers = c.headers || {};
1633
- var w = new r(c);
1634
- return d && w.on("response", d), w;
1635
- }, h.get = function(d, R) {
1636
- var P = h.request(d, R);
1637
- return P.end(), P;
1638
- }, h.ClientRequest = r, h.IncomingMessage = a.IncomingMessage, h.Agent = function() {
1639
- }, h.Agent.defaultMaxSockets = 4, h.globalAgent = new h.Agent(), h.STATUS_CODES = f, h.METHODS = [
1640
- "CHECKOUT",
1641
- "CONNECT",
1642
- "COPY",
1643
- "DELETE",
1644
- "GET",
1645
- "HEAD",
1646
- "LOCK",
1647
- "M-SEARCH",
1648
- "MERGE",
1649
- "MKACTIVITY",
1650
- "MKCOL",
1651
- "MOVE",
1652
- "NOTIFY",
1653
- "OPTIONS",
1654
- "PATCH",
1655
- "POST",
1656
- "PROPFIND",
1657
- "PROPPATCH",
1658
- "PURGE",
1659
- "PUT",
1660
- "REPORT",
1661
- "SEARCH",
1662
- "SUBSCRIBE",
1663
- "TRACE",
1664
- "UNLOCK",
1665
- "UNSUBSCRIBE"
1666
- ];
1667
- })(qe);
1668
- const pr = /* @__PURE__ */ wt(qe), gr = /* @__PURE__ */ Et({
1669
- __proto__: null,
1670
- default: pr
1671
- }, [qe]);
1672
- export {
1673
- gr as i,
1674
- hr as r,
1675
- qe as s
1676
- };