@opencloud-eu/web-client 5.1.0 → 6.1.0

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