@blocknote/xl-docx-exporter 0.30.0 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-xl-docx-exporter.cjs +2 -2
- package/dist/blocknote-xl-docx-exporter.cjs.map +1 -1
- package/dist/blocknote-xl-docx-exporter.js +5 -5
- package/dist/blocknote-xl-docx-exporter.js.map +1 -1
- package/dist/index-B-FmPo2r.cjs +7 -0
- package/dist/index-B-FmPo2r.cjs.map +1 -0
- package/dist/index-cA_PmnZy.js +1040 -0
- package/dist/index-cA_PmnZy.js.map +1 -0
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -3
- package/src/docx/defaultSchema/blocks.ts +11 -11
- package/src/docx/defaultSchema/inlinecontent.ts +1 -1
- package/src/docx/docxExporter.test.ts +13 -13
- package/src/docx/docxExporter.ts +19 -16
- package/src/docx/util/Table.tsx +12 -12
|
@@ -0,0 +1,1040 @@
|
|
|
1
|
+
function _r(c, f) {
|
|
2
|
+
for (var s = 0; s < f.length; s++) {
|
|
3
|
+
const w = f[s];
|
|
4
|
+
if (typeof w != "string" && !Array.isArray(w)) {
|
|
5
|
+
for (const y in w)
|
|
6
|
+
if (y !== "default" && !(y in c)) {
|
|
7
|
+
const l = Object.getOwnPropertyDescriptor(w, y);
|
|
8
|
+
l && Object.defineProperty(c, y, l.get ? l : {
|
|
9
|
+
enumerable: !0,
|
|
10
|
+
get: () => w[y]
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return Object.freeze(Object.defineProperty(c, Symbol.toStringTag, { value: "Module" }));
|
|
16
|
+
}
|
|
17
|
+
var ur = {}, j = {};
|
|
18
|
+
j.byteLength = br;
|
|
19
|
+
j.toByteArray = Mr;
|
|
20
|
+
j.fromByteArray = Pr;
|
|
21
|
+
var _ = [], R = [], Sr = typeof Uint8Array < "u" ? Uint8Array : Array, H = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
22
|
+
for (var k = 0, Lr = H.length; k < Lr; ++k)
|
|
23
|
+
_[k] = H[k], R[H.charCodeAt(k)] = k;
|
|
24
|
+
R[45] = 62;
|
|
25
|
+
R[95] = 63;
|
|
26
|
+
function hr(c) {
|
|
27
|
+
var f = c.length;
|
|
28
|
+
if (f % 4 > 0)
|
|
29
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
30
|
+
var s = c.indexOf("=");
|
|
31
|
+
s === -1 && (s = f);
|
|
32
|
+
var w = s === f ? 0 : 4 - s % 4;
|
|
33
|
+
return [s, w];
|
|
34
|
+
}
|
|
35
|
+
function br(c) {
|
|
36
|
+
var f = hr(c), s = f[0], w = f[1];
|
|
37
|
+
return (s + w) * 3 / 4 - w;
|
|
38
|
+
}
|
|
39
|
+
function Nr(c, f, s) {
|
|
40
|
+
return (f + s) * 3 / 4 - s;
|
|
41
|
+
}
|
|
42
|
+
function Mr(c) {
|
|
43
|
+
var f, s = hr(c), w = s[0], y = s[1], l = new Sr(Nr(c, w, y)), p = 0, o = y > 0 ? w - 4 : w, B;
|
|
44
|
+
for (B = 0; B < o; B += 4)
|
|
45
|
+
f = R[c.charCodeAt(B)] << 18 | R[c.charCodeAt(B + 1)] << 12 | R[c.charCodeAt(B + 2)] << 6 | R[c.charCodeAt(B + 3)], l[p++] = f >> 16 & 255, l[p++] = f >> 8 & 255, l[p++] = f & 255;
|
|
46
|
+
return y === 2 && (f = R[c.charCodeAt(B)] << 2 | R[c.charCodeAt(B + 1)] >> 4, l[p++] = f & 255), y === 1 && (f = R[c.charCodeAt(B)] << 10 | R[c.charCodeAt(B + 1)] << 4 | R[c.charCodeAt(B + 2)] >> 2, l[p++] = f >> 8 & 255, l[p++] = f & 255), l;
|
|
47
|
+
}
|
|
48
|
+
function kr(c) {
|
|
49
|
+
return _[c >> 18 & 63] + _[c >> 12 & 63] + _[c >> 6 & 63] + _[c & 63];
|
|
50
|
+
}
|
|
51
|
+
function Dr(c, f, s) {
|
|
52
|
+
for (var w, y = [], l = f; l < s; l += 3)
|
|
53
|
+
w = (c[l] << 16 & 16711680) + (c[l + 1] << 8 & 65280) + (c[l + 2] & 255), y.push(kr(w));
|
|
54
|
+
return y.join("");
|
|
55
|
+
}
|
|
56
|
+
function Pr(c) {
|
|
57
|
+
for (var f, s = c.length, w = s % 3, y = [], l = 16383, p = 0, o = s - w; p < o; p += l)
|
|
58
|
+
y.push(Dr(c, p, p + l > o ? o : p + l));
|
|
59
|
+
return w === 1 ? (f = c[s - 1], y.push(
|
|
60
|
+
_[f >> 2] + _[f << 4 & 63] + "=="
|
|
61
|
+
)) : w === 2 && (f = (c[s - 2] << 8) + c[s - 1], y.push(
|
|
62
|
+
_[f >> 10] + _[f >> 4 & 63] + _[f << 2 & 63] + "="
|
|
63
|
+
)), y.join("");
|
|
64
|
+
}
|
|
65
|
+
var V = {};
|
|
66
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
67
|
+
V.read = function(c, f, s, w, y) {
|
|
68
|
+
var l, p, o = y * 8 - w - 1, B = (1 << o) - 1, T = B >> 1, I = -7, F = s ? y - 1 : 0, S = s ? -1 : 1, A = c[f + F];
|
|
69
|
+
for (F += S, l = A & (1 << -I) - 1, A >>= -I, I += o; I > 0; l = l * 256 + c[f + F], F += S, I -= 8)
|
|
70
|
+
;
|
|
71
|
+
for (p = l & (1 << -I) - 1, l >>= -I, I += w; I > 0; p = p * 256 + c[f + F], F += S, I -= 8)
|
|
72
|
+
;
|
|
73
|
+
if (l === 0)
|
|
74
|
+
l = 1 - T;
|
|
75
|
+
else {
|
|
76
|
+
if (l === B)
|
|
77
|
+
return p ? NaN : (A ? -1 : 1) * (1 / 0);
|
|
78
|
+
p = p + Math.pow(2, w), l = l - T;
|
|
79
|
+
}
|
|
80
|
+
return (A ? -1 : 1) * p * Math.pow(2, l - w);
|
|
81
|
+
};
|
|
82
|
+
V.write = function(c, f, s, w, y, l) {
|
|
83
|
+
var p, o, B, T = l * 8 - y - 1, I = (1 << T) - 1, F = I >> 1, S = y === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, A = w ? 0 : l - 1, D = w ? 1 : -1, P = f < 0 || f === 0 && 1 / f < 0 ? 1 : 0;
|
|
84
|
+
for (f = Math.abs(f), isNaN(f) || f === 1 / 0 ? (o = isNaN(f) ? 1 : 0, p = I) : (p = Math.floor(Math.log(f) / Math.LN2), f * (B = Math.pow(2, -p)) < 1 && (p--, B *= 2), p + F >= 1 ? f += S / B : f += S * Math.pow(2, 1 - F), f * B >= 2 && (p++, B /= 2), p + F >= I ? (o = 0, p = I) : p + F >= 1 ? (o = (f * B - 1) * Math.pow(2, y), p = p + F) : (o = f * Math.pow(2, F - 1) * Math.pow(2, y), p = 0)); y >= 8; c[s + A] = o & 255, A += D, o /= 256, y -= 8)
|
|
85
|
+
;
|
|
86
|
+
for (p = p << y | o, T += y; T > 0; c[s + A] = p & 255, A += D, p /= 256, T -= 8)
|
|
87
|
+
;
|
|
88
|
+
c[s + A - D] |= P * 128;
|
|
89
|
+
};
|
|
90
|
+
/*!
|
|
91
|
+
* The buffer module from node.js, for the browser.
|
|
92
|
+
*
|
|
93
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
94
|
+
* @license MIT
|
|
95
|
+
*/
|
|
96
|
+
(function(c) {
|
|
97
|
+
const f = j, s = V, w = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
98
|
+
c.Buffer = o, c.SlowBuffer = cr, c.INSPECT_MAX_BYTES = 50;
|
|
99
|
+
const y = 2147483647;
|
|
100
|
+
c.kMaxLength = y, o.TYPED_ARRAY_SUPPORT = l(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
101
|
+
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
102
|
+
);
|
|
103
|
+
function l() {
|
|
104
|
+
try {
|
|
105
|
+
const i = new Uint8Array(1), r = { foo: function() {
|
|
106
|
+
return 42;
|
|
107
|
+
} };
|
|
108
|
+
return Object.setPrototypeOf(r, Uint8Array.prototype), Object.setPrototypeOf(i, r), i.foo() === 42;
|
|
109
|
+
} catch {
|
|
110
|
+
return !1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
Object.defineProperty(o.prototype, "parent", {
|
|
114
|
+
enumerable: !0,
|
|
115
|
+
get: function() {
|
|
116
|
+
if (o.isBuffer(this))
|
|
117
|
+
return this.buffer;
|
|
118
|
+
}
|
|
119
|
+
}), Object.defineProperty(o.prototype, "offset", {
|
|
120
|
+
enumerable: !0,
|
|
121
|
+
get: function() {
|
|
122
|
+
if (o.isBuffer(this))
|
|
123
|
+
return this.byteOffset;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
function p(i) {
|
|
127
|
+
if (i > y)
|
|
128
|
+
throw new RangeError('The value "' + i + '" is invalid for option "size"');
|
|
129
|
+
const r = new Uint8Array(i);
|
|
130
|
+
return Object.setPrototypeOf(r, o.prototype), r;
|
|
131
|
+
}
|
|
132
|
+
function o(i, r, t) {
|
|
133
|
+
if (typeof i == "number") {
|
|
134
|
+
if (typeof r == "string")
|
|
135
|
+
throw new TypeError(
|
|
136
|
+
'The "string" argument must be of type string. Received type number'
|
|
137
|
+
);
|
|
138
|
+
return F(i);
|
|
139
|
+
}
|
|
140
|
+
return B(i, r, t);
|
|
141
|
+
}
|
|
142
|
+
o.poolSize = 8192;
|
|
143
|
+
function B(i, r, t) {
|
|
144
|
+
if (typeof i == "string")
|
|
145
|
+
return S(i, r);
|
|
146
|
+
if (ArrayBuffer.isView(i))
|
|
147
|
+
return D(i);
|
|
148
|
+
if (i == null)
|
|
149
|
+
throw new TypeError(
|
|
150
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
|
|
151
|
+
);
|
|
152
|
+
if (C(i, ArrayBuffer) || i && C(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (C(i, SharedArrayBuffer) || i && C(i.buffer, SharedArrayBuffer)))
|
|
153
|
+
return P(i, r, t);
|
|
154
|
+
if (typeof i == "number")
|
|
155
|
+
throw new TypeError(
|
|
156
|
+
'The "value" argument must not be of type number. Received type number'
|
|
157
|
+
);
|
|
158
|
+
const n = i.valueOf && i.valueOf();
|
|
159
|
+
if (n != null && n !== i)
|
|
160
|
+
return o.from(n, r, t);
|
|
161
|
+
const e = fr(i);
|
|
162
|
+
if (e) return e;
|
|
163
|
+
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
|
|
164
|
+
return o.from(i[Symbol.toPrimitive]("string"), r, t);
|
|
165
|
+
throw new TypeError(
|
|
166
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
o.from = function(i, r, t) {
|
|
170
|
+
return B(i, r, t);
|
|
171
|
+
}, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
|
|
172
|
+
function T(i) {
|
|
173
|
+
if (typeof i != "number")
|
|
174
|
+
throw new TypeError('"size" argument must be of type number');
|
|
175
|
+
if (i < 0)
|
|
176
|
+
throw new RangeError('The value "' + i + '" is invalid for option "size"');
|
|
177
|
+
}
|
|
178
|
+
function I(i, r, t) {
|
|
179
|
+
return T(i), i <= 0 ? p(i) : r !== void 0 ? typeof t == "string" ? p(i).fill(r, t) : p(i).fill(r) : p(i);
|
|
180
|
+
}
|
|
181
|
+
o.alloc = function(i, r, t) {
|
|
182
|
+
return I(i, r, t);
|
|
183
|
+
};
|
|
184
|
+
function F(i) {
|
|
185
|
+
return T(i), p(i < 0 ? 0 : G(i) | 0);
|
|
186
|
+
}
|
|
187
|
+
o.allocUnsafe = function(i) {
|
|
188
|
+
return F(i);
|
|
189
|
+
}, o.allocUnsafeSlow = function(i) {
|
|
190
|
+
return F(i);
|
|
191
|
+
};
|
|
192
|
+
function S(i, r) {
|
|
193
|
+
if ((typeof r != "string" || r === "") && (r = "utf8"), !o.isEncoding(r))
|
|
194
|
+
throw new TypeError("Unknown encoding: " + r);
|
|
195
|
+
const t = X(i, r) | 0;
|
|
196
|
+
let n = p(t);
|
|
197
|
+
const e = n.write(i, r);
|
|
198
|
+
return e !== t && (n = n.slice(0, e)), n;
|
|
199
|
+
}
|
|
200
|
+
function A(i) {
|
|
201
|
+
const r = i.length < 0 ? 0 : G(i.length) | 0, t = p(r);
|
|
202
|
+
for (let n = 0; n < r; n += 1)
|
|
203
|
+
t[n] = i[n] & 255;
|
|
204
|
+
return t;
|
|
205
|
+
}
|
|
206
|
+
function D(i) {
|
|
207
|
+
if (C(i, Uint8Array)) {
|
|
208
|
+
const r = new Uint8Array(i);
|
|
209
|
+
return P(r.buffer, r.byteOffset, r.byteLength);
|
|
210
|
+
}
|
|
211
|
+
return A(i);
|
|
212
|
+
}
|
|
213
|
+
function P(i, r, t) {
|
|
214
|
+
if (r < 0 || i.byteLength < r)
|
|
215
|
+
throw new RangeError('"offset" is outside of buffer bounds');
|
|
216
|
+
if (i.byteLength < r + (t || 0))
|
|
217
|
+
throw new RangeError('"length" is outside of buffer bounds');
|
|
218
|
+
let n;
|
|
219
|
+
return r === void 0 && t === void 0 ? n = new Uint8Array(i) : t === void 0 ? n = new Uint8Array(i, r) : n = new Uint8Array(i, r, t), Object.setPrototypeOf(n, o.prototype), n;
|
|
220
|
+
}
|
|
221
|
+
function fr(i) {
|
|
222
|
+
if (o.isBuffer(i)) {
|
|
223
|
+
const r = G(i.length) | 0, t = p(r);
|
|
224
|
+
return t.length === 0 || i.copy(t, 0, 0, r), t;
|
|
225
|
+
}
|
|
226
|
+
if (i.length !== void 0)
|
|
227
|
+
return typeof i.length != "number" || q(i.length) ? p(0) : A(i);
|
|
228
|
+
if (i.type === "Buffer" && Array.isArray(i.data))
|
|
229
|
+
return A(i.data);
|
|
230
|
+
}
|
|
231
|
+
function G(i) {
|
|
232
|
+
if (i >= y)
|
|
233
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + y.toString(16) + " bytes");
|
|
234
|
+
return i | 0;
|
|
235
|
+
}
|
|
236
|
+
function cr(i) {
|
|
237
|
+
return +i != i && (i = 0), o.alloc(+i);
|
|
238
|
+
}
|
|
239
|
+
o.isBuffer = function(r) {
|
|
240
|
+
return r != null && r._isBuffer === !0 && r !== o.prototype;
|
|
241
|
+
}, o.compare = function(r, t) {
|
|
242
|
+
if (C(r, Uint8Array) && (r = o.from(r, r.offset, r.byteLength)), C(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(r) || !o.isBuffer(t))
|
|
243
|
+
throw new TypeError(
|
|
244
|
+
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
245
|
+
);
|
|
246
|
+
if (r === t) return 0;
|
|
247
|
+
let n = r.length, e = t.length;
|
|
248
|
+
for (let u = 0, h = Math.min(n, e); u < h; ++u)
|
|
249
|
+
if (r[u] !== t[u]) {
|
|
250
|
+
n = r[u], e = t[u];
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
return n < e ? -1 : e < n ? 1 : 0;
|
|
254
|
+
}, o.isEncoding = function(r) {
|
|
255
|
+
switch (String(r).toLowerCase()) {
|
|
256
|
+
case "hex":
|
|
257
|
+
case "utf8":
|
|
258
|
+
case "utf-8":
|
|
259
|
+
case "ascii":
|
|
260
|
+
case "latin1":
|
|
261
|
+
case "binary":
|
|
262
|
+
case "base64":
|
|
263
|
+
case "ucs2":
|
|
264
|
+
case "ucs-2":
|
|
265
|
+
case "utf16le":
|
|
266
|
+
case "utf-16le":
|
|
267
|
+
return !0;
|
|
268
|
+
default:
|
|
269
|
+
return !1;
|
|
270
|
+
}
|
|
271
|
+
}, o.concat = function(r, t) {
|
|
272
|
+
if (!Array.isArray(r))
|
|
273
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
274
|
+
if (r.length === 0)
|
|
275
|
+
return o.alloc(0);
|
|
276
|
+
let n;
|
|
277
|
+
if (t === void 0)
|
|
278
|
+
for (t = 0, n = 0; n < r.length; ++n)
|
|
279
|
+
t += r[n].length;
|
|
280
|
+
const e = o.allocUnsafe(t);
|
|
281
|
+
let u = 0;
|
|
282
|
+
for (n = 0; n < r.length; ++n) {
|
|
283
|
+
let h = r[n];
|
|
284
|
+
if (C(h, Uint8Array))
|
|
285
|
+
u + h.length > e.length ? (o.isBuffer(h) || (h = o.from(h)), h.copy(e, u)) : Uint8Array.prototype.set.call(
|
|
286
|
+
e,
|
|
287
|
+
h,
|
|
288
|
+
u
|
|
289
|
+
);
|
|
290
|
+
else if (o.isBuffer(h))
|
|
291
|
+
h.copy(e, u);
|
|
292
|
+
else
|
|
293
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
294
|
+
u += h.length;
|
|
295
|
+
}
|
|
296
|
+
return e;
|
|
297
|
+
};
|
|
298
|
+
function X(i, r) {
|
|
299
|
+
if (o.isBuffer(i))
|
|
300
|
+
return i.length;
|
|
301
|
+
if (ArrayBuffer.isView(i) || C(i, ArrayBuffer))
|
|
302
|
+
return i.byteLength;
|
|
303
|
+
if (typeof i != "string")
|
|
304
|
+
throw new TypeError(
|
|
305
|
+
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
|
|
306
|
+
);
|
|
307
|
+
const t = i.length, n = arguments.length > 2 && arguments[2] === !0;
|
|
308
|
+
if (!n && t === 0) return 0;
|
|
309
|
+
let e = !1;
|
|
310
|
+
for (; ; )
|
|
311
|
+
switch (r) {
|
|
312
|
+
case "ascii":
|
|
313
|
+
case "latin1":
|
|
314
|
+
case "binary":
|
|
315
|
+
return t;
|
|
316
|
+
case "utf8":
|
|
317
|
+
case "utf-8":
|
|
318
|
+
return W(i).length;
|
|
319
|
+
case "ucs2":
|
|
320
|
+
case "ucs-2":
|
|
321
|
+
case "utf16le":
|
|
322
|
+
case "utf-16le":
|
|
323
|
+
return t * 2;
|
|
324
|
+
case "hex":
|
|
325
|
+
return t >>> 1;
|
|
326
|
+
case "base64":
|
|
327
|
+
return or(i).length;
|
|
328
|
+
default:
|
|
329
|
+
if (e)
|
|
330
|
+
return n ? -1 : W(i).length;
|
|
331
|
+
r = ("" + r).toLowerCase(), e = !0;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
o.byteLength = X;
|
|
335
|
+
function pr(i, r, t) {
|
|
336
|
+
let n = !1;
|
|
337
|
+
if ((r === void 0 || r < 0) && (r = 0), r > this.length || ((t === void 0 || t > this.length) && (t = this.length), t <= 0) || (t >>>= 0, r >>>= 0, t <= r))
|
|
338
|
+
return "";
|
|
339
|
+
for (i || (i = "utf8"); ; )
|
|
340
|
+
switch (i) {
|
|
341
|
+
case "hex":
|
|
342
|
+
return gr(this, r, t);
|
|
343
|
+
case "utf8":
|
|
344
|
+
case "utf-8":
|
|
345
|
+
return K(this, r, t);
|
|
346
|
+
case "ascii":
|
|
347
|
+
return Er(this, r, t);
|
|
348
|
+
case "latin1":
|
|
349
|
+
case "binary":
|
|
350
|
+
return dr(this, r, t);
|
|
351
|
+
case "base64":
|
|
352
|
+
return xr(this, r, t);
|
|
353
|
+
case "ucs2":
|
|
354
|
+
case "ucs-2":
|
|
355
|
+
case "utf16le":
|
|
356
|
+
case "utf-16le":
|
|
357
|
+
return mr(this, r, t);
|
|
358
|
+
default:
|
|
359
|
+
if (n) throw new TypeError("Unknown encoding: " + i);
|
|
360
|
+
i = (i + "").toLowerCase(), n = !0;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
o.prototype._isBuffer = !0;
|
|
364
|
+
function b(i, r, t) {
|
|
365
|
+
const n = i[r];
|
|
366
|
+
i[r] = i[t], i[t] = n;
|
|
367
|
+
}
|
|
368
|
+
o.prototype.swap16 = function() {
|
|
369
|
+
const r = this.length;
|
|
370
|
+
if (r % 2 !== 0)
|
|
371
|
+
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
372
|
+
for (let t = 0; t < r; t += 2)
|
|
373
|
+
b(this, t, t + 1);
|
|
374
|
+
return this;
|
|
375
|
+
}, o.prototype.swap32 = function() {
|
|
376
|
+
const r = this.length;
|
|
377
|
+
if (r % 4 !== 0)
|
|
378
|
+
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
379
|
+
for (let t = 0; t < r; t += 4)
|
|
380
|
+
b(this, t, t + 3), b(this, t + 1, t + 2);
|
|
381
|
+
return this;
|
|
382
|
+
}, o.prototype.swap64 = function() {
|
|
383
|
+
const r = this.length;
|
|
384
|
+
if (r % 8 !== 0)
|
|
385
|
+
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
386
|
+
for (let t = 0; t < r; t += 8)
|
|
387
|
+
b(this, t, t + 7), b(this, t + 1, t + 6), b(this, t + 2, t + 5), b(this, t + 3, t + 4);
|
|
388
|
+
return this;
|
|
389
|
+
}, o.prototype.toString = function() {
|
|
390
|
+
const r = this.length;
|
|
391
|
+
return r === 0 ? "" : arguments.length === 0 ? K(this, 0, r) : pr.apply(this, arguments);
|
|
392
|
+
}, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(r) {
|
|
393
|
+
if (!o.isBuffer(r)) throw new TypeError("Argument must be a Buffer");
|
|
394
|
+
return this === r ? !0 : o.compare(this, r) === 0;
|
|
395
|
+
}, o.prototype.inspect = function() {
|
|
396
|
+
let r = "";
|
|
397
|
+
const t = c.INSPECT_MAX_BYTES;
|
|
398
|
+
return r = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (r += " ... "), "<Buffer " + r + ">";
|
|
399
|
+
}, w && (o.prototype[w] = o.prototype.inspect), o.prototype.compare = function(r, t, n, e, u) {
|
|
400
|
+
if (C(r, Uint8Array) && (r = o.from(r, r.offset, r.byteLength)), !o.isBuffer(r))
|
|
401
|
+
throw new TypeError(
|
|
402
|
+
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r
|
|
403
|
+
);
|
|
404
|
+
if (t === void 0 && (t = 0), n === void 0 && (n = r ? r.length : 0), e === void 0 && (e = 0), u === void 0 && (u = this.length), t < 0 || n > r.length || e < 0 || u > this.length)
|
|
405
|
+
throw new RangeError("out of range index");
|
|
406
|
+
if (e >= u && t >= n)
|
|
407
|
+
return 0;
|
|
408
|
+
if (e >= u)
|
|
409
|
+
return -1;
|
|
410
|
+
if (t >= n)
|
|
411
|
+
return 1;
|
|
412
|
+
if (t >>>= 0, n >>>= 0, e >>>= 0, u >>>= 0, this === r) return 0;
|
|
413
|
+
let h = u - e, a = n - t;
|
|
414
|
+
const d = Math.min(h, a), E = this.slice(e, u), g = r.slice(t, n);
|
|
415
|
+
for (let x = 0; x < d; ++x)
|
|
416
|
+
if (E[x] !== g[x]) {
|
|
417
|
+
h = E[x], a = g[x];
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
return h < a ? -1 : a < h ? 1 : 0;
|
|
421
|
+
};
|
|
422
|
+
function z(i, r, t, n, e) {
|
|
423
|
+
if (i.length === 0) return -1;
|
|
424
|
+
if (typeof t == "string" ? (n = t, t = 0) : t > 2147483647 ? t = 2147483647 : t < -2147483648 && (t = -2147483648), t = +t, q(t) && (t = e ? 0 : i.length - 1), t < 0 && (t = i.length + t), t >= i.length) {
|
|
425
|
+
if (e) return -1;
|
|
426
|
+
t = i.length - 1;
|
|
427
|
+
} else if (t < 0)
|
|
428
|
+
if (e) t = 0;
|
|
429
|
+
else return -1;
|
|
430
|
+
if (typeof r == "string" && (r = o.from(r, n)), o.isBuffer(r))
|
|
431
|
+
return r.length === 0 ? -1 : J(i, r, t, n, e);
|
|
432
|
+
if (typeof r == "number")
|
|
433
|
+
return r = r & 255, typeof Uint8Array.prototype.indexOf == "function" ? e ? Uint8Array.prototype.indexOf.call(i, r, t) : Uint8Array.prototype.lastIndexOf.call(i, r, t) : J(i, [r], t, n, e);
|
|
434
|
+
throw new TypeError("val must be string, number or Buffer");
|
|
435
|
+
}
|
|
436
|
+
function J(i, r, t, n, e) {
|
|
437
|
+
let u = 1, h = i.length, a = r.length;
|
|
438
|
+
if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
|
|
439
|
+
if (i.length < 2 || r.length < 2)
|
|
440
|
+
return -1;
|
|
441
|
+
u = 2, h /= 2, a /= 2, t /= 2;
|
|
442
|
+
}
|
|
443
|
+
function d(g, x) {
|
|
444
|
+
return u === 1 ? g[x] : g.readUInt16BE(x * u);
|
|
445
|
+
}
|
|
446
|
+
let E;
|
|
447
|
+
if (e) {
|
|
448
|
+
let g = -1;
|
|
449
|
+
for (E = t; E < h; E++)
|
|
450
|
+
if (d(i, E) === d(r, g === -1 ? 0 : E - g)) {
|
|
451
|
+
if (g === -1 && (g = E), E - g + 1 === a) return g * u;
|
|
452
|
+
} else
|
|
453
|
+
g !== -1 && (E -= E - g), g = -1;
|
|
454
|
+
} else
|
|
455
|
+
for (t + a > h && (t = h - a), E = t; E >= 0; E--) {
|
|
456
|
+
let g = !0;
|
|
457
|
+
for (let x = 0; x < a; x++)
|
|
458
|
+
if (d(i, E + x) !== d(r, x)) {
|
|
459
|
+
g = !1;
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
if (g) return E;
|
|
463
|
+
}
|
|
464
|
+
return -1;
|
|
465
|
+
}
|
|
466
|
+
o.prototype.includes = function(r, t, n) {
|
|
467
|
+
return this.indexOf(r, t, n) !== -1;
|
|
468
|
+
}, o.prototype.indexOf = function(r, t, n) {
|
|
469
|
+
return z(this, r, t, n, !0);
|
|
470
|
+
}, o.prototype.lastIndexOf = function(r, t, n) {
|
|
471
|
+
return z(this, r, t, n, !1);
|
|
472
|
+
};
|
|
473
|
+
function sr(i, r, t, n) {
|
|
474
|
+
t = Number(t) || 0;
|
|
475
|
+
const e = i.length - t;
|
|
476
|
+
n ? (n = Number(n), n > e && (n = e)) : n = e;
|
|
477
|
+
const u = r.length;
|
|
478
|
+
n > u / 2 && (n = u / 2);
|
|
479
|
+
let h;
|
|
480
|
+
for (h = 0; h < n; ++h) {
|
|
481
|
+
const a = parseInt(r.substr(h * 2, 2), 16);
|
|
482
|
+
if (q(a)) return h;
|
|
483
|
+
i[t + h] = a;
|
|
484
|
+
}
|
|
485
|
+
return h;
|
|
486
|
+
}
|
|
487
|
+
function lr(i, r, t, n) {
|
|
488
|
+
return O(W(r, i.length - t), i, t, n);
|
|
489
|
+
}
|
|
490
|
+
function ar(i, r, t, n) {
|
|
491
|
+
return O(Ur(r), i, t, n);
|
|
492
|
+
}
|
|
493
|
+
function yr(i, r, t, n) {
|
|
494
|
+
return O(or(r), i, t, n);
|
|
495
|
+
}
|
|
496
|
+
function wr(i, r, t, n) {
|
|
497
|
+
return O(Rr(r, i.length - t), i, t, n);
|
|
498
|
+
}
|
|
499
|
+
o.prototype.write = function(r, t, n, e) {
|
|
500
|
+
if (t === void 0)
|
|
501
|
+
e = "utf8", n = this.length, t = 0;
|
|
502
|
+
else if (n === void 0 && typeof t == "string")
|
|
503
|
+
e = t, n = this.length, t = 0;
|
|
504
|
+
else if (isFinite(t))
|
|
505
|
+
t = t >>> 0, isFinite(n) ? (n = n >>> 0, e === void 0 && (e = "utf8")) : (e = n, n = void 0);
|
|
506
|
+
else
|
|
507
|
+
throw new Error(
|
|
508
|
+
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
509
|
+
);
|
|
510
|
+
const u = this.length - t;
|
|
511
|
+
if ((n === void 0 || n > u) && (n = u), r.length > 0 && (n < 0 || t < 0) || t > this.length)
|
|
512
|
+
throw new RangeError("Attempt to write outside buffer bounds");
|
|
513
|
+
e || (e = "utf8");
|
|
514
|
+
let h = !1;
|
|
515
|
+
for (; ; )
|
|
516
|
+
switch (e) {
|
|
517
|
+
case "hex":
|
|
518
|
+
return sr(this, r, t, n);
|
|
519
|
+
case "utf8":
|
|
520
|
+
case "utf-8":
|
|
521
|
+
return lr(this, r, t, n);
|
|
522
|
+
case "ascii":
|
|
523
|
+
case "latin1":
|
|
524
|
+
case "binary":
|
|
525
|
+
return ar(this, r, t, n);
|
|
526
|
+
case "base64":
|
|
527
|
+
return yr(this, r, t, n);
|
|
528
|
+
case "ucs2":
|
|
529
|
+
case "ucs-2":
|
|
530
|
+
case "utf16le":
|
|
531
|
+
case "utf-16le":
|
|
532
|
+
return wr(this, r, t, n);
|
|
533
|
+
default:
|
|
534
|
+
if (h) throw new TypeError("Unknown encoding: " + e);
|
|
535
|
+
e = ("" + e).toLowerCase(), h = !0;
|
|
536
|
+
}
|
|
537
|
+
}, o.prototype.toJSON = function() {
|
|
538
|
+
return {
|
|
539
|
+
type: "Buffer",
|
|
540
|
+
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
function xr(i, r, t) {
|
|
544
|
+
return r === 0 && t === i.length ? f.fromByteArray(i) : f.fromByteArray(i.slice(r, t));
|
|
545
|
+
}
|
|
546
|
+
function K(i, r, t) {
|
|
547
|
+
t = Math.min(i.length, t);
|
|
548
|
+
const n = [];
|
|
549
|
+
let e = r;
|
|
550
|
+
for (; e < t; ) {
|
|
551
|
+
const u = i[e];
|
|
552
|
+
let h = null, a = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
|
|
553
|
+
if (e + a <= t) {
|
|
554
|
+
let d, E, g, x;
|
|
555
|
+
switch (a) {
|
|
556
|
+
case 1:
|
|
557
|
+
u < 128 && (h = u);
|
|
558
|
+
break;
|
|
559
|
+
case 2:
|
|
560
|
+
d = i[e + 1], (d & 192) === 128 && (x = (u & 31) << 6 | d & 63, x > 127 && (h = x));
|
|
561
|
+
break;
|
|
562
|
+
case 3:
|
|
563
|
+
d = i[e + 1], E = i[e + 2], (d & 192) === 128 && (E & 192) === 128 && (x = (u & 15) << 12 | (d & 63) << 6 | E & 63, x > 2047 && (x < 55296 || x > 57343) && (h = x));
|
|
564
|
+
break;
|
|
565
|
+
case 4:
|
|
566
|
+
d = i[e + 1], E = i[e + 2], g = i[e + 3], (d & 192) === 128 && (E & 192) === 128 && (g & 192) === 128 && (x = (u & 15) << 18 | (d & 63) << 12 | (E & 63) << 6 | g & 63, x > 65535 && x < 1114112 && (h = x));
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
h === null ? (h = 65533, a = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), n.push(h), e += a;
|
|
570
|
+
}
|
|
571
|
+
return Br(n);
|
|
572
|
+
}
|
|
573
|
+
const Z = 4096;
|
|
574
|
+
function Br(i) {
|
|
575
|
+
const r = i.length;
|
|
576
|
+
if (r <= Z)
|
|
577
|
+
return String.fromCharCode.apply(String, i);
|
|
578
|
+
let t = "", n = 0;
|
|
579
|
+
for (; n < r; )
|
|
580
|
+
t += String.fromCharCode.apply(
|
|
581
|
+
String,
|
|
582
|
+
i.slice(n, n += Z)
|
|
583
|
+
);
|
|
584
|
+
return t;
|
|
585
|
+
}
|
|
586
|
+
function Er(i, r, t) {
|
|
587
|
+
let n = "";
|
|
588
|
+
t = Math.min(i.length, t);
|
|
589
|
+
for (let e = r; e < t; ++e)
|
|
590
|
+
n += String.fromCharCode(i[e] & 127);
|
|
591
|
+
return n;
|
|
592
|
+
}
|
|
593
|
+
function dr(i, r, t) {
|
|
594
|
+
let n = "";
|
|
595
|
+
t = Math.min(i.length, t);
|
|
596
|
+
for (let e = r; e < t; ++e)
|
|
597
|
+
n += String.fromCharCode(i[e]);
|
|
598
|
+
return n;
|
|
599
|
+
}
|
|
600
|
+
function gr(i, r, t) {
|
|
601
|
+
const n = i.length;
|
|
602
|
+
(!r || r < 0) && (r = 0), (!t || t < 0 || t > n) && (t = n);
|
|
603
|
+
let e = "";
|
|
604
|
+
for (let u = r; u < t; ++u)
|
|
605
|
+
e += Tr[i[u]];
|
|
606
|
+
return e;
|
|
607
|
+
}
|
|
608
|
+
function mr(i, r, t) {
|
|
609
|
+
const n = i.slice(r, t);
|
|
610
|
+
let e = "";
|
|
611
|
+
for (let u = 0; u < n.length - 1; u += 2)
|
|
612
|
+
e += String.fromCharCode(n[u] + n[u + 1] * 256);
|
|
613
|
+
return e;
|
|
614
|
+
}
|
|
615
|
+
o.prototype.slice = function(r, t) {
|
|
616
|
+
const n = this.length;
|
|
617
|
+
r = ~~r, t = t === void 0 ? n : ~~t, r < 0 ? (r += n, r < 0 && (r = 0)) : r > n && (r = n), t < 0 ? (t += n, t < 0 && (t = 0)) : t > n && (t = n), t < r && (t = r);
|
|
618
|
+
const e = this.subarray(r, t);
|
|
619
|
+
return Object.setPrototypeOf(e, o.prototype), e;
|
|
620
|
+
};
|
|
621
|
+
function m(i, r, t) {
|
|
622
|
+
if (i % 1 !== 0 || i < 0) throw new RangeError("offset is not uint");
|
|
623
|
+
if (i + r > t) throw new RangeError("Trying to access beyond buffer length");
|
|
624
|
+
}
|
|
625
|
+
o.prototype.readUintLE = o.prototype.readUIntLE = function(r, t, n) {
|
|
626
|
+
r = r >>> 0, t = t >>> 0, n || m(r, t, this.length);
|
|
627
|
+
let e = this[r], u = 1, h = 0;
|
|
628
|
+
for (; ++h < t && (u *= 256); )
|
|
629
|
+
e += this[r + h] * u;
|
|
630
|
+
return e;
|
|
631
|
+
}, o.prototype.readUintBE = o.prototype.readUIntBE = function(r, t, n) {
|
|
632
|
+
r = r >>> 0, t = t >>> 0, n || m(r, t, this.length);
|
|
633
|
+
let e = this[r + --t], u = 1;
|
|
634
|
+
for (; t > 0 && (u *= 256); )
|
|
635
|
+
e += this[r + --t] * u;
|
|
636
|
+
return e;
|
|
637
|
+
}, o.prototype.readUint8 = o.prototype.readUInt8 = function(r, t) {
|
|
638
|
+
return r = r >>> 0, t || m(r, 1, this.length), this[r];
|
|
639
|
+
}, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(r, t) {
|
|
640
|
+
return r = r >>> 0, t || m(r, 2, this.length), this[r] | this[r + 1] << 8;
|
|
641
|
+
}, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(r, t) {
|
|
642
|
+
return r = r >>> 0, t || m(r, 2, this.length), this[r] << 8 | this[r + 1];
|
|
643
|
+
}, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(r, t) {
|
|
644
|
+
return r = r >>> 0, t || m(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
|
|
645
|
+
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(r, t) {
|
|
646
|
+
return r = r >>> 0, t || m(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
|
|
647
|
+
}, o.prototype.readBigUInt64LE = L(function(r) {
|
|
648
|
+
r = r >>> 0, M(r, "offset");
|
|
649
|
+
const t = this[r], n = this[r + 7];
|
|
650
|
+
(t === void 0 || n === void 0) && $(r, this.length - 8);
|
|
651
|
+
const e = t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, u = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + n * 2 ** 24;
|
|
652
|
+
return BigInt(e) + (BigInt(u) << BigInt(32));
|
|
653
|
+
}), o.prototype.readBigUInt64BE = L(function(r) {
|
|
654
|
+
r = r >>> 0, M(r, "offset");
|
|
655
|
+
const t = this[r], n = this[r + 7];
|
|
656
|
+
(t === void 0 || n === void 0) && $(r, this.length - 8);
|
|
657
|
+
const e = t * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], u = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + n;
|
|
658
|
+
return (BigInt(e) << BigInt(32)) + BigInt(u);
|
|
659
|
+
}), o.prototype.readIntLE = function(r, t, n) {
|
|
660
|
+
r = r >>> 0, t = t >>> 0, n || m(r, t, this.length);
|
|
661
|
+
let e = this[r], u = 1, h = 0;
|
|
662
|
+
for (; ++h < t && (u *= 256); )
|
|
663
|
+
e += this[r + h] * u;
|
|
664
|
+
return u *= 128, e >= u && (e -= Math.pow(2, 8 * t)), e;
|
|
665
|
+
}, o.prototype.readIntBE = function(r, t, n) {
|
|
666
|
+
r = r >>> 0, t = t >>> 0, n || m(r, t, this.length);
|
|
667
|
+
let e = t, u = 1, h = this[r + --e];
|
|
668
|
+
for (; e > 0 && (u *= 256); )
|
|
669
|
+
h += this[r + --e] * u;
|
|
670
|
+
return u *= 128, h >= u && (h -= Math.pow(2, 8 * t)), h;
|
|
671
|
+
}, o.prototype.readInt8 = function(r, t) {
|
|
672
|
+
return r = r >>> 0, t || m(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
|
|
673
|
+
}, o.prototype.readInt16LE = function(r, t) {
|
|
674
|
+
r = r >>> 0, t || m(r, 2, this.length);
|
|
675
|
+
const n = this[r] | this[r + 1] << 8;
|
|
676
|
+
return n & 32768 ? n | 4294901760 : n;
|
|
677
|
+
}, o.prototype.readInt16BE = function(r, t) {
|
|
678
|
+
r = r >>> 0, t || m(r, 2, this.length);
|
|
679
|
+
const n = this[r + 1] | this[r] << 8;
|
|
680
|
+
return n & 32768 ? n | 4294901760 : n;
|
|
681
|
+
}, o.prototype.readInt32LE = function(r, t) {
|
|
682
|
+
return r = r >>> 0, t || m(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
|
|
683
|
+
}, o.prototype.readInt32BE = function(r, t) {
|
|
684
|
+
return r = r >>> 0, t || m(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
|
|
685
|
+
}, o.prototype.readBigInt64LE = L(function(r) {
|
|
686
|
+
r = r >>> 0, M(r, "offset");
|
|
687
|
+
const t = this[r], n = this[r + 7];
|
|
688
|
+
(t === void 0 || n === void 0) && $(r, this.length - 8);
|
|
689
|
+
const e = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (n << 24);
|
|
690
|
+
return (BigInt(e) << BigInt(32)) + BigInt(t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
|
|
691
|
+
}), o.prototype.readBigInt64BE = L(function(r) {
|
|
692
|
+
r = r >>> 0, M(r, "offset");
|
|
693
|
+
const t = this[r], n = this[r + 7];
|
|
694
|
+
(t === void 0 || n === void 0) && $(r, this.length - 8);
|
|
695
|
+
const e = (t << 24) + // Overflow
|
|
696
|
+
this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
|
|
697
|
+
return (BigInt(e) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + n);
|
|
698
|
+
}), o.prototype.readFloatLE = function(r, t) {
|
|
699
|
+
return r = r >>> 0, t || m(r, 4, this.length), s.read(this, r, !0, 23, 4);
|
|
700
|
+
}, o.prototype.readFloatBE = function(r, t) {
|
|
701
|
+
return r = r >>> 0, t || m(r, 4, this.length), s.read(this, r, !1, 23, 4);
|
|
702
|
+
}, o.prototype.readDoubleLE = function(r, t) {
|
|
703
|
+
return r = r >>> 0, t || m(r, 8, this.length), s.read(this, r, !0, 52, 8);
|
|
704
|
+
}, o.prototype.readDoubleBE = function(r, t) {
|
|
705
|
+
return r = r >>> 0, t || m(r, 8, this.length), s.read(this, r, !1, 52, 8);
|
|
706
|
+
};
|
|
707
|
+
function U(i, r, t, n, e, u) {
|
|
708
|
+
if (!o.isBuffer(i)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
709
|
+
if (r > e || r < u) throw new RangeError('"value" argument is out of bounds');
|
|
710
|
+
if (t + n > i.length) throw new RangeError("Index out of range");
|
|
711
|
+
}
|
|
712
|
+
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(r, t, n, e) {
|
|
713
|
+
if (r = +r, t = t >>> 0, n = n >>> 0, !e) {
|
|
714
|
+
const a = Math.pow(2, 8 * n) - 1;
|
|
715
|
+
U(this, r, t, n, a, 0);
|
|
716
|
+
}
|
|
717
|
+
let u = 1, h = 0;
|
|
718
|
+
for (this[t] = r & 255; ++h < n && (u *= 256); )
|
|
719
|
+
this[t + h] = r / u & 255;
|
|
720
|
+
return t + n;
|
|
721
|
+
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(r, t, n, e) {
|
|
722
|
+
if (r = +r, t = t >>> 0, n = n >>> 0, !e) {
|
|
723
|
+
const a = Math.pow(2, 8 * n) - 1;
|
|
724
|
+
U(this, r, t, n, a, 0);
|
|
725
|
+
}
|
|
726
|
+
let u = n - 1, h = 1;
|
|
727
|
+
for (this[t + u] = r & 255; --u >= 0 && (h *= 256); )
|
|
728
|
+
this[t + u] = r / h & 255;
|
|
729
|
+
return t + n;
|
|
730
|
+
}, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(r, t, n) {
|
|
731
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 1, 255, 0), this[t] = r & 255, t + 1;
|
|
732
|
+
}, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(r, t, n) {
|
|
733
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 2, 65535, 0), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
|
|
734
|
+
}, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(r, t, n) {
|
|
735
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 2, 65535, 0), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
|
|
736
|
+
}, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(r, t, n) {
|
|
737
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 4, 4294967295, 0), this[t + 3] = r >>> 24, this[t + 2] = r >>> 16, this[t + 1] = r >>> 8, this[t] = r & 255, t + 4;
|
|
738
|
+
}, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(r, t, n) {
|
|
739
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 4, 4294967295, 0), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
|
|
740
|
+
};
|
|
741
|
+
function Q(i, r, t, n, e) {
|
|
742
|
+
er(r, n, e, i, t, 7);
|
|
743
|
+
let u = Number(r & BigInt(4294967295));
|
|
744
|
+
i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u;
|
|
745
|
+
let h = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
746
|
+
return i[t++] = h, h = h >> 8, i[t++] = h, h = h >> 8, i[t++] = h, h = h >> 8, i[t++] = h, t;
|
|
747
|
+
}
|
|
748
|
+
function v(i, r, t, n, e) {
|
|
749
|
+
er(r, n, e, i, t, 7);
|
|
750
|
+
let u = Number(r & BigInt(4294967295));
|
|
751
|
+
i[t + 7] = u, u = u >> 8, i[t + 6] = u, u = u >> 8, i[t + 5] = u, u = u >> 8, i[t + 4] = u;
|
|
752
|
+
let h = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
753
|
+
return i[t + 3] = h, h = h >> 8, i[t + 2] = h, h = h >> 8, i[t + 1] = h, h = h >> 8, i[t] = h, t + 8;
|
|
754
|
+
}
|
|
755
|
+
o.prototype.writeBigUInt64LE = L(function(r, t = 0) {
|
|
756
|
+
return Q(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
757
|
+
}), o.prototype.writeBigUInt64BE = L(function(r, t = 0) {
|
|
758
|
+
return v(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
759
|
+
}), o.prototype.writeIntLE = function(r, t, n, e) {
|
|
760
|
+
if (r = +r, t = t >>> 0, !e) {
|
|
761
|
+
const d = Math.pow(2, 8 * n - 1);
|
|
762
|
+
U(this, r, t, n, d - 1, -d);
|
|
763
|
+
}
|
|
764
|
+
let u = 0, h = 1, a = 0;
|
|
765
|
+
for (this[t] = r & 255; ++u < n && (h *= 256); )
|
|
766
|
+
r < 0 && a === 0 && this[t + u - 1] !== 0 && (a = 1), this[t + u] = (r / h >> 0) - a & 255;
|
|
767
|
+
return t + n;
|
|
768
|
+
}, o.prototype.writeIntBE = function(r, t, n, e) {
|
|
769
|
+
if (r = +r, t = t >>> 0, !e) {
|
|
770
|
+
const d = Math.pow(2, 8 * n - 1);
|
|
771
|
+
U(this, r, t, n, d - 1, -d);
|
|
772
|
+
}
|
|
773
|
+
let u = n - 1, h = 1, a = 0;
|
|
774
|
+
for (this[t + u] = r & 255; --u >= 0 && (h *= 256); )
|
|
775
|
+
r < 0 && a === 0 && this[t + u + 1] !== 0 && (a = 1), this[t + u] = (r / h >> 0) - a & 255;
|
|
776
|
+
return t + n;
|
|
777
|
+
}, o.prototype.writeInt8 = function(r, t, n) {
|
|
778
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 1, 127, -128), r < 0 && (r = 255 + r + 1), this[t] = r & 255, t + 1;
|
|
779
|
+
}, o.prototype.writeInt16LE = function(r, t, n) {
|
|
780
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 2, 32767, -32768), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
|
|
781
|
+
}, o.prototype.writeInt16BE = function(r, t, n) {
|
|
782
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 2, 32767, -32768), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
|
|
783
|
+
}, o.prototype.writeInt32LE = function(r, t, n) {
|
|
784
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 4, 2147483647, -2147483648), this[t] = r & 255, this[t + 1] = r >>> 8, this[t + 2] = r >>> 16, this[t + 3] = r >>> 24, t + 4;
|
|
785
|
+
}, o.prototype.writeInt32BE = function(r, t, n) {
|
|
786
|
+
return r = +r, t = t >>> 0, n || U(this, r, t, 4, 2147483647, -2147483648), r < 0 && (r = 4294967295 + r + 1), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
|
|
787
|
+
}, o.prototype.writeBigInt64LE = L(function(r, t = 0) {
|
|
788
|
+
return Q(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
789
|
+
}), o.prototype.writeBigInt64BE = L(function(r, t = 0) {
|
|
790
|
+
return v(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
791
|
+
});
|
|
792
|
+
function rr(i, r, t, n, e, u) {
|
|
793
|
+
if (t + n > i.length) throw new RangeError("Index out of range");
|
|
794
|
+
if (t < 0) throw new RangeError("Index out of range");
|
|
795
|
+
}
|
|
796
|
+
function tr(i, r, t, n, e) {
|
|
797
|
+
return r = +r, t = t >>> 0, e || rr(i, r, t, 4), s.write(i, r, t, n, 23, 4), t + 4;
|
|
798
|
+
}
|
|
799
|
+
o.prototype.writeFloatLE = function(r, t, n) {
|
|
800
|
+
return tr(this, r, t, !0, n);
|
|
801
|
+
}, o.prototype.writeFloatBE = function(r, t, n) {
|
|
802
|
+
return tr(this, r, t, !1, n);
|
|
803
|
+
};
|
|
804
|
+
function ir(i, r, t, n, e) {
|
|
805
|
+
return r = +r, t = t >>> 0, e || rr(i, r, t, 8), s.write(i, r, t, n, 52, 8), t + 8;
|
|
806
|
+
}
|
|
807
|
+
o.prototype.writeDoubleLE = function(r, t, n) {
|
|
808
|
+
return ir(this, r, t, !0, n);
|
|
809
|
+
}, o.prototype.writeDoubleBE = function(r, t, n) {
|
|
810
|
+
return ir(this, r, t, !1, n);
|
|
811
|
+
}, o.prototype.copy = function(r, t, n, e) {
|
|
812
|
+
if (!o.isBuffer(r)) throw new TypeError("argument should be a Buffer");
|
|
813
|
+
if (n || (n = 0), !e && e !== 0 && (e = this.length), t >= r.length && (t = r.length), t || (t = 0), e > 0 && e < n && (e = n), e === n || r.length === 0 || this.length === 0) return 0;
|
|
814
|
+
if (t < 0)
|
|
815
|
+
throw new RangeError("targetStart out of bounds");
|
|
816
|
+
if (n < 0 || n >= this.length) throw new RangeError("Index out of range");
|
|
817
|
+
if (e < 0) throw new RangeError("sourceEnd out of bounds");
|
|
818
|
+
e > this.length && (e = this.length), r.length - t < e - n && (e = r.length - t + n);
|
|
819
|
+
const u = e - n;
|
|
820
|
+
return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(t, n, e) : Uint8Array.prototype.set.call(
|
|
821
|
+
r,
|
|
822
|
+
this.subarray(n, e),
|
|
823
|
+
t
|
|
824
|
+
), u;
|
|
825
|
+
}, o.prototype.fill = function(r, t, n, e) {
|
|
826
|
+
if (typeof r == "string") {
|
|
827
|
+
if (typeof t == "string" ? (e = t, t = 0, n = this.length) : typeof n == "string" && (e = n, n = this.length), e !== void 0 && typeof e != "string")
|
|
828
|
+
throw new TypeError("encoding must be a string");
|
|
829
|
+
if (typeof e == "string" && !o.isEncoding(e))
|
|
830
|
+
throw new TypeError("Unknown encoding: " + e);
|
|
831
|
+
if (r.length === 1) {
|
|
832
|
+
const h = r.charCodeAt(0);
|
|
833
|
+
(e === "utf8" && h < 128 || e === "latin1") && (r = h);
|
|
834
|
+
}
|
|
835
|
+
} else typeof r == "number" ? r = r & 255 : typeof r == "boolean" && (r = Number(r));
|
|
836
|
+
if (t < 0 || this.length < t || this.length < n)
|
|
837
|
+
throw new RangeError("Out of range index");
|
|
838
|
+
if (n <= t)
|
|
839
|
+
return this;
|
|
840
|
+
t = t >>> 0, n = n === void 0 ? this.length : n >>> 0, r || (r = 0);
|
|
841
|
+
let u;
|
|
842
|
+
if (typeof r == "number")
|
|
843
|
+
for (u = t; u < n; ++u)
|
|
844
|
+
this[u] = r;
|
|
845
|
+
else {
|
|
846
|
+
const h = o.isBuffer(r) ? r : o.from(r, e), a = h.length;
|
|
847
|
+
if (a === 0)
|
|
848
|
+
throw new TypeError('The value "' + r + '" is invalid for argument "value"');
|
|
849
|
+
for (u = 0; u < n - t; ++u)
|
|
850
|
+
this[u + t] = h[u % a];
|
|
851
|
+
}
|
|
852
|
+
return this;
|
|
853
|
+
};
|
|
854
|
+
const N = {};
|
|
855
|
+
function Y(i, r, t) {
|
|
856
|
+
N[i] = class extends t {
|
|
857
|
+
constructor() {
|
|
858
|
+
super(), Object.defineProperty(this, "message", {
|
|
859
|
+
value: r.apply(this, arguments),
|
|
860
|
+
writable: !0,
|
|
861
|
+
configurable: !0
|
|
862
|
+
}), this.name = `${this.name} [${i}]`, this.stack, delete this.name;
|
|
863
|
+
}
|
|
864
|
+
get code() {
|
|
865
|
+
return i;
|
|
866
|
+
}
|
|
867
|
+
set code(e) {
|
|
868
|
+
Object.defineProperty(this, "code", {
|
|
869
|
+
configurable: !0,
|
|
870
|
+
enumerable: !0,
|
|
871
|
+
value: e,
|
|
872
|
+
writable: !0
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
toString() {
|
|
876
|
+
return `${this.name} [${i}]: ${this.message}`;
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
Y(
|
|
881
|
+
"ERR_BUFFER_OUT_OF_BOUNDS",
|
|
882
|
+
function(i) {
|
|
883
|
+
return i ? `${i} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
884
|
+
},
|
|
885
|
+
RangeError
|
|
886
|
+
), Y(
|
|
887
|
+
"ERR_INVALID_ARG_TYPE",
|
|
888
|
+
function(i, r) {
|
|
889
|
+
return `The "${i}" argument must be of type number. Received type ${typeof r}`;
|
|
890
|
+
},
|
|
891
|
+
TypeError
|
|
892
|
+
), Y(
|
|
893
|
+
"ERR_OUT_OF_RANGE",
|
|
894
|
+
function(i, r, t) {
|
|
895
|
+
let n = `The value of "${i}" is out of range.`, e = t;
|
|
896
|
+
return Number.isInteger(t) && Math.abs(t) > 2 ** 32 ? e = nr(String(t)) : typeof t == "bigint" && (e = String(t), (t > BigInt(2) ** BigInt(32) || t < -(BigInt(2) ** BigInt(32))) && (e = nr(e)), e += "n"), n += ` It must be ${r}. Received ${e}`, n;
|
|
897
|
+
},
|
|
898
|
+
RangeError
|
|
899
|
+
);
|
|
900
|
+
function nr(i) {
|
|
901
|
+
let r = "", t = i.length;
|
|
902
|
+
const n = i[0] === "-" ? 1 : 0;
|
|
903
|
+
for (; t >= n + 4; t -= 3)
|
|
904
|
+
r = `_${i.slice(t - 3, t)}${r}`;
|
|
905
|
+
return `${i.slice(0, t)}${r}`;
|
|
906
|
+
}
|
|
907
|
+
function Ir(i, r, t) {
|
|
908
|
+
M(r, "offset"), (i[r] === void 0 || i[r + t] === void 0) && $(r, i.length - (t + 1));
|
|
909
|
+
}
|
|
910
|
+
function er(i, r, t, n, e, u) {
|
|
911
|
+
if (i > t || i < r) {
|
|
912
|
+
const h = typeof r == "bigint" ? "n" : "";
|
|
913
|
+
let a;
|
|
914
|
+
throw r === 0 || r === BigInt(0) ? a = `>= 0${h} and < 2${h} ** ${(u + 1) * 8}${h}` : a = `>= -(2${h} ** ${(u + 1) * 8 - 1}${h}) and < 2 ** ${(u + 1) * 8 - 1}${h}`, new N.ERR_OUT_OF_RANGE("value", a, i);
|
|
915
|
+
}
|
|
916
|
+
Ir(n, e, u);
|
|
917
|
+
}
|
|
918
|
+
function M(i, r) {
|
|
919
|
+
if (typeof i != "number")
|
|
920
|
+
throw new N.ERR_INVALID_ARG_TYPE(r, "number", i);
|
|
921
|
+
}
|
|
922
|
+
function $(i, r, t) {
|
|
923
|
+
throw Math.floor(i) !== i ? (M(i, t), new N.ERR_OUT_OF_RANGE("offset", "an integer", i)) : r < 0 ? new N.ERR_BUFFER_OUT_OF_BOUNDS() : new N.ERR_OUT_OF_RANGE(
|
|
924
|
+
"offset",
|
|
925
|
+
`>= 0 and <= ${r}`,
|
|
926
|
+
i
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
const Fr = /[^+/0-9A-Za-z-_]/g;
|
|
930
|
+
function Ar(i) {
|
|
931
|
+
if (i = i.split("=")[0], i = i.trim().replace(Fr, ""), i.length < 2) return "";
|
|
932
|
+
for (; i.length % 4 !== 0; )
|
|
933
|
+
i = i + "=";
|
|
934
|
+
return i;
|
|
935
|
+
}
|
|
936
|
+
function W(i, r) {
|
|
937
|
+
r = r || 1 / 0;
|
|
938
|
+
let t;
|
|
939
|
+
const n = i.length;
|
|
940
|
+
let e = null;
|
|
941
|
+
const u = [];
|
|
942
|
+
for (let h = 0; h < n; ++h) {
|
|
943
|
+
if (t = i.charCodeAt(h), t > 55295 && t < 57344) {
|
|
944
|
+
if (!e) {
|
|
945
|
+
if (t > 56319) {
|
|
946
|
+
(r -= 3) > -1 && u.push(239, 191, 189);
|
|
947
|
+
continue;
|
|
948
|
+
} else if (h + 1 === n) {
|
|
949
|
+
(r -= 3) > -1 && u.push(239, 191, 189);
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
e = t;
|
|
953
|
+
continue;
|
|
954
|
+
}
|
|
955
|
+
if (t < 56320) {
|
|
956
|
+
(r -= 3) > -1 && u.push(239, 191, 189), e = t;
|
|
957
|
+
continue;
|
|
958
|
+
}
|
|
959
|
+
t = (e - 55296 << 10 | t - 56320) + 65536;
|
|
960
|
+
} else e && (r -= 3) > -1 && u.push(239, 191, 189);
|
|
961
|
+
if (e = null, t < 128) {
|
|
962
|
+
if ((r -= 1) < 0) break;
|
|
963
|
+
u.push(t);
|
|
964
|
+
} else if (t < 2048) {
|
|
965
|
+
if ((r -= 2) < 0) break;
|
|
966
|
+
u.push(
|
|
967
|
+
t >> 6 | 192,
|
|
968
|
+
t & 63 | 128
|
|
969
|
+
);
|
|
970
|
+
} else if (t < 65536) {
|
|
971
|
+
if ((r -= 3) < 0) break;
|
|
972
|
+
u.push(
|
|
973
|
+
t >> 12 | 224,
|
|
974
|
+
t >> 6 & 63 | 128,
|
|
975
|
+
t & 63 | 128
|
|
976
|
+
);
|
|
977
|
+
} else if (t < 1114112) {
|
|
978
|
+
if ((r -= 4) < 0) break;
|
|
979
|
+
u.push(
|
|
980
|
+
t >> 18 | 240,
|
|
981
|
+
t >> 12 & 63 | 128,
|
|
982
|
+
t >> 6 & 63 | 128,
|
|
983
|
+
t & 63 | 128
|
|
984
|
+
);
|
|
985
|
+
} else
|
|
986
|
+
throw new Error("Invalid code point");
|
|
987
|
+
}
|
|
988
|
+
return u;
|
|
989
|
+
}
|
|
990
|
+
function Ur(i) {
|
|
991
|
+
const r = [];
|
|
992
|
+
for (let t = 0; t < i.length; ++t)
|
|
993
|
+
r.push(i.charCodeAt(t) & 255);
|
|
994
|
+
return r;
|
|
995
|
+
}
|
|
996
|
+
function Rr(i, r) {
|
|
997
|
+
let t, n, e;
|
|
998
|
+
const u = [];
|
|
999
|
+
for (let h = 0; h < i.length && !((r -= 2) < 0); ++h)
|
|
1000
|
+
t = i.charCodeAt(h), n = t >> 8, e = t % 256, u.push(e), u.push(n);
|
|
1001
|
+
return u;
|
|
1002
|
+
}
|
|
1003
|
+
function or(i) {
|
|
1004
|
+
return f.toByteArray(Ar(i));
|
|
1005
|
+
}
|
|
1006
|
+
function O(i, r, t, n) {
|
|
1007
|
+
let e;
|
|
1008
|
+
for (e = 0; e < n && !(e + t >= r.length || e >= i.length); ++e)
|
|
1009
|
+
r[e + t] = i[e];
|
|
1010
|
+
return e;
|
|
1011
|
+
}
|
|
1012
|
+
function C(i, r) {
|
|
1013
|
+
return i instanceof r || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === r.name;
|
|
1014
|
+
}
|
|
1015
|
+
function q(i) {
|
|
1016
|
+
return i !== i;
|
|
1017
|
+
}
|
|
1018
|
+
const Tr = function() {
|
|
1019
|
+
const i = "0123456789abcdef", r = new Array(256);
|
|
1020
|
+
for (let t = 0; t < 16; ++t) {
|
|
1021
|
+
const n = t * 16;
|
|
1022
|
+
for (let e = 0; e < 16; ++e)
|
|
1023
|
+
r[n + e] = i[t] + i[e];
|
|
1024
|
+
}
|
|
1025
|
+
return r;
|
|
1026
|
+
}();
|
|
1027
|
+
function L(i) {
|
|
1028
|
+
return typeof BigInt > "u" ? Cr : i;
|
|
1029
|
+
}
|
|
1030
|
+
function Cr() {
|
|
1031
|
+
throw new Error("BigInt not supported");
|
|
1032
|
+
}
|
|
1033
|
+
})(ur);
|
|
1034
|
+
const Or = /* @__PURE__ */ _r({
|
|
1035
|
+
__proto__: null
|
|
1036
|
+
}, [ur]);
|
|
1037
|
+
export {
|
|
1038
|
+
Or as i
|
|
1039
|
+
};
|
|
1040
|
+
//# sourceMappingURL=index-cA_PmnZy.js.map
|