@glodon-aiot/agent-cli-sdk 2.4.7

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