@genome-spy/app 0.57.0 → 0.58.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.css +1 -0
- package/dist/index-BftNdA0O.js +27 -0
- package/dist/index-C08YCM2T.js +539 -0
- package/dist/{index-C159nEYc.js → index-CCJIjehY.js} +89 -83
- package/dist/index-CalimFw3.js +2131 -0
- package/dist/{index-CfEH2hsw.js → index-DKe9Bhvi.js} +285 -260
- package/dist/index-DS2hvLgl.js +3425 -0
- package/dist/index-DTcHjAHp.js +505 -0
- package/dist/index-DnIkxb0L.js +1025 -0
- package/dist/{index-Bg62fPK7.js → index-DwLfOHEk.js} +435 -465
- package/dist/{index-DhPRJZz0.js → index-Ww3TAo6_.js} +7 -7
- package/dist/{index-DutovjI-.js → index-vgGDWUPz.js} +2 -2
- package/dist/index.es.js +5398 -6589
- package/dist/index.js +402 -397
- package/dist/long-BviWyoZx.js +2387 -0
- package/dist/{remoteFile-DwSeXAZ0.js → remoteFile-BuaqFGWk.js} +1 -1
- package/package.json +3 -3
- package/dist/index-CubKalvr.js +0 -500
- package/dist/index-DNzxWHJt.js +0 -2136
- package/dist/index-DluFz_0j.js +0 -1042
- package/dist/index-Dpv0n-cZ.js +0 -3998
- package/dist/long-DM5IWGqg.js +0 -2375
- package/dist/style.css +0 -1
@@ -0,0 +1,2131 @@
|
|
1
|
+
import { r as ce } from "./index-DnIkxb0L.js";
|
2
|
+
import { _ as Dt } from "./__vite-browser-external-C--ziKoh.js";
|
3
|
+
import { a as Pt } from "./_commonjsHelpers-DjF3Plf2.js";
|
4
|
+
var oe = { exports: {} }, $e;
|
5
|
+
function Be() {
|
6
|
+
if ($e) return oe.exports;
|
7
|
+
$e = 1;
|
8
|
+
var u = typeof Reflect == "object" ? Reflect : null, r = u && typeof u.apply == "function" ? u.apply : function(f, v, A) {
|
9
|
+
return Function.prototype.apply.call(f, v, A);
|
10
|
+
}, a;
|
11
|
+
u && typeof u.ownKeys == "function" ? a = u.ownKeys : Object.getOwnPropertySymbols ? a = function(f) {
|
12
|
+
return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f));
|
13
|
+
} : a = function(f) {
|
14
|
+
return Object.getOwnPropertyNames(f);
|
15
|
+
};
|
16
|
+
function s(o) {
|
17
|
+
console && console.warn && console.warn(o);
|
18
|
+
}
|
19
|
+
var b = Number.isNaN || function(f) {
|
20
|
+
return f !== f;
|
21
|
+
};
|
22
|
+
function n() {
|
23
|
+
n.init.call(this);
|
24
|
+
}
|
25
|
+
oe.exports = n, oe.exports.once = i, n.EventEmitter = n, n.prototype._events = void 0, n.prototype._eventsCount = 0, n.prototype._maxListeners = void 0;
|
26
|
+
var p = 10;
|
27
|
+
function c(o) {
|
28
|
+
if (typeof o != "function")
|
29
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof o);
|
30
|
+
}
|
31
|
+
Object.defineProperty(n, "defaultMaxListeners", {
|
32
|
+
enumerable: !0,
|
33
|
+
get: function() {
|
34
|
+
return p;
|
35
|
+
},
|
36
|
+
set: function(o) {
|
37
|
+
if (typeof o != "number" || o < 0 || b(o))
|
38
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + o + ".");
|
39
|
+
p = o;
|
40
|
+
}
|
41
|
+
}), n.init = function() {
|
42
|
+
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
43
|
+
}, n.prototype.setMaxListeners = function(f) {
|
44
|
+
if (typeof f != "number" || f < 0 || b(f))
|
45
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + f + ".");
|
46
|
+
return this._maxListeners = f, this;
|
47
|
+
};
|
48
|
+
function l(o) {
|
49
|
+
return o._maxListeners === void 0 ? n.defaultMaxListeners : o._maxListeners;
|
50
|
+
}
|
51
|
+
n.prototype.getMaxListeners = function() {
|
52
|
+
return l(this);
|
53
|
+
}, n.prototype.emit = function(f) {
|
54
|
+
for (var v = [], A = 1; A < arguments.length; A++) v.push(arguments[A]);
|
55
|
+
var L = f === "error", M = this._events;
|
56
|
+
if (M !== void 0)
|
57
|
+
L = L && M.error === void 0;
|
58
|
+
else if (!L)
|
59
|
+
return !1;
|
60
|
+
if (L) {
|
61
|
+
var N;
|
62
|
+
if (v.length > 0 && (N = v[0]), N instanceof Error)
|
63
|
+
throw N;
|
64
|
+
var B = new Error("Unhandled error." + (N ? " (" + N.message + ")" : ""));
|
65
|
+
throw B.context = N, B;
|
66
|
+
}
|
67
|
+
var F = M[f];
|
68
|
+
if (F === void 0)
|
69
|
+
return !1;
|
70
|
+
if (typeof F == "function")
|
71
|
+
r(F, this, v);
|
72
|
+
else
|
73
|
+
for (var W = F.length, Q = C(F, W), A = 0; A < W; ++A)
|
74
|
+
r(Q[A], this, v);
|
75
|
+
return !0;
|
76
|
+
};
|
77
|
+
function g(o, f, v, A) {
|
78
|
+
var L, M, N;
|
79
|
+
if (c(v), M = o._events, M === void 0 ? (M = o._events = /* @__PURE__ */ Object.create(null), o._eventsCount = 0) : (M.newListener !== void 0 && (o.emit(
|
80
|
+
"newListener",
|
81
|
+
f,
|
82
|
+
v.listener ? v.listener : v
|
83
|
+
), M = o._events), N = M[f]), N === void 0)
|
84
|
+
N = M[f] = v, ++o._eventsCount;
|
85
|
+
else if (typeof N == "function" ? N = M[f] = A ? [v, N] : [N, v] : A ? N.unshift(v) : N.push(v), L = l(o), L > 0 && N.length > L && !N.warned) {
|
86
|
+
N.warned = !0;
|
87
|
+
var B = new Error("Possible EventEmitter memory leak detected. " + N.length + " " + String(f) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
88
|
+
B.name = "MaxListenersExceededWarning", B.emitter = o, B.type = f, B.count = N.length, s(B);
|
89
|
+
}
|
90
|
+
return o;
|
91
|
+
}
|
92
|
+
n.prototype.addListener = function(f, v) {
|
93
|
+
return g(this, f, v, !1);
|
94
|
+
}, n.prototype.on = n.prototype.addListener, n.prototype.prependListener = function(f, v) {
|
95
|
+
return g(this, f, v, !0);
|
96
|
+
};
|
97
|
+
function T() {
|
98
|
+
if (!this.fired)
|
99
|
+
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
100
|
+
}
|
101
|
+
function E(o, f, v) {
|
102
|
+
var A = { fired: !1, wrapFn: void 0, target: o, type: f, listener: v }, L = T.bind(A);
|
103
|
+
return L.listener = v, A.wrapFn = L, L;
|
104
|
+
}
|
105
|
+
n.prototype.once = function(f, v) {
|
106
|
+
return c(v), this.on(f, E(this, f, v)), this;
|
107
|
+
}, n.prototype.prependOnceListener = function(f, v) {
|
108
|
+
return c(v), this.prependListener(f, E(this, f, v)), this;
|
109
|
+
}, n.prototype.removeListener = function(f, v) {
|
110
|
+
var A, L, M, N, B;
|
111
|
+
if (c(v), L = this._events, L === void 0)
|
112
|
+
return this;
|
113
|
+
if (A = L[f], A === void 0)
|
114
|
+
return this;
|
115
|
+
if (A === v || A.listener === v)
|
116
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete L[f], L.removeListener && this.emit("removeListener", f, A.listener || v));
|
117
|
+
else if (typeof A != "function") {
|
118
|
+
for (M = -1, N = A.length - 1; N >= 0; N--)
|
119
|
+
if (A[N] === v || A[N].listener === v) {
|
120
|
+
B = A[N].listener, M = N;
|
121
|
+
break;
|
122
|
+
}
|
123
|
+
if (M < 0)
|
124
|
+
return this;
|
125
|
+
M === 0 ? A.shift() : O(A, M), A.length === 1 && (L[f] = A[0]), L.removeListener !== void 0 && this.emit("removeListener", f, B || v);
|
126
|
+
}
|
127
|
+
return this;
|
128
|
+
}, n.prototype.off = n.prototype.removeListener, n.prototype.removeAllListeners = function(f) {
|
129
|
+
var v, A, L;
|
130
|
+
if (A = this._events, A === void 0)
|
131
|
+
return this;
|
132
|
+
if (A.removeListener === void 0)
|
133
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : A[f] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete A[f]), this;
|
134
|
+
if (arguments.length === 0) {
|
135
|
+
var M = Object.keys(A), N;
|
136
|
+
for (L = 0; L < M.length; ++L)
|
137
|
+
N = M[L], N !== "removeListener" && this.removeAllListeners(N);
|
138
|
+
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
139
|
+
}
|
140
|
+
if (v = A[f], typeof v == "function")
|
141
|
+
this.removeListener(f, v);
|
142
|
+
else if (v !== void 0)
|
143
|
+
for (L = v.length - 1; L >= 0; L--)
|
144
|
+
this.removeListener(f, v[L]);
|
145
|
+
return this;
|
146
|
+
};
|
147
|
+
function w(o, f, v) {
|
148
|
+
var A = o._events;
|
149
|
+
if (A === void 0)
|
150
|
+
return [];
|
151
|
+
var L = A[f];
|
152
|
+
return L === void 0 ? [] : typeof L == "function" ? v ? [L.listener || L] : [L] : v ? R(L) : C(L, L.length);
|
153
|
+
}
|
154
|
+
n.prototype.listeners = function(f) {
|
155
|
+
return w(this, f, !0);
|
156
|
+
}, n.prototype.rawListeners = function(f) {
|
157
|
+
return w(this, f, !1);
|
158
|
+
}, n.listenerCount = function(o, f) {
|
159
|
+
return typeof o.listenerCount == "function" ? o.listenerCount(f) : D.call(o, f);
|
160
|
+
}, n.prototype.listenerCount = D;
|
161
|
+
function D(o) {
|
162
|
+
var f = this._events;
|
163
|
+
if (f !== void 0) {
|
164
|
+
var v = f[o];
|
165
|
+
if (typeof v == "function")
|
166
|
+
return 1;
|
167
|
+
if (v !== void 0)
|
168
|
+
return v.length;
|
169
|
+
}
|
170
|
+
return 0;
|
171
|
+
}
|
172
|
+
n.prototype.eventNames = function() {
|
173
|
+
return this._eventsCount > 0 ? a(this._events) : [];
|
174
|
+
};
|
175
|
+
function C(o, f) {
|
176
|
+
for (var v = new Array(f), A = 0; A < f; ++A)
|
177
|
+
v[A] = o[A];
|
178
|
+
return v;
|
179
|
+
}
|
180
|
+
function O(o, f) {
|
181
|
+
for (; f + 1 < o.length; f++)
|
182
|
+
o[f] = o[f + 1];
|
183
|
+
o.pop();
|
184
|
+
}
|
185
|
+
function R(o) {
|
186
|
+
for (var f = new Array(o.length), v = 0; v < f.length; ++v)
|
187
|
+
f[v] = o[v].listener || o[v];
|
188
|
+
return f;
|
189
|
+
}
|
190
|
+
function i(o, f) {
|
191
|
+
return new Promise(function(v, A) {
|
192
|
+
function L(N) {
|
193
|
+
o.removeListener(f, M), A(N);
|
194
|
+
}
|
195
|
+
function M() {
|
196
|
+
typeof o.removeListener == "function" && o.removeListener("error", L), v([].slice.call(arguments));
|
197
|
+
}
|
198
|
+
m(o, f, M, { once: !0 }), f !== "error" && _(o, L, { once: !0 });
|
199
|
+
});
|
200
|
+
}
|
201
|
+
function _(o, f, v) {
|
202
|
+
typeof o.on == "function" && m(o, "error", f, v);
|
203
|
+
}
|
204
|
+
function m(o, f, v, A) {
|
205
|
+
if (typeof o.on == "function")
|
206
|
+
A.once ? o.once(f, v) : o.on(f, v);
|
207
|
+
else if (typeof o.addEventListener == "function")
|
208
|
+
o.addEventListener(f, function L(M) {
|
209
|
+
A.once && o.removeEventListener(f, L), v(M);
|
210
|
+
});
|
211
|
+
else
|
212
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof o);
|
213
|
+
}
|
214
|
+
return oe.exports;
|
215
|
+
}
|
216
|
+
var fe = { exports: {} }, Ve;
|
217
|
+
function X() {
|
218
|
+
return Ve || (Ve = 1, typeof Object.create == "function" ? fe.exports = function(r, a) {
|
219
|
+
a && (r.super_ = a, r.prototype = Object.create(a.prototype, {
|
220
|
+
constructor: {
|
221
|
+
value: r,
|
222
|
+
enumerable: !1,
|
223
|
+
writable: !0,
|
224
|
+
configurable: !0
|
225
|
+
}
|
226
|
+
}));
|
227
|
+
} : fe.exports = function(r, a) {
|
228
|
+
if (a) {
|
229
|
+
r.super_ = a;
|
230
|
+
var s = function() {
|
231
|
+
};
|
232
|
+
s.prototype = a.prototype, r.prototype = new s(), r.prototype.constructor = r;
|
233
|
+
}
|
234
|
+
}), fe.exports;
|
235
|
+
}
|
236
|
+
var we, Ge;
|
237
|
+
function ct() {
|
238
|
+
return Ge || (Ge = 1, we = Be().EventEmitter), we;
|
239
|
+
}
|
240
|
+
const ht = /* @__PURE__ */ Pt(Dt);
|
241
|
+
var me, Ke;
|
242
|
+
function Nt() {
|
243
|
+
if (Ke) return me;
|
244
|
+
Ke = 1;
|
245
|
+
function u(C, O) {
|
246
|
+
var R = Object.keys(C);
|
247
|
+
if (Object.getOwnPropertySymbols) {
|
248
|
+
var i = Object.getOwnPropertySymbols(C);
|
249
|
+
O && (i = i.filter(function(_) {
|
250
|
+
return Object.getOwnPropertyDescriptor(C, _).enumerable;
|
251
|
+
})), R.push.apply(R, i);
|
252
|
+
}
|
253
|
+
return R;
|
254
|
+
}
|
255
|
+
function r(C) {
|
256
|
+
for (var O = 1; O < arguments.length; O++) {
|
257
|
+
var R = arguments[O] != null ? arguments[O] : {};
|
258
|
+
O % 2 ? u(Object(R), !0).forEach(function(i) {
|
259
|
+
a(C, i, R[i]);
|
260
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(C, Object.getOwnPropertyDescriptors(R)) : u(Object(R)).forEach(function(i) {
|
261
|
+
Object.defineProperty(C, i, Object.getOwnPropertyDescriptor(R, i));
|
262
|
+
});
|
263
|
+
}
|
264
|
+
return C;
|
265
|
+
}
|
266
|
+
function a(C, O, R) {
|
267
|
+
return O = p(O), O in C ? Object.defineProperty(C, O, { value: R, enumerable: !0, configurable: !0, writable: !0 }) : C[O] = R, C;
|
268
|
+
}
|
269
|
+
function s(C, O) {
|
270
|
+
if (!(C instanceof O))
|
271
|
+
throw new TypeError("Cannot call a class as a function");
|
272
|
+
}
|
273
|
+
function b(C, O) {
|
274
|
+
for (var R = 0; R < O.length; R++) {
|
275
|
+
var i = O[R];
|
276
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(C, p(i.key), i);
|
277
|
+
}
|
278
|
+
}
|
279
|
+
function n(C, O, R) {
|
280
|
+
return O && b(C.prototype, O), Object.defineProperty(C, "prototype", { writable: !1 }), C;
|
281
|
+
}
|
282
|
+
function p(C) {
|
283
|
+
var O = c(C, "string");
|
284
|
+
return typeof O == "symbol" ? O : String(O);
|
285
|
+
}
|
286
|
+
function c(C, O) {
|
287
|
+
if (typeof C != "object" || C === null) return C;
|
288
|
+
var R = C[Symbol.toPrimitive];
|
289
|
+
if (R !== void 0) {
|
290
|
+
var i = R.call(C, O || "default");
|
291
|
+
if (typeof i != "object") return i;
|
292
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
293
|
+
}
|
294
|
+
return (O === "string" ? String : Number)(C);
|
295
|
+
}
|
296
|
+
var l = ce(), g = l.Buffer, T = ht, E = T.inspect, w = E && E.custom || "inspect";
|
297
|
+
function D(C, O, R) {
|
298
|
+
g.prototype.copy.call(C, O, R);
|
299
|
+
}
|
300
|
+
return me = /* @__PURE__ */ function() {
|
301
|
+
function C() {
|
302
|
+
s(this, C), this.head = null, this.tail = null, this.length = 0;
|
303
|
+
}
|
304
|
+
return n(C, [{
|
305
|
+
key: "push",
|
306
|
+
value: function(R) {
|
307
|
+
var i = {
|
308
|
+
data: R,
|
309
|
+
next: null
|
310
|
+
};
|
311
|
+
this.length > 0 ? this.tail.next = i : this.head = i, this.tail = i, ++this.length;
|
312
|
+
}
|
313
|
+
}, {
|
314
|
+
key: "unshift",
|
315
|
+
value: function(R) {
|
316
|
+
var i = {
|
317
|
+
data: R,
|
318
|
+
next: this.head
|
319
|
+
};
|
320
|
+
this.length === 0 && (this.tail = i), this.head = i, ++this.length;
|
321
|
+
}
|
322
|
+
}, {
|
323
|
+
key: "shift",
|
324
|
+
value: function() {
|
325
|
+
if (this.length !== 0) {
|
326
|
+
var R = this.head.data;
|
327
|
+
return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, R;
|
328
|
+
}
|
329
|
+
}
|
330
|
+
}, {
|
331
|
+
key: "clear",
|
332
|
+
value: function() {
|
333
|
+
this.head = this.tail = null, this.length = 0;
|
334
|
+
}
|
335
|
+
}, {
|
336
|
+
key: "join",
|
337
|
+
value: function(R) {
|
338
|
+
if (this.length === 0) return "";
|
339
|
+
for (var i = this.head, _ = "" + i.data; i = i.next; ) _ += R + i.data;
|
340
|
+
return _;
|
341
|
+
}
|
342
|
+
}, {
|
343
|
+
key: "concat",
|
344
|
+
value: function(R) {
|
345
|
+
if (this.length === 0) return g.alloc(0);
|
346
|
+
for (var i = g.allocUnsafe(R >>> 0), _ = this.head, m = 0; _; )
|
347
|
+
D(_.data, i, m), m += _.data.length, _ = _.next;
|
348
|
+
return i;
|
349
|
+
}
|
350
|
+
// Consumes a specified amount of bytes or characters from the buffered data.
|
351
|
+
}, {
|
352
|
+
key: "consume",
|
353
|
+
value: function(R, i) {
|
354
|
+
var _;
|
355
|
+
return R < this.head.data.length ? (_ = this.head.data.slice(0, R), this.head.data = this.head.data.slice(R)) : R === this.head.data.length ? _ = this.shift() : _ = i ? this._getString(R) : this._getBuffer(R), _;
|
356
|
+
}
|
357
|
+
}, {
|
358
|
+
key: "first",
|
359
|
+
value: function() {
|
360
|
+
return this.head.data;
|
361
|
+
}
|
362
|
+
// Consumes a specified amount of characters from the buffered data.
|
363
|
+
}, {
|
364
|
+
key: "_getString",
|
365
|
+
value: function(R) {
|
366
|
+
var i = this.head, _ = 1, m = i.data;
|
367
|
+
for (R -= m.length; i = i.next; ) {
|
368
|
+
var o = i.data, f = R > o.length ? o.length : R;
|
369
|
+
if (f === o.length ? m += o : m += o.slice(0, R), R -= f, R === 0) {
|
370
|
+
f === o.length ? (++_, i.next ? this.head = i.next : this.head = this.tail = null) : (this.head = i, i.data = o.slice(f));
|
371
|
+
break;
|
372
|
+
}
|
373
|
+
++_;
|
374
|
+
}
|
375
|
+
return this.length -= _, m;
|
376
|
+
}
|
377
|
+
// Consumes a specified amount of bytes from the buffered data.
|
378
|
+
}, {
|
379
|
+
key: "_getBuffer",
|
380
|
+
value: function(R) {
|
381
|
+
var i = g.allocUnsafe(R), _ = this.head, m = 1;
|
382
|
+
for (_.data.copy(i), R -= _.data.length; _ = _.next; ) {
|
383
|
+
var o = _.data, f = R > o.length ? o.length : R;
|
384
|
+
if (o.copy(i, i.length - R, 0, f), R -= f, R === 0) {
|
385
|
+
f === o.length ? (++m, _.next ? this.head = _.next : this.head = this.tail = null) : (this.head = _, _.data = o.slice(f));
|
386
|
+
break;
|
387
|
+
}
|
388
|
+
++m;
|
389
|
+
}
|
390
|
+
return this.length -= m, i;
|
391
|
+
}
|
392
|
+
// Make sure the linked list only shows the minimal necessary information.
|
393
|
+
}, {
|
394
|
+
key: w,
|
395
|
+
value: function(R, i) {
|
396
|
+
return E(this, r(r({}, i), {}, {
|
397
|
+
// Only inspect one level.
|
398
|
+
depth: 0,
|
399
|
+
// It should not recurse.
|
400
|
+
customInspect: !1
|
401
|
+
}));
|
402
|
+
}
|
403
|
+
}]), C;
|
404
|
+
}(), me;
|
405
|
+
}
|
406
|
+
var Se, Ye;
|
407
|
+
function pt() {
|
408
|
+
if (Ye) return Se;
|
409
|
+
Ye = 1;
|
410
|
+
function u(p, c) {
|
411
|
+
var l = this, g = this._readableState && this._readableState.destroyed, T = this._writableState && this._writableState.destroyed;
|
412
|
+
return g || T ? (c ? c(p) : p && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(b, this, p)) : process.nextTick(b, this, p)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(p || null, function(E) {
|
413
|
+
!c && E ? l._writableState ? l._writableState.errorEmitted ? process.nextTick(a, l) : (l._writableState.errorEmitted = !0, process.nextTick(r, l, E)) : process.nextTick(r, l, E) : c ? (process.nextTick(a, l), c(E)) : process.nextTick(a, l);
|
414
|
+
}), this);
|
415
|
+
}
|
416
|
+
function r(p, c) {
|
417
|
+
b(p, c), a(p);
|
418
|
+
}
|
419
|
+
function a(p) {
|
420
|
+
p._writableState && !p._writableState.emitClose || p._readableState && !p._readableState.emitClose || p.emit("close");
|
421
|
+
}
|
422
|
+
function s() {
|
423
|
+
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);
|
424
|
+
}
|
425
|
+
function b(p, c) {
|
426
|
+
p.emit("error", c);
|
427
|
+
}
|
428
|
+
function n(p, c) {
|
429
|
+
var l = p._readableState, g = p._writableState;
|
430
|
+
l && l.autoDestroy || g && g.autoDestroy ? p.destroy(c) : p.emit("error", c);
|
431
|
+
}
|
432
|
+
return Se = {
|
433
|
+
destroy: u,
|
434
|
+
undestroy: s,
|
435
|
+
errorOrDestroy: n
|
436
|
+
}, Se;
|
437
|
+
}
|
438
|
+
var Ee = {}, ze;
|
439
|
+
function J() {
|
440
|
+
if (ze) return Ee;
|
441
|
+
ze = 1;
|
442
|
+
function u(c, l) {
|
443
|
+
c.prototype = Object.create(l.prototype), c.prototype.constructor = c, c.__proto__ = l;
|
444
|
+
}
|
445
|
+
var r = {};
|
446
|
+
function a(c, l, g) {
|
447
|
+
g || (g = Error);
|
448
|
+
function T(w, D, C) {
|
449
|
+
return typeof l == "string" ? l : l(w, D, C);
|
450
|
+
}
|
451
|
+
var E = /* @__PURE__ */ function(w) {
|
452
|
+
u(D, w);
|
453
|
+
function D(C, O, R) {
|
454
|
+
return w.call(this, T(C, O, R)) || this;
|
455
|
+
}
|
456
|
+
return D;
|
457
|
+
}(g);
|
458
|
+
E.prototype.name = g.name, E.prototype.code = c, r[c] = E;
|
459
|
+
}
|
460
|
+
function s(c, l) {
|
461
|
+
if (Array.isArray(c)) {
|
462
|
+
var g = c.length;
|
463
|
+
return c = c.map(function(T) {
|
464
|
+
return String(T);
|
465
|
+
}), g > 2 ? "one of ".concat(l, " ").concat(c.slice(0, g - 1).join(", "), ", or ") + c[g - 1] : g === 2 ? "one of ".concat(l, " ").concat(c[0], " or ").concat(c[1]) : "of ".concat(l, " ").concat(c[0]);
|
466
|
+
} else
|
467
|
+
return "of ".concat(l, " ").concat(String(c));
|
468
|
+
}
|
469
|
+
function b(c, l, g) {
|
470
|
+
return c.substr(0, l.length) === l;
|
471
|
+
}
|
472
|
+
function n(c, l, g) {
|
473
|
+
return (g === void 0 || g > c.length) && (g = c.length), c.substring(g - l.length, g) === l;
|
474
|
+
}
|
475
|
+
function p(c, l, g) {
|
476
|
+
return typeof g != "number" && (g = 0), g + l.length > c.length ? !1 : c.indexOf(l, g) !== -1;
|
477
|
+
}
|
478
|
+
return a("ERR_INVALID_OPT_VALUE", function(c, l) {
|
479
|
+
return 'The value "' + l + '" is invalid for option "' + c + '"';
|
480
|
+
}, TypeError), a("ERR_INVALID_ARG_TYPE", function(c, l, g) {
|
481
|
+
var T;
|
482
|
+
typeof l == "string" && b(l, "not ") ? (T = "must not be", l = l.replace(/^not /, "")) : T = "must be";
|
483
|
+
var E;
|
484
|
+
if (n(c, " argument"))
|
485
|
+
E = "The ".concat(c, " ").concat(T, " ").concat(s(l, "type"));
|
486
|
+
else {
|
487
|
+
var w = p(c, ".") ? "property" : "argument";
|
488
|
+
E = 'The "'.concat(c, '" ').concat(w, " ").concat(T, " ").concat(s(l, "type"));
|
489
|
+
}
|
490
|
+
return E += ". Received type ".concat(typeof g), E;
|
491
|
+
}, TypeError), a("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), a("ERR_METHOD_NOT_IMPLEMENTED", function(c) {
|
492
|
+
return "The " + c + " method is not implemented";
|
493
|
+
}), a("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), a("ERR_STREAM_DESTROYED", function(c) {
|
494
|
+
return "Cannot call " + c + " after a stream was destroyed";
|
495
|
+
}), a("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), a("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), a("ERR_STREAM_WRITE_AFTER_END", "write after end"), a("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), a("ERR_UNKNOWN_ENCODING", function(c) {
|
496
|
+
return "Unknown encoding: " + c;
|
497
|
+
}, TypeError), a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), Ee.codes = r, Ee;
|
498
|
+
}
|
499
|
+
var Re, Xe;
|
500
|
+
function vt() {
|
501
|
+
if (Xe) return Re;
|
502
|
+
Xe = 1;
|
503
|
+
var u = J().codes.ERR_INVALID_OPT_VALUE;
|
504
|
+
function r(s, b, n) {
|
505
|
+
return s.highWaterMark != null ? s.highWaterMark : b ? s[n] : null;
|
506
|
+
}
|
507
|
+
function a(s, b, n, p) {
|
508
|
+
var c = r(b, p, n);
|
509
|
+
if (c != null) {
|
510
|
+
if (!(isFinite(c) && Math.floor(c) === c) || c < 0) {
|
511
|
+
var l = p ? n : "highWaterMark";
|
512
|
+
throw new u(l, c);
|
513
|
+
}
|
514
|
+
return Math.floor(c);
|
515
|
+
}
|
516
|
+
return s.objectMode ? 16 : 16 * 1024;
|
517
|
+
}
|
518
|
+
return Re = {
|
519
|
+
getHighWaterMark: a
|
520
|
+
}, Re;
|
521
|
+
}
|
522
|
+
var Le, Je;
|
523
|
+
function qt() {
|
524
|
+
if (Je) return Le;
|
525
|
+
Je = 1, Le = u;
|
526
|
+
function u(a, s) {
|
527
|
+
if (r("noDeprecation"))
|
528
|
+
return a;
|
529
|
+
var b = !1;
|
530
|
+
function n() {
|
531
|
+
if (!b) {
|
532
|
+
if (r("throwDeprecation"))
|
533
|
+
throw new Error(s);
|
534
|
+
r("traceDeprecation") ? console.trace(s) : console.warn(s), b = !0;
|
535
|
+
}
|
536
|
+
return a.apply(this, arguments);
|
537
|
+
}
|
538
|
+
return n;
|
539
|
+
}
|
540
|
+
function r(a) {
|
541
|
+
try {
|
542
|
+
if (!globalThis.localStorage) return !1;
|
543
|
+
} catch {
|
544
|
+
return !1;
|
545
|
+
}
|
546
|
+
var s = globalThis.localStorage[a];
|
547
|
+
return s == null ? !1 : String(s).toLowerCase() === "true";
|
548
|
+
}
|
549
|
+
return Le;
|
550
|
+
}
|
551
|
+
var Te, Qe;
|
552
|
+
function _t() {
|
553
|
+
if (Qe) return Te;
|
554
|
+
Qe = 1, Te = L;
|
555
|
+
function u(h) {
|
556
|
+
var d = this;
|
557
|
+
this.next = null, this.entry = null, this.finish = function() {
|
558
|
+
_e(d, h);
|
559
|
+
};
|
560
|
+
}
|
561
|
+
var r;
|
562
|
+
L.WritableState = v;
|
563
|
+
var a = {
|
564
|
+
deprecate: qt()
|
565
|
+
}, s = ct(), b = ce().Buffer, n = (typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
|
566
|
+
};
|
567
|
+
function p(h) {
|
568
|
+
return b.from(h);
|
569
|
+
}
|
570
|
+
function c(h) {
|
571
|
+
return b.isBuffer(h) || h instanceof n;
|
572
|
+
}
|
573
|
+
var l = pt(), g = vt(), T = g.getHighWaterMark, E = J().codes, w = E.ERR_INVALID_ARG_TYPE, D = E.ERR_METHOD_NOT_IMPLEMENTED, C = E.ERR_MULTIPLE_CALLBACK, O = E.ERR_STREAM_CANNOT_PIPE, R = E.ERR_STREAM_DESTROYED, i = E.ERR_STREAM_NULL_VALUES, _ = E.ERR_STREAM_WRITE_AFTER_END, m = E.ERR_UNKNOWN_ENCODING, o = l.errorOrDestroy;
|
574
|
+
X()(L, s);
|
575
|
+
function f() {
|
576
|
+
}
|
577
|
+
function v(h, d, S) {
|
578
|
+
r = r || z(), h = h || {}, typeof S != "boolean" && (S = d instanceof r), this.objectMode = !!h.objectMode, S && (this.objectMode = this.objectMode || !!h.writableObjectMode), this.highWaterMark = T(this, h, "writableHighWaterMark", S), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
|
579
|
+
var P = h.decodeStrings === !1;
|
580
|
+
this.decodeStrings = !P, this.defaultEncoding = h.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(k) {
|
581
|
+
he(d, k);
|
582
|
+
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = h.emitClose !== !1, this.autoDestroy = !!h.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new u(this);
|
583
|
+
}
|
584
|
+
v.prototype.getBuffer = function() {
|
585
|
+
for (var d = this.bufferedRequest, S = []; d; )
|
586
|
+
S.push(d), d = d.next;
|
587
|
+
return S;
|
588
|
+
}, function() {
|
589
|
+
try {
|
590
|
+
Object.defineProperty(v.prototype, "buffer", {
|
591
|
+
get: a.deprecate(function() {
|
592
|
+
return this.getBuffer();
|
593
|
+
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
|
594
|
+
});
|
595
|
+
} catch {
|
596
|
+
}
|
597
|
+
}();
|
598
|
+
var A;
|
599
|
+
typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (A = Function.prototype[Symbol.hasInstance], Object.defineProperty(L, Symbol.hasInstance, {
|
600
|
+
value: function(d) {
|
601
|
+
return A.call(this, d) ? !0 : this !== L ? !1 : d && d._writableState instanceof v;
|
602
|
+
}
|
603
|
+
})) : A = function(d) {
|
604
|
+
return d instanceof this;
|
605
|
+
};
|
606
|
+
function L(h) {
|
607
|
+
r = r || z();
|
608
|
+
var d = this instanceof r;
|
609
|
+
if (!d && !A.call(L, this)) return new L(h);
|
610
|
+
this._writableState = new v(h, this, d), this.writable = !0, h && (typeof h.write == "function" && (this._write = h.write), typeof h.writev == "function" && (this._writev = h.writev), typeof h.destroy == "function" && (this._destroy = h.destroy), typeof h.final == "function" && (this._final = h.final)), s.call(this);
|
611
|
+
}
|
612
|
+
L.prototype.pipe = function() {
|
613
|
+
o(this, new O());
|
614
|
+
};
|
615
|
+
function M(h, d) {
|
616
|
+
var S = new _();
|
617
|
+
o(h, S), process.nextTick(d, S);
|
618
|
+
}
|
619
|
+
function N(h, d, S, P) {
|
620
|
+
var k;
|
621
|
+
return S === null ? k = new i() : typeof S != "string" && !d.objectMode && (k = new w("chunk", ["string", "Buffer"], S)), k ? (o(h, k), process.nextTick(P, k), !1) : !0;
|
622
|
+
}
|
623
|
+
L.prototype.write = function(h, d, S) {
|
624
|
+
var P = this._writableState, k = !1, e = !P.objectMode && c(h);
|
625
|
+
return e && !b.isBuffer(h) && (h = p(h)), typeof d == "function" && (S = d, d = null), e ? d = "buffer" : d || (d = P.defaultEncoding), typeof S != "function" && (S = f), P.ending ? M(this, S) : (e || N(this, P, h, S)) && (P.pendingcb++, k = F(this, P, e, h, d, S)), k;
|
626
|
+
}, L.prototype.cork = function() {
|
627
|
+
this._writableState.corked++;
|
628
|
+
}, L.prototype.uncork = function() {
|
629
|
+
var h = this._writableState;
|
630
|
+
h.corked && (h.corked--, !h.writing && !h.corked && !h.bufferProcessing && h.bufferedRequest && V(this, h));
|
631
|
+
}, L.prototype.setDefaultEncoding = function(d) {
|
632
|
+
if (typeof d == "string" && (d = d.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((d + "").toLowerCase()) > -1)) throw new m(d);
|
633
|
+
return this._writableState.defaultEncoding = d, this;
|
634
|
+
}, Object.defineProperty(L.prototype, "writableBuffer", {
|
635
|
+
// making it explicit this property is not enumerable
|
636
|
+
// because otherwise some prototype manipulation in
|
637
|
+
// userland will fail
|
638
|
+
enumerable: !1,
|
639
|
+
get: function() {
|
640
|
+
return this._writableState && this._writableState.getBuffer();
|
641
|
+
}
|
642
|
+
});
|
643
|
+
function B(h, d, S) {
|
644
|
+
return !h.objectMode && h.decodeStrings !== !1 && typeof d == "string" && (d = b.from(d, S)), d;
|
645
|
+
}
|
646
|
+
Object.defineProperty(L.prototype, "writableHighWaterMark", {
|
647
|
+
// making it explicit this property is not enumerable
|
648
|
+
// because otherwise some prototype manipulation in
|
649
|
+
// userland will fail
|
650
|
+
enumerable: !1,
|
651
|
+
get: function() {
|
652
|
+
return this._writableState.highWaterMark;
|
653
|
+
}
|
654
|
+
});
|
655
|
+
function F(h, d, S, P, k, e) {
|
656
|
+
if (!S) {
|
657
|
+
var t = B(d, P, k);
|
658
|
+
P !== t && (S = !0, k = "buffer", P = t);
|
659
|
+
}
|
660
|
+
var y = d.objectMode ? 1 : P.length;
|
661
|
+
d.length += y;
|
662
|
+
var x = d.length < d.highWaterMark;
|
663
|
+
if (x || (d.needDrain = !0), d.writing || d.corked) {
|
664
|
+
var I = d.lastBufferedRequest;
|
665
|
+
d.lastBufferedRequest = {
|
666
|
+
chunk: P,
|
667
|
+
encoding: k,
|
668
|
+
isBuf: S,
|
669
|
+
callback: e,
|
670
|
+
next: null
|
671
|
+
}, I ? I.next = d.lastBufferedRequest : d.bufferedRequest = d.lastBufferedRequest, d.bufferedRequestCount += 1;
|
672
|
+
} else
|
673
|
+
W(h, d, !1, y, P, k, e);
|
674
|
+
return x;
|
675
|
+
}
|
676
|
+
function W(h, d, S, P, k, e, t) {
|
677
|
+
d.writelen = P, d.writecb = t, d.writing = !0, d.sync = !0, d.destroyed ? d.onwrite(new R("write")) : S ? h._writev(k, d.onwrite) : h._write(k, e, d.onwrite), d.sync = !1;
|
678
|
+
}
|
679
|
+
function Q(h, d, S, P, k) {
|
680
|
+
--d.pendingcb, S ? (process.nextTick(k, P), process.nextTick($, h, d), h._writableState.errorEmitted = !0, o(h, P)) : (k(P), h._writableState.errorEmitted = !0, o(h, P), $(h, d));
|
681
|
+
}
|
682
|
+
function re(h) {
|
683
|
+
h.writing = !1, h.writecb = null, h.length -= h.writelen, h.writelen = 0;
|
684
|
+
}
|
685
|
+
function he(h, d) {
|
686
|
+
var S = h._writableState, P = S.sync, k = S.writecb;
|
687
|
+
if (typeof k != "function") throw new C();
|
688
|
+
if (re(S), d) Q(h, S, P, d, k);
|
689
|
+
else {
|
690
|
+
var e = ie(S) || h.destroyed;
|
691
|
+
!e && !S.corked && !S.bufferProcessing && S.bufferedRequest && V(h, S), P ? process.nextTick(H, h, S, e, k) : H(h, S, e, k);
|
692
|
+
}
|
693
|
+
}
|
694
|
+
function H(h, d, S, P) {
|
695
|
+
S || ne(h, d), d.pendingcb--, P(), $(h, d);
|
696
|
+
}
|
697
|
+
function ne(h, d) {
|
698
|
+
d.length === 0 && d.needDrain && (d.needDrain = !1, h.emit("drain"));
|
699
|
+
}
|
700
|
+
function V(h, d) {
|
701
|
+
d.bufferProcessing = !0;
|
702
|
+
var S = d.bufferedRequest;
|
703
|
+
if (h._writev && S && S.next) {
|
704
|
+
var P = d.bufferedRequestCount, k = new Array(P), e = d.corkedRequestsFree;
|
705
|
+
e.entry = S;
|
706
|
+
for (var t = 0, y = !0; S; )
|
707
|
+
k[t] = S, S.isBuf || (y = !1), S = S.next, t += 1;
|
708
|
+
k.allBuffers = y, W(h, d, !0, d.length, k, "", e.finish), d.pendingcb++, d.lastBufferedRequest = null, e.next ? (d.corkedRequestsFree = e.next, e.next = null) : d.corkedRequestsFree = new u(d), d.bufferedRequestCount = 0;
|
709
|
+
} else {
|
710
|
+
for (; S; ) {
|
711
|
+
var x = S.chunk, I = S.encoding, q = S.callback, j = d.objectMode ? 1 : x.length;
|
712
|
+
if (W(h, d, !1, j, x, I, q), S = S.next, d.bufferedRequestCount--, d.writing)
|
713
|
+
break;
|
714
|
+
}
|
715
|
+
S === null && (d.lastBufferedRequest = null);
|
716
|
+
}
|
717
|
+
d.bufferedRequest = S, d.bufferProcessing = !1;
|
718
|
+
}
|
719
|
+
L.prototype._write = function(h, d, S) {
|
720
|
+
S(new D("_write()"));
|
721
|
+
}, L.prototype._writev = null, L.prototype.end = function(h, d, S) {
|
722
|
+
var P = this._writableState;
|
723
|
+
return typeof h == "function" ? (S = h, h = null, d = null) : typeof d == "function" && (S = d, d = null), h != null && this.write(h, d), P.corked && (P.corked = 1, this.uncork()), P.ending || ve(this, P, S), this;
|
724
|
+
}, Object.defineProperty(L.prototype, "writableLength", {
|
725
|
+
// making it explicit this property is not enumerable
|
726
|
+
// because otherwise some prototype manipulation in
|
727
|
+
// userland will fail
|
728
|
+
enumerable: !1,
|
729
|
+
get: function() {
|
730
|
+
return this._writableState.length;
|
731
|
+
}
|
732
|
+
});
|
733
|
+
function ie(h) {
|
734
|
+
return h.ending && h.length === 0 && h.bufferedRequest === null && !h.finished && !h.writing;
|
735
|
+
}
|
736
|
+
function pe(h, d) {
|
737
|
+
h._final(function(S) {
|
738
|
+
d.pendingcb--, S && o(h, S), d.prefinished = !0, h.emit("prefinish"), $(h, d);
|
739
|
+
});
|
740
|
+
}
|
741
|
+
function ae(h, d) {
|
742
|
+
!d.prefinished && !d.finalCalled && (typeof h._final == "function" && !d.destroyed ? (d.pendingcb++, d.finalCalled = !0, process.nextTick(pe, h, d)) : (d.prefinished = !0, h.emit("prefinish")));
|
743
|
+
}
|
744
|
+
function $(h, d) {
|
745
|
+
var S = ie(d);
|
746
|
+
if (S && (ae(h, d), d.pendingcb === 0 && (d.finished = !0, h.emit("finish"), d.autoDestroy))) {
|
747
|
+
var P = h._readableState;
|
748
|
+
(!P || P.autoDestroy && P.endEmitted) && h.destroy();
|
749
|
+
}
|
750
|
+
return S;
|
751
|
+
}
|
752
|
+
function ve(h, d, S) {
|
753
|
+
d.ending = !0, $(h, d), S && (d.finished ? process.nextTick(S) : h.once("finish", S)), d.ended = !0, h.writable = !1;
|
754
|
+
}
|
755
|
+
function _e(h, d, S) {
|
756
|
+
var P = h.entry;
|
757
|
+
for (h.entry = null; P; ) {
|
758
|
+
var k = P.callback;
|
759
|
+
d.pendingcb--, k(S), P = P.next;
|
760
|
+
}
|
761
|
+
d.corkedRequestsFree.next = h;
|
762
|
+
}
|
763
|
+
return Object.defineProperty(L.prototype, "destroyed", {
|
764
|
+
// making it explicit this property is not enumerable
|
765
|
+
// because otherwise some prototype manipulation in
|
766
|
+
// userland will fail
|
767
|
+
enumerable: !1,
|
768
|
+
get: function() {
|
769
|
+
return this._writableState === void 0 ? !1 : this._writableState.destroyed;
|
770
|
+
},
|
771
|
+
set: function(d) {
|
772
|
+
this._writableState && (this._writableState.destroyed = d);
|
773
|
+
}
|
774
|
+
}), L.prototype.destroy = l.destroy, L.prototype._undestroy = l.undestroy, L.prototype._destroy = function(h, d) {
|
775
|
+
d(h);
|
776
|
+
}, Te;
|
777
|
+
}
|
778
|
+
var Ce, Ze;
|
779
|
+
function z() {
|
780
|
+
if (Ze) return Ce;
|
781
|
+
Ze = 1;
|
782
|
+
var u = Object.keys || function(g) {
|
783
|
+
var T = [];
|
784
|
+
for (var E in g) T.push(E);
|
785
|
+
return T;
|
786
|
+
};
|
787
|
+
Ce = p;
|
788
|
+
var r = bt(), a = _t();
|
789
|
+
X()(p, r);
|
790
|
+
for (var s = u(a.prototype), b = 0; b < s.length; b++) {
|
791
|
+
var n = s[b];
|
792
|
+
p.prototype[n] || (p.prototype[n] = a.prototype[n]);
|
793
|
+
}
|
794
|
+
function p(g) {
|
795
|
+
if (!(this instanceof p)) return new p(g);
|
796
|
+
r.call(this, g), a.call(this, g), this.allowHalfOpen = !0, g && (g.readable === !1 && (this.readable = !1), g.writable === !1 && (this.writable = !1), g.allowHalfOpen === !1 && (this.allowHalfOpen = !1, this.once("end", c)));
|
797
|
+
}
|
798
|
+
Object.defineProperty(p.prototype, "writableHighWaterMark", {
|
799
|
+
// making it explicit this property is not enumerable
|
800
|
+
// because otherwise some prototype manipulation in
|
801
|
+
// userland will fail
|
802
|
+
enumerable: !1,
|
803
|
+
get: function() {
|
804
|
+
return this._writableState.highWaterMark;
|
805
|
+
}
|
806
|
+
}), Object.defineProperty(p.prototype, "writableBuffer", {
|
807
|
+
// making it explicit this property is not enumerable
|
808
|
+
// because otherwise some prototype manipulation in
|
809
|
+
// userland will fail
|
810
|
+
enumerable: !1,
|
811
|
+
get: function() {
|
812
|
+
return this._writableState && this._writableState.getBuffer();
|
813
|
+
}
|
814
|
+
}), Object.defineProperty(p.prototype, "writableLength", {
|
815
|
+
// making it explicit this property is not enumerable
|
816
|
+
// because otherwise some prototype manipulation in
|
817
|
+
// userland will fail
|
818
|
+
enumerable: !1,
|
819
|
+
get: function() {
|
820
|
+
return this._writableState.length;
|
821
|
+
}
|
822
|
+
});
|
823
|
+
function c() {
|
824
|
+
this._writableState.ended || process.nextTick(l, this);
|
825
|
+
}
|
826
|
+
function l(g) {
|
827
|
+
g.end();
|
828
|
+
}
|
829
|
+
return Object.defineProperty(p.prototype, "destroyed", {
|
830
|
+
// making it explicit this property is not enumerable
|
831
|
+
// because otherwise some prototype manipulation in
|
832
|
+
// userland will fail
|
833
|
+
enumerable: !1,
|
834
|
+
get: function() {
|
835
|
+
return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed;
|
836
|
+
},
|
837
|
+
set: function(T) {
|
838
|
+
this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = T, this._writableState.destroyed = T);
|
839
|
+
}
|
840
|
+
}), Ce;
|
841
|
+
}
|
842
|
+
var Ae = {}, ue = { exports: {} };
|
843
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
844
|
+
var et;
|
845
|
+
function kt() {
|
846
|
+
return et || (et = 1, function(u, r) {
|
847
|
+
var a = ce(), s = a.Buffer;
|
848
|
+
function b(p, c) {
|
849
|
+
for (var l in p)
|
850
|
+
c[l] = p[l];
|
851
|
+
}
|
852
|
+
s.from && s.alloc && s.allocUnsafe && s.allocUnsafeSlow ? u.exports = a : (b(a, r), r.Buffer = n);
|
853
|
+
function n(p, c, l) {
|
854
|
+
return s(p, c, l);
|
855
|
+
}
|
856
|
+
n.prototype = Object.create(s.prototype), b(s, n), n.from = function(p, c, l) {
|
857
|
+
if (typeof p == "number")
|
858
|
+
throw new TypeError("Argument must not be a number");
|
859
|
+
return s(p, c, l);
|
860
|
+
}, n.alloc = function(p, c, l) {
|
861
|
+
if (typeof p != "number")
|
862
|
+
throw new TypeError("Argument must be a number");
|
863
|
+
var g = s(p);
|
864
|
+
return c !== void 0 ? typeof l == "string" ? g.fill(c, l) : g.fill(c) : g.fill(0), g;
|
865
|
+
}, n.allocUnsafe = function(p) {
|
866
|
+
if (typeof p != "number")
|
867
|
+
throw new TypeError("Argument must be a number");
|
868
|
+
return s(p);
|
869
|
+
}, n.allocUnsafeSlow = function(p) {
|
870
|
+
if (typeof p != "number")
|
871
|
+
throw new TypeError("Argument must be a number");
|
872
|
+
return a.SlowBuffer(p);
|
873
|
+
};
|
874
|
+
}(ue, ue.exports)), ue.exports;
|
875
|
+
}
|
876
|
+
var tt;
|
877
|
+
function je() {
|
878
|
+
if (tt) return Ae;
|
879
|
+
tt = 1;
|
880
|
+
var u = kt().Buffer, r = u.isEncoding || function(i) {
|
881
|
+
switch (i = "" + i, i && i.toLowerCase()) {
|
882
|
+
case "hex":
|
883
|
+
case "utf8":
|
884
|
+
case "utf-8":
|
885
|
+
case "ascii":
|
886
|
+
case "binary":
|
887
|
+
case "base64":
|
888
|
+
case "ucs2":
|
889
|
+
case "ucs-2":
|
890
|
+
case "utf16le":
|
891
|
+
case "utf-16le":
|
892
|
+
case "raw":
|
893
|
+
return !0;
|
894
|
+
default:
|
895
|
+
return !1;
|
896
|
+
}
|
897
|
+
};
|
898
|
+
function a(i) {
|
899
|
+
if (!i) return "utf8";
|
900
|
+
for (var _; ; )
|
901
|
+
switch (i) {
|
902
|
+
case "utf8":
|
903
|
+
case "utf-8":
|
904
|
+
return "utf8";
|
905
|
+
case "ucs2":
|
906
|
+
case "ucs-2":
|
907
|
+
case "utf16le":
|
908
|
+
case "utf-16le":
|
909
|
+
return "utf16le";
|
910
|
+
case "latin1":
|
911
|
+
case "binary":
|
912
|
+
return "latin1";
|
913
|
+
case "base64":
|
914
|
+
case "ascii":
|
915
|
+
case "hex":
|
916
|
+
return i;
|
917
|
+
default:
|
918
|
+
if (_) return;
|
919
|
+
i = ("" + i).toLowerCase(), _ = !0;
|
920
|
+
}
|
921
|
+
}
|
922
|
+
function s(i) {
|
923
|
+
var _ = a(i);
|
924
|
+
if (typeof _ != "string" && (u.isEncoding === r || !r(i))) throw new Error("Unknown encoding: " + i);
|
925
|
+
return _ || i;
|
926
|
+
}
|
927
|
+
Ae.StringDecoder = b;
|
928
|
+
function b(i) {
|
929
|
+
this.encoding = s(i);
|
930
|
+
var _;
|
931
|
+
switch (this.encoding) {
|
932
|
+
case "utf16le":
|
933
|
+
this.text = E, this.end = w, _ = 4;
|
934
|
+
break;
|
935
|
+
case "utf8":
|
936
|
+
this.fillLast = l, _ = 4;
|
937
|
+
break;
|
938
|
+
case "base64":
|
939
|
+
this.text = D, this.end = C, _ = 3;
|
940
|
+
break;
|
941
|
+
default:
|
942
|
+
this.write = O, this.end = R;
|
943
|
+
return;
|
944
|
+
}
|
945
|
+
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = u.allocUnsafe(_);
|
946
|
+
}
|
947
|
+
b.prototype.write = function(i) {
|
948
|
+
if (i.length === 0) return "";
|
949
|
+
var _, m;
|
950
|
+
if (this.lastNeed) {
|
951
|
+
if (_ = this.fillLast(i), _ === void 0) return "";
|
952
|
+
m = this.lastNeed, this.lastNeed = 0;
|
953
|
+
} else
|
954
|
+
m = 0;
|
955
|
+
return m < i.length ? _ ? _ + this.text(i, m) : this.text(i, m) : _ || "";
|
956
|
+
}, b.prototype.end = T, b.prototype.text = g, b.prototype.fillLast = function(i) {
|
957
|
+
if (this.lastNeed <= i.length)
|
958
|
+
return i.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
959
|
+
i.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, i.length), this.lastNeed -= i.length;
|
960
|
+
};
|
961
|
+
function n(i) {
|
962
|
+
return i <= 127 ? 0 : i >> 5 === 6 ? 2 : i >> 4 === 14 ? 3 : i >> 3 === 30 ? 4 : i >> 6 === 2 ? -1 : -2;
|
963
|
+
}
|
964
|
+
function p(i, _, m) {
|
965
|
+
var o = _.length - 1;
|
966
|
+
if (o < m) return 0;
|
967
|
+
var f = n(_[o]);
|
968
|
+
return f >= 0 ? (f > 0 && (i.lastNeed = f - 1), f) : --o < m || f === -2 ? 0 : (f = n(_[o]), f >= 0 ? (f > 0 && (i.lastNeed = f - 2), f) : --o < m || f === -2 ? 0 : (f = n(_[o]), f >= 0 ? (f > 0 && (f === 2 ? f = 0 : i.lastNeed = f - 3), f) : 0));
|
969
|
+
}
|
970
|
+
function c(i, _, m) {
|
971
|
+
if ((_[0] & 192) !== 128)
|
972
|
+
return i.lastNeed = 0, "�";
|
973
|
+
if (i.lastNeed > 1 && _.length > 1) {
|
974
|
+
if ((_[1] & 192) !== 128)
|
975
|
+
return i.lastNeed = 1, "�";
|
976
|
+
if (i.lastNeed > 2 && _.length > 2 && (_[2] & 192) !== 128)
|
977
|
+
return i.lastNeed = 2, "�";
|
978
|
+
}
|
979
|
+
}
|
980
|
+
function l(i) {
|
981
|
+
var _ = this.lastTotal - this.lastNeed, m = c(this, i);
|
982
|
+
if (m !== void 0) return m;
|
983
|
+
if (this.lastNeed <= i.length)
|
984
|
+
return i.copy(this.lastChar, _, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
985
|
+
i.copy(this.lastChar, _, 0, i.length), this.lastNeed -= i.length;
|
986
|
+
}
|
987
|
+
function g(i, _) {
|
988
|
+
var m = p(this, i, _);
|
989
|
+
if (!this.lastNeed) return i.toString("utf8", _);
|
990
|
+
this.lastTotal = m;
|
991
|
+
var o = i.length - (m - this.lastNeed);
|
992
|
+
return i.copy(this.lastChar, 0, o), i.toString("utf8", _, o);
|
993
|
+
}
|
994
|
+
function T(i) {
|
995
|
+
var _ = i && i.length ? this.write(i) : "";
|
996
|
+
return this.lastNeed ? _ + "�" : _;
|
997
|
+
}
|
998
|
+
function E(i, _) {
|
999
|
+
if ((i.length - _) % 2 === 0) {
|
1000
|
+
var m = i.toString("utf16le", _);
|
1001
|
+
if (m) {
|
1002
|
+
var o = m.charCodeAt(m.length - 1);
|
1003
|
+
if (o >= 55296 && o <= 56319)
|
1004
|
+
return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = i[i.length - 2], this.lastChar[1] = i[i.length - 1], m.slice(0, -1);
|
1005
|
+
}
|
1006
|
+
return m;
|
1007
|
+
}
|
1008
|
+
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = i[i.length - 1], i.toString("utf16le", _, i.length - 1);
|
1009
|
+
}
|
1010
|
+
function w(i) {
|
1011
|
+
var _ = i && i.length ? this.write(i) : "";
|
1012
|
+
if (this.lastNeed) {
|
1013
|
+
var m = this.lastTotal - this.lastNeed;
|
1014
|
+
return _ + this.lastChar.toString("utf16le", 0, m);
|
1015
|
+
}
|
1016
|
+
return _;
|
1017
|
+
}
|
1018
|
+
function D(i, _) {
|
1019
|
+
var m = (i.length - _) % 3;
|
1020
|
+
return m === 0 ? i.toString("base64", _) : (this.lastNeed = 3 - m, this.lastTotal = 3, m === 1 ? this.lastChar[0] = i[i.length - 1] : (this.lastChar[0] = i[i.length - 2], this.lastChar[1] = i[i.length - 1]), i.toString("base64", _, i.length - m));
|
1021
|
+
}
|
1022
|
+
function C(i) {
|
1023
|
+
var _ = i && i.length ? this.write(i) : "";
|
1024
|
+
return this.lastNeed ? _ + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : _;
|
1025
|
+
}
|
1026
|
+
function O(i) {
|
1027
|
+
return i.toString(this.encoding);
|
1028
|
+
}
|
1029
|
+
function R(i) {
|
1030
|
+
return i && i.length ? this.write(i) : "";
|
1031
|
+
}
|
1032
|
+
return Ae;
|
1033
|
+
}
|
1034
|
+
var Me, rt;
|
1035
|
+
function Fe() {
|
1036
|
+
if (rt) return Me;
|
1037
|
+
rt = 1;
|
1038
|
+
var u = J().codes.ERR_STREAM_PREMATURE_CLOSE;
|
1039
|
+
function r(n) {
|
1040
|
+
var p = !1;
|
1041
|
+
return function() {
|
1042
|
+
if (!p) {
|
1043
|
+
p = !0;
|
1044
|
+
for (var c = arguments.length, l = new Array(c), g = 0; g < c; g++)
|
1045
|
+
l[g] = arguments[g];
|
1046
|
+
n.apply(this, l);
|
1047
|
+
}
|
1048
|
+
};
|
1049
|
+
}
|
1050
|
+
function a() {
|
1051
|
+
}
|
1052
|
+
function s(n) {
|
1053
|
+
return n.setHeader && typeof n.abort == "function";
|
1054
|
+
}
|
1055
|
+
function b(n, p, c) {
|
1056
|
+
if (typeof p == "function") return b(n, null, p);
|
1057
|
+
p || (p = {}), c = r(c || a);
|
1058
|
+
var l = p.readable || p.readable !== !1 && n.readable, g = p.writable || p.writable !== !1 && n.writable, T = function() {
|
1059
|
+
n.writable || w();
|
1060
|
+
}, E = n._writableState && n._writableState.finished, w = function() {
|
1061
|
+
g = !1, E = !0, l || c.call(n);
|
1062
|
+
}, D = n._readableState && n._readableState.endEmitted, C = function() {
|
1063
|
+
l = !1, D = !0, g || c.call(n);
|
1064
|
+
}, O = function(m) {
|
1065
|
+
c.call(n, m);
|
1066
|
+
}, R = function() {
|
1067
|
+
var m;
|
1068
|
+
if (l && !D)
|
1069
|
+
return (!n._readableState || !n._readableState.ended) && (m = new u()), c.call(n, m);
|
1070
|
+
if (g && !E)
|
1071
|
+
return (!n._writableState || !n._writableState.ended) && (m = new u()), c.call(n, m);
|
1072
|
+
}, i = function() {
|
1073
|
+
n.req.on("finish", w);
|
1074
|
+
};
|
1075
|
+
return s(n) ? (n.on("complete", w), n.on("abort", R), n.req ? i() : n.on("request", i)) : g && !n._writableState && (n.on("end", T), n.on("close", T)), n.on("end", C), n.on("finish", w), p.error !== !1 && n.on("error", O), n.on("close", R), function() {
|
1076
|
+
n.removeListener("complete", w), n.removeListener("abort", R), n.removeListener("request", i), n.req && n.req.removeListener("finish", w), n.removeListener("end", T), n.removeListener("close", T), n.removeListener("finish", w), n.removeListener("end", C), n.removeListener("error", O), n.removeListener("close", R);
|
1077
|
+
};
|
1078
|
+
}
|
1079
|
+
return Me = b, Me;
|
1080
|
+
}
|
1081
|
+
var Oe, nt;
|
1082
|
+
function jt() {
|
1083
|
+
if (nt) return Oe;
|
1084
|
+
nt = 1;
|
1085
|
+
var u;
|
1086
|
+
function r(m, o, f) {
|
1087
|
+
return o = a(o), o in m ? Object.defineProperty(m, o, { value: f, enumerable: !0, configurable: !0, writable: !0 }) : m[o] = f, m;
|
1088
|
+
}
|
1089
|
+
function a(m) {
|
1090
|
+
var o = s(m, "string");
|
1091
|
+
return typeof o == "symbol" ? o : String(o);
|
1092
|
+
}
|
1093
|
+
function s(m, o) {
|
1094
|
+
if (typeof m != "object" || m === null) return m;
|
1095
|
+
var f = m[Symbol.toPrimitive];
|
1096
|
+
if (f !== void 0) {
|
1097
|
+
var v = f.call(m, o || "default");
|
1098
|
+
if (typeof v != "object") return v;
|
1099
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
1100
|
+
}
|
1101
|
+
return (o === "string" ? String : Number)(m);
|
1102
|
+
}
|
1103
|
+
var b = Fe(), n = Symbol("lastResolve"), p = Symbol("lastReject"), c = Symbol("error"), l = Symbol("ended"), g = Symbol("lastPromise"), T = Symbol("handlePromise"), E = Symbol("stream");
|
1104
|
+
function w(m, o) {
|
1105
|
+
return {
|
1106
|
+
value: m,
|
1107
|
+
done: o
|
1108
|
+
};
|
1109
|
+
}
|
1110
|
+
function D(m) {
|
1111
|
+
var o = m[n];
|
1112
|
+
if (o !== null) {
|
1113
|
+
var f = m[E].read();
|
1114
|
+
f !== null && (m[g] = null, m[n] = null, m[p] = null, o(w(f, !1)));
|
1115
|
+
}
|
1116
|
+
}
|
1117
|
+
function C(m) {
|
1118
|
+
process.nextTick(D, m);
|
1119
|
+
}
|
1120
|
+
function O(m, o) {
|
1121
|
+
return function(f, v) {
|
1122
|
+
m.then(function() {
|
1123
|
+
if (o[l]) {
|
1124
|
+
f(w(void 0, !0));
|
1125
|
+
return;
|
1126
|
+
}
|
1127
|
+
o[T](f, v);
|
1128
|
+
}, v);
|
1129
|
+
};
|
1130
|
+
}
|
1131
|
+
var R = Object.getPrototypeOf(function() {
|
1132
|
+
}), i = Object.setPrototypeOf((u = {
|
1133
|
+
get stream() {
|
1134
|
+
return this[E];
|
1135
|
+
},
|
1136
|
+
next: function() {
|
1137
|
+
var o = this, f = this[c];
|
1138
|
+
if (f !== null)
|
1139
|
+
return Promise.reject(f);
|
1140
|
+
if (this[l])
|
1141
|
+
return Promise.resolve(w(void 0, !0));
|
1142
|
+
if (this[E].destroyed)
|
1143
|
+
return new Promise(function(M, N) {
|
1144
|
+
process.nextTick(function() {
|
1145
|
+
o[c] ? N(o[c]) : M(w(void 0, !0));
|
1146
|
+
});
|
1147
|
+
});
|
1148
|
+
var v = this[g], A;
|
1149
|
+
if (v)
|
1150
|
+
A = new Promise(O(v, this));
|
1151
|
+
else {
|
1152
|
+
var L = this[E].read();
|
1153
|
+
if (L !== null)
|
1154
|
+
return Promise.resolve(w(L, !1));
|
1155
|
+
A = new Promise(this[T]);
|
1156
|
+
}
|
1157
|
+
return this[g] = A, A;
|
1158
|
+
}
|
1159
|
+
}, r(u, Symbol.asyncIterator, function() {
|
1160
|
+
return this;
|
1161
|
+
}), r(u, "return", function() {
|
1162
|
+
var o = this;
|
1163
|
+
return new Promise(function(f, v) {
|
1164
|
+
o[E].destroy(null, function(A) {
|
1165
|
+
if (A) {
|
1166
|
+
v(A);
|
1167
|
+
return;
|
1168
|
+
}
|
1169
|
+
f(w(void 0, !0));
|
1170
|
+
});
|
1171
|
+
});
|
1172
|
+
}), u), R), _ = function(o) {
|
1173
|
+
var f, v = Object.create(i, (f = {}, r(f, E, {
|
1174
|
+
value: o,
|
1175
|
+
writable: !0
|
1176
|
+
}), r(f, n, {
|
1177
|
+
value: null,
|
1178
|
+
writable: !0
|
1179
|
+
}), r(f, p, {
|
1180
|
+
value: null,
|
1181
|
+
writable: !0
|
1182
|
+
}), r(f, c, {
|
1183
|
+
value: null,
|
1184
|
+
writable: !0
|
1185
|
+
}), r(f, l, {
|
1186
|
+
value: o._readableState.endEmitted,
|
1187
|
+
writable: !0
|
1188
|
+
}), r(f, T, {
|
1189
|
+
value: function(L, M) {
|
1190
|
+
var N = v[E].read();
|
1191
|
+
N ? (v[g] = null, v[n] = null, v[p] = null, L(w(N, !1))) : (v[n] = L, v[p] = M);
|
1192
|
+
},
|
1193
|
+
writable: !0
|
1194
|
+
}), f));
|
1195
|
+
return v[g] = null, b(o, function(A) {
|
1196
|
+
if (A && A.code !== "ERR_STREAM_PREMATURE_CLOSE") {
|
1197
|
+
var L = v[p];
|
1198
|
+
L !== null && (v[g] = null, v[n] = null, v[p] = null, L(A)), v[c] = A;
|
1199
|
+
return;
|
1200
|
+
}
|
1201
|
+
var M = v[n];
|
1202
|
+
M !== null && (v[g] = null, v[n] = null, v[p] = null, M(w(void 0, !0))), v[l] = !0;
|
1203
|
+
}), o.on("readable", C.bind(null, v)), v;
|
1204
|
+
};
|
1205
|
+
return Oe = _, Oe;
|
1206
|
+
}
|
1207
|
+
var xe, it;
|
1208
|
+
function It() {
|
1209
|
+
return it || (it = 1, xe = function() {
|
1210
|
+
throw new Error("Readable.from is not available in the browser");
|
1211
|
+
}), xe;
|
1212
|
+
}
|
1213
|
+
var De, at;
|
1214
|
+
function bt() {
|
1215
|
+
if (at) return De;
|
1216
|
+
at = 1, De = M;
|
1217
|
+
var u;
|
1218
|
+
M.ReadableState = L, Be().EventEmitter;
|
1219
|
+
var r = function(t, y) {
|
1220
|
+
return t.listeners(y).length;
|
1221
|
+
}, a = ct(), s = ce().Buffer, b = (typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
|
1222
|
+
};
|
1223
|
+
function n(e) {
|
1224
|
+
return s.from(e);
|
1225
|
+
}
|
1226
|
+
function p(e) {
|
1227
|
+
return s.isBuffer(e) || e instanceof b;
|
1228
|
+
}
|
1229
|
+
var c = ht, l;
|
1230
|
+
c && c.debuglog ? l = c.debuglog("stream") : l = function() {
|
1231
|
+
};
|
1232
|
+
var g = Nt(), T = pt(), E = vt(), w = E.getHighWaterMark, D = J().codes, C = D.ERR_INVALID_ARG_TYPE, O = D.ERR_STREAM_PUSH_AFTER_EOF, R = D.ERR_METHOD_NOT_IMPLEMENTED, i = D.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, _, m, o;
|
1233
|
+
X()(M, a);
|
1234
|
+
var f = T.errorOrDestroy, v = ["error", "close", "destroy", "pause", "resume"];
|
1235
|
+
function A(e, t, y) {
|
1236
|
+
if (typeof e.prependListener == "function") return e.prependListener(t, y);
|
1237
|
+
!e._events || !e._events[t] ? e.on(t, y) : Array.isArray(e._events[t]) ? e._events[t].unshift(y) : e._events[t] = [y, e._events[t]];
|
1238
|
+
}
|
1239
|
+
function L(e, t, y) {
|
1240
|
+
u = u || z(), e = e || {}, typeof y != "boolean" && (y = t instanceof u), this.objectMode = !!e.objectMode, y && (this.objectMode = this.objectMode || !!e.readableObjectMode), this.highWaterMark = w(this, e, "readableHighWaterMark", y), this.buffer = new g(), 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 = e.emitClose !== !1, this.autoDestroy = !!e.autoDestroy, this.destroyed = !1, this.defaultEncoding = e.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, e.encoding && (_ || (_ = je().StringDecoder), this.decoder = new _(e.encoding), this.encoding = e.encoding);
|
1241
|
+
}
|
1242
|
+
function M(e) {
|
1243
|
+
if (u = u || z(), !(this instanceof M)) return new M(e);
|
1244
|
+
var t = this instanceof u;
|
1245
|
+
this._readableState = new L(e, this, t), this.readable = !0, e && (typeof e.read == "function" && (this._read = e.read), typeof e.destroy == "function" && (this._destroy = e.destroy)), a.call(this);
|
1246
|
+
}
|
1247
|
+
Object.defineProperty(M.prototype, "destroyed", {
|
1248
|
+
// making it explicit this property is not enumerable
|
1249
|
+
// because otherwise some prototype manipulation in
|
1250
|
+
// userland will fail
|
1251
|
+
enumerable: !1,
|
1252
|
+
get: function() {
|
1253
|
+
return this._readableState === void 0 ? !1 : this._readableState.destroyed;
|
1254
|
+
},
|
1255
|
+
set: function(t) {
|
1256
|
+
this._readableState && (this._readableState.destroyed = t);
|
1257
|
+
}
|
1258
|
+
}), M.prototype.destroy = T.destroy, M.prototype._undestroy = T.undestroy, M.prototype._destroy = function(e, t) {
|
1259
|
+
t(e);
|
1260
|
+
}, M.prototype.push = function(e, t) {
|
1261
|
+
var y = this._readableState, x;
|
1262
|
+
return y.objectMode ? x = !0 : typeof e == "string" && (t = t || y.defaultEncoding, t !== y.encoding && (e = s.from(e, t), t = ""), x = !0), N(this, e, t, !1, x);
|
1263
|
+
}, M.prototype.unshift = function(e) {
|
1264
|
+
return N(this, e, null, !0, !1);
|
1265
|
+
};
|
1266
|
+
function N(e, t, y, x, I) {
|
1267
|
+
l("readableAddChunk", t);
|
1268
|
+
var q = e._readableState;
|
1269
|
+
if (t === null)
|
1270
|
+
q.reading = !1, he(e, q);
|
1271
|
+
else {
|
1272
|
+
var j;
|
1273
|
+
if (I || (j = F(q, t)), j)
|
1274
|
+
f(e, j);
|
1275
|
+
else if (q.objectMode || t && t.length > 0)
|
1276
|
+
if (typeof t != "string" && !q.objectMode && Object.getPrototypeOf(t) !== s.prototype && (t = n(t)), x)
|
1277
|
+
q.endEmitted ? f(e, new i()) : B(e, q, t, !0);
|
1278
|
+
else if (q.ended)
|
1279
|
+
f(e, new O());
|
1280
|
+
else {
|
1281
|
+
if (q.destroyed)
|
1282
|
+
return !1;
|
1283
|
+
q.reading = !1, q.decoder && !y ? (t = q.decoder.write(t), q.objectMode || t.length !== 0 ? B(e, q, t, !1) : V(e, q)) : B(e, q, t, !1);
|
1284
|
+
}
|
1285
|
+
else x || (q.reading = !1, V(e, q));
|
1286
|
+
}
|
1287
|
+
return !q.ended && (q.length < q.highWaterMark || q.length === 0);
|
1288
|
+
}
|
1289
|
+
function B(e, t, y, x) {
|
1290
|
+
t.flowing && t.length === 0 && !t.sync ? (t.awaitDrain = 0, e.emit("data", y)) : (t.length += t.objectMode ? 1 : y.length, x ? t.buffer.unshift(y) : t.buffer.push(y), t.needReadable && H(e)), V(e, t);
|
1291
|
+
}
|
1292
|
+
function F(e, t) {
|
1293
|
+
var y;
|
1294
|
+
return !p(t) && typeof t != "string" && t !== void 0 && !e.objectMode && (y = new C("chunk", ["string", "Buffer", "Uint8Array"], t)), y;
|
1295
|
+
}
|
1296
|
+
M.prototype.isPaused = function() {
|
1297
|
+
return this._readableState.flowing === !1;
|
1298
|
+
}, M.prototype.setEncoding = function(e) {
|
1299
|
+
_ || (_ = je().StringDecoder);
|
1300
|
+
var t = new _(e);
|
1301
|
+
this._readableState.decoder = t, this._readableState.encoding = this._readableState.decoder.encoding;
|
1302
|
+
for (var y = this._readableState.buffer.head, x = ""; y !== null; )
|
1303
|
+
x += t.write(y.data), y = y.next;
|
1304
|
+
return this._readableState.buffer.clear(), x !== "" && this._readableState.buffer.push(x), this._readableState.length = x.length, this;
|
1305
|
+
};
|
1306
|
+
var W = 1073741824;
|
1307
|
+
function Q(e) {
|
1308
|
+
return e >= W ? e = W : (e--, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e++), e;
|
1309
|
+
}
|
1310
|
+
function re(e, t) {
|
1311
|
+
return e <= 0 || t.length === 0 && t.ended ? 0 : t.objectMode ? 1 : e !== e ? t.flowing && t.length ? t.buffer.head.data.length : t.length : (e > t.highWaterMark && (t.highWaterMark = Q(e)), e <= t.length ? e : t.ended ? t.length : (t.needReadable = !0, 0));
|
1312
|
+
}
|
1313
|
+
M.prototype.read = function(e) {
|
1314
|
+
l("read", e), e = parseInt(e, 10);
|
1315
|
+
var t = this._readableState, y = e;
|
1316
|
+
if (e !== 0 && (t.emittedReadable = !1), e === 0 && t.needReadable && ((t.highWaterMark !== 0 ? t.length >= t.highWaterMark : t.length > 0) || t.ended))
|
1317
|
+
return l("read: emitReadable", t.length, t.ended), t.length === 0 && t.ended ? S(this) : H(this), null;
|
1318
|
+
if (e = re(e, t), e === 0 && t.ended)
|
1319
|
+
return t.length === 0 && S(this), null;
|
1320
|
+
var x = t.needReadable;
|
1321
|
+
l("need readable", x), (t.length === 0 || t.length - e < t.highWaterMark) && (x = !0, l("length less than watermark", x)), t.ended || t.reading ? (x = !1, l("reading or ended", x)) : x && (l("do read"), t.reading = !0, t.sync = !0, t.length === 0 && (t.needReadable = !0), this._read(t.highWaterMark), t.sync = !1, t.reading || (e = re(y, t)));
|
1322
|
+
var I;
|
1323
|
+
return e > 0 ? I = d(e, t) : I = null, I === null ? (t.needReadable = t.length <= t.highWaterMark, e = 0) : (t.length -= e, t.awaitDrain = 0), t.length === 0 && (t.ended || (t.needReadable = !0), y !== e && t.ended && S(this)), I !== null && this.emit("data", I), I;
|
1324
|
+
};
|
1325
|
+
function he(e, t) {
|
1326
|
+
if (l("onEofChunk"), !t.ended) {
|
1327
|
+
if (t.decoder) {
|
1328
|
+
var y = t.decoder.end();
|
1329
|
+
y && y.length && (t.buffer.push(y), t.length += t.objectMode ? 1 : y.length);
|
1330
|
+
}
|
1331
|
+
t.ended = !0, t.sync ? H(e) : (t.needReadable = !1, t.emittedReadable || (t.emittedReadable = !0, ne(e)));
|
1332
|
+
}
|
1333
|
+
}
|
1334
|
+
function H(e) {
|
1335
|
+
var t = e._readableState;
|
1336
|
+
l("emitReadable", t.needReadable, t.emittedReadable), t.needReadable = !1, t.emittedReadable || (l("emitReadable", t.flowing), t.emittedReadable = !0, process.nextTick(ne, e));
|
1337
|
+
}
|
1338
|
+
function ne(e) {
|
1339
|
+
var t = e._readableState;
|
1340
|
+
l("emitReadable_", t.destroyed, t.length, t.ended), !t.destroyed && (t.length || t.ended) && (e.emit("readable"), t.emittedReadable = !1), t.needReadable = !t.flowing && !t.ended && t.length <= t.highWaterMark, h(e);
|
1341
|
+
}
|
1342
|
+
function V(e, t) {
|
1343
|
+
t.readingMore || (t.readingMore = !0, process.nextTick(ie, e, t));
|
1344
|
+
}
|
1345
|
+
function ie(e, t) {
|
1346
|
+
for (; !t.reading && !t.ended && (t.length < t.highWaterMark || t.flowing && t.length === 0); ) {
|
1347
|
+
var y = t.length;
|
1348
|
+
if (l("maybeReadMore read 0"), e.read(0), y === t.length)
|
1349
|
+
break;
|
1350
|
+
}
|
1351
|
+
t.readingMore = !1;
|
1352
|
+
}
|
1353
|
+
M.prototype._read = function(e) {
|
1354
|
+
f(this, new R("_read()"));
|
1355
|
+
}, M.prototype.pipe = function(e, t) {
|
1356
|
+
var y = this, x = this._readableState;
|
1357
|
+
switch (x.pipesCount) {
|
1358
|
+
case 0:
|
1359
|
+
x.pipes = e;
|
1360
|
+
break;
|
1361
|
+
case 1:
|
1362
|
+
x.pipes = [x.pipes, e];
|
1363
|
+
break;
|
1364
|
+
default:
|
1365
|
+
x.pipes.push(e);
|
1366
|
+
break;
|
1367
|
+
}
|
1368
|
+
x.pipesCount += 1, l("pipe count=%d opts=%j", x.pipesCount, t);
|
1369
|
+
var I = (!t || t.end !== !1) && e !== process.stdout && e !== process.stderr, q = I ? G : Z;
|
1370
|
+
x.endEmitted ? process.nextTick(q) : y.once("end", q), e.on("unpipe", j);
|
1371
|
+
function j(K, Y) {
|
1372
|
+
l("onunpipe"), K === y && Y && Y.hasUnpiped === !1 && (Y.hasUnpiped = !0, xt());
|
1373
|
+
}
|
1374
|
+
function G() {
|
1375
|
+
l("onend"), e.end();
|
1376
|
+
}
|
1377
|
+
var se = pe(y);
|
1378
|
+
e.on("drain", se);
|
1379
|
+
var Ue = !1;
|
1380
|
+
function xt() {
|
1381
|
+
l("cleanup"), e.removeListener("close", ge), e.removeListener("finish", ye), e.removeListener("drain", se), e.removeListener("error", be), e.removeListener("unpipe", j), y.removeListener("end", G), y.removeListener("end", Z), y.removeListener("data", He), Ue = !0, x.awaitDrain && (!e._writableState || e._writableState.needDrain) && se();
|
1382
|
+
}
|
1383
|
+
y.on("data", He);
|
1384
|
+
function He(K) {
|
1385
|
+
l("ondata");
|
1386
|
+
var Y = e.write(K);
|
1387
|
+
l("dest.write", Y), Y === !1 && ((x.pipesCount === 1 && x.pipes === e || x.pipesCount > 1 && k(x.pipes, e) !== -1) && !Ue && (l("false write response, pause", x.awaitDrain), x.awaitDrain++), y.pause());
|
1388
|
+
}
|
1389
|
+
function be(K) {
|
1390
|
+
l("onerror", K), Z(), e.removeListener("error", be), r(e, "error") === 0 && f(e, K);
|
1391
|
+
}
|
1392
|
+
A(e, "error", be);
|
1393
|
+
function ge() {
|
1394
|
+
e.removeListener("finish", ye), Z();
|
1395
|
+
}
|
1396
|
+
e.once("close", ge);
|
1397
|
+
function ye() {
|
1398
|
+
l("onfinish"), e.removeListener("close", ge), Z();
|
1399
|
+
}
|
1400
|
+
e.once("finish", ye);
|
1401
|
+
function Z() {
|
1402
|
+
l("unpipe"), y.unpipe(e);
|
1403
|
+
}
|
1404
|
+
return e.emit("pipe", y), x.flowing || (l("pipe resume"), y.resume()), e;
|
1405
|
+
};
|
1406
|
+
function pe(e) {
|
1407
|
+
return function() {
|
1408
|
+
var y = e._readableState;
|
1409
|
+
l("pipeOnDrain", y.awaitDrain), y.awaitDrain && y.awaitDrain--, y.awaitDrain === 0 && r(e, "data") && (y.flowing = !0, h(e));
|
1410
|
+
};
|
1411
|
+
}
|
1412
|
+
M.prototype.unpipe = function(e) {
|
1413
|
+
var t = this._readableState, y = {
|
1414
|
+
hasUnpiped: !1
|
1415
|
+
};
|
1416
|
+
if (t.pipesCount === 0) return this;
|
1417
|
+
if (t.pipesCount === 1)
|
1418
|
+
return e && e !== t.pipes ? this : (e || (e = t.pipes), t.pipes = null, t.pipesCount = 0, t.flowing = !1, e && e.emit("unpipe", this, y), this);
|
1419
|
+
if (!e) {
|
1420
|
+
var x = t.pipes, I = t.pipesCount;
|
1421
|
+
t.pipes = null, t.pipesCount = 0, t.flowing = !1;
|
1422
|
+
for (var q = 0; q < I; q++) x[q].emit("unpipe", this, {
|
1423
|
+
hasUnpiped: !1
|
1424
|
+
});
|
1425
|
+
return this;
|
1426
|
+
}
|
1427
|
+
var j = k(t.pipes, e);
|
1428
|
+
return j === -1 ? this : (t.pipes.splice(j, 1), t.pipesCount -= 1, t.pipesCount === 1 && (t.pipes = t.pipes[0]), e.emit("unpipe", this, y), this);
|
1429
|
+
}, M.prototype.on = function(e, t) {
|
1430
|
+
var y = a.prototype.on.call(this, e, t), x = this._readableState;
|
1431
|
+
return e === "data" ? (x.readableListening = this.listenerCount("readable") > 0, x.flowing !== !1 && this.resume()) : e === "readable" && !x.endEmitted && !x.readableListening && (x.readableListening = x.needReadable = !0, x.flowing = !1, x.emittedReadable = !1, l("on readable", x.length, x.reading), x.length ? H(this) : x.reading || process.nextTick($, this)), y;
|
1432
|
+
}, M.prototype.addListener = M.prototype.on, M.prototype.removeListener = function(e, t) {
|
1433
|
+
var y = a.prototype.removeListener.call(this, e, t);
|
1434
|
+
return e === "readable" && process.nextTick(ae, this), y;
|
1435
|
+
}, M.prototype.removeAllListeners = function(e) {
|
1436
|
+
var t = a.prototype.removeAllListeners.apply(this, arguments);
|
1437
|
+
return (e === "readable" || e === void 0) && process.nextTick(ae, this), t;
|
1438
|
+
};
|
1439
|
+
function ae(e) {
|
1440
|
+
var t = e._readableState;
|
1441
|
+
t.readableListening = e.listenerCount("readable") > 0, t.resumeScheduled && !t.paused ? t.flowing = !0 : e.listenerCount("data") > 0 && e.resume();
|
1442
|
+
}
|
1443
|
+
function $(e) {
|
1444
|
+
l("readable nexttick read 0"), e.read(0);
|
1445
|
+
}
|
1446
|
+
M.prototype.resume = function() {
|
1447
|
+
var e = this._readableState;
|
1448
|
+
return e.flowing || (l("resume"), e.flowing = !e.readableListening, ve(this, e)), e.paused = !1, this;
|
1449
|
+
};
|
1450
|
+
function ve(e, t) {
|
1451
|
+
t.resumeScheduled || (t.resumeScheduled = !0, process.nextTick(_e, e, t));
|
1452
|
+
}
|
1453
|
+
function _e(e, t) {
|
1454
|
+
l("resume", t.reading), t.reading || e.read(0), t.resumeScheduled = !1, e.emit("resume"), h(e), t.flowing && !t.reading && e.read(0);
|
1455
|
+
}
|
1456
|
+
M.prototype.pause = function() {
|
1457
|
+
return l("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (l("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this;
|
1458
|
+
};
|
1459
|
+
function h(e) {
|
1460
|
+
var t = e._readableState;
|
1461
|
+
for (l("flow", t.flowing); t.flowing && e.read() !== null; ) ;
|
1462
|
+
}
|
1463
|
+
M.prototype.wrap = function(e) {
|
1464
|
+
var t = this, y = this._readableState, x = !1;
|
1465
|
+
e.on("end", function() {
|
1466
|
+
if (l("wrapped end"), y.decoder && !y.ended) {
|
1467
|
+
var j = y.decoder.end();
|
1468
|
+
j && j.length && t.push(j);
|
1469
|
+
}
|
1470
|
+
t.push(null);
|
1471
|
+
}), e.on("data", function(j) {
|
1472
|
+
if (l("wrapped data"), y.decoder && (j = y.decoder.write(j)), !(y.objectMode && j == null) && !(!y.objectMode && (!j || !j.length))) {
|
1473
|
+
var G = t.push(j);
|
1474
|
+
G || (x = !0, e.pause());
|
1475
|
+
}
|
1476
|
+
});
|
1477
|
+
for (var I in e)
|
1478
|
+
this[I] === void 0 && typeof e[I] == "function" && (this[I] = /* @__PURE__ */ function(G) {
|
1479
|
+
return function() {
|
1480
|
+
return e[G].apply(e, arguments);
|
1481
|
+
};
|
1482
|
+
}(I));
|
1483
|
+
for (var q = 0; q < v.length; q++)
|
1484
|
+
e.on(v[q], this.emit.bind(this, v[q]));
|
1485
|
+
return this._read = function(j) {
|
1486
|
+
l("wrapped _read", j), x && (x = !1, e.resume());
|
1487
|
+
}, this;
|
1488
|
+
}, typeof Symbol == "function" && (M.prototype[Symbol.asyncIterator] = function() {
|
1489
|
+
return m === void 0 && (m = jt()), m(this);
|
1490
|
+
}), Object.defineProperty(M.prototype, "readableHighWaterMark", {
|
1491
|
+
// making it explicit this property is not enumerable
|
1492
|
+
// because otherwise some prototype manipulation in
|
1493
|
+
// userland will fail
|
1494
|
+
enumerable: !1,
|
1495
|
+
get: function() {
|
1496
|
+
return this._readableState.highWaterMark;
|
1497
|
+
}
|
1498
|
+
}), Object.defineProperty(M.prototype, "readableBuffer", {
|
1499
|
+
// making it explicit this property is not enumerable
|
1500
|
+
// because otherwise some prototype manipulation in
|
1501
|
+
// userland will fail
|
1502
|
+
enumerable: !1,
|
1503
|
+
get: function() {
|
1504
|
+
return this._readableState && this._readableState.buffer;
|
1505
|
+
}
|
1506
|
+
}), Object.defineProperty(M.prototype, "readableFlowing", {
|
1507
|
+
// making it explicit this property is not enumerable
|
1508
|
+
// because otherwise some prototype manipulation in
|
1509
|
+
// userland will fail
|
1510
|
+
enumerable: !1,
|
1511
|
+
get: function() {
|
1512
|
+
return this._readableState.flowing;
|
1513
|
+
},
|
1514
|
+
set: function(t) {
|
1515
|
+
this._readableState && (this._readableState.flowing = t);
|
1516
|
+
}
|
1517
|
+
}), M._fromList = d, Object.defineProperty(M.prototype, "readableLength", {
|
1518
|
+
// making it explicit this property is not enumerable
|
1519
|
+
// because otherwise some prototype manipulation in
|
1520
|
+
// userland will fail
|
1521
|
+
enumerable: !1,
|
1522
|
+
get: function() {
|
1523
|
+
return this._readableState.length;
|
1524
|
+
}
|
1525
|
+
});
|
1526
|
+
function d(e, t) {
|
1527
|
+
if (t.length === 0) return null;
|
1528
|
+
var y;
|
1529
|
+
return t.objectMode ? y = t.buffer.shift() : !e || e >= t.length ? (t.decoder ? y = t.buffer.join("") : t.buffer.length === 1 ? y = t.buffer.first() : y = t.buffer.concat(t.length), t.buffer.clear()) : y = t.buffer.consume(e, t.decoder), y;
|
1530
|
+
}
|
1531
|
+
function S(e) {
|
1532
|
+
var t = e._readableState;
|
1533
|
+
l("endReadable", t.endEmitted), t.endEmitted || (t.ended = !0, process.nextTick(P, t, e));
|
1534
|
+
}
|
1535
|
+
function P(e, t) {
|
1536
|
+
if (l("endReadableNT", e.endEmitted, e.length), !e.endEmitted && e.length === 0 && (e.endEmitted = !0, t.readable = !1, t.emit("end"), e.autoDestroy)) {
|
1537
|
+
var y = t._writableState;
|
1538
|
+
(!y || y.autoDestroy && y.finished) && t.destroy();
|
1539
|
+
}
|
1540
|
+
}
|
1541
|
+
typeof Symbol == "function" && (M.from = function(e, t) {
|
1542
|
+
return o === void 0 && (o = It()), o(M, e, t);
|
1543
|
+
});
|
1544
|
+
function k(e, t) {
|
1545
|
+
for (var y = 0, x = e.length; y < x; y++)
|
1546
|
+
if (e[y] === t) return y;
|
1547
|
+
return -1;
|
1548
|
+
}
|
1549
|
+
return De;
|
1550
|
+
}
|
1551
|
+
var Pe, st;
|
1552
|
+
function gt() {
|
1553
|
+
if (st) return Pe;
|
1554
|
+
st = 1, Pe = c;
|
1555
|
+
var u = J().codes, r = u.ERR_METHOD_NOT_IMPLEMENTED, a = u.ERR_MULTIPLE_CALLBACK, s = u.ERR_TRANSFORM_ALREADY_TRANSFORMING, b = u.ERR_TRANSFORM_WITH_LENGTH_0, n = z();
|
1556
|
+
X()(c, n);
|
1557
|
+
function p(T, E) {
|
1558
|
+
var w = this._transformState;
|
1559
|
+
w.transforming = !1;
|
1560
|
+
var D = w.writecb;
|
1561
|
+
if (D === null)
|
1562
|
+
return this.emit("error", new a());
|
1563
|
+
w.writechunk = null, w.writecb = null, E != null && this.push(E), D(T);
|
1564
|
+
var C = this._readableState;
|
1565
|
+
C.reading = !1, (C.needReadable || C.length < C.highWaterMark) && this._read(C.highWaterMark);
|
1566
|
+
}
|
1567
|
+
function c(T) {
|
1568
|
+
if (!(this instanceof c)) return new c(T);
|
1569
|
+
n.call(this, T), this._transformState = {
|
1570
|
+
afterTransform: p.bind(this),
|
1571
|
+
needTransform: !1,
|
1572
|
+
transforming: !1,
|
1573
|
+
writecb: null,
|
1574
|
+
writechunk: null,
|
1575
|
+
writeencoding: null
|
1576
|
+
}, this._readableState.needReadable = !0, this._readableState.sync = !1, T && (typeof T.transform == "function" && (this._transform = T.transform), typeof T.flush == "function" && (this._flush = T.flush)), this.on("prefinish", l);
|
1577
|
+
}
|
1578
|
+
function l() {
|
1579
|
+
var T = this;
|
1580
|
+
typeof this._flush == "function" && !this._readableState.destroyed ? this._flush(function(E, w) {
|
1581
|
+
g(T, E, w);
|
1582
|
+
}) : g(this, null, null);
|
1583
|
+
}
|
1584
|
+
c.prototype.push = function(T, E) {
|
1585
|
+
return this._transformState.needTransform = !1, n.prototype.push.call(this, T, E);
|
1586
|
+
}, c.prototype._transform = function(T, E, w) {
|
1587
|
+
w(new r("_transform()"));
|
1588
|
+
}, c.prototype._write = function(T, E, w) {
|
1589
|
+
var D = this._transformState;
|
1590
|
+
if (D.writecb = w, D.writechunk = T, D.writeencoding = E, !D.transforming) {
|
1591
|
+
var C = this._readableState;
|
1592
|
+
(D.needTransform || C.needReadable || C.length < C.highWaterMark) && this._read(C.highWaterMark);
|
1593
|
+
}
|
1594
|
+
}, c.prototype._read = function(T) {
|
1595
|
+
var E = this._transformState;
|
1596
|
+
E.writechunk !== null && !E.transforming ? (E.transforming = !0, this._transform(E.writechunk, E.writeencoding, E.afterTransform)) : E.needTransform = !0;
|
1597
|
+
}, c.prototype._destroy = function(T, E) {
|
1598
|
+
n.prototype._destroy.call(this, T, function(w) {
|
1599
|
+
E(w);
|
1600
|
+
});
|
1601
|
+
};
|
1602
|
+
function g(T, E, w) {
|
1603
|
+
if (E) return T.emit("error", E);
|
1604
|
+
if (w != null && T.push(w), T._writableState.length) throw new b();
|
1605
|
+
if (T._transformState.transforming) throw new s();
|
1606
|
+
return T.push(null);
|
1607
|
+
}
|
1608
|
+
return Pe;
|
1609
|
+
}
|
1610
|
+
var Ne, ot;
|
1611
|
+
function Bt() {
|
1612
|
+
if (ot) return Ne;
|
1613
|
+
ot = 1, Ne = r;
|
1614
|
+
var u = gt();
|
1615
|
+
X()(r, u);
|
1616
|
+
function r(a) {
|
1617
|
+
if (!(this instanceof r)) return new r(a);
|
1618
|
+
u.call(this, a);
|
1619
|
+
}
|
1620
|
+
return r.prototype._transform = function(a, s, b) {
|
1621
|
+
b(null, a);
|
1622
|
+
}, Ne;
|
1623
|
+
}
|
1624
|
+
var qe, ft;
|
1625
|
+
function Ft() {
|
1626
|
+
if (ft) return qe;
|
1627
|
+
ft = 1;
|
1628
|
+
var u;
|
1629
|
+
function r(w) {
|
1630
|
+
var D = !1;
|
1631
|
+
return function() {
|
1632
|
+
D || (D = !0, w.apply(void 0, arguments));
|
1633
|
+
};
|
1634
|
+
}
|
1635
|
+
var a = J().codes, s = a.ERR_MISSING_ARGS, b = a.ERR_STREAM_DESTROYED;
|
1636
|
+
function n(w) {
|
1637
|
+
if (w) throw w;
|
1638
|
+
}
|
1639
|
+
function p(w) {
|
1640
|
+
return w.setHeader && typeof w.abort == "function";
|
1641
|
+
}
|
1642
|
+
function c(w, D, C, O) {
|
1643
|
+
O = r(O);
|
1644
|
+
var R = !1;
|
1645
|
+
w.on("close", function() {
|
1646
|
+
R = !0;
|
1647
|
+
}), u === void 0 && (u = Fe()), u(w, {
|
1648
|
+
readable: D,
|
1649
|
+
writable: C
|
1650
|
+
}, function(_) {
|
1651
|
+
if (_) return O(_);
|
1652
|
+
R = !0, O();
|
1653
|
+
});
|
1654
|
+
var i = !1;
|
1655
|
+
return function(_) {
|
1656
|
+
if (!R && !i) {
|
1657
|
+
if (i = !0, p(w)) return w.abort();
|
1658
|
+
if (typeof w.destroy == "function") return w.destroy();
|
1659
|
+
O(_ || new b("pipe"));
|
1660
|
+
}
|
1661
|
+
};
|
1662
|
+
}
|
1663
|
+
function l(w) {
|
1664
|
+
w();
|
1665
|
+
}
|
1666
|
+
function g(w, D) {
|
1667
|
+
return w.pipe(D);
|
1668
|
+
}
|
1669
|
+
function T(w) {
|
1670
|
+
return !w.length || typeof w[w.length - 1] != "function" ? n : w.pop();
|
1671
|
+
}
|
1672
|
+
function E() {
|
1673
|
+
for (var w = arguments.length, D = new Array(w), C = 0; C < w; C++)
|
1674
|
+
D[C] = arguments[C];
|
1675
|
+
var O = T(D);
|
1676
|
+
if (Array.isArray(D[0]) && (D = D[0]), D.length < 2)
|
1677
|
+
throw new s("streams");
|
1678
|
+
var R, i = D.map(function(_, m) {
|
1679
|
+
var o = m < D.length - 1, f = m > 0;
|
1680
|
+
return c(_, o, f, function(v) {
|
1681
|
+
R || (R = v), v && i.forEach(l), !o && (i.forEach(l), O(R));
|
1682
|
+
});
|
1683
|
+
});
|
1684
|
+
return D.reduce(g);
|
1685
|
+
}
|
1686
|
+
return qe = E, qe;
|
1687
|
+
}
|
1688
|
+
var ke, ut;
|
1689
|
+
function Wt() {
|
1690
|
+
if (ut) return ke;
|
1691
|
+
ut = 1, ke = a;
|
1692
|
+
var u = Be().EventEmitter, r = X();
|
1693
|
+
r(a, u), a.Readable = bt(), a.Writable = _t(), a.Duplex = z(), a.Transform = gt(), a.PassThrough = Bt(), a.finished = Fe(), a.pipeline = Ft(), a.Stream = a;
|
1694
|
+
function a() {
|
1695
|
+
u.call(this);
|
1696
|
+
}
|
1697
|
+
return a.prototype.pipe = function(s, b) {
|
1698
|
+
var n = this;
|
1699
|
+
function p(D) {
|
1700
|
+
s.writable && s.write(D) === !1 && n.pause && n.pause();
|
1701
|
+
}
|
1702
|
+
n.on("data", p);
|
1703
|
+
function c() {
|
1704
|
+
n.readable && n.resume && n.resume();
|
1705
|
+
}
|
1706
|
+
s.on("drain", c), !s._isStdio && (!b || b.end !== !1) && (n.on("end", g), n.on("close", T));
|
1707
|
+
var l = !1;
|
1708
|
+
function g() {
|
1709
|
+
l || (l = !0, s.end());
|
1710
|
+
}
|
1711
|
+
function T() {
|
1712
|
+
l || (l = !0, typeof s.destroy == "function" && s.destroy());
|
1713
|
+
}
|
1714
|
+
function E(D) {
|
1715
|
+
if (w(), u.listenerCount(this, "error") === 0)
|
1716
|
+
throw D;
|
1717
|
+
}
|
1718
|
+
n.on("error", E), s.on("error", E);
|
1719
|
+
function w() {
|
1720
|
+
n.removeListener("data", p), s.removeListener("drain", c), n.removeListener("end", g), n.removeListener("close", T), n.removeListener("error", E), s.removeListener("error", E), n.removeListener("end", w), n.removeListener("close", w), s.removeListener("close", w);
|
1721
|
+
}
|
1722
|
+
return n.on("end", w), n.on("close", w), s.on("close", w), s.emit("pipe", n), s;
|
1723
|
+
}, ke;
|
1724
|
+
}
|
1725
|
+
var yt = Wt(), Ut = je();
|
1726
|
+
function te(u) {
|
1727
|
+
return u.replace(/%([0-9A-Fa-f]{2})/g, (r, a) => String.fromCharCode(parseInt(a, 16)));
|
1728
|
+
}
|
1729
|
+
function wt(u, r) {
|
1730
|
+
return String(r).replace(u, (a) => `%${a.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
|
1731
|
+
}
|
1732
|
+
function ee(u) {
|
1733
|
+
return wt(/[\n;\r\t=%&,\x00-\x1f\x7f-\xff]/g, u);
|
1734
|
+
}
|
1735
|
+
function U(u) {
|
1736
|
+
return wt(/[\n\r\t%\x00-\x1f\x7f-\xff]/g, u);
|
1737
|
+
}
|
1738
|
+
function mt(u) {
|
1739
|
+
if (!(u && u.length) || u === ".")
|
1740
|
+
return {};
|
1741
|
+
const r = {};
|
1742
|
+
return u.replace(/\r?\n$/, "").split(";").forEach((a) => {
|
1743
|
+
const s = a.split("=", 2);
|
1744
|
+
if (!(s[1] && s[1].length))
|
1745
|
+
return;
|
1746
|
+
s[0] = s[0].trim();
|
1747
|
+
let b = r[s[0].trim()];
|
1748
|
+
b || (b = [], r[s[0]] = b), b.push(...s[1].split(",").map((n) => n.trim()).map(te));
|
1749
|
+
}), r;
|
1750
|
+
}
|
1751
|
+
function St(u) {
|
1752
|
+
const r = u.split(" ").map((s) => s === "." || s === "" ? null : s);
|
1753
|
+
return {
|
1754
|
+
seq_id: r[0] && te(r[0]),
|
1755
|
+
source: r[1] && te(r[1]),
|
1756
|
+
type: r[2] && te(r[2]),
|
1757
|
+
start: r[3] === null ? null : parseInt(r[3], 10),
|
1758
|
+
end: r[4] === null ? null : parseInt(r[4], 10),
|
1759
|
+
score: r[5] === null ? null : parseFloat(r[5]),
|
1760
|
+
strand: r[6],
|
1761
|
+
phase: r[7],
|
1762
|
+
attributes: r[8] === null ? null : mt(r[8])
|
1763
|
+
};
|
1764
|
+
}
|
1765
|
+
function Et(u) {
|
1766
|
+
const r = /^\s*##\s*(\S+)\s*(.*)/.exec(u);
|
1767
|
+
if (!r)
|
1768
|
+
return null;
|
1769
|
+
const [, a] = r;
|
1770
|
+
let [, , s] = r;
|
1771
|
+
const b = { directive: a };
|
1772
|
+
if (s.length && (s = s.replace(/\r?\n$/, ""), b.value = s), a === "sequence-region") {
|
1773
|
+
const n = s.split(/\s+/, 3);
|
1774
|
+
return {
|
1775
|
+
...b,
|
1776
|
+
seq_id: n[0],
|
1777
|
+
start: n[1] && n[1].replace(/\D/g, ""),
|
1778
|
+
end: n[2] && n[2].replace(/\D/g, "")
|
1779
|
+
};
|
1780
|
+
} else if (a === "genome-build") {
|
1781
|
+
const [n, p] = s.split(/\s+/, 2);
|
1782
|
+
return {
|
1783
|
+
...b,
|
1784
|
+
source: n,
|
1785
|
+
buildName: p
|
1786
|
+
};
|
1787
|
+
}
|
1788
|
+
return b;
|
1789
|
+
}
|
1790
|
+
function Rt(u) {
|
1791
|
+
const r = [];
|
1792
|
+
return Object.entries(u).forEach(([a, s]) => {
|
1793
|
+
if (!s)
|
1794
|
+
return;
|
1795
|
+
let b;
|
1796
|
+
s.hasOwnProperty("toString") ? b = ee(s.toString()) : Array.isArray(s) ? b = s.map(ee).join(",") : b = ee(s), r.push(`${ee(a)}=${b}`);
|
1797
|
+
}), r.length ? r.join(";") : ".";
|
1798
|
+
}
|
1799
|
+
function Ht(u, r) {
|
1800
|
+
const a = u.attributes === null || u.attributes === void 0 ? "." : Rt(u.attributes), b = `${[
|
1801
|
+
u.seq_id === null ? "." : U(u.seq_id),
|
1802
|
+
u.source === null ? "." : U(u.source),
|
1803
|
+
u.type === null ? "." : U(u.type),
|
1804
|
+
u.start === null ? "." : U(u.start),
|
1805
|
+
u.end === null ? "." : U(u.end),
|
1806
|
+
u.score === null ? "." : U(u.score),
|
1807
|
+
u.strand === null ? "." : U(u.strand),
|
1808
|
+
u.phase === null ? "." : U(u.phase),
|
1809
|
+
a
|
1810
|
+
].join(" ")}
|
1811
|
+
`;
|
1812
|
+
return r[b] ? "" : (r[b] = !0, b);
|
1813
|
+
}
|
1814
|
+
function le(u, r) {
|
1815
|
+
if (Array.isArray(u))
|
1816
|
+
return u.map((s) => le(s, r)).join("");
|
1817
|
+
const a = [Ht(u, r)];
|
1818
|
+
return $t(u) && a.push(...u.child_features.map((s) => le(s, r)), ...u.derived_features.map((s) => le(s, r))), a.join("");
|
1819
|
+
}
|
1820
|
+
function Lt(u) {
|
1821
|
+
return le(u, {});
|
1822
|
+
}
|
1823
|
+
function Tt(u) {
|
1824
|
+
let r = `##${u.directive}`;
|
1825
|
+
return u.value && (r += ` ${u.value}`), r += `
|
1826
|
+
`, r;
|
1827
|
+
}
|
1828
|
+
function Ct(u) {
|
1829
|
+
return `# ${u.comment}
|
1830
|
+
`;
|
1831
|
+
}
|
1832
|
+
function We(u) {
|
1833
|
+
return `>${u.id}${u.description ? ` ${u.description}` : ""}
|
1834
|
+
${u.sequence}
|
1835
|
+
`;
|
1836
|
+
}
|
1837
|
+
function de(u) {
|
1838
|
+
function r(a) {
|
1839
|
+
return "attributes" in a ? Lt(a) : "directive" in a ? Tt(a) : "sequence" in a ? We(a) : "comment" in a ? Ct(a) : `# (invalid item found during format)
|
1840
|
+
`;
|
1841
|
+
}
|
1842
|
+
return Array.isArray(u) ? u.map(r) : r(u);
|
1843
|
+
}
|
1844
|
+
function $t(u) {
|
1845
|
+
return u.child_features !== void 0 && u.derived_features !== void 0;
|
1846
|
+
}
|
1847
|
+
const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1848
|
+
__proto__: null,
|
1849
|
+
escape: ee,
|
1850
|
+
escapeColumn: U,
|
1851
|
+
formatAttributes: Rt,
|
1852
|
+
formatComment: Ct,
|
1853
|
+
formatDirective: Tt,
|
1854
|
+
formatFeature: Lt,
|
1855
|
+
formatItem: de,
|
1856
|
+
formatSequence: We,
|
1857
|
+
parseAttributes: mt,
|
1858
|
+
parseDirective: Et,
|
1859
|
+
parseFeature: St,
|
1860
|
+
unescape: te
|
1861
|
+
}, Symbol.toStringTag, { value: "Module" })), lt = {
|
1862
|
+
Parent: "child_features",
|
1863
|
+
Derives_from: "derived_features"
|
1864
|
+
};
|
1865
|
+
class dt {
|
1866
|
+
constructor(r) {
|
1867
|
+
this.seqCallback = r, this.currentSequence = void 0;
|
1868
|
+
}
|
1869
|
+
addLine(r) {
|
1870
|
+
const a = /^>\s*(\S+)\s*(.*)/.exec(r);
|
1871
|
+
a ? (this._flush(), this.currentSequence = { id: a[1], sequence: "" }, a[2] && (this.currentSequence.description = a[2].trim())) : this.currentSequence && /\S/.test(r) && (this.currentSequence.sequence += r.replace(/\s/g, ""));
|
1872
|
+
}
|
1873
|
+
_flush() {
|
1874
|
+
this.currentSequence && this.seqCallback(this.currentSequence);
|
1875
|
+
}
|
1876
|
+
finish() {
|
1877
|
+
this._flush();
|
1878
|
+
}
|
1879
|
+
}
|
1880
|
+
class At {
|
1881
|
+
constructor(r) {
|
1882
|
+
this.fastaParser = void 0, this.eof = !1, this.lineNumber = 0, this._underConstructionTopLevel = [], this._underConstructionById = {}, this._completedReferences = {}, this._underConstructionOrphans = {};
|
1883
|
+
const a = () => {
|
1884
|
+
};
|
1885
|
+
this.featureCallback = r.featureCallback || a, this.endCallback = r.endCallback || a, this.commentCallback = r.commentCallback || a, this.errorCallback = r.errorCallback || a, this.directiveCallback = r.directiveCallback || a, this.sequenceCallback = r.sequenceCallback || a, this.disableDerivesFromReferences = r.disableDerivesFromReferences || !1, this.bufferSize = r.bufferSize === void 0 ? 1e3 : r.bufferSize;
|
1886
|
+
}
|
1887
|
+
addLine(r) {
|
1888
|
+
if (this.fastaParser) {
|
1889
|
+
this.fastaParser.addLine(r);
|
1890
|
+
return;
|
1891
|
+
}
|
1892
|
+
if (this.eof)
|
1893
|
+
return;
|
1894
|
+
if (this.lineNumber += 1, /^\s*[^#\s>]/.test(r)) {
|
1895
|
+
this._bufferLine(r);
|
1896
|
+
return;
|
1897
|
+
}
|
1898
|
+
const a = /^\s*(#+)(.*)/.exec(r);
|
1899
|
+
if (a) {
|
1900
|
+
const [, s] = a;
|
1901
|
+
let [, , b] = a;
|
1902
|
+
if (s.length === 3)
|
1903
|
+
this._emitAllUnderConstructionFeatures();
|
1904
|
+
else if (s.length === 2) {
|
1905
|
+
const n = Et(r);
|
1906
|
+
n && (n.directive === "FASTA" ? (this._emitAllUnderConstructionFeatures(), this.eof = !0, this.fastaParser = new dt(this.sequenceCallback)) : this._emitItem(n));
|
1907
|
+
} else
|
1908
|
+
b = b.replace(/\s*/, ""), this._emitItem({ comment: b });
|
1909
|
+
} else if (!/^\s*$/.test(r)) if (/^\s*>/.test(r))
|
1910
|
+
this._emitAllUnderConstructionFeatures(), this.eof = !0, this.fastaParser = new dt(this.sequenceCallback), this.fastaParser.addLine(r);
|
1911
|
+
else {
|
1912
|
+
const s = r.replace(/\r?\n?$/g, "");
|
1913
|
+
throw new Error(`GFF3 parse error. Cannot parse '${s}'.`);
|
1914
|
+
}
|
1915
|
+
}
|
1916
|
+
finish() {
|
1917
|
+
this._emitAllUnderConstructionFeatures(), this.fastaParser && this.fastaParser.finish(), this.endCallback();
|
1918
|
+
}
|
1919
|
+
_emitItem(r) {
|
1920
|
+
Array.isArray(r) ? this.featureCallback(r) : "directive" in r ? this.directiveCallback(r) : "comment" in r && this.commentCallback(r);
|
1921
|
+
}
|
1922
|
+
_enforceBufferSizeLimit(r = 0) {
|
1923
|
+
const a = (s) => {
|
1924
|
+
s && Array.isArray(s) && s[0].attributes && s[0].attributes.ID && s[0].attributes.ID[0] && (s[0].attributes.ID.forEach((n) => {
|
1925
|
+
delete this._underConstructionById[n], delete this._completedReferences[n];
|
1926
|
+
}), s.forEach((n) => {
|
1927
|
+
n.child_features && n.child_features.forEach((p) => a(p)), n.derived_features && n.derived_features.forEach((p) => a(p));
|
1928
|
+
}));
|
1929
|
+
};
|
1930
|
+
for (; this._underConstructionTopLevel.length + r > this.bufferSize; ) {
|
1931
|
+
const s = this._underConstructionTopLevel.shift();
|
1932
|
+
s && (this._emitItem(s), a(s));
|
1933
|
+
}
|
1934
|
+
}
|
1935
|
+
/**
|
1936
|
+
* return all under-construction features, called when we know
|
1937
|
+
* there will be no additional data to attach to them
|
1938
|
+
*/
|
1939
|
+
_emitAllUnderConstructionFeatures() {
|
1940
|
+
if (this._underConstructionTopLevel.forEach(this._emitItem.bind(this)), this._underConstructionTopLevel = [], this._underConstructionById = {}, this._completedReferences = {}, Array.from(Object.values(this._underConstructionOrphans)).length)
|
1941
|
+
throw new Error(`some features reference other features that do not exist in the file (or in the same '###' scope). ${Object.keys(this._underConstructionOrphans)}`);
|
1942
|
+
}
|
1943
|
+
// do the right thing with a newly-parsed feature line
|
1944
|
+
_bufferLine(r) {
|
1945
|
+
var a, s, b;
|
1946
|
+
const p = {
|
1947
|
+
...St(r),
|
1948
|
+
child_features: [],
|
1949
|
+
derived_features: []
|
1950
|
+
}, c = ((a = p.attributes) === null || a === void 0 ? void 0 : a.ID) || [], l = ((s = p.attributes) === null || s === void 0 ? void 0 : s.Parent) || [], g = this.disableDerivesFromReferences ? [] : ((b = p.attributes) === null || b === void 0 ? void 0 : b.Derives_from) || [];
|
1951
|
+
if (!c.length && !l.length && !g.length) {
|
1952
|
+
this._emitItem([p]);
|
1953
|
+
return;
|
1954
|
+
}
|
1955
|
+
let T;
|
1956
|
+
c.forEach((E) => {
|
1957
|
+
const w = this._underConstructionById[E];
|
1958
|
+
w ? (w[w.length - 1].type !== p.type && this._parseError(`multi-line feature "${E}" has inconsistent types: "${p.type}", "${w[w.length - 1].type}"`), w.push(p), T = w) : (T = [p], this._enforceBufferSizeLimit(1), !l.length && !g.length && this._underConstructionTopLevel.push(T), this._underConstructionById[E] = T, this._resolveReferencesTo(T, E));
|
1959
|
+
}), this._resolveReferencesFrom(T || [p], { Parent: l, Derives_from: g }, c);
|
1960
|
+
}
|
1961
|
+
_resolveReferencesTo(r, a) {
|
1962
|
+
const s = this._underConstructionOrphans[a];
|
1963
|
+
s && (r.forEach((b) => {
|
1964
|
+
b.child_features.push(...s.Parent);
|
1965
|
+
}), r.forEach((b) => {
|
1966
|
+
b.derived_features.push(...s.Derives_from);
|
1967
|
+
}), delete this._underConstructionOrphans[a]);
|
1968
|
+
}
|
1969
|
+
_parseError(r) {
|
1970
|
+
this.eof = !0, this.errorCallback(`${this.lineNumber}: ${r}`);
|
1971
|
+
}
|
1972
|
+
_resolveReferencesFrom(r, a, s) {
|
1973
|
+
function b(n, p, c) {
|
1974
|
+
let l = n[p];
|
1975
|
+
l || (l = {}, n[p] = l);
|
1976
|
+
const g = l[c] || !1;
|
1977
|
+
return l[c] = !0, g;
|
1978
|
+
}
|
1979
|
+
a.Parent.forEach((n) => {
|
1980
|
+
const p = this._underConstructionById[n];
|
1981
|
+
if (p) {
|
1982
|
+
const c = lt.Parent;
|
1983
|
+
s.filter((l) => b(this._completedReferences, l, `Parent,${n}`)).length || p.forEach((l) => {
|
1984
|
+
l[c].push(r);
|
1985
|
+
});
|
1986
|
+
} else {
|
1987
|
+
let c = this._underConstructionOrphans[n];
|
1988
|
+
c || (c = {
|
1989
|
+
Parent: [],
|
1990
|
+
Derives_from: []
|
1991
|
+
}, this._underConstructionOrphans[n] = c), c.Parent.push(r);
|
1992
|
+
}
|
1993
|
+
}), a.Derives_from.forEach((n) => {
|
1994
|
+
const p = this._underConstructionById[n];
|
1995
|
+
if (p) {
|
1996
|
+
const c = lt.Derives_from;
|
1997
|
+
s.filter((l) => b(this._completedReferences, l, `Derives_from,${n}`)).length || p.forEach((l) => {
|
1998
|
+
l[c].push(r);
|
1999
|
+
});
|
2000
|
+
} else {
|
2001
|
+
let c = this._underConstructionOrphans[n];
|
2002
|
+
c || (c = {
|
2003
|
+
Parent: [],
|
2004
|
+
Derives_from: []
|
2005
|
+
}, this._underConstructionOrphans[n] = c), c.Derives_from.push(r);
|
2006
|
+
}
|
2007
|
+
});
|
2008
|
+
}
|
2009
|
+
}
|
2010
|
+
function Ie(u) {
|
2011
|
+
process && process.nextTick ? process.nextTick(u) : u();
|
2012
|
+
}
|
2013
|
+
function Mt(u) {
|
2014
|
+
const r = {
|
2015
|
+
encoding: "utf8",
|
2016
|
+
parseFeatures: !0,
|
2017
|
+
parseDirectives: !1,
|
2018
|
+
parseSequences: !0,
|
2019
|
+
parseComments: !1,
|
2020
|
+
bufferSize: 1e3,
|
2021
|
+
disableDerivesFromReferences: !1,
|
2022
|
+
...u
|
2023
|
+
};
|
2024
|
+
return u.parseAll && (r.parseFeatures = !0, r.parseDirectives = !0, r.parseComments = !0, r.parseSequences = !0), r;
|
2025
|
+
}
|
2026
|
+
class Gt extends yt.Transform {
|
2027
|
+
constructor(r = {}) {
|
2028
|
+
super({ objectMode: !0 }), this.textBuffer = "";
|
2029
|
+
const a = Mt(r);
|
2030
|
+
this.encoding = r.encoding || "utf8", this.decoder = new Ut.StringDecoder();
|
2031
|
+
const s = this.push.bind(this);
|
2032
|
+
this.parser = new At({
|
2033
|
+
featureCallback: a.parseFeatures ? s : void 0,
|
2034
|
+
directiveCallback: a.parseDirectives ? s : void 0,
|
2035
|
+
commentCallback: a.parseComments ? s : void 0,
|
2036
|
+
sequenceCallback: a.parseSequences ? s : void 0,
|
2037
|
+
errorCallback: (b) => this.emit("error", b),
|
2038
|
+
bufferSize: a.bufferSize,
|
2039
|
+
disableDerivesFromReferences: a.disableDerivesFromReferences
|
2040
|
+
});
|
2041
|
+
}
|
2042
|
+
_addLine(r) {
|
2043
|
+
r && this.parser.addLine(r);
|
2044
|
+
}
|
2045
|
+
_nextText(r) {
|
2046
|
+
const a = (this.textBuffer + r).split(/\r?\n/);
|
2047
|
+
this.textBuffer = a.pop() || "", a.forEach((s) => this._addLine(s));
|
2048
|
+
}
|
2049
|
+
_transform(r, a, s) {
|
2050
|
+
this._nextText(this.decoder.write(r)), Ie(s);
|
2051
|
+
}
|
2052
|
+
_flush(r) {
|
2053
|
+
this.decoder.end && this._nextText(this.decoder.end()), this.textBuffer != null && this._addLine(this.textBuffer), this.parser.finish(), Ie(r);
|
2054
|
+
}
|
2055
|
+
}
|
2056
|
+
function Kt(u = {}) {
|
2057
|
+
return new Gt(u);
|
2058
|
+
}
|
2059
|
+
function Yt(u, r = {}) {
|
2060
|
+
if (!u)
|
2061
|
+
return [];
|
2062
|
+
const a = Mt(r), s = [], b = s.push.bind(s), n = new At({
|
2063
|
+
featureCallback: a.parseFeatures ? b : void 0,
|
2064
|
+
directiveCallback: a.parseDirectives ? b : void 0,
|
2065
|
+
commentCallback: a.parseComments ? b : void 0,
|
2066
|
+
sequenceCallback: a.parseSequences ? b : void 0,
|
2067
|
+
disableDerivesFromReferences: a.disableDerivesFromReferences || !1,
|
2068
|
+
bufferSize: 1 / 0,
|
2069
|
+
errorCallback: (p) => {
|
2070
|
+
throw p;
|
2071
|
+
}
|
2072
|
+
});
|
2073
|
+
return u.split(/\r?\n/).forEach(n.addLine.bind(n)), n.finish(), s;
|
2074
|
+
}
|
2075
|
+
function zt(u) {
|
2076
|
+
const r = [], a = [];
|
2077
|
+
u.forEach((b) => {
|
2078
|
+
"sequence" in b ? a.push(b) : r.push(b);
|
2079
|
+
});
|
2080
|
+
let s = r.map(de).join("");
|
2081
|
+
return a.length && (s += `##FASTA
|
2082
|
+
`, s += a.map(We).join("")), s;
|
2083
|
+
}
|
2084
|
+
class Ot extends yt.Transform {
|
2085
|
+
constructor(r = {}) {
|
2086
|
+
super(Object.assign(r, { objectMode: !0 })), this.linesSinceLastSyncMark = 0, this.haveWeEmittedData = !1, this.fastaMode = !1, this.minLinesBetweenSyncMarks = r.minSyncLines || 100, this.insertVersionDirective = r.insertVersionDirective || !1;
|
2087
|
+
}
|
2088
|
+
_transform(r, a, s) {
|
2089
|
+
let b;
|
2090
|
+
if (!this.haveWeEmittedData && this.insertVersionDirective) {
|
2091
|
+
const n = Array.isArray(r) ? r[0] : r;
|
2092
|
+
"directive" in n && n.directive !== "gff-version" && this.push(`##gff-version 3
|
2093
|
+
`);
|
2094
|
+
}
|
2095
|
+
if ("sequence" in r && !this.fastaMode && (this.push(`##FASTA
|
2096
|
+
`), this.fastaMode = !0), Array.isArray(r) ? b = r.map(de).join("") : b = de(r), this.push(b), this.linesSinceLastSyncMark >= this.minLinesBetweenSyncMarks)
|
2097
|
+
this.push(`###
|
2098
|
+
`), this.linesSinceLastSyncMark = 0;
|
2099
|
+
else {
|
2100
|
+
let n = 0;
|
2101
|
+
for (let p = 0; p < b.length; p += 1)
|
2102
|
+
b[p] === `
|
2103
|
+
` && (n += 1);
|
2104
|
+
this.linesSinceLastSyncMark += n;
|
2105
|
+
}
|
2106
|
+
this.haveWeEmittedData = !0, Ie(s);
|
2107
|
+
}
|
2108
|
+
}
|
2109
|
+
function Xt(u = {}) {
|
2110
|
+
return new Ot(u);
|
2111
|
+
}
|
2112
|
+
function Jt(u, r, a = {}) {
|
2113
|
+
const s = {
|
2114
|
+
insertVersionDirective: !0,
|
2115
|
+
...a
|
2116
|
+
};
|
2117
|
+
return new Promise((b, n) => {
|
2118
|
+
u.pipe(new Ot(s)).on("end", () => b(null)).on("error", n).pipe(r);
|
2119
|
+
});
|
2120
|
+
}
|
2121
|
+
const tr = {
|
2122
|
+
parseStream: Kt,
|
2123
|
+
parseStringSync: Yt,
|
2124
|
+
formatSync: zt,
|
2125
|
+
formatStream: Xt,
|
2126
|
+
formatFile: Jt,
|
2127
|
+
util: Vt
|
2128
|
+
};
|
2129
|
+
export {
|
2130
|
+
tr as default
|
2131
|
+
};
|