@stinkycomputing/cachearoo 1.0.24
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/.github/workflows/build_and_test.yml +29 -0
- package/.github/workflows/npm-publish.yml +30 -0
- package/README.md +400 -0
- package/dist/cachearoo-node.d.ts +19 -0
- package/dist/cachearoo-node.js +31 -0
- package/dist/cachearoo.d.ts +19 -0
- package/dist/cachearoo.es.js +2996 -0
- package/dist/cachearoo.min.js +15 -0
- package/dist/libs/cro.connection.d.ts +71 -0
- package/dist/libs/cro.connection.js +401 -0
- package/dist/libs/cro.d.ts +82 -0
- package/dist/libs/cro.js +283 -0
- package/dist/libs/cro.msg.competing-consumers.d.ts +46 -0
- package/dist/libs/cro.msg.competing-consumers.js +204 -0
- package/dist/libs/cro.msg.request-reply.d.ts +32 -0
- package/dist/libs/cro.msg.request-reply.js +117 -0
- package/package.json +36 -0
- package/tsconfig-node.json +32 -0
|
@@ -0,0 +1,2996 @@
|
|
|
1
|
+
var Ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function Er(o) {
|
|
3
|
+
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
4
|
+
}
|
|
5
|
+
var Dt = {}, Qe = {};
|
|
6
|
+
Qe.byteLength = Tr;
|
|
7
|
+
Qe.toByteArray = Fr;
|
|
8
|
+
Qe.fromByteArray = kr;
|
|
9
|
+
var re = [], H = [], Ar = typeof Uint8Array < "u" ? Uint8Array : Array, Ye = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
10
|
+
for (var Se = 0, Sr = Ye.length; Se < Sr; ++Se)
|
|
11
|
+
re[Se] = Ye[Se], H[Ye.charCodeAt(Se)] = Se;
|
|
12
|
+
H["-".charCodeAt(0)] = 62;
|
|
13
|
+
H["_".charCodeAt(0)] = 63;
|
|
14
|
+
function Nt(o) {
|
|
15
|
+
var e = o.length;
|
|
16
|
+
if (e % 4 > 0)
|
|
17
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
18
|
+
var n = o.indexOf("=");
|
|
19
|
+
n === -1 && (n = e);
|
|
20
|
+
var a = n === e ? 0 : 4 - n % 4;
|
|
21
|
+
return [n, a];
|
|
22
|
+
}
|
|
23
|
+
function Tr(o) {
|
|
24
|
+
var e = Nt(o), n = e[0], a = e[1];
|
|
25
|
+
return (n + a) * 3 / 4 - a;
|
|
26
|
+
}
|
|
27
|
+
function Or(o, e, n) {
|
|
28
|
+
return (e + n) * 3 / 4 - n;
|
|
29
|
+
}
|
|
30
|
+
function Fr(o) {
|
|
31
|
+
var e, n = Nt(o), a = n[0], u = n[1], c = new Ar(Or(o, a, u)), l = 0, f = u > 0 ? a - 4 : a, m;
|
|
32
|
+
for (m = 0; m < f; m += 4)
|
|
33
|
+
e = H[o.charCodeAt(m)] << 18 | H[o.charCodeAt(m + 1)] << 12 | H[o.charCodeAt(m + 2)] << 6 | H[o.charCodeAt(m + 3)], c[l++] = e >> 16 & 255, c[l++] = e >> 8 & 255, c[l++] = e & 255;
|
|
34
|
+
return u === 2 && (e = H[o.charCodeAt(m)] << 2 | H[o.charCodeAt(m + 1)] >> 4, c[l++] = e & 255), u === 1 && (e = H[o.charCodeAt(m)] << 10 | H[o.charCodeAt(m + 1)] << 4 | H[o.charCodeAt(m + 2)] >> 2, c[l++] = e >> 8 & 255, c[l++] = e & 255), c;
|
|
35
|
+
}
|
|
36
|
+
function xr(o) {
|
|
37
|
+
return re[o >> 18 & 63] + re[o >> 12 & 63] + re[o >> 6 & 63] + re[o & 63];
|
|
38
|
+
}
|
|
39
|
+
function Ir(o, e, n) {
|
|
40
|
+
for (var a, u = [], c = e; c < n; c += 3)
|
|
41
|
+
a = (o[c] << 16 & 16711680) + (o[c + 1] << 8 & 65280) + (o[c + 2] & 255), u.push(xr(a));
|
|
42
|
+
return u.join("");
|
|
43
|
+
}
|
|
44
|
+
function kr(o) {
|
|
45
|
+
for (var e, n = o.length, a = n % 3, u = [], c = 16383, l = 0, f = n - a; l < f; l += c)
|
|
46
|
+
u.push(Ir(o, l, l + c > f ? f : l + c));
|
|
47
|
+
return a === 1 ? (e = o[n - 1], u.push(
|
|
48
|
+
re[e >> 2] + re[e << 4 & 63] + "=="
|
|
49
|
+
)) : a === 2 && (e = (o[n - 2] << 8) + o[n - 1], u.push(
|
|
50
|
+
re[e >> 10] + re[e >> 4 & 63] + re[e << 2 & 63] + "="
|
|
51
|
+
)), u.join("");
|
|
52
|
+
}
|
|
53
|
+
var vt = {};
|
|
54
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
55
|
+
vt.read = function(o, e, n, a, u) {
|
|
56
|
+
var c, l, f = u * 8 - a - 1, m = (1 << f) - 1, E = m >> 1, w = -7, O = n ? u - 1 : 0, P = n ? -1 : 1, j = o[e + O];
|
|
57
|
+
for (O += P, c = j & (1 << -w) - 1, j >>= -w, w += f; w > 0; c = c * 256 + o[e + O], O += P, w -= 8)
|
|
58
|
+
;
|
|
59
|
+
for (l = c & (1 << -w) - 1, c >>= -w, w += a; w > 0; l = l * 256 + o[e + O], O += P, w -= 8)
|
|
60
|
+
;
|
|
61
|
+
if (c === 0)
|
|
62
|
+
c = 1 - E;
|
|
63
|
+
else {
|
|
64
|
+
if (c === m)
|
|
65
|
+
return l ? NaN : (j ? -1 : 1) * (1 / 0);
|
|
66
|
+
l = l + Math.pow(2, a), c = c - E;
|
|
67
|
+
}
|
|
68
|
+
return (j ? -1 : 1) * l * Math.pow(2, c - a);
|
|
69
|
+
};
|
|
70
|
+
vt.write = function(o, e, n, a, u, c) {
|
|
71
|
+
var l, f, m, E = c * 8 - u - 1, w = (1 << E) - 1, O = w >> 1, P = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, j = a ? 0 : c - 1, D = a ? 1 : -1, G = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
72
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, l = w) : (l = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -l)) < 1 && (l--, m *= 2), l + O >= 1 ? e += P / m : e += P * Math.pow(2, 1 - O), e * m >= 2 && (l++, m /= 2), l + O >= w ? (f = 0, l = w) : l + O >= 1 ? (f = (e * m - 1) * Math.pow(2, u), l = l + O) : (f = e * Math.pow(2, O - 1) * Math.pow(2, u), l = 0)); u >= 8; o[n + j] = f & 255, j += D, f /= 256, u -= 8)
|
|
73
|
+
;
|
|
74
|
+
for (l = l << u | f, E += u; E > 0; o[n + j] = l & 255, j += D, l /= 256, E -= 8)
|
|
75
|
+
;
|
|
76
|
+
o[n + j - D] |= G * 128;
|
|
77
|
+
};
|
|
78
|
+
/*!
|
|
79
|
+
* The buffer module from node.js, for the browser.
|
|
80
|
+
*
|
|
81
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
82
|
+
* @license MIT
|
|
83
|
+
*/
|
|
84
|
+
(function(o) {
|
|
85
|
+
var e = Qe, n = vt, a = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
86
|
+
o.Buffer = f, o.SlowBuffer = ue, o.INSPECT_MAX_BYTES = 50;
|
|
87
|
+
var u = 2147483647;
|
|
88
|
+
o.kMaxLength = u, f.TYPED_ARRAY_SUPPORT = c(), !f.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
89
|
+
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
90
|
+
);
|
|
91
|
+
function c() {
|
|
92
|
+
try {
|
|
93
|
+
var s = new Uint8Array(1), t = { foo: function() {
|
|
94
|
+
return 42;
|
|
95
|
+
} };
|
|
96
|
+
return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(s, t), s.foo() === 42;
|
|
97
|
+
} catch {
|
|
98
|
+
return !1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
Object.defineProperty(f.prototype, "parent", {
|
|
102
|
+
enumerable: !0,
|
|
103
|
+
get: function() {
|
|
104
|
+
if (f.isBuffer(this))
|
|
105
|
+
return this.buffer;
|
|
106
|
+
}
|
|
107
|
+
}), Object.defineProperty(f.prototype, "offset", {
|
|
108
|
+
enumerable: !0,
|
|
109
|
+
get: function() {
|
|
110
|
+
if (f.isBuffer(this))
|
|
111
|
+
return this.byteOffset;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
function l(s) {
|
|
115
|
+
if (s > u)
|
|
116
|
+
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
117
|
+
var t = new Uint8Array(s);
|
|
118
|
+
return Object.setPrototypeOf(t, f.prototype), t;
|
|
119
|
+
}
|
|
120
|
+
function f(s, t, r) {
|
|
121
|
+
if (typeof s == "number") {
|
|
122
|
+
if (typeof t == "string")
|
|
123
|
+
throw new TypeError(
|
|
124
|
+
'The "string" argument must be of type string. Received type number'
|
|
125
|
+
);
|
|
126
|
+
return O(s);
|
|
127
|
+
}
|
|
128
|
+
return m(s, t, r);
|
|
129
|
+
}
|
|
130
|
+
f.poolSize = 8192;
|
|
131
|
+
function m(s, t, r) {
|
|
132
|
+
if (typeof s == "string")
|
|
133
|
+
return P(s, t);
|
|
134
|
+
if (ArrayBuffer.isView(s))
|
|
135
|
+
return D(s);
|
|
136
|
+
if (s == null)
|
|
137
|
+
throw new TypeError(
|
|
138
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
139
|
+
);
|
|
140
|
+
if ($(s, ArrayBuffer) || s && $(s.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && ($(s, SharedArrayBuffer) || s && $(s.buffer, SharedArrayBuffer)))
|
|
141
|
+
return G(s, t, r);
|
|
142
|
+
if (typeof s == "number")
|
|
143
|
+
throw new TypeError(
|
|
144
|
+
'The "value" argument must not be of type number. Received type number'
|
|
145
|
+
);
|
|
146
|
+
var i = s.valueOf && s.valueOf();
|
|
147
|
+
if (i != null && i !== s)
|
|
148
|
+
return f.from(i, t, r);
|
|
149
|
+
var p = me(s);
|
|
150
|
+
if (p)
|
|
151
|
+
return p;
|
|
152
|
+
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof s[Symbol.toPrimitive] == "function")
|
|
153
|
+
return f.from(
|
|
154
|
+
s[Symbol.toPrimitive]("string"),
|
|
155
|
+
t,
|
|
156
|
+
r
|
|
157
|
+
);
|
|
158
|
+
throw new TypeError(
|
|
159
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
f.from = function(s, t, r) {
|
|
163
|
+
return m(s, t, r);
|
|
164
|
+
}, Object.setPrototypeOf(f.prototype, Uint8Array.prototype), Object.setPrototypeOf(f, Uint8Array);
|
|
165
|
+
function E(s) {
|
|
166
|
+
if (typeof s != "number")
|
|
167
|
+
throw new TypeError('"size" argument must be of type number');
|
|
168
|
+
if (s < 0)
|
|
169
|
+
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
170
|
+
}
|
|
171
|
+
function w(s, t, r) {
|
|
172
|
+
return E(s), s <= 0 ? l(s) : t !== void 0 ? typeof r == "string" ? l(s).fill(t, r) : l(s).fill(t) : l(s);
|
|
173
|
+
}
|
|
174
|
+
f.alloc = function(s, t, r) {
|
|
175
|
+
return w(s, t, r);
|
|
176
|
+
};
|
|
177
|
+
function O(s) {
|
|
178
|
+
return E(s), l(s < 0 ? 0 : ne(s) | 0);
|
|
179
|
+
}
|
|
180
|
+
f.allocUnsafe = function(s) {
|
|
181
|
+
return O(s);
|
|
182
|
+
}, f.allocUnsafeSlow = function(s) {
|
|
183
|
+
return O(s);
|
|
184
|
+
};
|
|
185
|
+
function P(s, t) {
|
|
186
|
+
if ((typeof t != "string" || t === "") && (t = "utf8"), !f.isEncoding(t))
|
|
187
|
+
throw new TypeError("Unknown encoding: " + t);
|
|
188
|
+
var r = we(s, t) | 0, i = l(r), p = i.write(s, t);
|
|
189
|
+
return p !== r && (i = i.slice(0, p)), i;
|
|
190
|
+
}
|
|
191
|
+
function j(s) {
|
|
192
|
+
for (var t = s.length < 0 ? 0 : ne(s.length) | 0, r = l(t), i = 0; i < t; i += 1)
|
|
193
|
+
r[i] = s[i] & 255;
|
|
194
|
+
return r;
|
|
195
|
+
}
|
|
196
|
+
function D(s) {
|
|
197
|
+
if ($(s, Uint8Array)) {
|
|
198
|
+
var t = new Uint8Array(s);
|
|
199
|
+
return G(t.buffer, t.byteOffset, t.byteLength);
|
|
200
|
+
}
|
|
201
|
+
return j(s);
|
|
202
|
+
}
|
|
203
|
+
function G(s, t, r) {
|
|
204
|
+
if (t < 0 || s.byteLength < t)
|
|
205
|
+
throw new RangeError('"offset" is outside of buffer bounds');
|
|
206
|
+
if (s.byteLength < t + (r || 0))
|
|
207
|
+
throw new RangeError('"length" is outside of buffer bounds');
|
|
208
|
+
var i;
|
|
209
|
+
return t === void 0 && r === void 0 ? i = new Uint8Array(s) : r === void 0 ? i = new Uint8Array(s, t) : i = new Uint8Array(s, t, r), Object.setPrototypeOf(i, f.prototype), i;
|
|
210
|
+
}
|
|
211
|
+
function me(s) {
|
|
212
|
+
if (f.isBuffer(s)) {
|
|
213
|
+
var t = ne(s.length) | 0, r = l(t);
|
|
214
|
+
return r.length === 0 || s.copy(r, 0, 0, t), r;
|
|
215
|
+
}
|
|
216
|
+
if (s.length !== void 0)
|
|
217
|
+
return typeof s.length != "number" || Y(s.length) ? l(0) : j(s);
|
|
218
|
+
if (s.type === "Buffer" && Array.isArray(s.data))
|
|
219
|
+
return j(s.data);
|
|
220
|
+
}
|
|
221
|
+
function ne(s) {
|
|
222
|
+
if (s >= u)
|
|
223
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
|
|
224
|
+
return s | 0;
|
|
225
|
+
}
|
|
226
|
+
function ue(s) {
|
|
227
|
+
return +s != s && (s = 0), f.alloc(+s);
|
|
228
|
+
}
|
|
229
|
+
f.isBuffer = function(t) {
|
|
230
|
+
return t != null && t._isBuffer === !0 && t !== f.prototype;
|
|
231
|
+
}, f.compare = function(t, r) {
|
|
232
|
+
if ($(t, Uint8Array) && (t = f.from(t, t.offset, t.byteLength)), $(r, Uint8Array) && (r = f.from(r, r.offset, r.byteLength)), !f.isBuffer(t) || !f.isBuffer(r))
|
|
233
|
+
throw new TypeError(
|
|
234
|
+
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
235
|
+
);
|
|
236
|
+
if (t === r)
|
|
237
|
+
return 0;
|
|
238
|
+
for (var i = t.length, p = r.length, d = 0, v = Math.min(i, p); d < v; ++d)
|
|
239
|
+
if (t[d] !== r[d]) {
|
|
240
|
+
i = t[d], p = r[d];
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
return i < p ? -1 : p < i ? 1 : 0;
|
|
244
|
+
}, f.isEncoding = function(t) {
|
|
245
|
+
switch (String(t).toLowerCase()) {
|
|
246
|
+
case "hex":
|
|
247
|
+
case "utf8":
|
|
248
|
+
case "utf-8":
|
|
249
|
+
case "ascii":
|
|
250
|
+
case "latin1":
|
|
251
|
+
case "binary":
|
|
252
|
+
case "base64":
|
|
253
|
+
case "ucs2":
|
|
254
|
+
case "ucs-2":
|
|
255
|
+
case "utf16le":
|
|
256
|
+
case "utf-16le":
|
|
257
|
+
return !0;
|
|
258
|
+
default:
|
|
259
|
+
return !1;
|
|
260
|
+
}
|
|
261
|
+
}, f.concat = function(t, r) {
|
|
262
|
+
if (!Array.isArray(t))
|
|
263
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
264
|
+
if (t.length === 0)
|
|
265
|
+
return f.alloc(0);
|
|
266
|
+
var i;
|
|
267
|
+
if (r === void 0)
|
|
268
|
+
for (r = 0, i = 0; i < t.length; ++i)
|
|
269
|
+
r += t[i].length;
|
|
270
|
+
var p = f.allocUnsafe(r), d = 0;
|
|
271
|
+
for (i = 0; i < t.length; ++i) {
|
|
272
|
+
var v = t[i];
|
|
273
|
+
if ($(v, Uint8Array))
|
|
274
|
+
d + v.length > p.length ? f.from(v).copy(p, d) : Uint8Array.prototype.set.call(
|
|
275
|
+
p,
|
|
276
|
+
v,
|
|
277
|
+
d
|
|
278
|
+
);
|
|
279
|
+
else if (f.isBuffer(v))
|
|
280
|
+
v.copy(p, d);
|
|
281
|
+
else
|
|
282
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
283
|
+
d += v.length;
|
|
284
|
+
}
|
|
285
|
+
return p;
|
|
286
|
+
};
|
|
287
|
+
function we(s, t) {
|
|
288
|
+
if (f.isBuffer(s))
|
|
289
|
+
return s.length;
|
|
290
|
+
if (ArrayBuffer.isView(s) || $(s, ArrayBuffer))
|
|
291
|
+
return s.byteLength;
|
|
292
|
+
if (typeof s != "string")
|
|
293
|
+
throw new TypeError(
|
|
294
|
+
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof s
|
|
295
|
+
);
|
|
296
|
+
var r = s.length, i = arguments.length > 2 && arguments[2] === !0;
|
|
297
|
+
if (!i && r === 0)
|
|
298
|
+
return 0;
|
|
299
|
+
for (var p = !1; ; )
|
|
300
|
+
switch (t) {
|
|
301
|
+
case "ascii":
|
|
302
|
+
case "latin1":
|
|
303
|
+
case "binary":
|
|
304
|
+
return r;
|
|
305
|
+
case "utf8":
|
|
306
|
+
case "utf-8":
|
|
307
|
+
return A(s).length;
|
|
308
|
+
case "ucs2":
|
|
309
|
+
case "ucs-2":
|
|
310
|
+
case "utf16le":
|
|
311
|
+
case "utf-16le":
|
|
312
|
+
return r * 2;
|
|
313
|
+
case "hex":
|
|
314
|
+
return r >>> 1;
|
|
315
|
+
case "base64":
|
|
316
|
+
return M(s).length;
|
|
317
|
+
default:
|
|
318
|
+
if (p)
|
|
319
|
+
return i ? -1 : A(s).length;
|
|
320
|
+
t = ("" + t).toLowerCase(), p = !0;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
f.byteLength = we;
|
|
324
|
+
function be(s, t, r) {
|
|
325
|
+
var i = !1;
|
|
326
|
+
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, t >>>= 0, r <= t))
|
|
327
|
+
return "";
|
|
328
|
+
for (s || (s = "utf8"); ; )
|
|
329
|
+
switch (s) {
|
|
330
|
+
case "hex":
|
|
331
|
+
return V(this, t, r);
|
|
332
|
+
case "utf8":
|
|
333
|
+
case "utf-8":
|
|
334
|
+
return Q(this, t, r);
|
|
335
|
+
case "ascii":
|
|
336
|
+
return Be(this, t, r);
|
|
337
|
+
case "latin1":
|
|
338
|
+
case "binary":
|
|
339
|
+
return pe(this, t, r);
|
|
340
|
+
case "base64":
|
|
341
|
+
return Re(this, t, r);
|
|
342
|
+
case "ucs2":
|
|
343
|
+
case "ucs-2":
|
|
344
|
+
case "utf16le":
|
|
345
|
+
case "utf-16le":
|
|
346
|
+
return he(this, t, r);
|
|
347
|
+
default:
|
|
348
|
+
if (i)
|
|
349
|
+
throw new TypeError("Unknown encoding: " + s);
|
|
350
|
+
s = (s + "").toLowerCase(), i = !0;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
f.prototype._isBuffer = !0;
|
|
354
|
+
function W(s, t, r) {
|
|
355
|
+
var i = s[t];
|
|
356
|
+
s[t] = s[r], s[r] = i;
|
|
357
|
+
}
|
|
358
|
+
f.prototype.swap16 = function() {
|
|
359
|
+
var t = this.length;
|
|
360
|
+
if (t % 2 !== 0)
|
|
361
|
+
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
362
|
+
for (var r = 0; r < t; r += 2)
|
|
363
|
+
W(this, r, r + 1);
|
|
364
|
+
return this;
|
|
365
|
+
}, f.prototype.swap32 = function() {
|
|
366
|
+
var t = this.length;
|
|
367
|
+
if (t % 4 !== 0)
|
|
368
|
+
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
369
|
+
for (var r = 0; r < t; r += 4)
|
|
370
|
+
W(this, r, r + 3), W(this, r + 1, r + 2);
|
|
371
|
+
return this;
|
|
372
|
+
}, f.prototype.swap64 = function() {
|
|
373
|
+
var t = this.length;
|
|
374
|
+
if (t % 8 !== 0)
|
|
375
|
+
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
376
|
+
for (var r = 0; r < t; r += 8)
|
|
377
|
+
W(this, r, r + 7), W(this, r + 1, r + 6), W(this, r + 2, r + 5), W(this, r + 3, r + 4);
|
|
378
|
+
return this;
|
|
379
|
+
}, f.prototype.toString = function() {
|
|
380
|
+
var t = this.length;
|
|
381
|
+
return t === 0 ? "" : arguments.length === 0 ? Q(this, 0, t) : be.apply(this, arguments);
|
|
382
|
+
}, f.prototype.toLocaleString = f.prototype.toString, f.prototype.equals = function(t) {
|
|
383
|
+
if (!f.isBuffer(t))
|
|
384
|
+
throw new TypeError("Argument must be a Buffer");
|
|
385
|
+
return this === t ? !0 : f.compare(this, t) === 0;
|
|
386
|
+
}, f.prototype.inspect = function() {
|
|
387
|
+
var t = "", r = o.INSPECT_MAX_BYTES;
|
|
388
|
+
return t = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (t += " ... "), "<Buffer " + t + ">";
|
|
389
|
+
}, a && (f.prototype[a] = f.prototype.inspect), f.prototype.compare = function(t, r, i, p, d) {
|
|
390
|
+
if ($(t, Uint8Array) && (t = f.from(t, t.offset, t.byteLength)), !f.isBuffer(t))
|
|
391
|
+
throw new TypeError(
|
|
392
|
+
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
|
|
393
|
+
);
|
|
394
|
+
if (r === void 0 && (r = 0), i === void 0 && (i = t ? t.length : 0), p === void 0 && (p = 0), d === void 0 && (d = this.length), r < 0 || i > t.length || p < 0 || d > this.length)
|
|
395
|
+
throw new RangeError("out of range index");
|
|
396
|
+
if (p >= d && r >= i)
|
|
397
|
+
return 0;
|
|
398
|
+
if (p >= d)
|
|
399
|
+
return -1;
|
|
400
|
+
if (r >= i)
|
|
401
|
+
return 1;
|
|
402
|
+
if (r >>>= 0, i >>>= 0, p >>>= 0, d >>>= 0, this === t)
|
|
403
|
+
return 0;
|
|
404
|
+
for (var v = d - p, x = i - r, B = Math.min(v, x), _ = this.slice(p, d), q = t.slice(r, i), L = 0; L < B; ++L)
|
|
405
|
+
if (_[L] !== q[L]) {
|
|
406
|
+
v = _[L], x = q[L];
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
return v < x ? -1 : x < v ? 1 : 0;
|
|
410
|
+
};
|
|
411
|
+
function Ee(s, t, r, i, p) {
|
|
412
|
+
if (s.length === 0)
|
|
413
|
+
return -1;
|
|
414
|
+
if (typeof r == "string" ? (i = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, Y(r) && (r = p ? 0 : s.length - 1), r < 0 && (r = s.length + r), r >= s.length) {
|
|
415
|
+
if (p)
|
|
416
|
+
return -1;
|
|
417
|
+
r = s.length - 1;
|
|
418
|
+
} else if (r < 0)
|
|
419
|
+
if (p)
|
|
420
|
+
r = 0;
|
|
421
|
+
else
|
|
422
|
+
return -1;
|
|
423
|
+
if (typeof t == "string" && (t = f.from(t, i)), f.isBuffer(t))
|
|
424
|
+
return t.length === 0 ? -1 : J(s, t, r, i, p);
|
|
425
|
+
if (typeof t == "number")
|
|
426
|
+
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? p ? Uint8Array.prototype.indexOf.call(s, t, r) : Uint8Array.prototype.lastIndexOf.call(s, t, r) : J(s, [t], r, i, p);
|
|
427
|
+
throw new TypeError("val must be string, number or Buffer");
|
|
428
|
+
}
|
|
429
|
+
function J(s, t, r, i, p) {
|
|
430
|
+
var d = 1, v = s.length, x = t.length;
|
|
431
|
+
if (i !== void 0 && (i = String(i).toLowerCase(), i === "ucs2" || i === "ucs-2" || i === "utf16le" || i === "utf-16le")) {
|
|
432
|
+
if (s.length < 2 || t.length < 2)
|
|
433
|
+
return -1;
|
|
434
|
+
d = 2, v /= 2, x /= 2, r /= 2;
|
|
435
|
+
}
|
|
436
|
+
function B(Ot, Ft) {
|
|
437
|
+
return d === 1 ? Ot[Ft] : Ot.readUInt16BE(Ft * d);
|
|
438
|
+
}
|
|
439
|
+
var _;
|
|
440
|
+
if (p) {
|
|
441
|
+
var q = -1;
|
|
442
|
+
for (_ = r; _ < v; _++)
|
|
443
|
+
if (B(s, _) === B(t, q === -1 ? 0 : _ - q)) {
|
|
444
|
+
if (q === -1 && (q = _), _ - q + 1 === x)
|
|
445
|
+
return q * d;
|
|
446
|
+
} else
|
|
447
|
+
q !== -1 && (_ -= _ - q), q = -1;
|
|
448
|
+
} else
|
|
449
|
+
for (r + x > v && (r = v - x), _ = r; _ >= 0; _--) {
|
|
450
|
+
for (var L = !0, Ue = 0; Ue < x; Ue++)
|
|
451
|
+
if (B(s, _ + Ue) !== B(t, Ue)) {
|
|
452
|
+
L = !1;
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
if (L)
|
|
456
|
+
return _;
|
|
457
|
+
}
|
|
458
|
+
return -1;
|
|
459
|
+
}
|
|
460
|
+
f.prototype.includes = function(t, r, i) {
|
|
461
|
+
return this.indexOf(t, r, i) !== -1;
|
|
462
|
+
}, f.prototype.indexOf = function(t, r, i) {
|
|
463
|
+
return Ee(this, t, r, i, !0);
|
|
464
|
+
}, f.prototype.lastIndexOf = function(t, r, i) {
|
|
465
|
+
return Ee(this, t, r, i, !1);
|
|
466
|
+
};
|
|
467
|
+
function ie(s, t, r, i) {
|
|
468
|
+
r = Number(r) || 0;
|
|
469
|
+
var p = s.length - r;
|
|
470
|
+
i ? (i = Number(i), i > p && (i = p)) : i = p;
|
|
471
|
+
var d = t.length;
|
|
472
|
+
i > d / 2 && (i = d / 2);
|
|
473
|
+
for (var v = 0; v < i; ++v) {
|
|
474
|
+
var x = parseInt(t.substr(v * 2, 2), 16);
|
|
475
|
+
if (Y(x))
|
|
476
|
+
return v;
|
|
477
|
+
s[r + v] = x;
|
|
478
|
+
}
|
|
479
|
+
return v;
|
|
480
|
+
}
|
|
481
|
+
function X(s, t, r, i) {
|
|
482
|
+
return z(A(t, s.length - r), s, r, i);
|
|
483
|
+
}
|
|
484
|
+
function fe(s, t, r, i) {
|
|
485
|
+
return z(T(t), s, r, i);
|
|
486
|
+
}
|
|
487
|
+
function oe(s, t, r, i) {
|
|
488
|
+
return z(M(t), s, r, i);
|
|
489
|
+
}
|
|
490
|
+
function K(s, t, r, i) {
|
|
491
|
+
return z(k(t, s.length - r), s, r, i);
|
|
492
|
+
}
|
|
493
|
+
f.prototype.write = function(t, r, i, p) {
|
|
494
|
+
if (r === void 0)
|
|
495
|
+
p = "utf8", i = this.length, r = 0;
|
|
496
|
+
else if (i === void 0 && typeof r == "string")
|
|
497
|
+
p = r, i = this.length, r = 0;
|
|
498
|
+
else if (isFinite(r))
|
|
499
|
+
r = r >>> 0, isFinite(i) ? (i = i >>> 0, p === void 0 && (p = "utf8")) : (p = i, i = void 0);
|
|
500
|
+
else
|
|
501
|
+
throw new Error(
|
|
502
|
+
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
503
|
+
);
|
|
504
|
+
var d = this.length - r;
|
|
505
|
+
if ((i === void 0 || i > d) && (i = d), t.length > 0 && (i < 0 || r < 0) || r > this.length)
|
|
506
|
+
throw new RangeError("Attempt to write outside buffer bounds");
|
|
507
|
+
p || (p = "utf8");
|
|
508
|
+
for (var v = !1; ; )
|
|
509
|
+
switch (p) {
|
|
510
|
+
case "hex":
|
|
511
|
+
return ie(this, t, r, i);
|
|
512
|
+
case "utf8":
|
|
513
|
+
case "utf-8":
|
|
514
|
+
return X(this, t, r, i);
|
|
515
|
+
case "ascii":
|
|
516
|
+
case "latin1":
|
|
517
|
+
case "binary":
|
|
518
|
+
return fe(this, t, r, i);
|
|
519
|
+
case "base64":
|
|
520
|
+
return oe(this, t, r, i);
|
|
521
|
+
case "ucs2":
|
|
522
|
+
case "ucs-2":
|
|
523
|
+
case "utf16le":
|
|
524
|
+
case "utf-16le":
|
|
525
|
+
return K(this, t, r, i);
|
|
526
|
+
default:
|
|
527
|
+
if (v)
|
|
528
|
+
throw new TypeError("Unknown encoding: " + p);
|
|
529
|
+
p = ("" + p).toLowerCase(), v = !0;
|
|
530
|
+
}
|
|
531
|
+
}, f.prototype.toJSON = function() {
|
|
532
|
+
return {
|
|
533
|
+
type: "Buffer",
|
|
534
|
+
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
function Re(s, t, r) {
|
|
538
|
+
return t === 0 && r === s.length ? e.fromByteArray(s) : e.fromByteArray(s.slice(t, r));
|
|
539
|
+
}
|
|
540
|
+
function Q(s, t, r) {
|
|
541
|
+
r = Math.min(s.length, r);
|
|
542
|
+
for (var i = [], p = t; p < r; ) {
|
|
543
|
+
var d = s[p], v = null, x = d > 239 ? 4 : d > 223 ? 3 : d > 191 ? 2 : 1;
|
|
544
|
+
if (p + x <= r) {
|
|
545
|
+
var B, _, q, L;
|
|
546
|
+
switch (x) {
|
|
547
|
+
case 1:
|
|
548
|
+
d < 128 && (v = d);
|
|
549
|
+
break;
|
|
550
|
+
case 2:
|
|
551
|
+
B = s[p + 1], (B & 192) === 128 && (L = (d & 31) << 6 | B & 63, L > 127 && (v = L));
|
|
552
|
+
break;
|
|
553
|
+
case 3:
|
|
554
|
+
B = s[p + 1], _ = s[p + 2], (B & 192) === 128 && (_ & 192) === 128 && (L = (d & 15) << 12 | (B & 63) << 6 | _ & 63, L > 2047 && (L < 55296 || L > 57343) && (v = L));
|
|
555
|
+
break;
|
|
556
|
+
case 4:
|
|
557
|
+
B = s[p + 1], _ = s[p + 2], q = s[p + 3], (B & 192) === 128 && (_ & 192) === 128 && (q & 192) === 128 && (L = (d & 15) << 18 | (B & 63) << 12 | (_ & 63) << 6 | q & 63, L > 65535 && L < 1114112 && (v = L));
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
v === null ? (v = 65533, x = 1) : v > 65535 && (v -= 65536, i.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), i.push(v), p += x;
|
|
561
|
+
}
|
|
562
|
+
return le(i);
|
|
563
|
+
}
|
|
564
|
+
var ce = 4096;
|
|
565
|
+
function le(s) {
|
|
566
|
+
var t = s.length;
|
|
567
|
+
if (t <= ce)
|
|
568
|
+
return String.fromCharCode.apply(String, s);
|
|
569
|
+
for (var r = "", i = 0; i < t; )
|
|
570
|
+
r += String.fromCharCode.apply(
|
|
571
|
+
String,
|
|
572
|
+
s.slice(i, i += ce)
|
|
573
|
+
);
|
|
574
|
+
return r;
|
|
575
|
+
}
|
|
576
|
+
function Be(s, t, r) {
|
|
577
|
+
var i = "";
|
|
578
|
+
r = Math.min(s.length, r);
|
|
579
|
+
for (var p = t; p < r; ++p)
|
|
580
|
+
i += String.fromCharCode(s[p] & 127);
|
|
581
|
+
return i;
|
|
582
|
+
}
|
|
583
|
+
function pe(s, t, r) {
|
|
584
|
+
var i = "";
|
|
585
|
+
r = Math.min(s.length, r);
|
|
586
|
+
for (var p = t; p < r; ++p)
|
|
587
|
+
i += String.fromCharCode(s[p]);
|
|
588
|
+
return i;
|
|
589
|
+
}
|
|
590
|
+
function V(s, t, r) {
|
|
591
|
+
var i = s.length;
|
|
592
|
+
(!t || t < 0) && (t = 0), (!r || r < 0 || r > i) && (r = i);
|
|
593
|
+
for (var p = "", d = t; d < r; ++d)
|
|
594
|
+
p += Ae[s[d]];
|
|
595
|
+
return p;
|
|
596
|
+
}
|
|
597
|
+
function he(s, t, r) {
|
|
598
|
+
for (var i = s.slice(t, r), p = "", d = 0; d < i.length - 1; d += 2)
|
|
599
|
+
p += String.fromCharCode(i[d] + i[d + 1] * 256);
|
|
600
|
+
return p;
|
|
601
|
+
}
|
|
602
|
+
f.prototype.slice = function(t, r) {
|
|
603
|
+
var i = this.length;
|
|
604
|
+
t = ~~t, r = r === void 0 ? i : ~~r, t < 0 ? (t += i, t < 0 && (t = 0)) : t > i && (t = i), r < 0 ? (r += i, r < 0 && (r = 0)) : r > i && (r = i), r < t && (r = t);
|
|
605
|
+
var p = this.subarray(t, r);
|
|
606
|
+
return Object.setPrototypeOf(p, f.prototype), p;
|
|
607
|
+
};
|
|
608
|
+
function U(s, t, r) {
|
|
609
|
+
if (s % 1 !== 0 || s < 0)
|
|
610
|
+
throw new RangeError("offset is not uint");
|
|
611
|
+
if (s + t > r)
|
|
612
|
+
throw new RangeError("Trying to access beyond buffer length");
|
|
613
|
+
}
|
|
614
|
+
f.prototype.readUintLE = f.prototype.readUIntLE = function(t, r, i) {
|
|
615
|
+
t = t >>> 0, r = r >>> 0, i || U(t, r, this.length);
|
|
616
|
+
for (var p = this[t], d = 1, v = 0; ++v < r && (d *= 256); )
|
|
617
|
+
p += this[t + v] * d;
|
|
618
|
+
return p;
|
|
619
|
+
}, f.prototype.readUintBE = f.prototype.readUIntBE = function(t, r, i) {
|
|
620
|
+
t = t >>> 0, r = r >>> 0, i || U(t, r, this.length);
|
|
621
|
+
for (var p = this[t + --r], d = 1; r > 0 && (d *= 256); )
|
|
622
|
+
p += this[t + --r] * d;
|
|
623
|
+
return p;
|
|
624
|
+
}, f.prototype.readUint8 = f.prototype.readUInt8 = function(t, r) {
|
|
625
|
+
return t = t >>> 0, r || U(t, 1, this.length), this[t];
|
|
626
|
+
}, f.prototype.readUint16LE = f.prototype.readUInt16LE = function(t, r) {
|
|
627
|
+
return t = t >>> 0, r || U(t, 2, this.length), this[t] | this[t + 1] << 8;
|
|
628
|
+
}, f.prototype.readUint16BE = f.prototype.readUInt16BE = function(t, r) {
|
|
629
|
+
return t = t >>> 0, r || U(t, 2, this.length), this[t] << 8 | this[t + 1];
|
|
630
|
+
}, f.prototype.readUint32LE = f.prototype.readUInt32LE = function(t, r) {
|
|
631
|
+
return t = t >>> 0, r || U(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
|
|
632
|
+
}, f.prototype.readUint32BE = f.prototype.readUInt32BE = function(t, r) {
|
|
633
|
+
return t = t >>> 0, r || U(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
|
|
634
|
+
}, f.prototype.readIntLE = function(t, r, i) {
|
|
635
|
+
t = t >>> 0, r = r >>> 0, i || U(t, r, this.length);
|
|
636
|
+
for (var p = this[t], d = 1, v = 0; ++v < r && (d *= 256); )
|
|
637
|
+
p += this[t + v] * d;
|
|
638
|
+
return d *= 128, p >= d && (p -= Math.pow(2, 8 * r)), p;
|
|
639
|
+
}, f.prototype.readIntBE = function(t, r, i) {
|
|
640
|
+
t = t >>> 0, r = r >>> 0, i || U(t, r, this.length);
|
|
641
|
+
for (var p = r, d = 1, v = this[t + --p]; p > 0 && (d *= 256); )
|
|
642
|
+
v += this[t + --p] * d;
|
|
643
|
+
return d *= 128, v >= d && (v -= Math.pow(2, 8 * r)), v;
|
|
644
|
+
}, f.prototype.readInt8 = function(t, r) {
|
|
645
|
+
return t = t >>> 0, r || U(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
|
|
646
|
+
}, f.prototype.readInt16LE = function(t, r) {
|
|
647
|
+
t = t >>> 0, r || U(t, 2, this.length);
|
|
648
|
+
var i = this[t] | this[t + 1] << 8;
|
|
649
|
+
return i & 32768 ? i | 4294901760 : i;
|
|
650
|
+
}, f.prototype.readInt16BE = function(t, r) {
|
|
651
|
+
t = t >>> 0, r || U(t, 2, this.length);
|
|
652
|
+
var i = this[t + 1] | this[t] << 8;
|
|
653
|
+
return i & 32768 ? i | 4294901760 : i;
|
|
654
|
+
}, f.prototype.readInt32LE = function(t, r) {
|
|
655
|
+
return t = t >>> 0, r || U(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
|
|
656
|
+
}, f.prototype.readInt32BE = function(t, r) {
|
|
657
|
+
return t = t >>> 0, r || U(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
|
|
658
|
+
}, f.prototype.readFloatLE = function(t, r) {
|
|
659
|
+
return t = t >>> 0, r || U(t, 4, this.length), n.read(this, t, !0, 23, 4);
|
|
660
|
+
}, f.prototype.readFloatBE = function(t, r) {
|
|
661
|
+
return t = t >>> 0, r || U(t, 4, this.length), n.read(this, t, !1, 23, 4);
|
|
662
|
+
}, f.prototype.readDoubleLE = function(t, r) {
|
|
663
|
+
return t = t >>> 0, r || U(t, 8, this.length), n.read(this, t, !0, 52, 8);
|
|
664
|
+
}, f.prototype.readDoubleBE = function(t, r) {
|
|
665
|
+
return t = t >>> 0, r || U(t, 8, this.length), n.read(this, t, !1, 52, 8);
|
|
666
|
+
};
|
|
667
|
+
function h(s, t, r, i, p, d) {
|
|
668
|
+
if (!f.isBuffer(s))
|
|
669
|
+
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
670
|
+
if (t > p || t < d)
|
|
671
|
+
throw new RangeError('"value" argument is out of bounds');
|
|
672
|
+
if (r + i > s.length)
|
|
673
|
+
throw new RangeError("Index out of range");
|
|
674
|
+
}
|
|
675
|
+
f.prototype.writeUintLE = f.prototype.writeUIntLE = function(t, r, i, p) {
|
|
676
|
+
if (t = +t, r = r >>> 0, i = i >>> 0, !p) {
|
|
677
|
+
var d = Math.pow(2, 8 * i) - 1;
|
|
678
|
+
h(this, t, r, i, d, 0);
|
|
679
|
+
}
|
|
680
|
+
var v = 1, x = 0;
|
|
681
|
+
for (this[r] = t & 255; ++x < i && (v *= 256); )
|
|
682
|
+
this[r + x] = t / v & 255;
|
|
683
|
+
return r + i;
|
|
684
|
+
}, f.prototype.writeUintBE = f.prototype.writeUIntBE = function(t, r, i, p) {
|
|
685
|
+
if (t = +t, r = r >>> 0, i = i >>> 0, !p) {
|
|
686
|
+
var d = Math.pow(2, 8 * i) - 1;
|
|
687
|
+
h(this, t, r, i, d, 0);
|
|
688
|
+
}
|
|
689
|
+
var v = i - 1, x = 1;
|
|
690
|
+
for (this[r + v] = t & 255; --v >= 0 && (x *= 256); )
|
|
691
|
+
this[r + v] = t / x & 255;
|
|
692
|
+
return r + i;
|
|
693
|
+
}, f.prototype.writeUint8 = f.prototype.writeUInt8 = function(t, r, i) {
|
|
694
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 1, 255, 0), this[r] = t & 255, r + 1;
|
|
695
|
+
}, f.prototype.writeUint16LE = f.prototype.writeUInt16LE = function(t, r, i) {
|
|
696
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 2, 65535, 0), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
|
|
697
|
+
}, f.prototype.writeUint16BE = f.prototype.writeUInt16BE = function(t, r, i) {
|
|
698
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 2, 65535, 0), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
|
|
699
|
+
}, f.prototype.writeUint32LE = f.prototype.writeUInt32LE = function(t, r, i) {
|
|
700
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 4, 4294967295, 0), this[r + 3] = t >>> 24, this[r + 2] = t >>> 16, this[r + 1] = t >>> 8, this[r] = t & 255, r + 4;
|
|
701
|
+
}, f.prototype.writeUint32BE = f.prototype.writeUInt32BE = function(t, r, i) {
|
|
702
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 4, 4294967295, 0), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
|
|
703
|
+
}, f.prototype.writeIntLE = function(t, r, i, p) {
|
|
704
|
+
if (t = +t, r = r >>> 0, !p) {
|
|
705
|
+
var d = Math.pow(2, 8 * i - 1);
|
|
706
|
+
h(this, t, r, i, d - 1, -d);
|
|
707
|
+
}
|
|
708
|
+
var v = 0, x = 1, B = 0;
|
|
709
|
+
for (this[r] = t & 255; ++v < i && (x *= 256); )
|
|
710
|
+
t < 0 && B === 0 && this[r + v - 1] !== 0 && (B = 1), this[r + v] = (t / x >> 0) - B & 255;
|
|
711
|
+
return r + i;
|
|
712
|
+
}, f.prototype.writeIntBE = function(t, r, i, p) {
|
|
713
|
+
if (t = +t, r = r >>> 0, !p) {
|
|
714
|
+
var d = Math.pow(2, 8 * i - 1);
|
|
715
|
+
h(this, t, r, i, d - 1, -d);
|
|
716
|
+
}
|
|
717
|
+
var v = i - 1, x = 1, B = 0;
|
|
718
|
+
for (this[r + v] = t & 255; --v >= 0 && (x *= 256); )
|
|
719
|
+
t < 0 && B === 0 && this[r + v + 1] !== 0 && (B = 1), this[r + v] = (t / x >> 0) - B & 255;
|
|
720
|
+
return r + i;
|
|
721
|
+
}, f.prototype.writeInt8 = function(t, r, i) {
|
|
722
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[r] = t & 255, r + 1;
|
|
723
|
+
}, f.prototype.writeInt16LE = function(t, r, i) {
|
|
724
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 2, 32767, -32768), this[r] = t & 255, this[r + 1] = t >>> 8, r + 2;
|
|
725
|
+
}, f.prototype.writeInt16BE = function(t, r, i) {
|
|
726
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 2, 32767, -32768), this[r] = t >>> 8, this[r + 1] = t & 255, r + 2;
|
|
727
|
+
}, f.prototype.writeInt32LE = function(t, r, i) {
|
|
728
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 4, 2147483647, -2147483648), this[r] = t & 255, this[r + 1] = t >>> 8, this[r + 2] = t >>> 16, this[r + 3] = t >>> 24, r + 4;
|
|
729
|
+
}, f.prototype.writeInt32BE = function(t, r, i) {
|
|
730
|
+
return t = +t, r = r >>> 0, i || h(this, t, r, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[r] = t >>> 24, this[r + 1] = t >>> 16, this[r + 2] = t >>> 8, this[r + 3] = t & 255, r + 4;
|
|
731
|
+
};
|
|
732
|
+
function y(s, t, r, i, p, d) {
|
|
733
|
+
if (r + i > s.length)
|
|
734
|
+
throw new RangeError("Index out of range");
|
|
735
|
+
if (r < 0)
|
|
736
|
+
throw new RangeError("Index out of range");
|
|
737
|
+
}
|
|
738
|
+
function g(s, t, r, i, p) {
|
|
739
|
+
return t = +t, r = r >>> 0, p || y(s, t, r, 4), n.write(s, t, r, i, 23, 4), r + 4;
|
|
740
|
+
}
|
|
741
|
+
f.prototype.writeFloatLE = function(t, r, i) {
|
|
742
|
+
return g(this, t, r, !0, i);
|
|
743
|
+
}, f.prototype.writeFloatBE = function(t, r, i) {
|
|
744
|
+
return g(this, t, r, !1, i);
|
|
745
|
+
};
|
|
746
|
+
function b(s, t, r, i, p) {
|
|
747
|
+
return t = +t, r = r >>> 0, p || y(s, t, r, 8), n.write(s, t, r, i, 52, 8), r + 8;
|
|
748
|
+
}
|
|
749
|
+
f.prototype.writeDoubleLE = function(t, r, i) {
|
|
750
|
+
return b(this, t, r, !0, i);
|
|
751
|
+
}, f.prototype.writeDoubleBE = function(t, r, i) {
|
|
752
|
+
return b(this, t, r, !1, i);
|
|
753
|
+
}, f.prototype.copy = function(t, r, i, p) {
|
|
754
|
+
if (!f.isBuffer(t))
|
|
755
|
+
throw new TypeError("argument should be a Buffer");
|
|
756
|
+
if (i || (i = 0), !p && p !== 0 && (p = this.length), r >= t.length && (r = t.length), r || (r = 0), p > 0 && p < i && (p = i), p === i || t.length === 0 || this.length === 0)
|
|
757
|
+
return 0;
|
|
758
|
+
if (r < 0)
|
|
759
|
+
throw new RangeError("targetStart out of bounds");
|
|
760
|
+
if (i < 0 || i >= this.length)
|
|
761
|
+
throw new RangeError("Index out of range");
|
|
762
|
+
if (p < 0)
|
|
763
|
+
throw new RangeError("sourceEnd out of bounds");
|
|
764
|
+
p > this.length && (p = this.length), t.length - r < p - i && (p = t.length - r + i);
|
|
765
|
+
var d = p - i;
|
|
766
|
+
return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(r, i, p) : Uint8Array.prototype.set.call(
|
|
767
|
+
t,
|
|
768
|
+
this.subarray(i, p),
|
|
769
|
+
r
|
|
770
|
+
), d;
|
|
771
|
+
}, f.prototype.fill = function(t, r, i, p) {
|
|
772
|
+
if (typeof t == "string") {
|
|
773
|
+
if (typeof r == "string" ? (p = r, r = 0, i = this.length) : typeof i == "string" && (p = i, i = this.length), p !== void 0 && typeof p != "string")
|
|
774
|
+
throw new TypeError("encoding must be a string");
|
|
775
|
+
if (typeof p == "string" && !f.isEncoding(p))
|
|
776
|
+
throw new TypeError("Unknown encoding: " + p);
|
|
777
|
+
if (t.length === 1) {
|
|
778
|
+
var d = t.charCodeAt(0);
|
|
779
|
+
(p === "utf8" && d < 128 || p === "latin1") && (t = d);
|
|
780
|
+
}
|
|
781
|
+
} else
|
|
782
|
+
typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
|
|
783
|
+
if (r < 0 || this.length < r || this.length < i)
|
|
784
|
+
throw new RangeError("Out of range index");
|
|
785
|
+
if (i <= r)
|
|
786
|
+
return this;
|
|
787
|
+
r = r >>> 0, i = i === void 0 ? this.length : i >>> 0, t || (t = 0);
|
|
788
|
+
var v;
|
|
789
|
+
if (typeof t == "number")
|
|
790
|
+
for (v = r; v < i; ++v)
|
|
791
|
+
this[v] = t;
|
|
792
|
+
else {
|
|
793
|
+
var x = f.isBuffer(t) ? t : f.from(t, p), B = x.length;
|
|
794
|
+
if (B === 0)
|
|
795
|
+
throw new TypeError('The value "' + t + '" is invalid for argument "value"');
|
|
796
|
+
for (v = 0; v < i - r; ++v)
|
|
797
|
+
this[v + r] = x[v % B];
|
|
798
|
+
}
|
|
799
|
+
return this;
|
|
800
|
+
};
|
|
801
|
+
var F = /[^+/0-9A-Za-z-_]/g;
|
|
802
|
+
function I(s) {
|
|
803
|
+
if (s = s.split("=")[0], s = s.trim().replace(F, ""), s.length < 2)
|
|
804
|
+
return "";
|
|
805
|
+
for (; s.length % 4 !== 0; )
|
|
806
|
+
s = s + "=";
|
|
807
|
+
return s;
|
|
808
|
+
}
|
|
809
|
+
function A(s, t) {
|
|
810
|
+
t = t || 1 / 0;
|
|
811
|
+
for (var r, i = s.length, p = null, d = [], v = 0; v < i; ++v) {
|
|
812
|
+
if (r = s.charCodeAt(v), r > 55295 && r < 57344) {
|
|
813
|
+
if (!p) {
|
|
814
|
+
if (r > 56319) {
|
|
815
|
+
(t -= 3) > -1 && d.push(239, 191, 189);
|
|
816
|
+
continue;
|
|
817
|
+
} else if (v + 1 === i) {
|
|
818
|
+
(t -= 3) > -1 && d.push(239, 191, 189);
|
|
819
|
+
continue;
|
|
820
|
+
}
|
|
821
|
+
p = r;
|
|
822
|
+
continue;
|
|
823
|
+
}
|
|
824
|
+
if (r < 56320) {
|
|
825
|
+
(t -= 3) > -1 && d.push(239, 191, 189), p = r;
|
|
826
|
+
continue;
|
|
827
|
+
}
|
|
828
|
+
r = (p - 55296 << 10 | r - 56320) + 65536;
|
|
829
|
+
} else
|
|
830
|
+
p && (t -= 3) > -1 && d.push(239, 191, 189);
|
|
831
|
+
if (p = null, r < 128) {
|
|
832
|
+
if ((t -= 1) < 0)
|
|
833
|
+
break;
|
|
834
|
+
d.push(r);
|
|
835
|
+
} else if (r < 2048) {
|
|
836
|
+
if ((t -= 2) < 0)
|
|
837
|
+
break;
|
|
838
|
+
d.push(
|
|
839
|
+
r >> 6 | 192,
|
|
840
|
+
r & 63 | 128
|
|
841
|
+
);
|
|
842
|
+
} else if (r < 65536) {
|
|
843
|
+
if ((t -= 3) < 0)
|
|
844
|
+
break;
|
|
845
|
+
d.push(
|
|
846
|
+
r >> 12 | 224,
|
|
847
|
+
r >> 6 & 63 | 128,
|
|
848
|
+
r & 63 | 128
|
|
849
|
+
);
|
|
850
|
+
} else if (r < 1114112) {
|
|
851
|
+
if ((t -= 4) < 0)
|
|
852
|
+
break;
|
|
853
|
+
d.push(
|
|
854
|
+
r >> 18 | 240,
|
|
855
|
+
r >> 12 & 63 | 128,
|
|
856
|
+
r >> 6 & 63 | 128,
|
|
857
|
+
r & 63 | 128
|
|
858
|
+
);
|
|
859
|
+
} else
|
|
860
|
+
throw new Error("Invalid code point");
|
|
861
|
+
}
|
|
862
|
+
return d;
|
|
863
|
+
}
|
|
864
|
+
function T(s) {
|
|
865
|
+
for (var t = [], r = 0; r < s.length; ++r)
|
|
866
|
+
t.push(s.charCodeAt(r) & 255);
|
|
867
|
+
return t;
|
|
868
|
+
}
|
|
869
|
+
function k(s, t) {
|
|
870
|
+
for (var r, i, p, d = [], v = 0; v < s.length && !((t -= 2) < 0); ++v)
|
|
871
|
+
r = s.charCodeAt(v), i = r >> 8, p = r % 256, d.push(p), d.push(i);
|
|
872
|
+
return d;
|
|
873
|
+
}
|
|
874
|
+
function M(s) {
|
|
875
|
+
return e.toByteArray(I(s));
|
|
876
|
+
}
|
|
877
|
+
function z(s, t, r, i) {
|
|
878
|
+
for (var p = 0; p < i && !(p + r >= t.length || p >= s.length); ++p)
|
|
879
|
+
t[p + r] = s[p];
|
|
880
|
+
return p;
|
|
881
|
+
}
|
|
882
|
+
function $(s, t) {
|
|
883
|
+
return s instanceof t || s != null && s.constructor != null && s.constructor.name != null && s.constructor.name === t.name;
|
|
884
|
+
}
|
|
885
|
+
function Y(s) {
|
|
886
|
+
return s !== s;
|
|
887
|
+
}
|
|
888
|
+
var Ae = function() {
|
|
889
|
+
for (var s = "0123456789abcdef", t = new Array(256), r = 0; r < 16; ++r)
|
|
890
|
+
for (var i = r * 16, p = 0; p < 16; ++p)
|
|
891
|
+
t[i + p] = s[r] + s[p];
|
|
892
|
+
return t;
|
|
893
|
+
}();
|
|
894
|
+
})(Dt);
|
|
895
|
+
var Mt = { exports: {} }, C = Mt.exports = {}, ee, te;
|
|
896
|
+
function ut() {
|
|
897
|
+
throw new Error("setTimeout has not been defined");
|
|
898
|
+
}
|
|
899
|
+
function ft() {
|
|
900
|
+
throw new Error("clearTimeout has not been defined");
|
|
901
|
+
}
|
|
902
|
+
(function() {
|
|
903
|
+
try {
|
|
904
|
+
typeof setTimeout == "function" ? ee = setTimeout : ee = ut;
|
|
905
|
+
} catch {
|
|
906
|
+
ee = ut;
|
|
907
|
+
}
|
|
908
|
+
try {
|
|
909
|
+
typeof clearTimeout == "function" ? te = clearTimeout : te = ft;
|
|
910
|
+
} catch {
|
|
911
|
+
te = ft;
|
|
912
|
+
}
|
|
913
|
+
})();
|
|
914
|
+
function qt(o) {
|
|
915
|
+
if (ee === setTimeout)
|
|
916
|
+
return setTimeout(o, 0);
|
|
917
|
+
if ((ee === ut || !ee) && setTimeout)
|
|
918
|
+
return ee = setTimeout, setTimeout(o, 0);
|
|
919
|
+
try {
|
|
920
|
+
return ee(o, 0);
|
|
921
|
+
} catch {
|
|
922
|
+
try {
|
|
923
|
+
return ee.call(null, o, 0);
|
|
924
|
+
} catch {
|
|
925
|
+
return ee.call(this, o, 0);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
function Pr(o) {
|
|
930
|
+
if (te === clearTimeout)
|
|
931
|
+
return clearTimeout(o);
|
|
932
|
+
if ((te === ft || !te) && clearTimeout)
|
|
933
|
+
return te = clearTimeout, clearTimeout(o);
|
|
934
|
+
try {
|
|
935
|
+
return te(o);
|
|
936
|
+
} catch {
|
|
937
|
+
try {
|
|
938
|
+
return te.call(null, o);
|
|
939
|
+
} catch {
|
|
940
|
+
return te.call(this, o);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
var se = [], xe = !1, de, Ce = -1;
|
|
945
|
+
function Rr() {
|
|
946
|
+
!xe || !de || (xe = !1, de.length ? se = de.concat(se) : Ce = -1, se.length && $t());
|
|
947
|
+
}
|
|
948
|
+
function $t() {
|
|
949
|
+
if (!xe) {
|
|
950
|
+
var o = qt(Rr);
|
|
951
|
+
xe = !0;
|
|
952
|
+
for (var e = se.length; e; ) {
|
|
953
|
+
for (de = se, se = []; ++Ce < e; )
|
|
954
|
+
de && de[Ce].run();
|
|
955
|
+
Ce = -1, e = se.length;
|
|
956
|
+
}
|
|
957
|
+
de = null, xe = !1, Pr(o);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
C.nextTick = function(o) {
|
|
961
|
+
var e = new Array(arguments.length - 1);
|
|
962
|
+
if (arguments.length > 1)
|
|
963
|
+
for (var n = 1; n < arguments.length; n++)
|
|
964
|
+
e[n - 1] = arguments[n];
|
|
965
|
+
se.push(new Gt(o, e)), se.length === 1 && !xe && qt($t);
|
|
966
|
+
};
|
|
967
|
+
function Gt(o, e) {
|
|
968
|
+
this.fun = o, this.array = e;
|
|
969
|
+
}
|
|
970
|
+
Gt.prototype.run = function() {
|
|
971
|
+
this.fun.apply(null, this.array);
|
|
972
|
+
};
|
|
973
|
+
C.title = "browser";
|
|
974
|
+
C.browser = !0;
|
|
975
|
+
C.env = {};
|
|
976
|
+
C.argv = [];
|
|
977
|
+
C.version = "";
|
|
978
|
+
C.versions = {};
|
|
979
|
+
function ae() {
|
|
980
|
+
}
|
|
981
|
+
C.on = ae;
|
|
982
|
+
C.addListener = ae;
|
|
983
|
+
C.once = ae;
|
|
984
|
+
C.off = ae;
|
|
985
|
+
C.removeListener = ae;
|
|
986
|
+
C.removeAllListeners = ae;
|
|
987
|
+
C.emit = ae;
|
|
988
|
+
C.prependListener = ae;
|
|
989
|
+
C.prependOnceListener = ae;
|
|
990
|
+
C.listeners = function(o) {
|
|
991
|
+
return [];
|
|
992
|
+
};
|
|
993
|
+
C.binding = function(o) {
|
|
994
|
+
throw new Error("process.binding is not supported");
|
|
995
|
+
};
|
|
996
|
+
C.cwd = function() {
|
|
997
|
+
return "/";
|
|
998
|
+
};
|
|
999
|
+
C.chdir = function(o) {
|
|
1000
|
+
throw new Error("process.chdir is not supported");
|
|
1001
|
+
};
|
|
1002
|
+
C.umask = function() {
|
|
1003
|
+
return 0;
|
|
1004
|
+
};
|
|
1005
|
+
var Br = Mt.exports;
|
|
1006
|
+
const Z = /* @__PURE__ */ Er(Br);
|
|
1007
|
+
var jr = function(o) {
|
|
1008
|
+
function e() {
|
|
1009
|
+
var a = this || self;
|
|
1010
|
+
return delete o.prototype.__magic__, a;
|
|
1011
|
+
}
|
|
1012
|
+
if (typeof globalThis == "object")
|
|
1013
|
+
return globalThis;
|
|
1014
|
+
if (this)
|
|
1015
|
+
return e();
|
|
1016
|
+
o.defineProperty(o.prototype, "__magic__", {
|
|
1017
|
+
configurable: !0,
|
|
1018
|
+
get: e
|
|
1019
|
+
});
|
|
1020
|
+
var n = __magic__;
|
|
1021
|
+
return n;
|
|
1022
|
+
}(Object), _r = jr, mt = {}, Wt = {}, Jt = function() {
|
|
1023
|
+
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
1024
|
+
return !1;
|
|
1025
|
+
if (typeof Symbol.iterator == "symbol")
|
|
1026
|
+
return !0;
|
|
1027
|
+
var e = {}, n = Symbol("test"), a = Object(n);
|
|
1028
|
+
if (typeof n == "string" || Object.prototype.toString.call(n) !== "[object Symbol]" || Object.prototype.toString.call(a) !== "[object Symbol]")
|
|
1029
|
+
return !1;
|
|
1030
|
+
var u = 42;
|
|
1031
|
+
e[n] = u;
|
|
1032
|
+
for (n in e)
|
|
1033
|
+
return !1;
|
|
1034
|
+
if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
|
|
1035
|
+
return !1;
|
|
1036
|
+
var c = Object.getOwnPropertySymbols(e);
|
|
1037
|
+
if (c.length !== 1 || c[0] !== n || !Object.prototype.propertyIsEnumerable.call(e, n))
|
|
1038
|
+
return !1;
|
|
1039
|
+
if (typeof Object.getOwnPropertyDescriptor == "function") {
|
|
1040
|
+
var l = Object.getOwnPropertyDescriptor(e, n);
|
|
1041
|
+
if (l.value !== u || l.enumerable !== !0)
|
|
1042
|
+
return !1;
|
|
1043
|
+
}
|
|
1044
|
+
return !0;
|
|
1045
|
+
}, Ur = Jt, wt = function() {
|
|
1046
|
+
return Ur() && !!Symbol.toStringTag;
|
|
1047
|
+
}, xt = typeof Symbol < "u" && Symbol, Lr = Jt, Cr = function() {
|
|
1048
|
+
return typeof xt != "function" || typeof Symbol != "function" || typeof xt("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Lr();
|
|
1049
|
+
}, It = {
|
|
1050
|
+
foo: {}
|
|
1051
|
+
}, Dr = Object, Nr = function() {
|
|
1052
|
+
return { __proto__: It }.foo === It.foo && !({ __proto__: null } instanceof Dr);
|
|
1053
|
+
}, Mr = "Function.prototype.bind called on incompatible ", Ze = Array.prototype.slice, qr = Object.prototype.toString, $r = "[object Function]", Gr = function(e) {
|
|
1054
|
+
var n = this;
|
|
1055
|
+
if (typeof n != "function" || qr.call(n) !== $r)
|
|
1056
|
+
throw new TypeError(Mr + n);
|
|
1057
|
+
for (var a = Ze.call(arguments, 1), u, c = function() {
|
|
1058
|
+
if (this instanceof u) {
|
|
1059
|
+
var w = n.apply(
|
|
1060
|
+
this,
|
|
1061
|
+
a.concat(Ze.call(arguments))
|
|
1062
|
+
);
|
|
1063
|
+
return Object(w) === w ? w : this;
|
|
1064
|
+
} else
|
|
1065
|
+
return n.apply(
|
|
1066
|
+
e,
|
|
1067
|
+
a.concat(Ze.call(arguments))
|
|
1068
|
+
);
|
|
1069
|
+
}, l = Math.max(0, n.length - a.length), f = [], m = 0; m < l; m++)
|
|
1070
|
+
f.push("$" + m);
|
|
1071
|
+
if (u = Function("binder", "return function (" + f.join(",") + "){ return binder.apply(this,arguments); }")(c), n.prototype) {
|
|
1072
|
+
var E = function() {
|
|
1073
|
+
};
|
|
1074
|
+
E.prototype = n.prototype, u.prototype = new E(), E.prototype = null;
|
|
1075
|
+
}
|
|
1076
|
+
return u;
|
|
1077
|
+
}, Wr = Gr, bt = Function.prototype.bind || Wr, Jr = bt, zr = Jr.call(Function.call, Object.prototype.hasOwnProperty), S, Pe = SyntaxError, zt = Function, Ie = TypeError, et = function(o) {
|
|
1078
|
+
try {
|
|
1079
|
+
return zt('"use strict"; return (' + o + ").constructor;")();
|
|
1080
|
+
} catch {
|
|
1081
|
+
}
|
|
1082
|
+
}, ge = Object.getOwnPropertyDescriptor;
|
|
1083
|
+
if (ge)
|
|
1084
|
+
try {
|
|
1085
|
+
ge({}, "");
|
|
1086
|
+
} catch {
|
|
1087
|
+
ge = null;
|
|
1088
|
+
}
|
|
1089
|
+
var tt = function() {
|
|
1090
|
+
throw new Ie();
|
|
1091
|
+
}, Hr = ge ? function() {
|
|
1092
|
+
try {
|
|
1093
|
+
return arguments.callee, tt;
|
|
1094
|
+
} catch {
|
|
1095
|
+
try {
|
|
1096
|
+
return ge(arguments, "callee").get;
|
|
1097
|
+
} catch {
|
|
1098
|
+
return tt;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}() : tt, Te = Cr(), Kr = Nr(), N = Object.getPrototypeOf || (Kr ? function(o) {
|
|
1102
|
+
return o.__proto__;
|
|
1103
|
+
} : null), Oe = {}, Qr = typeof Uint8Array > "u" || !N ? S : N(Uint8Array), ve = {
|
|
1104
|
+
"%AggregateError%": typeof AggregateError > "u" ? S : AggregateError,
|
|
1105
|
+
"%Array%": Array,
|
|
1106
|
+
"%ArrayBuffer%": typeof ArrayBuffer > "u" ? S : ArrayBuffer,
|
|
1107
|
+
"%ArrayIteratorPrototype%": Te && N ? N([][Symbol.iterator]()) : S,
|
|
1108
|
+
"%AsyncFromSyncIteratorPrototype%": S,
|
|
1109
|
+
"%AsyncFunction%": Oe,
|
|
1110
|
+
"%AsyncGenerator%": Oe,
|
|
1111
|
+
"%AsyncGeneratorFunction%": Oe,
|
|
1112
|
+
"%AsyncIteratorPrototype%": Oe,
|
|
1113
|
+
"%Atomics%": typeof Atomics > "u" ? S : Atomics,
|
|
1114
|
+
"%BigInt%": typeof BigInt > "u" ? S : BigInt,
|
|
1115
|
+
"%BigInt64Array%": typeof BigInt64Array > "u" ? S : BigInt64Array,
|
|
1116
|
+
"%BigUint64Array%": typeof BigUint64Array > "u" ? S : BigUint64Array,
|
|
1117
|
+
"%Boolean%": Boolean,
|
|
1118
|
+
"%DataView%": typeof DataView > "u" ? S : DataView,
|
|
1119
|
+
"%Date%": Date,
|
|
1120
|
+
"%decodeURI%": decodeURI,
|
|
1121
|
+
"%decodeURIComponent%": decodeURIComponent,
|
|
1122
|
+
"%encodeURI%": encodeURI,
|
|
1123
|
+
"%encodeURIComponent%": encodeURIComponent,
|
|
1124
|
+
"%Error%": Error,
|
|
1125
|
+
"%eval%": eval,
|
|
1126
|
+
// eslint-disable-line no-eval
|
|
1127
|
+
"%EvalError%": EvalError,
|
|
1128
|
+
"%Float32Array%": typeof Float32Array > "u" ? S : Float32Array,
|
|
1129
|
+
"%Float64Array%": typeof Float64Array > "u" ? S : Float64Array,
|
|
1130
|
+
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? S : FinalizationRegistry,
|
|
1131
|
+
"%Function%": zt,
|
|
1132
|
+
"%GeneratorFunction%": Oe,
|
|
1133
|
+
"%Int8Array%": typeof Int8Array > "u" ? S : Int8Array,
|
|
1134
|
+
"%Int16Array%": typeof Int16Array > "u" ? S : Int16Array,
|
|
1135
|
+
"%Int32Array%": typeof Int32Array > "u" ? S : Int32Array,
|
|
1136
|
+
"%isFinite%": isFinite,
|
|
1137
|
+
"%isNaN%": isNaN,
|
|
1138
|
+
"%IteratorPrototype%": Te && N ? N(N([][Symbol.iterator]())) : S,
|
|
1139
|
+
"%JSON%": typeof JSON == "object" ? JSON : S,
|
|
1140
|
+
"%Map%": typeof Map > "u" ? S : Map,
|
|
1141
|
+
"%MapIteratorPrototype%": typeof Map > "u" || !Te || !N ? S : N((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
1142
|
+
"%Math%": Math,
|
|
1143
|
+
"%Number%": Number,
|
|
1144
|
+
"%Object%": Object,
|
|
1145
|
+
"%parseFloat%": parseFloat,
|
|
1146
|
+
"%parseInt%": parseInt,
|
|
1147
|
+
"%Promise%": typeof Promise > "u" ? S : Promise,
|
|
1148
|
+
"%Proxy%": typeof Proxy > "u" ? S : Proxy,
|
|
1149
|
+
"%RangeError%": RangeError,
|
|
1150
|
+
"%ReferenceError%": ReferenceError,
|
|
1151
|
+
"%Reflect%": typeof Reflect > "u" ? S : Reflect,
|
|
1152
|
+
"%RegExp%": RegExp,
|
|
1153
|
+
"%Set%": typeof Set > "u" ? S : Set,
|
|
1154
|
+
"%SetIteratorPrototype%": typeof Set > "u" || !Te || !N ? S : N((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
1155
|
+
"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? S : SharedArrayBuffer,
|
|
1156
|
+
"%String%": String,
|
|
1157
|
+
"%StringIteratorPrototype%": Te && N ? N(""[Symbol.iterator]()) : S,
|
|
1158
|
+
"%Symbol%": Te ? Symbol : S,
|
|
1159
|
+
"%SyntaxError%": Pe,
|
|
1160
|
+
"%ThrowTypeError%": Hr,
|
|
1161
|
+
"%TypedArray%": Qr,
|
|
1162
|
+
"%TypeError%": Ie,
|
|
1163
|
+
"%Uint8Array%": typeof Uint8Array > "u" ? S : Uint8Array,
|
|
1164
|
+
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? S : Uint8ClampedArray,
|
|
1165
|
+
"%Uint16Array%": typeof Uint16Array > "u" ? S : Uint16Array,
|
|
1166
|
+
"%Uint32Array%": typeof Uint32Array > "u" ? S : Uint32Array,
|
|
1167
|
+
"%URIError%": URIError,
|
|
1168
|
+
"%WeakMap%": typeof WeakMap > "u" ? S : WeakMap,
|
|
1169
|
+
"%WeakRef%": typeof WeakRef > "u" ? S : WeakRef,
|
|
1170
|
+
"%WeakSet%": typeof WeakSet > "u" ? S : WeakSet
|
|
1171
|
+
};
|
|
1172
|
+
if (N)
|
|
1173
|
+
try {
|
|
1174
|
+
null.error;
|
|
1175
|
+
} catch (o) {
|
|
1176
|
+
var Vr = N(N(o));
|
|
1177
|
+
ve["%Error.prototype%"] = Vr;
|
|
1178
|
+
}
|
|
1179
|
+
var Xr = function o(e) {
|
|
1180
|
+
var n;
|
|
1181
|
+
if (e === "%AsyncFunction%")
|
|
1182
|
+
n = et("async function () {}");
|
|
1183
|
+
else if (e === "%GeneratorFunction%")
|
|
1184
|
+
n = et("function* () {}");
|
|
1185
|
+
else if (e === "%AsyncGeneratorFunction%")
|
|
1186
|
+
n = et("async function* () {}");
|
|
1187
|
+
else if (e === "%AsyncGenerator%") {
|
|
1188
|
+
var a = o("%AsyncGeneratorFunction%");
|
|
1189
|
+
a && (n = a.prototype);
|
|
1190
|
+
} else if (e === "%AsyncIteratorPrototype%") {
|
|
1191
|
+
var u = o("%AsyncGenerator%");
|
|
1192
|
+
u && N && (n = N(u.prototype));
|
|
1193
|
+
}
|
|
1194
|
+
return ve[e] = n, n;
|
|
1195
|
+
}, kt = {
|
|
1196
|
+
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
1197
|
+
"%ArrayPrototype%": ["Array", "prototype"],
|
|
1198
|
+
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
|
|
1199
|
+
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
|
|
1200
|
+
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
|
|
1201
|
+
"%ArrayProto_values%": ["Array", "prototype", "values"],
|
|
1202
|
+
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
|
|
1203
|
+
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
|
|
1204
|
+
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
|
|
1205
|
+
"%BooleanPrototype%": ["Boolean", "prototype"],
|
|
1206
|
+
"%DataViewPrototype%": ["DataView", "prototype"],
|
|
1207
|
+
"%DatePrototype%": ["Date", "prototype"],
|
|
1208
|
+
"%ErrorPrototype%": ["Error", "prototype"],
|
|
1209
|
+
"%EvalErrorPrototype%": ["EvalError", "prototype"],
|
|
1210
|
+
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
|
|
1211
|
+
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
|
|
1212
|
+
"%FunctionPrototype%": ["Function", "prototype"],
|
|
1213
|
+
"%Generator%": ["GeneratorFunction", "prototype"],
|
|
1214
|
+
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
|
|
1215
|
+
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
|
|
1216
|
+
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
|
|
1217
|
+
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
|
|
1218
|
+
"%JSONParse%": ["JSON", "parse"],
|
|
1219
|
+
"%JSONStringify%": ["JSON", "stringify"],
|
|
1220
|
+
"%MapPrototype%": ["Map", "prototype"],
|
|
1221
|
+
"%NumberPrototype%": ["Number", "prototype"],
|
|
1222
|
+
"%ObjectPrototype%": ["Object", "prototype"],
|
|
1223
|
+
"%ObjProto_toString%": ["Object", "prototype", "toString"],
|
|
1224
|
+
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
|
|
1225
|
+
"%PromisePrototype%": ["Promise", "prototype"],
|
|
1226
|
+
"%PromiseProto_then%": ["Promise", "prototype", "then"],
|
|
1227
|
+
"%Promise_all%": ["Promise", "all"],
|
|
1228
|
+
"%Promise_reject%": ["Promise", "reject"],
|
|
1229
|
+
"%Promise_resolve%": ["Promise", "resolve"],
|
|
1230
|
+
"%RangeErrorPrototype%": ["RangeError", "prototype"],
|
|
1231
|
+
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
|
|
1232
|
+
"%RegExpPrototype%": ["RegExp", "prototype"],
|
|
1233
|
+
"%SetPrototype%": ["Set", "prototype"],
|
|
1234
|
+
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
|
|
1235
|
+
"%StringPrototype%": ["String", "prototype"],
|
|
1236
|
+
"%SymbolPrototype%": ["Symbol", "prototype"],
|
|
1237
|
+
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
|
|
1238
|
+
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
|
|
1239
|
+
"%TypeErrorPrototype%": ["TypeError", "prototype"],
|
|
1240
|
+
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
|
|
1241
|
+
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
|
|
1242
|
+
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
|
|
1243
|
+
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
|
|
1244
|
+
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
1245
|
+
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
1246
|
+
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
1247
|
+
}, _e = bt, Ge = zr, Yr = _e.call(Function.call, Array.prototype.concat), Zr = _e.call(Function.apply, Array.prototype.splice), Pt = _e.call(Function.call, String.prototype.replace), We = _e.call(Function.call, String.prototype.slice), en = _e.call(Function.call, RegExp.prototype.exec), tn = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, rn = /\\(\\)?/g, nn = function(e) {
|
|
1248
|
+
var n = We(e, 0, 1), a = We(e, -1);
|
|
1249
|
+
if (n === "%" && a !== "%")
|
|
1250
|
+
throw new Pe("invalid intrinsic syntax, expected closing `%`");
|
|
1251
|
+
if (a === "%" && n !== "%")
|
|
1252
|
+
throw new Pe("invalid intrinsic syntax, expected opening `%`");
|
|
1253
|
+
var u = [];
|
|
1254
|
+
return Pt(e, tn, function(c, l, f, m) {
|
|
1255
|
+
u[u.length] = f ? Pt(m, rn, "$1") : l || c;
|
|
1256
|
+
}), u;
|
|
1257
|
+
}, on = function(e, n) {
|
|
1258
|
+
var a = e, u;
|
|
1259
|
+
if (Ge(kt, a) && (u = kt[a], a = "%" + u[0] + "%"), Ge(ve, a)) {
|
|
1260
|
+
var c = ve[a];
|
|
1261
|
+
if (c === Oe && (c = Xr(a)), typeof c > "u" && !n)
|
|
1262
|
+
throw new Ie("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
1263
|
+
return {
|
|
1264
|
+
alias: u,
|
|
1265
|
+
name: a,
|
|
1266
|
+
value: c
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
throw new Pe("intrinsic " + e + " does not exist!");
|
|
1270
|
+
}, Et = function(e, n) {
|
|
1271
|
+
if (typeof e != "string" || e.length === 0)
|
|
1272
|
+
throw new Ie("intrinsic name must be a non-empty string");
|
|
1273
|
+
if (arguments.length > 1 && typeof n != "boolean")
|
|
1274
|
+
throw new Ie('"allowMissing" argument must be a boolean');
|
|
1275
|
+
if (en(/^%?[^%]*%?$/, e) === null)
|
|
1276
|
+
throw new Pe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
1277
|
+
var a = nn(e), u = a.length > 0 ? a[0] : "", c = on("%" + u + "%", n), l = c.name, f = c.value, m = !1, E = c.alias;
|
|
1278
|
+
E && (u = E[0], Zr(a, Yr([0, 1], E)));
|
|
1279
|
+
for (var w = 1, O = !0; w < a.length; w += 1) {
|
|
1280
|
+
var P = a[w], j = We(P, 0, 1), D = We(P, -1);
|
|
1281
|
+
if ((j === '"' || j === "'" || j === "`" || D === '"' || D === "'" || D === "`") && j !== D)
|
|
1282
|
+
throw new Pe("property names with quotes must have matching quotes");
|
|
1283
|
+
if ((P === "constructor" || !O) && (m = !0), u += "." + P, l = "%" + u + "%", Ge(ve, l))
|
|
1284
|
+
f = ve[l];
|
|
1285
|
+
else if (f != null) {
|
|
1286
|
+
if (!(P in f)) {
|
|
1287
|
+
if (!n)
|
|
1288
|
+
throw new Ie("base intrinsic for " + e + " exists, but the property is not available.");
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
if (ge && w + 1 >= a.length) {
|
|
1292
|
+
var G = ge(f, P);
|
|
1293
|
+
O = !!G, O && "get" in G && !("originalValue" in G.get) ? f = G.get : f = f[P];
|
|
1294
|
+
} else
|
|
1295
|
+
O = Ge(f, P), f = f[P];
|
|
1296
|
+
O && !m && (ve[l] = f);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
return f;
|
|
1300
|
+
}, Ht = { exports: {} };
|
|
1301
|
+
(function(o) {
|
|
1302
|
+
var e = bt, n = Et, a = n("%Function.prototype.apply%"), u = n("%Function.prototype.call%"), c = n("%Reflect.apply%", !0) || e.call(u, a), l = n("%Object.getOwnPropertyDescriptor%", !0), f = n("%Object.defineProperty%", !0), m = n("%Math.max%");
|
|
1303
|
+
if (f)
|
|
1304
|
+
try {
|
|
1305
|
+
f({}, "a", { value: 1 });
|
|
1306
|
+
} catch {
|
|
1307
|
+
f = null;
|
|
1308
|
+
}
|
|
1309
|
+
o.exports = function(O) {
|
|
1310
|
+
var P = c(e, u, arguments);
|
|
1311
|
+
if (l && f) {
|
|
1312
|
+
var j = l(P, "length");
|
|
1313
|
+
j.configurable && f(
|
|
1314
|
+
P,
|
|
1315
|
+
"length",
|
|
1316
|
+
{ value: 1 + m(0, O.length - (arguments.length - 1)) }
|
|
1317
|
+
);
|
|
1318
|
+
}
|
|
1319
|
+
return P;
|
|
1320
|
+
};
|
|
1321
|
+
var E = function() {
|
|
1322
|
+
return c(e, a, arguments);
|
|
1323
|
+
};
|
|
1324
|
+
f ? f(o.exports, "apply", { value: E }) : o.exports.apply = E;
|
|
1325
|
+
})(Ht);
|
|
1326
|
+
var Kt = Ht.exports, Qt = Et, Vt = Kt, sn = Vt(Qt("String.prototype.indexOf")), Xt = function(e, n) {
|
|
1327
|
+
var a = Qt(e, !!n);
|
|
1328
|
+
return typeof a == "function" && sn(e, ".prototype.") > -1 ? Vt(a) : a;
|
|
1329
|
+
}, an = wt(), un = Xt, ct = un("Object.prototype.toString"), Ve = function(e) {
|
|
1330
|
+
return an && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : ct(e) === "[object Arguments]";
|
|
1331
|
+
}, Yt = function(e) {
|
|
1332
|
+
return Ve(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && ct(e) !== "[object Array]" && ct(e.callee) === "[object Function]";
|
|
1333
|
+
}, fn = function() {
|
|
1334
|
+
return Ve(arguments);
|
|
1335
|
+
}();
|
|
1336
|
+
Ve.isLegacyArguments = Yt;
|
|
1337
|
+
var cn = fn ? Ve : Yt, ln = Object.prototype.toString, pn = Function.prototype.toString, hn = /^\s*(?:function)?\*/, Zt = wt(), rt = Object.getPrototypeOf, yn = function() {
|
|
1338
|
+
if (!Zt)
|
|
1339
|
+
return !1;
|
|
1340
|
+
try {
|
|
1341
|
+
return Function("return function*() {}")();
|
|
1342
|
+
} catch {
|
|
1343
|
+
}
|
|
1344
|
+
}, nt, dn = function(e) {
|
|
1345
|
+
if (typeof e != "function")
|
|
1346
|
+
return !1;
|
|
1347
|
+
if (hn.test(pn.call(e)))
|
|
1348
|
+
return !0;
|
|
1349
|
+
if (!Zt) {
|
|
1350
|
+
var n = ln.call(e);
|
|
1351
|
+
return n === "[object GeneratorFunction]";
|
|
1352
|
+
}
|
|
1353
|
+
if (!rt)
|
|
1354
|
+
return !1;
|
|
1355
|
+
if (typeof nt > "u") {
|
|
1356
|
+
var a = yn();
|
|
1357
|
+
nt = a ? rt(a) : !1;
|
|
1358
|
+
}
|
|
1359
|
+
return rt(e) === nt;
|
|
1360
|
+
}, er = Function.prototype.toString, Fe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, lt, De;
|
|
1361
|
+
if (typeof Fe == "function" && typeof Object.defineProperty == "function")
|
|
1362
|
+
try {
|
|
1363
|
+
lt = Object.defineProperty({}, "length", {
|
|
1364
|
+
get: function() {
|
|
1365
|
+
throw De;
|
|
1366
|
+
}
|
|
1367
|
+
}), De = {}, Fe(function() {
|
|
1368
|
+
throw 42;
|
|
1369
|
+
}, null, lt);
|
|
1370
|
+
} catch (o) {
|
|
1371
|
+
o !== De && (Fe = null);
|
|
1372
|
+
}
|
|
1373
|
+
else
|
|
1374
|
+
Fe = null;
|
|
1375
|
+
var gn = /^\s*class\b/, pt = function(e) {
|
|
1376
|
+
try {
|
|
1377
|
+
var n = er.call(e);
|
|
1378
|
+
return gn.test(n);
|
|
1379
|
+
} catch {
|
|
1380
|
+
return !1;
|
|
1381
|
+
}
|
|
1382
|
+
}, it = function(e) {
|
|
1383
|
+
try {
|
|
1384
|
+
return pt(e) ? !1 : (er.call(e), !0);
|
|
1385
|
+
} catch {
|
|
1386
|
+
return !1;
|
|
1387
|
+
}
|
|
1388
|
+
}, Ne = Object.prototype.toString, vn = "[object Object]", mn = "[object Function]", wn = "[object GeneratorFunction]", bn = "[object HTMLAllCollection]", En = "[object HTML document.all class]", An = "[object HTMLCollection]", Sn = typeof Symbol == "function" && !!Symbol.toStringTag, Tn = !(0 in [,]), ht = function() {
|
|
1389
|
+
return !1;
|
|
1390
|
+
};
|
|
1391
|
+
if (typeof document == "object") {
|
|
1392
|
+
var On = document.all;
|
|
1393
|
+
Ne.call(On) === Ne.call(document.all) && (ht = function(e) {
|
|
1394
|
+
if ((Tn || !e) && (typeof e > "u" || typeof e == "object"))
|
|
1395
|
+
try {
|
|
1396
|
+
var n = Ne.call(e);
|
|
1397
|
+
return (n === bn || n === En || n === An || n === vn) && e("") == null;
|
|
1398
|
+
} catch {
|
|
1399
|
+
}
|
|
1400
|
+
return !1;
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
var Fn = Fe ? function(e) {
|
|
1404
|
+
if (ht(e))
|
|
1405
|
+
return !0;
|
|
1406
|
+
if (!e || typeof e != "function" && typeof e != "object")
|
|
1407
|
+
return !1;
|
|
1408
|
+
try {
|
|
1409
|
+
Fe(e, null, lt);
|
|
1410
|
+
} catch (n) {
|
|
1411
|
+
if (n !== De)
|
|
1412
|
+
return !1;
|
|
1413
|
+
}
|
|
1414
|
+
return !pt(e) && it(e);
|
|
1415
|
+
} : function(e) {
|
|
1416
|
+
if (ht(e))
|
|
1417
|
+
return !0;
|
|
1418
|
+
if (!e || typeof e != "function" && typeof e != "object")
|
|
1419
|
+
return !1;
|
|
1420
|
+
if (Sn)
|
|
1421
|
+
return it(e);
|
|
1422
|
+
if (pt(e))
|
|
1423
|
+
return !1;
|
|
1424
|
+
var n = Ne.call(e);
|
|
1425
|
+
return n !== mn && n !== wn && !/^\[object HTML/.test(n) ? !1 : it(e);
|
|
1426
|
+
}, xn = Fn, In = Object.prototype.toString, tr = Object.prototype.hasOwnProperty, kn = function(e, n, a) {
|
|
1427
|
+
for (var u = 0, c = e.length; u < c; u++)
|
|
1428
|
+
tr.call(e, u) && (a == null ? n(e[u], u, e) : n.call(a, e[u], u, e));
|
|
1429
|
+
}, Pn = function(e, n, a) {
|
|
1430
|
+
for (var u = 0, c = e.length; u < c; u++)
|
|
1431
|
+
a == null ? n(e.charAt(u), u, e) : n.call(a, e.charAt(u), u, e);
|
|
1432
|
+
}, Rn = function(e, n, a) {
|
|
1433
|
+
for (var u in e)
|
|
1434
|
+
tr.call(e, u) && (a == null ? n(e[u], u, e) : n.call(a, e[u], u, e));
|
|
1435
|
+
}, Bn = function(e, n, a) {
|
|
1436
|
+
if (!xn(n))
|
|
1437
|
+
throw new TypeError("iterator must be a function");
|
|
1438
|
+
var u;
|
|
1439
|
+
arguments.length >= 3 && (u = a), In.call(e) === "[object Array]" ? kn(e, n, u) : typeof e == "string" ? Pn(e, n, u) : Rn(e, n, u);
|
|
1440
|
+
}, jn = Bn, ot = [
|
|
1441
|
+
"BigInt64Array",
|
|
1442
|
+
"BigUint64Array",
|
|
1443
|
+
"Float32Array",
|
|
1444
|
+
"Float64Array",
|
|
1445
|
+
"Int16Array",
|
|
1446
|
+
"Int32Array",
|
|
1447
|
+
"Int8Array",
|
|
1448
|
+
"Uint16Array",
|
|
1449
|
+
"Uint32Array",
|
|
1450
|
+
"Uint8Array",
|
|
1451
|
+
"Uint8ClampedArray"
|
|
1452
|
+
], _n = typeof globalThis > "u" ? Ct : globalThis, Un = function() {
|
|
1453
|
+
for (var e = [], n = 0; n < ot.length; n++)
|
|
1454
|
+
typeof _n[ot[n]] == "function" && (e[e.length] = ot[n]);
|
|
1455
|
+
return e;
|
|
1456
|
+
}, Ln = Et, Me = Ln("%Object.getOwnPropertyDescriptor%", !0);
|
|
1457
|
+
if (Me)
|
|
1458
|
+
try {
|
|
1459
|
+
Me([], "length");
|
|
1460
|
+
} catch {
|
|
1461
|
+
Me = null;
|
|
1462
|
+
}
|
|
1463
|
+
var Cn = Me, Je = jn, Dn = Un, Rt = Kt, At = Xt, qe = Cn, Nn = At("Object.prototype.toString"), rr = wt(), Bt = typeof globalThis > "u" ? Ct : globalThis, yt = Dn(), St = At("String.prototype.slice"), st = Object.getPrototypeOf, Mn = At("Array.prototype.indexOf", !0) || function(e, n) {
|
|
1464
|
+
for (var a = 0; a < e.length; a += 1)
|
|
1465
|
+
if (e[a] === n)
|
|
1466
|
+
return a;
|
|
1467
|
+
return -1;
|
|
1468
|
+
}, ze = { __proto__: null };
|
|
1469
|
+
rr && qe && st ? Je(yt, function(o) {
|
|
1470
|
+
var e = new Bt[o]();
|
|
1471
|
+
if (Symbol.toStringTag in e) {
|
|
1472
|
+
var n = st(e), a = qe(n, Symbol.toStringTag);
|
|
1473
|
+
if (!a) {
|
|
1474
|
+
var u = st(n);
|
|
1475
|
+
a = qe(u, Symbol.toStringTag);
|
|
1476
|
+
}
|
|
1477
|
+
ze["$" + o] = Rt(a.get);
|
|
1478
|
+
}
|
|
1479
|
+
}) : Je(yt, function(o) {
|
|
1480
|
+
var e = new Bt[o]();
|
|
1481
|
+
ze["$" + o] = Rt(e.slice);
|
|
1482
|
+
});
|
|
1483
|
+
var qn = function(e) {
|
|
1484
|
+
var n = !1;
|
|
1485
|
+
return Je(ze, function(a, u) {
|
|
1486
|
+
if (!n)
|
|
1487
|
+
try {
|
|
1488
|
+
"$" + a(e) === u && (n = St(u, 1));
|
|
1489
|
+
} catch {
|
|
1490
|
+
}
|
|
1491
|
+
}), n;
|
|
1492
|
+
}, $n = function(e) {
|
|
1493
|
+
var n = !1;
|
|
1494
|
+
return Je(ze, function(a, u) {
|
|
1495
|
+
if (!n)
|
|
1496
|
+
try {
|
|
1497
|
+
a(e), n = St(u, 1);
|
|
1498
|
+
} catch {
|
|
1499
|
+
}
|
|
1500
|
+
}), n;
|
|
1501
|
+
}, nr = function(e) {
|
|
1502
|
+
if (!e || typeof e != "object")
|
|
1503
|
+
return !1;
|
|
1504
|
+
if (!rr) {
|
|
1505
|
+
var n = St(Nn(e), 8, -1);
|
|
1506
|
+
return Mn(yt, n) > -1 ? n : n !== "Object" ? !1 : $n(e);
|
|
1507
|
+
}
|
|
1508
|
+
return qe ? qn(e) : null;
|
|
1509
|
+
}, Gn = nr, Wn = function(e) {
|
|
1510
|
+
return !!Gn(e);
|
|
1511
|
+
};
|
|
1512
|
+
(function(o) {
|
|
1513
|
+
var e = cn, n = dn, a = nr, u = Wn;
|
|
1514
|
+
function c(i) {
|
|
1515
|
+
return i.call.bind(i);
|
|
1516
|
+
}
|
|
1517
|
+
var l = typeof BigInt < "u", f = typeof Symbol < "u", m = c(Object.prototype.toString), E = c(Number.prototype.valueOf), w = c(String.prototype.valueOf), O = c(Boolean.prototype.valueOf);
|
|
1518
|
+
if (l)
|
|
1519
|
+
var P = c(BigInt.prototype.valueOf);
|
|
1520
|
+
if (f)
|
|
1521
|
+
var j = c(Symbol.prototype.valueOf);
|
|
1522
|
+
function D(i, p) {
|
|
1523
|
+
if (typeof i != "object")
|
|
1524
|
+
return !1;
|
|
1525
|
+
try {
|
|
1526
|
+
return p(i), !0;
|
|
1527
|
+
} catch {
|
|
1528
|
+
return !1;
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
o.isArgumentsObject = e, o.isGeneratorFunction = n, o.isTypedArray = u;
|
|
1532
|
+
function G(i) {
|
|
1533
|
+
return typeof Promise < "u" && i instanceof Promise || i !== null && typeof i == "object" && typeof i.then == "function" && typeof i.catch == "function";
|
|
1534
|
+
}
|
|
1535
|
+
o.isPromise = G;
|
|
1536
|
+
function me(i) {
|
|
1537
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(i) : u(i) || y(i);
|
|
1538
|
+
}
|
|
1539
|
+
o.isArrayBufferView = me;
|
|
1540
|
+
function ne(i) {
|
|
1541
|
+
return a(i) === "Uint8Array";
|
|
1542
|
+
}
|
|
1543
|
+
o.isUint8Array = ne;
|
|
1544
|
+
function ue(i) {
|
|
1545
|
+
return a(i) === "Uint8ClampedArray";
|
|
1546
|
+
}
|
|
1547
|
+
o.isUint8ClampedArray = ue;
|
|
1548
|
+
function we(i) {
|
|
1549
|
+
return a(i) === "Uint16Array";
|
|
1550
|
+
}
|
|
1551
|
+
o.isUint16Array = we;
|
|
1552
|
+
function be(i) {
|
|
1553
|
+
return a(i) === "Uint32Array";
|
|
1554
|
+
}
|
|
1555
|
+
o.isUint32Array = be;
|
|
1556
|
+
function W(i) {
|
|
1557
|
+
return a(i) === "Int8Array";
|
|
1558
|
+
}
|
|
1559
|
+
o.isInt8Array = W;
|
|
1560
|
+
function Ee(i) {
|
|
1561
|
+
return a(i) === "Int16Array";
|
|
1562
|
+
}
|
|
1563
|
+
o.isInt16Array = Ee;
|
|
1564
|
+
function J(i) {
|
|
1565
|
+
return a(i) === "Int32Array";
|
|
1566
|
+
}
|
|
1567
|
+
o.isInt32Array = J;
|
|
1568
|
+
function ie(i) {
|
|
1569
|
+
return a(i) === "Float32Array";
|
|
1570
|
+
}
|
|
1571
|
+
o.isFloat32Array = ie;
|
|
1572
|
+
function X(i) {
|
|
1573
|
+
return a(i) === "Float64Array";
|
|
1574
|
+
}
|
|
1575
|
+
o.isFloat64Array = X;
|
|
1576
|
+
function fe(i) {
|
|
1577
|
+
return a(i) === "BigInt64Array";
|
|
1578
|
+
}
|
|
1579
|
+
o.isBigInt64Array = fe;
|
|
1580
|
+
function oe(i) {
|
|
1581
|
+
return a(i) === "BigUint64Array";
|
|
1582
|
+
}
|
|
1583
|
+
o.isBigUint64Array = oe;
|
|
1584
|
+
function K(i) {
|
|
1585
|
+
return m(i) === "[object Map]";
|
|
1586
|
+
}
|
|
1587
|
+
K.working = typeof Map < "u" && K(/* @__PURE__ */ new Map());
|
|
1588
|
+
function Re(i) {
|
|
1589
|
+
return typeof Map > "u" ? !1 : K.working ? K(i) : i instanceof Map;
|
|
1590
|
+
}
|
|
1591
|
+
o.isMap = Re;
|
|
1592
|
+
function Q(i) {
|
|
1593
|
+
return m(i) === "[object Set]";
|
|
1594
|
+
}
|
|
1595
|
+
Q.working = typeof Set < "u" && Q(/* @__PURE__ */ new Set());
|
|
1596
|
+
function ce(i) {
|
|
1597
|
+
return typeof Set > "u" ? !1 : Q.working ? Q(i) : i instanceof Set;
|
|
1598
|
+
}
|
|
1599
|
+
o.isSet = ce;
|
|
1600
|
+
function le(i) {
|
|
1601
|
+
return m(i) === "[object WeakMap]";
|
|
1602
|
+
}
|
|
1603
|
+
le.working = typeof WeakMap < "u" && le(/* @__PURE__ */ new WeakMap());
|
|
1604
|
+
function Be(i) {
|
|
1605
|
+
return typeof WeakMap > "u" ? !1 : le.working ? le(i) : i instanceof WeakMap;
|
|
1606
|
+
}
|
|
1607
|
+
o.isWeakMap = Be;
|
|
1608
|
+
function pe(i) {
|
|
1609
|
+
return m(i) === "[object WeakSet]";
|
|
1610
|
+
}
|
|
1611
|
+
pe.working = typeof WeakSet < "u" && pe(/* @__PURE__ */ new WeakSet());
|
|
1612
|
+
function V(i) {
|
|
1613
|
+
return pe(i);
|
|
1614
|
+
}
|
|
1615
|
+
o.isWeakSet = V;
|
|
1616
|
+
function he(i) {
|
|
1617
|
+
return m(i) === "[object ArrayBuffer]";
|
|
1618
|
+
}
|
|
1619
|
+
he.working = typeof ArrayBuffer < "u" && he(new ArrayBuffer());
|
|
1620
|
+
function U(i) {
|
|
1621
|
+
return typeof ArrayBuffer > "u" ? !1 : he.working ? he(i) : i instanceof ArrayBuffer;
|
|
1622
|
+
}
|
|
1623
|
+
o.isArrayBuffer = U;
|
|
1624
|
+
function h(i) {
|
|
1625
|
+
return m(i) === "[object DataView]";
|
|
1626
|
+
}
|
|
1627
|
+
h.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && h(new DataView(new ArrayBuffer(1), 0, 1));
|
|
1628
|
+
function y(i) {
|
|
1629
|
+
return typeof DataView > "u" ? !1 : h.working ? h(i) : i instanceof DataView;
|
|
1630
|
+
}
|
|
1631
|
+
o.isDataView = y;
|
|
1632
|
+
var g = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
|
|
1633
|
+
function b(i) {
|
|
1634
|
+
return m(i) === "[object SharedArrayBuffer]";
|
|
1635
|
+
}
|
|
1636
|
+
function F(i) {
|
|
1637
|
+
return typeof g > "u" ? !1 : (typeof b.working > "u" && (b.working = b(new g())), b.working ? b(i) : i instanceof g);
|
|
1638
|
+
}
|
|
1639
|
+
o.isSharedArrayBuffer = F;
|
|
1640
|
+
function I(i) {
|
|
1641
|
+
return m(i) === "[object AsyncFunction]";
|
|
1642
|
+
}
|
|
1643
|
+
o.isAsyncFunction = I;
|
|
1644
|
+
function A(i) {
|
|
1645
|
+
return m(i) === "[object Map Iterator]";
|
|
1646
|
+
}
|
|
1647
|
+
o.isMapIterator = A;
|
|
1648
|
+
function T(i) {
|
|
1649
|
+
return m(i) === "[object Set Iterator]";
|
|
1650
|
+
}
|
|
1651
|
+
o.isSetIterator = T;
|
|
1652
|
+
function k(i) {
|
|
1653
|
+
return m(i) === "[object Generator]";
|
|
1654
|
+
}
|
|
1655
|
+
o.isGeneratorObject = k;
|
|
1656
|
+
function M(i) {
|
|
1657
|
+
return m(i) === "[object WebAssembly.Module]";
|
|
1658
|
+
}
|
|
1659
|
+
o.isWebAssemblyCompiledModule = M;
|
|
1660
|
+
function z(i) {
|
|
1661
|
+
return D(i, E);
|
|
1662
|
+
}
|
|
1663
|
+
o.isNumberObject = z;
|
|
1664
|
+
function $(i) {
|
|
1665
|
+
return D(i, w);
|
|
1666
|
+
}
|
|
1667
|
+
o.isStringObject = $;
|
|
1668
|
+
function Y(i) {
|
|
1669
|
+
return D(i, O);
|
|
1670
|
+
}
|
|
1671
|
+
o.isBooleanObject = Y;
|
|
1672
|
+
function Ae(i) {
|
|
1673
|
+
return l && D(i, P);
|
|
1674
|
+
}
|
|
1675
|
+
o.isBigIntObject = Ae;
|
|
1676
|
+
function s(i) {
|
|
1677
|
+
return f && D(i, j);
|
|
1678
|
+
}
|
|
1679
|
+
o.isSymbolObject = s;
|
|
1680
|
+
function t(i) {
|
|
1681
|
+
return z(i) || $(i) || Y(i) || Ae(i) || s(i);
|
|
1682
|
+
}
|
|
1683
|
+
o.isBoxedPrimitive = t;
|
|
1684
|
+
function r(i) {
|
|
1685
|
+
return typeof Uint8Array < "u" && (U(i) || F(i));
|
|
1686
|
+
}
|
|
1687
|
+
o.isAnyArrayBuffer = r, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(i) {
|
|
1688
|
+
Object.defineProperty(o, i, {
|
|
1689
|
+
enumerable: !1,
|
|
1690
|
+
value: function() {
|
|
1691
|
+
throw new Error(i + " is not supported in userland");
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
});
|
|
1695
|
+
})(Wt);
|
|
1696
|
+
var Jn = function(e) {
|
|
1697
|
+
return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
|
|
1698
|
+
}, dt = { exports: {} };
|
|
1699
|
+
typeof Object.create == "function" ? dt.exports = function(e, n) {
|
|
1700
|
+
n && (e.super_ = n, e.prototype = Object.create(n.prototype, {
|
|
1701
|
+
constructor: {
|
|
1702
|
+
value: e,
|
|
1703
|
+
enumerable: !1,
|
|
1704
|
+
writable: !0,
|
|
1705
|
+
configurable: !0
|
|
1706
|
+
}
|
|
1707
|
+
}));
|
|
1708
|
+
} : dt.exports = function(e, n) {
|
|
1709
|
+
if (n) {
|
|
1710
|
+
e.super_ = n;
|
|
1711
|
+
var a = function() {
|
|
1712
|
+
};
|
|
1713
|
+
a.prototype = n.prototype, e.prototype = new a(), e.prototype.constructor = e;
|
|
1714
|
+
}
|
|
1715
|
+
};
|
|
1716
|
+
var zn = dt.exports;
|
|
1717
|
+
(function(o) {
|
|
1718
|
+
var e = Object.getOwnPropertyDescriptors || function(y) {
|
|
1719
|
+
for (var g = Object.keys(y), b = {}, F = 0; F < g.length; F++)
|
|
1720
|
+
b[g[F]] = Object.getOwnPropertyDescriptor(y, g[F]);
|
|
1721
|
+
return b;
|
|
1722
|
+
}, n = /%[sdj%]/g;
|
|
1723
|
+
o.format = function(h) {
|
|
1724
|
+
if (!W(h)) {
|
|
1725
|
+
for (var y = [], g = 0; g < arguments.length; g++)
|
|
1726
|
+
y.push(l(arguments[g]));
|
|
1727
|
+
return y.join(" ");
|
|
1728
|
+
}
|
|
1729
|
+
for (var g = 1, b = arguments, F = b.length, I = String(h).replace(n, function(T) {
|
|
1730
|
+
if (T === "%%")
|
|
1731
|
+
return "%";
|
|
1732
|
+
if (g >= F)
|
|
1733
|
+
return T;
|
|
1734
|
+
switch (T) {
|
|
1735
|
+
case "%s":
|
|
1736
|
+
return String(b[g++]);
|
|
1737
|
+
case "%d":
|
|
1738
|
+
return Number(b[g++]);
|
|
1739
|
+
case "%j":
|
|
1740
|
+
try {
|
|
1741
|
+
return JSON.stringify(b[g++]);
|
|
1742
|
+
} catch {
|
|
1743
|
+
return "[Circular]";
|
|
1744
|
+
}
|
|
1745
|
+
default:
|
|
1746
|
+
return T;
|
|
1747
|
+
}
|
|
1748
|
+
}), A = b[g]; g < F; A = b[++g])
|
|
1749
|
+
ue(A) || !X(A) ? I += " " + A : I += " " + l(A);
|
|
1750
|
+
return I;
|
|
1751
|
+
}, o.deprecate = function(h, y) {
|
|
1752
|
+
if (typeof Z < "u" && Z.noDeprecation === !0)
|
|
1753
|
+
return h;
|
|
1754
|
+
if (typeof Z > "u")
|
|
1755
|
+
return function() {
|
|
1756
|
+
return o.deprecate(h, y).apply(this, arguments);
|
|
1757
|
+
};
|
|
1758
|
+
var g = !1;
|
|
1759
|
+
function b() {
|
|
1760
|
+
if (!g) {
|
|
1761
|
+
if (Z.throwDeprecation)
|
|
1762
|
+
throw new Error(y);
|
|
1763
|
+
Z.traceDeprecation ? console.trace(y) : console.error(y), g = !0;
|
|
1764
|
+
}
|
|
1765
|
+
return h.apply(this, arguments);
|
|
1766
|
+
}
|
|
1767
|
+
return b;
|
|
1768
|
+
};
|
|
1769
|
+
var a = {}, u = /^$/;
|
|
1770
|
+
if (Z.env.NODE_DEBUG) {
|
|
1771
|
+
var c = Z.env.NODE_DEBUG;
|
|
1772
|
+
c = c.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), u = new RegExp("^" + c + "$", "i");
|
|
1773
|
+
}
|
|
1774
|
+
o.debuglog = function(h) {
|
|
1775
|
+
if (h = h.toUpperCase(), !a[h])
|
|
1776
|
+
if (u.test(h)) {
|
|
1777
|
+
var y = Z.pid;
|
|
1778
|
+
a[h] = function() {
|
|
1779
|
+
var g = o.format.apply(o, arguments);
|
|
1780
|
+
console.error("%s %d: %s", h, y, g);
|
|
1781
|
+
};
|
|
1782
|
+
} else
|
|
1783
|
+
a[h] = function() {
|
|
1784
|
+
};
|
|
1785
|
+
return a[h];
|
|
1786
|
+
};
|
|
1787
|
+
function l(h, y) {
|
|
1788
|
+
var g = {
|
|
1789
|
+
seen: [],
|
|
1790
|
+
stylize: m
|
|
1791
|
+
};
|
|
1792
|
+
return arguments.length >= 3 && (g.depth = arguments[2]), arguments.length >= 4 && (g.colors = arguments[3]), ne(y) ? g.showHidden = y : y && o._extend(g, y), J(g.showHidden) && (g.showHidden = !1), J(g.depth) && (g.depth = 2), J(g.colors) && (g.colors = !1), J(g.customInspect) && (g.customInspect = !0), g.colors && (g.stylize = f), w(g, h, g.depth);
|
|
1793
|
+
}
|
|
1794
|
+
o.inspect = l, l.colors = {
|
|
1795
|
+
bold: [1, 22],
|
|
1796
|
+
italic: [3, 23],
|
|
1797
|
+
underline: [4, 24],
|
|
1798
|
+
inverse: [7, 27],
|
|
1799
|
+
white: [37, 39],
|
|
1800
|
+
grey: [90, 39],
|
|
1801
|
+
black: [30, 39],
|
|
1802
|
+
blue: [34, 39],
|
|
1803
|
+
cyan: [36, 39],
|
|
1804
|
+
green: [32, 39],
|
|
1805
|
+
magenta: [35, 39],
|
|
1806
|
+
red: [31, 39],
|
|
1807
|
+
yellow: [33, 39]
|
|
1808
|
+
}, l.styles = {
|
|
1809
|
+
special: "cyan",
|
|
1810
|
+
number: "yellow",
|
|
1811
|
+
boolean: "yellow",
|
|
1812
|
+
undefined: "grey",
|
|
1813
|
+
null: "bold",
|
|
1814
|
+
string: "green",
|
|
1815
|
+
date: "magenta",
|
|
1816
|
+
// "name": intentionally not styling
|
|
1817
|
+
regexp: "red"
|
|
1818
|
+
};
|
|
1819
|
+
function f(h, y) {
|
|
1820
|
+
var g = l.styles[y];
|
|
1821
|
+
return g ? "\x1B[" + l.colors[g][0] + "m" + h + "\x1B[" + l.colors[g][1] + "m" : h;
|
|
1822
|
+
}
|
|
1823
|
+
function m(h, y) {
|
|
1824
|
+
return h;
|
|
1825
|
+
}
|
|
1826
|
+
function E(h) {
|
|
1827
|
+
var y = {};
|
|
1828
|
+
return h.forEach(function(g, b) {
|
|
1829
|
+
y[g] = !0;
|
|
1830
|
+
}), y;
|
|
1831
|
+
}
|
|
1832
|
+
function w(h, y, g) {
|
|
1833
|
+
if (h.customInspect && y && K(y.inspect) && // Filter out the util module, it's inspect function is special
|
|
1834
|
+
y.inspect !== o.inspect && // Also filter out any prototype objects using the circular check.
|
|
1835
|
+
!(y.constructor && y.constructor.prototype === y)) {
|
|
1836
|
+
var b = y.inspect(g, h);
|
|
1837
|
+
return W(b) || (b = w(h, b, g)), b;
|
|
1838
|
+
}
|
|
1839
|
+
var F = O(h, y);
|
|
1840
|
+
if (F)
|
|
1841
|
+
return F;
|
|
1842
|
+
var I = Object.keys(y), A = E(I);
|
|
1843
|
+
if (h.showHidden && (I = Object.getOwnPropertyNames(y)), oe(y) && (I.indexOf("message") >= 0 || I.indexOf("description") >= 0))
|
|
1844
|
+
return P(y);
|
|
1845
|
+
if (I.length === 0) {
|
|
1846
|
+
if (K(y)) {
|
|
1847
|
+
var T = y.name ? ": " + y.name : "";
|
|
1848
|
+
return h.stylize("[Function" + T + "]", "special");
|
|
1849
|
+
}
|
|
1850
|
+
if (ie(y))
|
|
1851
|
+
return h.stylize(RegExp.prototype.toString.call(y), "regexp");
|
|
1852
|
+
if (fe(y))
|
|
1853
|
+
return h.stylize(Date.prototype.toString.call(y), "date");
|
|
1854
|
+
if (oe(y))
|
|
1855
|
+
return P(y);
|
|
1856
|
+
}
|
|
1857
|
+
var k = "", M = !1, z = ["{", "}"];
|
|
1858
|
+
if (me(y) && (M = !0, z = ["[", "]"]), K(y)) {
|
|
1859
|
+
var $ = y.name ? ": " + y.name : "";
|
|
1860
|
+
k = " [Function" + $ + "]";
|
|
1861
|
+
}
|
|
1862
|
+
if (ie(y) && (k = " " + RegExp.prototype.toString.call(y)), fe(y) && (k = " " + Date.prototype.toUTCString.call(y)), oe(y) && (k = " " + P(y)), I.length === 0 && (!M || y.length == 0))
|
|
1863
|
+
return z[0] + k + z[1];
|
|
1864
|
+
if (g < 0)
|
|
1865
|
+
return ie(y) ? h.stylize(RegExp.prototype.toString.call(y), "regexp") : h.stylize("[Object]", "special");
|
|
1866
|
+
h.seen.push(y);
|
|
1867
|
+
var Y;
|
|
1868
|
+
return M ? Y = j(h, y, g, A, I) : Y = I.map(function(Ae) {
|
|
1869
|
+
return D(h, y, g, A, Ae, M);
|
|
1870
|
+
}), h.seen.pop(), G(Y, k, z);
|
|
1871
|
+
}
|
|
1872
|
+
function O(h, y) {
|
|
1873
|
+
if (J(y))
|
|
1874
|
+
return h.stylize("undefined", "undefined");
|
|
1875
|
+
if (W(y)) {
|
|
1876
|
+
var g = "'" + JSON.stringify(y).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
1877
|
+
return h.stylize(g, "string");
|
|
1878
|
+
}
|
|
1879
|
+
if (be(y))
|
|
1880
|
+
return h.stylize("" + y, "number");
|
|
1881
|
+
if (ne(y))
|
|
1882
|
+
return h.stylize("" + y, "boolean");
|
|
1883
|
+
if (ue(y))
|
|
1884
|
+
return h.stylize("null", "null");
|
|
1885
|
+
}
|
|
1886
|
+
function P(h) {
|
|
1887
|
+
return "[" + Error.prototype.toString.call(h) + "]";
|
|
1888
|
+
}
|
|
1889
|
+
function j(h, y, g, b, F) {
|
|
1890
|
+
for (var I = [], A = 0, T = y.length; A < T; ++A)
|
|
1891
|
+
pe(y, String(A)) ? I.push(D(
|
|
1892
|
+
h,
|
|
1893
|
+
y,
|
|
1894
|
+
g,
|
|
1895
|
+
b,
|
|
1896
|
+
String(A),
|
|
1897
|
+
!0
|
|
1898
|
+
)) : I.push("");
|
|
1899
|
+
return F.forEach(function(k) {
|
|
1900
|
+
k.match(/^\d+$/) || I.push(D(
|
|
1901
|
+
h,
|
|
1902
|
+
y,
|
|
1903
|
+
g,
|
|
1904
|
+
b,
|
|
1905
|
+
k,
|
|
1906
|
+
!0
|
|
1907
|
+
));
|
|
1908
|
+
}), I;
|
|
1909
|
+
}
|
|
1910
|
+
function D(h, y, g, b, F, I) {
|
|
1911
|
+
var A, T, k;
|
|
1912
|
+
if (k = Object.getOwnPropertyDescriptor(y, F) || { value: y[F] }, k.get ? k.set ? T = h.stylize("[Getter/Setter]", "special") : T = h.stylize("[Getter]", "special") : k.set && (T = h.stylize("[Setter]", "special")), pe(b, F) || (A = "[" + F + "]"), T || (h.seen.indexOf(k.value) < 0 ? (ue(g) ? T = w(h, k.value, null) : T = w(h, k.value, g - 1), T.indexOf(`
|
|
1913
|
+
`) > -1 && (I ? T = T.split(`
|
|
1914
|
+
`).map(function(M) {
|
|
1915
|
+
return " " + M;
|
|
1916
|
+
}).join(`
|
|
1917
|
+
`).slice(2) : T = `
|
|
1918
|
+
` + T.split(`
|
|
1919
|
+
`).map(function(M) {
|
|
1920
|
+
return " " + M;
|
|
1921
|
+
}).join(`
|
|
1922
|
+
`))) : T = h.stylize("[Circular]", "special")), J(A)) {
|
|
1923
|
+
if (I && F.match(/^\d+$/))
|
|
1924
|
+
return T;
|
|
1925
|
+
A = JSON.stringify("" + F), A.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (A = A.slice(1, -1), A = h.stylize(A, "name")) : (A = A.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), A = h.stylize(A, "string"));
|
|
1926
|
+
}
|
|
1927
|
+
return A + ": " + T;
|
|
1928
|
+
}
|
|
1929
|
+
function G(h, y, g) {
|
|
1930
|
+
var b = h.reduce(function(F, I) {
|
|
1931
|
+
return I.indexOf(`
|
|
1932
|
+
`) >= 0, F + I.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
1933
|
+
}, 0);
|
|
1934
|
+
return b > 60 ? g[0] + (y === "" ? "" : y + `
|
|
1935
|
+
`) + " " + h.join(`,
|
|
1936
|
+
`) + " " + g[1] : g[0] + y + " " + h.join(", ") + " " + g[1];
|
|
1937
|
+
}
|
|
1938
|
+
o.types = Wt;
|
|
1939
|
+
function me(h) {
|
|
1940
|
+
return Array.isArray(h);
|
|
1941
|
+
}
|
|
1942
|
+
o.isArray = me;
|
|
1943
|
+
function ne(h) {
|
|
1944
|
+
return typeof h == "boolean";
|
|
1945
|
+
}
|
|
1946
|
+
o.isBoolean = ne;
|
|
1947
|
+
function ue(h) {
|
|
1948
|
+
return h === null;
|
|
1949
|
+
}
|
|
1950
|
+
o.isNull = ue;
|
|
1951
|
+
function we(h) {
|
|
1952
|
+
return h == null;
|
|
1953
|
+
}
|
|
1954
|
+
o.isNullOrUndefined = we;
|
|
1955
|
+
function be(h) {
|
|
1956
|
+
return typeof h == "number";
|
|
1957
|
+
}
|
|
1958
|
+
o.isNumber = be;
|
|
1959
|
+
function W(h) {
|
|
1960
|
+
return typeof h == "string";
|
|
1961
|
+
}
|
|
1962
|
+
o.isString = W;
|
|
1963
|
+
function Ee(h) {
|
|
1964
|
+
return typeof h == "symbol";
|
|
1965
|
+
}
|
|
1966
|
+
o.isSymbol = Ee;
|
|
1967
|
+
function J(h) {
|
|
1968
|
+
return h === void 0;
|
|
1969
|
+
}
|
|
1970
|
+
o.isUndefined = J;
|
|
1971
|
+
function ie(h) {
|
|
1972
|
+
return X(h) && Q(h) === "[object RegExp]";
|
|
1973
|
+
}
|
|
1974
|
+
o.isRegExp = ie, o.types.isRegExp = ie;
|
|
1975
|
+
function X(h) {
|
|
1976
|
+
return typeof h == "object" && h !== null;
|
|
1977
|
+
}
|
|
1978
|
+
o.isObject = X;
|
|
1979
|
+
function fe(h) {
|
|
1980
|
+
return X(h) && Q(h) === "[object Date]";
|
|
1981
|
+
}
|
|
1982
|
+
o.isDate = fe, o.types.isDate = fe;
|
|
1983
|
+
function oe(h) {
|
|
1984
|
+
return X(h) && (Q(h) === "[object Error]" || h instanceof Error);
|
|
1985
|
+
}
|
|
1986
|
+
o.isError = oe, o.types.isNativeError = oe;
|
|
1987
|
+
function K(h) {
|
|
1988
|
+
return typeof h == "function";
|
|
1989
|
+
}
|
|
1990
|
+
o.isFunction = K;
|
|
1991
|
+
function Re(h) {
|
|
1992
|
+
return h === null || typeof h == "boolean" || typeof h == "number" || typeof h == "string" || typeof h == "symbol" || // ES6 symbol
|
|
1993
|
+
typeof h > "u";
|
|
1994
|
+
}
|
|
1995
|
+
o.isPrimitive = Re, o.isBuffer = Jn;
|
|
1996
|
+
function Q(h) {
|
|
1997
|
+
return Object.prototype.toString.call(h);
|
|
1998
|
+
}
|
|
1999
|
+
function ce(h) {
|
|
2000
|
+
return h < 10 ? "0" + h.toString(10) : h.toString(10);
|
|
2001
|
+
}
|
|
2002
|
+
var le = [
|
|
2003
|
+
"Jan",
|
|
2004
|
+
"Feb",
|
|
2005
|
+
"Mar",
|
|
2006
|
+
"Apr",
|
|
2007
|
+
"May",
|
|
2008
|
+
"Jun",
|
|
2009
|
+
"Jul",
|
|
2010
|
+
"Aug",
|
|
2011
|
+
"Sep",
|
|
2012
|
+
"Oct",
|
|
2013
|
+
"Nov",
|
|
2014
|
+
"Dec"
|
|
2015
|
+
];
|
|
2016
|
+
function Be() {
|
|
2017
|
+
var h = /* @__PURE__ */ new Date(), y = [
|
|
2018
|
+
ce(h.getHours()),
|
|
2019
|
+
ce(h.getMinutes()),
|
|
2020
|
+
ce(h.getSeconds())
|
|
2021
|
+
].join(":");
|
|
2022
|
+
return [h.getDate(), le[h.getMonth()], y].join(" ");
|
|
2023
|
+
}
|
|
2024
|
+
o.log = function() {
|
|
2025
|
+
console.log("%s - %s", Be(), o.format.apply(o, arguments));
|
|
2026
|
+
}, o.inherits = zn, o._extend = function(h, y) {
|
|
2027
|
+
if (!y || !X(y))
|
|
2028
|
+
return h;
|
|
2029
|
+
for (var g = Object.keys(y), b = g.length; b--; )
|
|
2030
|
+
h[g[b]] = y[g[b]];
|
|
2031
|
+
return h;
|
|
2032
|
+
};
|
|
2033
|
+
function pe(h, y) {
|
|
2034
|
+
return Object.prototype.hasOwnProperty.call(h, y);
|
|
2035
|
+
}
|
|
2036
|
+
var V = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
|
|
2037
|
+
o.promisify = function(y) {
|
|
2038
|
+
if (typeof y != "function")
|
|
2039
|
+
throw new TypeError('The "original" argument must be of type Function');
|
|
2040
|
+
if (V && y[V]) {
|
|
2041
|
+
var g = y[V];
|
|
2042
|
+
if (typeof g != "function")
|
|
2043
|
+
throw new TypeError('The "util.promisify.custom" argument must be of type Function');
|
|
2044
|
+
return Object.defineProperty(g, V, {
|
|
2045
|
+
value: g,
|
|
2046
|
+
enumerable: !1,
|
|
2047
|
+
writable: !1,
|
|
2048
|
+
configurable: !0
|
|
2049
|
+
}), g;
|
|
2050
|
+
}
|
|
2051
|
+
function g() {
|
|
2052
|
+
for (var b, F, I = new Promise(function(k, M) {
|
|
2053
|
+
b = k, F = M;
|
|
2054
|
+
}), A = [], T = 0; T < arguments.length; T++)
|
|
2055
|
+
A.push(arguments[T]);
|
|
2056
|
+
A.push(function(k, M) {
|
|
2057
|
+
k ? F(k) : b(M);
|
|
2058
|
+
});
|
|
2059
|
+
try {
|
|
2060
|
+
y.apply(this, A);
|
|
2061
|
+
} catch (k) {
|
|
2062
|
+
F(k);
|
|
2063
|
+
}
|
|
2064
|
+
return I;
|
|
2065
|
+
}
|
|
2066
|
+
return Object.setPrototypeOf(g, Object.getPrototypeOf(y)), V && Object.defineProperty(g, V, {
|
|
2067
|
+
value: g,
|
|
2068
|
+
enumerable: !1,
|
|
2069
|
+
writable: !1,
|
|
2070
|
+
configurable: !0
|
|
2071
|
+
}), Object.defineProperties(
|
|
2072
|
+
g,
|
|
2073
|
+
e(y)
|
|
2074
|
+
);
|
|
2075
|
+
}, o.promisify.custom = V;
|
|
2076
|
+
function he(h, y) {
|
|
2077
|
+
if (!h) {
|
|
2078
|
+
var g = new Error("Promise was rejected with a falsy value");
|
|
2079
|
+
g.reason = h, h = g;
|
|
2080
|
+
}
|
|
2081
|
+
return y(h);
|
|
2082
|
+
}
|
|
2083
|
+
function U(h) {
|
|
2084
|
+
if (typeof h != "function")
|
|
2085
|
+
throw new TypeError('The "original" argument must be of type Function');
|
|
2086
|
+
function y() {
|
|
2087
|
+
for (var g = [], b = 0; b < arguments.length; b++)
|
|
2088
|
+
g.push(arguments[b]);
|
|
2089
|
+
var F = g.pop();
|
|
2090
|
+
if (typeof F != "function")
|
|
2091
|
+
throw new TypeError("The last argument must be of type Function");
|
|
2092
|
+
var I = this, A = function() {
|
|
2093
|
+
return F.apply(I, arguments);
|
|
2094
|
+
};
|
|
2095
|
+
h.apply(this, g).then(
|
|
2096
|
+
function(T) {
|
|
2097
|
+
Z.nextTick(A.bind(null, null, T));
|
|
2098
|
+
},
|
|
2099
|
+
function(T) {
|
|
2100
|
+
Z.nextTick(he.bind(null, T, A));
|
|
2101
|
+
}
|
|
2102
|
+
);
|
|
2103
|
+
}
|
|
2104
|
+
return Object.setPrototypeOf(y, Object.getPrototypeOf(h)), Object.defineProperties(
|
|
2105
|
+
y,
|
|
2106
|
+
e(h)
|
|
2107
|
+
), y;
|
|
2108
|
+
}
|
|
2109
|
+
o.callbackify = U;
|
|
2110
|
+
})(mt);
|
|
2111
|
+
var at, jt;
|
|
2112
|
+
function Hn() {
|
|
2113
|
+
if (jt)
|
|
2114
|
+
return at;
|
|
2115
|
+
jt = 1;
|
|
2116
|
+
var o = function() {
|
|
2117
|
+
if (typeof self == "object" && self)
|
|
2118
|
+
return self;
|
|
2119
|
+
if (typeof window == "object" && window)
|
|
2120
|
+
return window;
|
|
2121
|
+
throw new Error("Unable to resolve global `this`");
|
|
2122
|
+
};
|
|
2123
|
+
return at = function() {
|
|
2124
|
+
if (this)
|
|
2125
|
+
return this;
|
|
2126
|
+
if (typeof globalThis == "object" && globalThis)
|
|
2127
|
+
return globalThis;
|
|
2128
|
+
try {
|
|
2129
|
+
Object.defineProperty(Object.prototype, "__global__", {
|
|
2130
|
+
get: function() {
|
|
2131
|
+
return this;
|
|
2132
|
+
},
|
|
2133
|
+
configurable: !0
|
|
2134
|
+
});
|
|
2135
|
+
} catch {
|
|
2136
|
+
return o();
|
|
2137
|
+
}
|
|
2138
|
+
try {
|
|
2139
|
+
return __global__ || o();
|
|
2140
|
+
} finally {
|
|
2141
|
+
delete Object.prototype.__global__;
|
|
2142
|
+
}
|
|
2143
|
+
}(), at;
|
|
2144
|
+
}
|
|
2145
|
+
const Kn = "websocket@^1.0.30", Qn = "websocket@1.0.34", Vn = !1, Xn = "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", Yn = "/websocket", Zn = {}, ei = {
|
|
2146
|
+
type: "range",
|
|
2147
|
+
registry: !0,
|
|
2148
|
+
raw: "websocket@^1.0.30",
|
|
2149
|
+
name: "websocket",
|
|
2150
|
+
escapedName: "websocket",
|
|
2151
|
+
rawSpec: "^1.0.30",
|
|
2152
|
+
saveSpec: null,
|
|
2153
|
+
fetchSpec: "^1.0.30"
|
|
2154
|
+
}, ti = [
|
|
2155
|
+
"/"
|
|
2156
|
+
], ri = "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", ni = "2bdc2602c08bf2c82253b730655c0ef7dcab3111", ii = "websocket@^1.0.30", oi = "/Users/peter/dev/cachearoo-js", si = {
|
|
2157
|
+
name: "Brian McKelvey",
|
|
2158
|
+
email: "theturtle32@gmail.com",
|
|
2159
|
+
url: "https://github.com/theturtle32"
|
|
2160
|
+
}, ai = "lib/browser.js", ui = {
|
|
2161
|
+
url: "https://github.com/theturtle32/WebSocket-Node/issues"
|
|
2162
|
+
}, fi = !1, ci = {
|
|
2163
|
+
verbose: !1
|
|
2164
|
+
}, li = [
|
|
2165
|
+
{
|
|
2166
|
+
name: "Iñaki Baz Castillo",
|
|
2167
|
+
email: "ibc@aliax.net",
|
|
2168
|
+
url: "http://dev.sipdoc.net"
|
|
2169
|
+
}
|
|
2170
|
+
], pi = {
|
|
2171
|
+
bufferutil: "^4.0.1",
|
|
2172
|
+
debug: "^2.2.0",
|
|
2173
|
+
"es5-ext": "^0.10.50",
|
|
2174
|
+
"typedarray-to-buffer": "^3.1.5",
|
|
2175
|
+
"utf-8-validate": "^5.0.2",
|
|
2176
|
+
yaeti: "^0.0.6"
|
|
2177
|
+
}, hi = !1, yi = "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.", di = {
|
|
2178
|
+
"buffer-equal": "^1.0.0",
|
|
2179
|
+
gulp: "^4.0.2",
|
|
2180
|
+
"gulp-jshint": "^2.0.4",
|
|
2181
|
+
jshint: "^2.0.0",
|
|
2182
|
+
"jshint-stylish": "^2.2.1",
|
|
2183
|
+
tape: "^4.9.1"
|
|
2184
|
+
}, gi = {
|
|
2185
|
+
lib: "./lib"
|
|
2186
|
+
}, vi = {
|
|
2187
|
+
node: ">=4.0.0"
|
|
2188
|
+
}, mi = "https://github.com/theturtle32/WebSocket-Node", wi = [
|
|
2189
|
+
"websocket",
|
|
2190
|
+
"websockets",
|
|
2191
|
+
"socket",
|
|
2192
|
+
"networking",
|
|
2193
|
+
"comet",
|
|
2194
|
+
"push",
|
|
2195
|
+
"RFC-6455",
|
|
2196
|
+
"realtime",
|
|
2197
|
+
"server",
|
|
2198
|
+
"client"
|
|
2199
|
+
], bi = "Apache-2.0", Ei = "index", Ai = "websocket", Si = {
|
|
2200
|
+
type: "git",
|
|
2201
|
+
url: "git+https://github.com/theturtle32/WebSocket-Node.git"
|
|
2202
|
+
}, Ti = {
|
|
2203
|
+
gulp: "gulp",
|
|
2204
|
+
test: "tape test/unit/*.js"
|
|
2205
|
+
}, Oi = "1.0.34", Fi = {
|
|
2206
|
+
_from: Kn,
|
|
2207
|
+
_id: Qn,
|
|
2208
|
+
_inBundle: Vn,
|
|
2209
|
+
_integrity: Xn,
|
|
2210
|
+
_location: Yn,
|
|
2211
|
+
_phantomChildren: Zn,
|
|
2212
|
+
_requested: ei,
|
|
2213
|
+
_requiredBy: ti,
|
|
2214
|
+
_resolved: ri,
|
|
2215
|
+
_shasum: ni,
|
|
2216
|
+
_spec: ii,
|
|
2217
|
+
_where: oi,
|
|
2218
|
+
author: si,
|
|
2219
|
+
browser: ai,
|
|
2220
|
+
bugs: ui,
|
|
2221
|
+
bundleDependencies: fi,
|
|
2222
|
+
config: ci,
|
|
2223
|
+
contributors: li,
|
|
2224
|
+
dependencies: pi,
|
|
2225
|
+
deprecated: hi,
|
|
2226
|
+
description: yi,
|
|
2227
|
+
devDependencies: di,
|
|
2228
|
+
directories: gi,
|
|
2229
|
+
engines: vi,
|
|
2230
|
+
homepage: mi,
|
|
2231
|
+
keywords: wi,
|
|
2232
|
+
license: bi,
|
|
2233
|
+
main: Ei,
|
|
2234
|
+
name: Ai,
|
|
2235
|
+
repository: Si,
|
|
2236
|
+
scripts: Ti,
|
|
2237
|
+
version: Oi
|
|
2238
|
+
};
|
|
2239
|
+
var xi = Fi.version, ye;
|
|
2240
|
+
if (typeof globalThis == "object")
|
|
2241
|
+
ye = globalThis;
|
|
2242
|
+
else
|
|
2243
|
+
try {
|
|
2244
|
+
ye = Hn();
|
|
2245
|
+
} catch {
|
|
2246
|
+
} finally {
|
|
2247
|
+
if (!ye && typeof window < "u" && (ye = window), !ye)
|
|
2248
|
+
throw new Error("Could not determine global this");
|
|
2249
|
+
}
|
|
2250
|
+
var je = ye.WebSocket || ye.MozWebSocket, Ii = xi;
|
|
2251
|
+
function ir(o, e) {
|
|
2252
|
+
var n;
|
|
2253
|
+
return e ? n = new je(o, e) : n = new je(o), n;
|
|
2254
|
+
}
|
|
2255
|
+
je && ["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function(o) {
|
|
2256
|
+
Object.defineProperty(ir, o, {
|
|
2257
|
+
get: function() {
|
|
2258
|
+
return je[o];
|
|
2259
|
+
}
|
|
2260
|
+
});
|
|
2261
|
+
});
|
|
2262
|
+
var ki = {
|
|
2263
|
+
w3cwebsocket: je ? ir : null,
|
|
2264
|
+
version: Ii
|
|
2265
|
+
};
|
|
2266
|
+
const Pi = 3e3;
|
|
2267
|
+
function Ri(o) {
|
|
2268
|
+
const e = new Uint8Array(128);
|
|
2269
|
+
let n = 0;
|
|
2270
|
+
const a = typeof window < "u" ? window.TextEncoder : mt.TextEncoder, u = new a(), c = u.encode(o.bucket), l = u.encode(o.key), f = u.encode(o.apiKey);
|
|
2271
|
+
if (c.byteLength > 36 || l.byteLength > 36 || f.byteLength > 36)
|
|
2272
|
+
throw new Error("Cannot write binary header, bucket/key/apiKey cannot exceed 36 bytes each");
|
|
2273
|
+
return e[0] = o.type, e[1] = c.byteLength, e[2] = l.byteLength, e[3] = f.byteLength, n = 4, e.set(c, n), n += e[1], e.set(l, n), n += e[2], e.set(f, n), e;
|
|
2274
|
+
}
|
|
2275
|
+
function Bi(o) {
|
|
2276
|
+
let e = o[1], n = o[2], a = o[3];
|
|
2277
|
+
const u = typeof window < "u" ? window.TextDecoder : mt.TextDecoder, c = new u("utf-8"), l = {
|
|
2278
|
+
type: o[0],
|
|
2279
|
+
bucket: "",
|
|
2280
|
+
key: "",
|
|
2281
|
+
apiKey: ""
|
|
2282
|
+
};
|
|
2283
|
+
let f = 4;
|
|
2284
|
+
return l.bucket = c.decode(o.slice(f, f + e)), f = f + e, l.key = c.decode(o.slice(f, f + n)), f = f + n, l.apiKey = c.decode(o.slice(f, f + a)), l;
|
|
2285
|
+
}
|
|
2286
|
+
class ji {
|
|
2287
|
+
constructor(e) {
|
|
2288
|
+
this.connected = !1, this.id = void 0, this.enablePing = !1, this.requestID = 0, this.events = [], this.binaryEvents = [], this.sendValues = !1, this.ws = void 0, this.eventsReceived = 0, this.skipReconnect = !1, this.requests = [], this.requestTimer = void 0, this.reconnectTimer = void 0, this.pingTimer = void 0, this.pingInterval = 5e3, this.settings = e, this.enablePing = !!e.enablePing, this.pingInterval = e.pingInterval || this.pingInterval;
|
|
2289
|
+
var n = e.secure ? "wss://" : "ws://";
|
|
2290
|
+
this.apiKey = e.apiKey;
|
|
2291
|
+
const a = e.wsSubDomain ? e.wsSubDomain + "." : "", u = n + a + e.host + ":" + e.port + e.path + "?id=" + e.clientId + "&apiKey=" + (e.apiKey || "");
|
|
2292
|
+
this.wsStart(u), this.checkRequestTimeouts();
|
|
2293
|
+
}
|
|
2294
|
+
async request(e) {
|
|
2295
|
+
e.key || (e.key = "");
|
|
2296
|
+
const n = e.bucket || this.settings.bucket || "", a = e.method || "GET";
|
|
2297
|
+
if (a === "GET" && e.key === "")
|
|
2298
|
+
return this.list(n, e.keysOnly, e.filter);
|
|
2299
|
+
if (a === "GET")
|
|
2300
|
+
return this.read(n, e.key);
|
|
2301
|
+
if (a === "POST" || a === "PUT")
|
|
2302
|
+
return this.write(n, e.key, e.data, e.failIfExists, e.expire);
|
|
2303
|
+
if (a === "DELETE")
|
|
2304
|
+
return this.delete(n, e.key);
|
|
2305
|
+
if (a === "PATCH")
|
|
2306
|
+
return this.patch(n, e.key, e.data, e.removeDataFromReply);
|
|
2307
|
+
if (a === "EVENT")
|
|
2308
|
+
return this.signalEvent(n, e.key, e.data);
|
|
2309
|
+
}
|
|
2310
|
+
async read(e, n) {
|
|
2311
|
+
return new Promise((a, u) => {
|
|
2312
|
+
this.addRequest({ op: "read", bucket: e, key: n }, function(c, l) {
|
|
2313
|
+
c ? u(new Error("Cachearoo ws READ error: " + JSON.stringify(c) + " for bucket: " + e + ", key: " + n)) : a(l);
|
|
2314
|
+
});
|
|
2315
|
+
});
|
|
2316
|
+
}
|
|
2317
|
+
async list(e, n, a) {
|
|
2318
|
+
return new Promise((u, c) => {
|
|
2319
|
+
this.addRequest({ op: "filter", bucket: e, keysOnly: n, filter: a }, function(l, f) {
|
|
2320
|
+
l ? c(new Error("Cachearoo ws FILTER error: " + JSON.stringify(l) + " for bucket: " + e)) : u(f);
|
|
2321
|
+
});
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2324
|
+
async write(e, n, a, u, c) {
|
|
2325
|
+
return new Promise((l, f) => {
|
|
2326
|
+
this.addRequest({ op: "write", bucket: e, key: n, value: a, failIfExists: u, expire: c }, function(m, E) {
|
|
2327
|
+
if (m) {
|
|
2328
|
+
const w = m.alreadyExists ? new sr(`Key ${n} already exists`) : new Error("Cachearoo ws WRITE error: " + JSON.stringify(m) + " for bucket: " + e + ", key: " + n);
|
|
2329
|
+
f(w);
|
|
2330
|
+
} else
|
|
2331
|
+
l(E);
|
|
2332
|
+
});
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
async patch(e, n, a, u) {
|
|
2336
|
+
return new Promise((c, l) => {
|
|
2337
|
+
this.addRequest({ op: "patch", bucket: e, key: n, patch: a, removeDataFromReply: u }, function(f, m) {
|
|
2338
|
+
f ? l(new Error("Cachearoo ws PATCH error: " + JSON.stringify(f) + " for bucket: " + e + ", key: " + n)) : c(m);
|
|
2339
|
+
});
|
|
2340
|
+
});
|
|
2341
|
+
}
|
|
2342
|
+
async delete(e, n) {
|
|
2343
|
+
return new Promise((a, u) => {
|
|
2344
|
+
this.addRequest({ op: "remove", bucket: e, key: n }, function(c) {
|
|
2345
|
+
c ? u(new Error("Cachearoo ws REMOVE error: " + JSON.stringify(c) + " for bucket: " + e + ", key: " + n)) : a();
|
|
2346
|
+
});
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
async signalEvent(e, n, a) {
|
|
2350
|
+
var u = { bucket: e, key: n, value: a };
|
|
2351
|
+
return this.connected && this.ws ? (this.ws.send(JSON.stringify({ msg: "event-broadcast", apiKey: this.apiKey, event: u })), Promise.resolve()) : Promise.reject(new Error("Cannot call SignalEvent when disconnected"));
|
|
2352
|
+
}
|
|
2353
|
+
async signalEventBinary(e, n, a, u) {
|
|
2354
|
+
const c = {
|
|
2355
|
+
type: e,
|
|
2356
|
+
bucket: n,
|
|
2357
|
+
key: a,
|
|
2358
|
+
apiKey: this.apiKey || ""
|
|
2359
|
+
}, l = Ri(c);
|
|
2360
|
+
this.connected && this.ws && this.ws.send(Dt.Buffer.concat([l, u]));
|
|
2361
|
+
}
|
|
2362
|
+
close() {
|
|
2363
|
+
this.events = [], this.skipReconnect = !0, this.connected = !1, this.ws && this.ws.close && this.ws.close(), this.ws = void 0, clearTimeout(this.reconnectTimer), clearInterval(this.pingTimer), clearTimeout(this.requestTimer);
|
|
2364
|
+
}
|
|
2365
|
+
addListenerBinary(e, n, a) {
|
|
2366
|
+
if (a == null || typeof a != "function")
|
|
2367
|
+
throw "Callback is not a function";
|
|
2368
|
+
this.binaryEvents.push({
|
|
2369
|
+
bucket: e,
|
|
2370
|
+
key: n,
|
|
2371
|
+
callback: a
|
|
2372
|
+
}), this.registerEvents();
|
|
2373
|
+
}
|
|
2374
|
+
addListener(e, n, a, u) {
|
|
2375
|
+
if (u == null || typeof u != "function")
|
|
2376
|
+
throw "Callback is not a function";
|
|
2377
|
+
a && (this.sendValues = !0), this.events.push({
|
|
2378
|
+
bucket: e,
|
|
2379
|
+
key: n,
|
|
2380
|
+
callback: u
|
|
2381
|
+
}), this.registerEvents();
|
|
2382
|
+
}
|
|
2383
|
+
removeListener(e) {
|
|
2384
|
+
this.events = this.events.filter((n) => n.callback !== e), this.binaryEvents = this.binaryEvents.filter((n) => n.callback !== e), this.registerEvents();
|
|
2385
|
+
}
|
|
2386
|
+
removeAllListeners() {
|
|
2387
|
+
this.events = [], this.binaryEvents = [];
|
|
2388
|
+
}
|
|
2389
|
+
addRequest(e, n) {
|
|
2390
|
+
this.requestID = this.requestID + 1, this.requests[this.requestID] = { timeStamp: /* @__PURE__ */ new Date(), callback: n }, e.id = this.requestID + "", this.connected && this.ws && this.ws.send(JSON.stringify({ msg: "datastore-operation", apiKey: this.apiKey, request: e }));
|
|
2391
|
+
}
|
|
2392
|
+
handleReponse(e) {
|
|
2393
|
+
this.requests[e.id] && (this.requests[e.id].callback(e.error, e.value || e.location), this.requests[e.id] = null);
|
|
2394
|
+
}
|
|
2395
|
+
checkRequestTimeouts() {
|
|
2396
|
+
this.requestTimer = setTimeout(() => {
|
|
2397
|
+
for (var e in this.requests) {
|
|
2398
|
+
var n = this.requests[e + ""];
|
|
2399
|
+
if (n) {
|
|
2400
|
+
var a = (/* @__PURE__ */ new Date()).getTime();
|
|
2401
|
+
a - this.requests[e].timeStamp > Pi && (n.callback("Timeout occured for request " + n.id), this.requests[e] = null);
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
this.skipReconnect || this.checkRequestTimeouts();
|
|
2405
|
+
}, 1e3);
|
|
2406
|
+
}
|
|
2407
|
+
registerEvents() {
|
|
2408
|
+
var c;
|
|
2409
|
+
if (this.connected) {
|
|
2410
|
+
var e = [], n = [];
|
|
2411
|
+
const l = [...this.events, ...this.binaryEvents];
|
|
2412
|
+
for (var a = 0; a < l.length; a++) {
|
|
2413
|
+
var u = JSON.stringify(l[a]);
|
|
2414
|
+
e[u] || (n.push({
|
|
2415
|
+
bucket: l[a].bucket,
|
|
2416
|
+
key: l[a].key
|
|
2417
|
+
}), e[u] = !0);
|
|
2418
|
+
}
|
|
2419
|
+
(c = this.ws) == null || c.send(JSON.stringify({
|
|
2420
|
+
msg: "register-events",
|
|
2421
|
+
events: n,
|
|
2422
|
+
sendValues: this.sendValues,
|
|
2423
|
+
apiKey: this.apiKey
|
|
2424
|
+
}));
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
processBinaryMessage(e) {
|
|
2428
|
+
if (e.byteLength < 128)
|
|
2429
|
+
return console.error("Binary data without header");
|
|
2430
|
+
const n = Bi(new Uint8Array(e));
|
|
2431
|
+
for (var a = 0; a < this.binaryEvents.length; a++)
|
|
2432
|
+
(this.binaryEvents[a].bucket === "*" || this.binaryEvents[a].bucket == n.bucket) && (this.binaryEvents[a].key === "*" || this.binaryEvents[a].key == n.key) && this.binaryEvents[a].callback({
|
|
2433
|
+
type: n.type,
|
|
2434
|
+
bucket: n.bucket,
|
|
2435
|
+
key: n.key,
|
|
2436
|
+
content: e.slice(128)
|
|
2437
|
+
});
|
|
2438
|
+
}
|
|
2439
|
+
processStringMessage(e) {
|
|
2440
|
+
var n = JSON.parse(e);
|
|
2441
|
+
if (n.id) {
|
|
2442
|
+
this.id = n.id, typeof this.onConnect == "function" && this.onConnect(this);
|
|
2443
|
+
return;
|
|
2444
|
+
}
|
|
2445
|
+
if (n.response) {
|
|
2446
|
+
this.handleReponse(n.response);
|
|
2447
|
+
return;
|
|
2448
|
+
}
|
|
2449
|
+
if (n.pong) {
|
|
2450
|
+
typeof this.onPong == "function" && this.onPong();
|
|
2451
|
+
return;
|
|
2452
|
+
}
|
|
2453
|
+
this.eventsReceived++;
|
|
2454
|
+
var a = typeof n.value < "u" && typeof n.isDeleted > "u" ? n.value : null, u = {
|
|
2455
|
+
bucket: n.bucket,
|
|
2456
|
+
key: n.key,
|
|
2457
|
+
value: a,
|
|
2458
|
+
isDeleted: void 0
|
|
2459
|
+
};
|
|
2460
|
+
n.isDeleted && (u.isDeleted = !0);
|
|
2461
|
+
for (var c = 0; c < this.events.length; c++)
|
|
2462
|
+
(this.events[c].bucket === "*" || this.events[c].bucket == u.bucket) && (this.events[c].key === "*" || this.events[c].key == u.key) && this.events[c].callback(u);
|
|
2463
|
+
}
|
|
2464
|
+
wsStart(e) {
|
|
2465
|
+
this.skipReconnect = !1, this.connected = !1, this.pingTimer && clearInterval(this.pingTimer), this.ws && this.ws.close && this.ws.close(), this.ws = new ki.w3cwebsocket(e, "", void 0, void 0, void 0, { maxReceivedMessageSize: 128 * 1024 * 1024 }), this.ws.binaryType = "arraybuffer", this.enablePing && (this.pingTimer = setInterval(() => {
|
|
2466
|
+
this.ws != null && this.connected && this.ws.send(JSON.stringify({ msg: "ping" }));
|
|
2467
|
+
}, this.pingInterval)), this.ws.onerror = (n) => {
|
|
2468
|
+
typeof this.onError == "function" && this.onError(n);
|
|
2469
|
+
}, this.ws.onmessage = (n) => {
|
|
2470
|
+
typeof n.data == "string" ? this.processStringMessage(n.data) : this.processBinaryMessage(n.data);
|
|
2471
|
+
}, this.ws.onclose = () => {
|
|
2472
|
+
this.connected && (this.connected = !1, typeof this.onDisconnect == "function" && this.onDisconnect(this)), this.skipReconnect || (this.reconnectTimer = setTimeout(() => {
|
|
2473
|
+
this.skipReconnect || this.wsStart(e);
|
|
2474
|
+
}, 3e3));
|
|
2475
|
+
}, this.ws.onopen = () => {
|
|
2476
|
+
this.connected = !0, this.registerEvents();
|
|
2477
|
+
};
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
const _i = _r.fetch, Ui = 4300, Le = 200, Li = 404, _t = 201, Ci = 304, Di = 50;
|
|
2481
|
+
class or extends Error {
|
|
2482
|
+
constructor(e, n) {
|
|
2483
|
+
super(e), Error.captureStackTrace(this, this.constructor), this.progressTimeout = n;
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
class sr extends Error {
|
|
2487
|
+
constructor(e) {
|
|
2488
|
+
super(e), this.name = "AlreadyExistsError", Error.captureStackTrace(this, this.constructor);
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
function ar() {
|
|
2492
|
+
function o() {
|
|
2493
|
+
return Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
|
2494
|
+
}
|
|
2495
|
+
return o() + o() + "-" + o() + "-" + o() + "-" + o() + "-" + o() + o() + o();
|
|
2496
|
+
}
|
|
2497
|
+
class ur {
|
|
2498
|
+
constructor() {
|
|
2499
|
+
this.bucket = void 0, this.host = void 0, this.port = void 0, this.path = "", this.apiKey = void 0, this.secure = !1, this.enablePing = !1, this.pingInterval = 5e3, this.clientId = void 0, this.wsSubDomain = void 0;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
class He {
|
|
2503
|
+
constructor(e) {
|
|
2504
|
+
this.bucket = void 0, this.data = void 0, this.failIfExists = !1, this.expire = void 0, this.async = !0, this.forceHttp = !1, this.keysOnly = !1, this.filter = void 0, this.removeDataFromReply = !1, e && (this.bucket = e.bucket, this.data = e.data, this.failIfExists = e.failIfExists, this.expire = e.expire, this.async = e.async, this.forceHttp = e.forceHttp, this.keysOnly = e.keysOnly, this.filter = e.filter, this.removeDataFromReply = e.removeDataFromReply);
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
class Ni extends He {
|
|
2508
|
+
constructor() {
|
|
2509
|
+
super(...arguments), this.url = void 0, this.method = void 0, this.key = void 0, this.forceHttp = !1, this.keysOnly = !1, this.filter = void 0, this.removeDataFromReply = !1, this.isList = !1;
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
class Mi {
|
|
2513
|
+
constructor(e) {
|
|
2514
|
+
this.pendingRequests = 0, e == null && (e = new ur()), e.host = e.host || "127.0.0.1", e.port = e.port || Ui, typeof e.path != "string" && (e.path = ""), e.path !== "" && e.path.charAt(0) !== "/" && (e.path = "/" + e.path), e.path.charAt(e.path.length - 1) !== "/" && (e.path = e.path + "/"), this.settings = e, this.connection = new ji(e), this.requestQueue = [];
|
|
2515
|
+
}
|
|
2516
|
+
internalizeRequestOptions(e, n, a = !1) {
|
|
2517
|
+
var u = n.bucket || this.settings.bucket || "";
|
|
2518
|
+
n.async == null && (n.async = !0);
|
|
2519
|
+
var c = new Ni(null);
|
|
2520
|
+
return n.keysOnly !== void 0 && (c.keysOnly = n.keysOnly), n.filter !== void 0 && (c.filter = n.filter), c.url = this.getUrl(e, u, c.keysOnly, c.filter, a), c.bucket = u, c.key = e, c.async = n.async, c.failIfExists = n.failIfExists, c.forceHttp = n.forceHttp, c.expire = n.expire, c.isList = a, c.removeDataFromReply = n.removeDataFromReply, c;
|
|
2521
|
+
}
|
|
2522
|
+
checkOptions(e) {
|
|
2523
|
+
return e instanceof He || (e = new He(e)), e;
|
|
2524
|
+
}
|
|
2525
|
+
async read(e, n) {
|
|
2526
|
+
let a = this.internalizeRequestOptions(e, this.checkOptions(n));
|
|
2527
|
+
return a.method = "GET", this.request(a);
|
|
2528
|
+
}
|
|
2529
|
+
async list(e) {
|
|
2530
|
+
let n = { ...e };
|
|
2531
|
+
n.keysOnly === void 0 && (n.keysOnly = !0);
|
|
2532
|
+
let a = this.internalizeRequestOptions("", this.checkOptions(n), !0);
|
|
2533
|
+
return a.method = "GET", await this.request(a);
|
|
2534
|
+
}
|
|
2535
|
+
async write(e, n, a) {
|
|
2536
|
+
let u = this.internalizeRequestOptions(e, this.checkOptions(a));
|
|
2537
|
+
return u.method = u.key ? "PUT" : "POST", u.data = n, this.request(u);
|
|
2538
|
+
}
|
|
2539
|
+
async patch(e, n, a) {
|
|
2540
|
+
let u = this.internalizeRequestOptions(e, this.checkOptions(a));
|
|
2541
|
+
return u.method = "PATCH", u.data = n, this.request(u);
|
|
2542
|
+
}
|
|
2543
|
+
async remove(e, n) {
|
|
2544
|
+
let a = this.internalizeRequestOptions(e, this.checkOptions(n));
|
|
2545
|
+
return a.method = "DELETE", this.request(a);
|
|
2546
|
+
}
|
|
2547
|
+
async repair(e) {
|
|
2548
|
+
var n = this.settings.secure ? "https://" : "http://", a = n + this.settings.host + ":" + this.settings.port + this.settings.path + "_repair/" + e;
|
|
2549
|
+
const u = {
|
|
2550
|
+
url: a,
|
|
2551
|
+
method: "GET"
|
|
2552
|
+
};
|
|
2553
|
+
return await this.requestHttp(u);
|
|
2554
|
+
}
|
|
2555
|
+
getUrl(e, n, a, u, c = !1) {
|
|
2556
|
+
e || (e = "");
|
|
2557
|
+
var l = "d=" + (/* @__PURE__ */ new Date()).getTime();
|
|
2558
|
+
l = (e.indexOf("?") > -1 ? "&" : "?") + l, a && (l = l + "&keysOnly=true"), u != null && u !== "" && (l = l + "&filter=" + u);
|
|
2559
|
+
var f = this.settings.secure ? "https://" : "http://";
|
|
2560
|
+
return c ? f + this.settings.host + ":" + this.settings.port + this.settings.path + "_data/" + encodeURIComponent(n) + l : f + this.settings.host + ":" + this.settings.port + this.settings.path + "_data/" + encodeURIComponent(n) + "/" + encodeURIComponent(e) + l;
|
|
2561
|
+
}
|
|
2562
|
+
async requestHttp(e) {
|
|
2563
|
+
const n = e.method || "GET";
|
|
2564
|
+
let a = {
|
|
2565
|
+
method: n,
|
|
2566
|
+
headers: {},
|
|
2567
|
+
body: void 0
|
|
2568
|
+
};
|
|
2569
|
+
this.settings.apiKey && (a.headers["API-Key"] = this.settings.apiKey, a.headers["x-api-key"] = this.settings.apiKey), (n == "PUT" || n == "POST" || n == "PATCH") && (a.body = JSON.stringify(e.data), a.headers["Content-Type"] = "application/json", e.failIfExists && (a.headers.failIfExists = e.failIfExists), e.removeDataFromReply && (a.headers.RemoveDataFromReply = e.removeDataFromReply), e.expire && (a.headers.expire = e.expire));
|
|
2570
|
+
const u = await _i(e.url, a);
|
|
2571
|
+
if ((n === "GET" || n === "PATCH") && [Le, Ci].indexOf(u.status) > -1)
|
|
2572
|
+
return await u.json();
|
|
2573
|
+
if (["POST", "PUT"].indexOf(n) > -1 && [Le, _t].indexOf(u.status) > -1) {
|
|
2574
|
+
let c = e.key;
|
|
2575
|
+
return u.status === _t && (c = u.headers.location), c;
|
|
2576
|
+
} else {
|
|
2577
|
+
if (n === "DELETE" && [Le, Li].indexOf(u.status) > -1)
|
|
2578
|
+
return;
|
|
2579
|
+
if (u.status == Le)
|
|
2580
|
+
return;
|
|
2581
|
+
throw new Error(`${u.status}`);
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
async request(e) {
|
|
2585
|
+
var n, a, u = new Promise(function(l, f) {
|
|
2586
|
+
n = l, a = f;
|
|
2587
|
+
});
|
|
2588
|
+
e.async === void 0 && (e.async = !0);
|
|
2589
|
+
var c = { resolve: n, reject: a, options: e };
|
|
2590
|
+
return setTimeout(() => {
|
|
2591
|
+
this.requestQueue.unshift(c), this.processRequestQueue();
|
|
2592
|
+
}), u;
|
|
2593
|
+
}
|
|
2594
|
+
processRequestQueue() {
|
|
2595
|
+
if (this.pendingRequests >= Di || this.requestQueue.length === 0)
|
|
2596
|
+
return;
|
|
2597
|
+
const e = this.requestQueue.pop();
|
|
2598
|
+
this.pendingRequests++;
|
|
2599
|
+
var n;
|
|
2600
|
+
this.connection && e.options.async && this.connection.connected && !e.options.forceHttp ? n = this.connection.request(e.options) : n = this.requestHttp(e.options), n.then((a) => {
|
|
2601
|
+
this.pendingRequests--, e.resolve(a), setTimeout(this.processRequestQueue.bind(this));
|
|
2602
|
+
}).catch((a) => {
|
|
2603
|
+
this.pendingRequests--, e.reject(a), setTimeout(this.processRequestQueue.bind(this));
|
|
2604
|
+
});
|
|
2605
|
+
}
|
|
2606
|
+
close() {
|
|
2607
|
+
this.connection.close();
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
var Tt = { exports: {} }, ke = typeof Reflect == "object" ? Reflect : null, Ut = ke && typeof ke.apply == "function" ? ke.apply : function(e, n, a) {
|
|
2611
|
+
return Function.prototype.apply.call(e, n, a);
|
|
2612
|
+
}, $e;
|
|
2613
|
+
ke && typeof ke.ownKeys == "function" ? $e = ke.ownKeys : Object.getOwnPropertySymbols ? $e = function(e) {
|
|
2614
|
+
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
2615
|
+
} : $e = function(e) {
|
|
2616
|
+
return Object.getOwnPropertyNames(e);
|
|
2617
|
+
};
|
|
2618
|
+
function qi(o) {
|
|
2619
|
+
console && console.warn && console.warn(o);
|
|
2620
|
+
}
|
|
2621
|
+
var fr = Number.isNaN || function(e) {
|
|
2622
|
+
return e !== e;
|
|
2623
|
+
};
|
|
2624
|
+
function R() {
|
|
2625
|
+
R.init.call(this);
|
|
2626
|
+
}
|
|
2627
|
+
Tt.exports = R;
|
|
2628
|
+
Tt.exports.once = Ji;
|
|
2629
|
+
R.EventEmitter = R;
|
|
2630
|
+
R.prototype._events = void 0;
|
|
2631
|
+
R.prototype._eventsCount = 0;
|
|
2632
|
+
R.prototype._maxListeners = void 0;
|
|
2633
|
+
var Lt = 10;
|
|
2634
|
+
function Xe(o) {
|
|
2635
|
+
if (typeof o != "function")
|
|
2636
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof o);
|
|
2637
|
+
}
|
|
2638
|
+
Object.defineProperty(R, "defaultMaxListeners", {
|
|
2639
|
+
enumerable: !0,
|
|
2640
|
+
get: function() {
|
|
2641
|
+
return Lt;
|
|
2642
|
+
},
|
|
2643
|
+
set: function(o) {
|
|
2644
|
+
if (typeof o != "number" || o < 0 || fr(o))
|
|
2645
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + o + ".");
|
|
2646
|
+
Lt = o;
|
|
2647
|
+
}
|
|
2648
|
+
});
|
|
2649
|
+
R.init = function() {
|
|
2650
|
+
(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;
|
|
2651
|
+
};
|
|
2652
|
+
R.prototype.setMaxListeners = function(e) {
|
|
2653
|
+
if (typeof e != "number" || e < 0 || fr(e))
|
|
2654
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
2655
|
+
return this._maxListeners = e, this;
|
|
2656
|
+
};
|
|
2657
|
+
function cr(o) {
|
|
2658
|
+
return o._maxListeners === void 0 ? R.defaultMaxListeners : o._maxListeners;
|
|
2659
|
+
}
|
|
2660
|
+
R.prototype.getMaxListeners = function() {
|
|
2661
|
+
return cr(this);
|
|
2662
|
+
};
|
|
2663
|
+
R.prototype.emit = function(e) {
|
|
2664
|
+
for (var n = [], a = 1; a < arguments.length; a++)
|
|
2665
|
+
n.push(arguments[a]);
|
|
2666
|
+
var u = e === "error", c = this._events;
|
|
2667
|
+
if (c !== void 0)
|
|
2668
|
+
u = u && c.error === void 0;
|
|
2669
|
+
else if (!u)
|
|
2670
|
+
return !1;
|
|
2671
|
+
if (u) {
|
|
2672
|
+
var l;
|
|
2673
|
+
if (n.length > 0 && (l = n[0]), l instanceof Error)
|
|
2674
|
+
throw l;
|
|
2675
|
+
var f = new Error("Unhandled error." + (l ? " (" + l.message + ")" : ""));
|
|
2676
|
+
throw f.context = l, f;
|
|
2677
|
+
}
|
|
2678
|
+
var m = c[e];
|
|
2679
|
+
if (m === void 0)
|
|
2680
|
+
return !1;
|
|
2681
|
+
if (typeof m == "function")
|
|
2682
|
+
Ut(m, this, n);
|
|
2683
|
+
else
|
|
2684
|
+
for (var E = m.length, w = dr(m, E), a = 0; a < E; ++a)
|
|
2685
|
+
Ut(w[a], this, n);
|
|
2686
|
+
return !0;
|
|
2687
|
+
};
|
|
2688
|
+
function lr(o, e, n, a) {
|
|
2689
|
+
var u, c, l;
|
|
2690
|
+
if (Xe(n), c = o._events, c === void 0 ? (c = o._events = /* @__PURE__ */ Object.create(null), o._eventsCount = 0) : (c.newListener !== void 0 && (o.emit(
|
|
2691
|
+
"newListener",
|
|
2692
|
+
e,
|
|
2693
|
+
n.listener ? n.listener : n
|
|
2694
|
+
), c = o._events), l = c[e]), l === void 0)
|
|
2695
|
+
l = c[e] = n, ++o._eventsCount;
|
|
2696
|
+
else if (typeof l == "function" ? l = c[e] = a ? [n, l] : [l, n] : a ? l.unshift(n) : l.push(n), u = cr(o), u > 0 && l.length > u && !l.warned) {
|
|
2697
|
+
l.warned = !0;
|
|
2698
|
+
var f = new Error("Possible EventEmitter memory leak detected. " + l.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
2699
|
+
f.name = "MaxListenersExceededWarning", f.emitter = o, f.type = e, f.count = l.length, qi(f);
|
|
2700
|
+
}
|
|
2701
|
+
return o;
|
|
2702
|
+
}
|
|
2703
|
+
R.prototype.addListener = function(e, n) {
|
|
2704
|
+
return lr(this, e, n, !1);
|
|
2705
|
+
};
|
|
2706
|
+
R.prototype.on = R.prototype.addListener;
|
|
2707
|
+
R.prototype.prependListener = function(e, n) {
|
|
2708
|
+
return lr(this, e, n, !0);
|
|
2709
|
+
};
|
|
2710
|
+
function $i() {
|
|
2711
|
+
if (!this.fired)
|
|
2712
|
+
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);
|
|
2713
|
+
}
|
|
2714
|
+
function pr(o, e, n) {
|
|
2715
|
+
var a = { fired: !1, wrapFn: void 0, target: o, type: e, listener: n }, u = $i.bind(a);
|
|
2716
|
+
return u.listener = n, a.wrapFn = u, u;
|
|
2717
|
+
}
|
|
2718
|
+
R.prototype.once = function(e, n) {
|
|
2719
|
+
return Xe(n), this.on(e, pr(this, e, n)), this;
|
|
2720
|
+
};
|
|
2721
|
+
R.prototype.prependOnceListener = function(e, n) {
|
|
2722
|
+
return Xe(n), this.prependListener(e, pr(this, e, n)), this;
|
|
2723
|
+
};
|
|
2724
|
+
R.prototype.removeListener = function(e, n) {
|
|
2725
|
+
var a, u, c, l, f;
|
|
2726
|
+
if (Xe(n), u = this._events, u === void 0)
|
|
2727
|
+
return this;
|
|
2728
|
+
if (a = u[e], a === void 0)
|
|
2729
|
+
return this;
|
|
2730
|
+
if (a === n || a.listener === n)
|
|
2731
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete u[e], u.removeListener && this.emit("removeListener", e, a.listener || n));
|
|
2732
|
+
else if (typeof a != "function") {
|
|
2733
|
+
for (c = -1, l = a.length - 1; l >= 0; l--)
|
|
2734
|
+
if (a[l] === n || a[l].listener === n) {
|
|
2735
|
+
f = a[l].listener, c = l;
|
|
2736
|
+
break;
|
|
2737
|
+
}
|
|
2738
|
+
if (c < 0)
|
|
2739
|
+
return this;
|
|
2740
|
+
c === 0 ? a.shift() : Gi(a, c), a.length === 1 && (u[e] = a[0]), u.removeListener !== void 0 && this.emit("removeListener", e, f || n);
|
|
2741
|
+
}
|
|
2742
|
+
return this;
|
|
2743
|
+
};
|
|
2744
|
+
R.prototype.off = R.prototype.removeListener;
|
|
2745
|
+
R.prototype.removeAllListeners = function(e) {
|
|
2746
|
+
var n, a, u;
|
|
2747
|
+
if (a = this._events, a === void 0)
|
|
2748
|
+
return this;
|
|
2749
|
+
if (a.removeListener === void 0)
|
|
2750
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : a[e] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete a[e]), this;
|
|
2751
|
+
if (arguments.length === 0) {
|
|
2752
|
+
var c = Object.keys(a), l;
|
|
2753
|
+
for (u = 0; u < c.length; ++u)
|
|
2754
|
+
l = c[u], l !== "removeListener" && this.removeAllListeners(l);
|
|
2755
|
+
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
2756
|
+
}
|
|
2757
|
+
if (n = a[e], typeof n == "function")
|
|
2758
|
+
this.removeListener(e, n);
|
|
2759
|
+
else if (n !== void 0)
|
|
2760
|
+
for (u = n.length - 1; u >= 0; u--)
|
|
2761
|
+
this.removeListener(e, n[u]);
|
|
2762
|
+
return this;
|
|
2763
|
+
};
|
|
2764
|
+
function hr(o, e, n) {
|
|
2765
|
+
var a = o._events;
|
|
2766
|
+
if (a === void 0)
|
|
2767
|
+
return [];
|
|
2768
|
+
var u = a[e];
|
|
2769
|
+
return u === void 0 ? [] : typeof u == "function" ? n ? [u.listener || u] : [u] : n ? Wi(u) : dr(u, u.length);
|
|
2770
|
+
}
|
|
2771
|
+
R.prototype.listeners = function(e) {
|
|
2772
|
+
return hr(this, e, !0);
|
|
2773
|
+
};
|
|
2774
|
+
R.prototype.rawListeners = function(e) {
|
|
2775
|
+
return hr(this, e, !1);
|
|
2776
|
+
};
|
|
2777
|
+
R.listenerCount = function(o, e) {
|
|
2778
|
+
return typeof o.listenerCount == "function" ? o.listenerCount(e) : yr.call(o, e);
|
|
2779
|
+
};
|
|
2780
|
+
R.prototype.listenerCount = yr;
|
|
2781
|
+
function yr(o) {
|
|
2782
|
+
var e = this._events;
|
|
2783
|
+
if (e !== void 0) {
|
|
2784
|
+
var n = e[o];
|
|
2785
|
+
if (typeof n == "function")
|
|
2786
|
+
return 1;
|
|
2787
|
+
if (n !== void 0)
|
|
2788
|
+
return n.length;
|
|
2789
|
+
}
|
|
2790
|
+
return 0;
|
|
2791
|
+
}
|
|
2792
|
+
R.prototype.eventNames = function() {
|
|
2793
|
+
return this._eventsCount > 0 ? $e(this._events) : [];
|
|
2794
|
+
};
|
|
2795
|
+
function dr(o, e) {
|
|
2796
|
+
for (var n = new Array(e), a = 0; a < e; ++a)
|
|
2797
|
+
n[a] = o[a];
|
|
2798
|
+
return n;
|
|
2799
|
+
}
|
|
2800
|
+
function Gi(o, e) {
|
|
2801
|
+
for (; e + 1 < o.length; e++)
|
|
2802
|
+
o[e] = o[e + 1];
|
|
2803
|
+
o.pop();
|
|
2804
|
+
}
|
|
2805
|
+
function Wi(o) {
|
|
2806
|
+
for (var e = new Array(o.length), n = 0; n < e.length; ++n)
|
|
2807
|
+
e[n] = o[n].listener || o[n];
|
|
2808
|
+
return e;
|
|
2809
|
+
}
|
|
2810
|
+
function Ji(o, e) {
|
|
2811
|
+
return new Promise(function(n, a) {
|
|
2812
|
+
function u(l) {
|
|
2813
|
+
o.removeListener(e, c), a(l);
|
|
2814
|
+
}
|
|
2815
|
+
function c() {
|
|
2816
|
+
typeof o.removeListener == "function" && o.removeListener("error", u), n([].slice.call(arguments));
|
|
2817
|
+
}
|
|
2818
|
+
gr(o, e, c, { once: !0 }), e !== "error" && zi(o, u, { once: !0 });
|
|
2819
|
+
});
|
|
2820
|
+
}
|
|
2821
|
+
function zi(o, e, n) {
|
|
2822
|
+
typeof o.on == "function" && gr(o, "error", e, n);
|
|
2823
|
+
}
|
|
2824
|
+
function gr(o, e, n, a) {
|
|
2825
|
+
if (typeof o.on == "function")
|
|
2826
|
+
a.once ? o.once(e, n) : o.on(e, n);
|
|
2827
|
+
else if (typeof o.addEventListener == "function")
|
|
2828
|
+
o.addEventListener(e, function u(c) {
|
|
2829
|
+
a.once && o.removeEventListener(e, u), n(c);
|
|
2830
|
+
});
|
|
2831
|
+
else
|
|
2832
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof o);
|
|
2833
|
+
}
|
|
2834
|
+
var Hi = Tt.exports;
|
|
2835
|
+
const Ke = "messaging.compcon", Ki = 1e4, Qi = 1e4, Vi = 20, vr = 100, mr = 200;
|
|
2836
|
+
class Xi {
|
|
2837
|
+
constructor(e) {
|
|
2838
|
+
const n = (/* @__PURE__ */ new Date()).valueOf();
|
|
2839
|
+
this.lastProgress = void 0, this.publishTime = n, this.callback = e;
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
async function Yi(o) {
|
|
2843
|
+
o !== 0 && await new Promise((e) => {
|
|
2844
|
+
setTimeout(() => e(null), o);
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
class Zi {
|
|
2848
|
+
constructor(e, n, a, u) {
|
|
2849
|
+
this.pendingJobs = /* @__PURE__ */ new Map(), this.jobQueue = Ke + "." + n + ".jobs", this.statusQueue = Ke + "." + n + ".status", this.timeout = a || Ki, this.progressTimeout = u || Qi, this.de = e, this.jobStatusQueueListener = (c) => {
|
|
2850
|
+
if (this.pendingJobs.has(c.key)) {
|
|
2851
|
+
const l = this.pendingJobs.get(c.key);
|
|
2852
|
+
l.lastProgress = (/* @__PURE__ */ new Date()).valueOf(), l.callback(c.value.err, c), c.value.done && this.pendingJobs.delete(c.key);
|
|
2853
|
+
}
|
|
2854
|
+
}, e.connection.addListener(this.statusQueue, "*", !0, this.jobStatusQueueListener);
|
|
2855
|
+
}
|
|
2856
|
+
destroy() {
|
|
2857
|
+
this.de.connection && this.de.connection.removeListener(this.jobStatusQueueListener);
|
|
2858
|
+
}
|
|
2859
|
+
async addJob(e, n, a, u) {
|
|
2860
|
+
a = a || this.timeout, u = u || this.progressTimeout;
|
|
2861
|
+
const c = ar();
|
|
2862
|
+
return await this.de.connection.write(this.jobQueue, c, e), new Promise((l, f) => {
|
|
2863
|
+
const m = setInterval(() => {
|
|
2864
|
+
const E = (/* @__PURE__ */ new Date()).valueOf();
|
|
2865
|
+
let w = !1;
|
|
2866
|
+
this.pendingJobs[c].lastProgress != null && (w = E > this.pendingJobs[c].lastProgress + u);
|
|
2867
|
+
const O = E > this.pendingJobs[c].publishTime + a;
|
|
2868
|
+
(w || O) && (this.pendingJobs[c] = null, clearInterval(m), f(new or(`Timeout for job id ${c}`, w)));
|
|
2869
|
+
}, 500);
|
|
2870
|
+
this.pendingJobs[c] = new Xi((E, w) => {
|
|
2871
|
+
E ? (clearInterval(m), f(new Error(E))) : w.value.done ? (clearInterval(m), l(w.value), this.de.connection.delete(this.statusQueue, w.key)) : typeof n == "function" && n(w.value);
|
|
2872
|
+
});
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
class eo extends Hi.EventEmitter {
|
|
2877
|
+
constructor(e, n, a) {
|
|
2878
|
+
super(), this.jobCount = 0, this.statusQueue = Ke + "." + n + ".status", this.jobQueue = Ke + "." + n + ".jobs", this.de = e, this.clientId = a, this.jobQueueListener = (u) => {
|
|
2879
|
+
u.isDeleted || u.value == null || this.jobHandler(u.key, u.value).catch(() => this.emit("job", { id: u.value.id, status: "No worker" }));
|
|
2880
|
+
}, e.connection.addListener(this.jobQueue, "*", !0, this.jobQueueListener);
|
|
2881
|
+
}
|
|
2882
|
+
destroy() {
|
|
2883
|
+
this.de.connection.removeListener(this.jobQueueListener), this.removeAllListeners();
|
|
2884
|
+
}
|
|
2885
|
+
async jobHandler(e, n) {
|
|
2886
|
+
this.emit("job", { id: n.id, status: "Job received" }), await Yi(Math.floor(Math.random() * Vi));
|
|
2887
|
+
const a = await this.waitForWorker(n);
|
|
2888
|
+
try {
|
|
2889
|
+
const u = {
|
|
2890
|
+
claim: { id: this.clientId },
|
|
2891
|
+
done: !1,
|
|
2892
|
+
err: null,
|
|
2893
|
+
data: null,
|
|
2894
|
+
progress: null
|
|
2895
|
+
};
|
|
2896
|
+
await this.de.connection.write(this.statusQueue, e, u, !0), await this.de.connection.delete(this.jobQueue, e), this.jobCount += 1, a.work && await a.work(n, async (c, l) => {
|
|
2897
|
+
this.jobCount -= 1, c instanceof Error && (c = c.message), this.emit("job", { id: n.id, done: !0, data: l }), await this.de.connection.write(this.statusQueue, e, { ...u, err: c, data: l, done: !0 });
|
|
2898
|
+
}, (c) => {
|
|
2899
|
+
this.emit("job", { id: n.id, done: !1, progress: c }), this.de.connection.write(this.statusQueue, e, { ...u, progress: c });
|
|
2900
|
+
});
|
|
2901
|
+
} catch (u) {
|
|
2902
|
+
if (a.release(), !(u instanceof sr))
|
|
2903
|
+
throw u;
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
async waitForWorker(e) {
|
|
2907
|
+
return new Promise((n, a) => {
|
|
2908
|
+
var u = setInterval(() => {
|
|
2909
|
+
this.onJobQuery != null && this.onJobQuery(e, (c, l) => {
|
|
2910
|
+
if (c == null) {
|
|
2911
|
+
clearInterval(u), this.emit("job", { id: e.id, status: "Worker assigned" }), n(l);
|
|
2912
|
+
return;
|
|
2913
|
+
} else
|
|
2914
|
+
c == vr ? (clearInterval(u), this.emit("job", { id: e.id, error: "Not supported" }), a(new Error("Job not supported"))) : c == mr || (clearInterval(u), this.emit("job", { id: e.id, errno: c }), a(new Error(`Error no : ${c}`)));
|
|
2915
|
+
});
|
|
2916
|
+
}, 100);
|
|
2917
|
+
});
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
const wr = "#reqrep/", br = "#reqrep-progress/";
|
|
2921
|
+
class to {
|
|
2922
|
+
constructor(e, n) {
|
|
2923
|
+
const a = (/* @__PURE__ */ new Date()).valueOf();
|
|
2924
|
+
this.lastProgress = a, this.requestTime = a, this.reply = e, this.progress = n;
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
class ro {
|
|
2928
|
+
constructor(e, n, a, u) {
|
|
2929
|
+
this.pendingRequests = /* @__PURE__ */ new Map(), this.timeout = a || 5e3, this.progressTimeout = u || 5e3, this.channel = wr + n, this.progressChannel = br + n, this.de = e, this.progressListener = (c) => {
|
|
2930
|
+
const l = this.pendingRequests[c.key];
|
|
2931
|
+
l && (l.lastProgress = (/* @__PURE__ */ new Date()).valueOf(), typeof l.progress == "function" && l.progress(c.value.data));
|
|
2932
|
+
}, this.replyListener = (c) => {
|
|
2933
|
+
this.pendingRequests[c.key] && (this.pendingRequests[c.key].reply(c.value.err, c.value.data), this.pendingRequests[c.key] = null);
|
|
2934
|
+
}, e.connection.addListener(this.channel, "*", !0, this.replyListener), e.connection.addListener(this.progressChannel, "*", !0, this.progressListener);
|
|
2935
|
+
}
|
|
2936
|
+
destroy() {
|
|
2937
|
+
this.de.connection.removeListener(this.progressListener), this.de.connection.removeListener(this.replyListener);
|
|
2938
|
+
}
|
|
2939
|
+
async request(e, n, a, u) {
|
|
2940
|
+
return a = a || this.timeout, u = u || this.progressTimeout, new Promise((c, l) => {
|
|
2941
|
+
var f = ar();
|
|
2942
|
+
this.de.connection.signalEvent(this.channel, f, e);
|
|
2943
|
+
const m = setInterval(() => {
|
|
2944
|
+
const E = (/* @__PURE__ */ new Date()).valueOf(), w = E > this.pendingRequests[f].lastProgress + u, O = E > this.pendingRequests[f].requestTime + a;
|
|
2945
|
+
(w || O) && (this.pendingRequests[f] = null, clearInterval(m), l(new or(`Timeout in request id ${f}`, w)));
|
|
2946
|
+
}, 500);
|
|
2947
|
+
this.pendingRequests[f] = new to((E, w) => {
|
|
2948
|
+
clearInterval(m), E ? l(new Error(E)) : c(w);
|
|
2949
|
+
}, n);
|
|
2950
|
+
});
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
class no {
|
|
2954
|
+
constructor(e, n) {
|
|
2955
|
+
this.channel = wr + n, this.progressChannel = br + n, this.de = e, this.requestListener = (a) => {
|
|
2956
|
+
this.onMessage !== void 0 && this.onMessage(a.value, (u, c) => {
|
|
2957
|
+
if (this.de.connection.connected) {
|
|
2958
|
+
const l = u instanceof Error ? u.message : u;
|
|
2959
|
+
this.de.connection.signalEvent(this.channel, a.key, { err: l, data: c });
|
|
2960
|
+
}
|
|
2961
|
+
}, (u) => {
|
|
2962
|
+
this.de.connection.connected && this.de.connection.signalEvent(this.progressChannel, a.key, { data: u });
|
|
2963
|
+
});
|
|
2964
|
+
}, e.connection.addListener(this.channel, "*", !0, this.requestListener);
|
|
2965
|
+
}
|
|
2966
|
+
destroy() {
|
|
2967
|
+
this.de.connection.removeListener(this.requestListener);
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
var gt;
|
|
2971
|
+
((o) => {
|
|
2972
|
+
o.RequestReply = {
|
|
2973
|
+
Requestor: ro,
|
|
2974
|
+
Replier: no
|
|
2975
|
+
}, o.CompetingConsumers = {
|
|
2976
|
+
CompetingConsumer: eo,
|
|
2977
|
+
Producer: Zi
|
|
2978
|
+
}, o.Errors = {
|
|
2979
|
+
JOB_NOT_SUPPORTED: vr,
|
|
2980
|
+
NO_WORKER_AVAILABLE: mr
|
|
2981
|
+
};
|
|
2982
|
+
})(gt || (gt = {}));
|
|
2983
|
+
typeof window < "u" && window && (window.Cachearoo = {
|
|
2984
|
+
Cachearoo: Mi,
|
|
2985
|
+
CachearooSettings: ur,
|
|
2986
|
+
RequestOptions: He,
|
|
2987
|
+
Messaging: gt
|
|
2988
|
+
});
|
|
2989
|
+
export {
|
|
2990
|
+
Mi as Cachearoo,
|
|
2991
|
+
ur as CachearooSettings,
|
|
2992
|
+
gt as Messaging,
|
|
2993
|
+
no as Replier,
|
|
2994
|
+
He as RequestOptions,
|
|
2995
|
+
ro as Requestor
|
|
2996
|
+
};
|