@automerge/automerge-repo-react-hooks 2.0.0-alpha.2 → 2.0.0-alpha.4

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 (2) hide show
  1. package/dist/index.js +879 -842
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,29 +1,29 @@
1
- import lr, { createContext as ur, useContext as hr, useRef as Pt, useState as Vt, useEffect as Ce, useCallback as dr, useMemo as yr } from "react";
2
- const pr = ur(null);
3
- function dt() {
4
- const e = hr(pr);
1
+ import hr, { createContext as dr, useContext as yr, useRef as Nt, useState as $t, useEffect as _e, useCallback as pr, useMemo as br } from "react";
2
+ const gr = dr(null);
3
+ function bt() {
4
+ const e = yr(gr);
5
5
  if (!e) throw new Error("Repo was not found on RepoContext.");
6
6
  return e;
7
7
  }
8
- function Fn(e) {
9
- const t = dt(), r = e ? t.find(e) : null, n = Pt(r);
8
+ function jn(e) {
9
+ const t = bt(), r = e ? t.find(e) : null, n = Nt(r);
10
10
  r !== n.current && (n.current = r);
11
- const [, s] = Vt(0), o = () => s((c) => c + 1);
12
- Ce(() => !e || !r ? void 0 : (n.current = r, r.doc().then(() => {
11
+ const [, s] = $t(0), o = () => s((c) => c + 1);
12
+ _e(() => !e || !r ? void 0 : (n.current = r, r.doc().then(() => {
13
13
  o();
14
- }).catch((a) => console.error(a)), r.on("change", o), r.on("delete", o), () => {
14
+ }).catch((f) => console.error(f)), r.on("change", o), r.on("delete", o), () => {
15
15
  r.removeListener("change", o), r.removeListener("delete", o);
16
16
  }), [e, r]);
17
- const i = dr(
18
- (c, a) => {
19
- r && r.change(c, a);
17
+ const i = pr(
18
+ (c, f) => {
19
+ r && r.change(c, f);
20
20
  },
21
21
  [r]
22
22
  );
23
23
  return [r?.docSync(), i];
24
24
  }
25
- const ye = Symbol.for("_am_meta"), Ee = Symbol.for("_am_trace"), _e = Symbol.for("_am_objectId"), yt = Symbol.for("_am_isProxy"), Nt = Symbol.for("_am_clearCache"), br = Symbol.for("_am_uint"), gr = Symbol.for("_am_int"), xr = Symbol.for("_am_f64"), Ht = Symbol.for("_am_counter"), wr = Symbol.for("_am_text");
26
- class pe {
25
+ const pe = Symbol.for("_am_meta"), Oe = Symbol.for("_am_trace"), Ie = Symbol.for("_am_objectId"), gt = Symbol.for("_am_isProxy"), zt = Symbol.for("_am_clearCache"), xr = Symbol.for("_am_uint"), wr = Symbol.for("_am_int"), mr = Symbol.for("_am_f64"), Ht = Symbol.for("_am_counter"), Sr = Symbol.for("_am_text");
26
+ class be {
27
27
  constructor(t) {
28
28
  if (typeof t == "string")
29
29
  this.elems = [...t];
@@ -33,7 +33,7 @@ class pe {
33
33
  this.elems = [];
34
34
  else
35
35
  throw new TypeError(`Unsupported initial value for Text: ${t}`);
36
- Reflect.defineProperty(this, wr, { value: !0 });
36
+ Reflect.defineProperty(this, Sr, { value: !0 });
37
37
  }
38
38
  get length() {
39
39
  return this.elems.length;
@@ -95,7 +95,7 @@ class pe {
95
95
  * Updates the list item at position `index` to a new value `value`.
96
96
  */
97
97
  set(t, r) {
98
- if (this[ye])
98
+ if (this[pe])
99
99
  throw new RangeError("object cannot be modified outside of a change block");
100
100
  this.elems[t] = r;
101
101
  }
@@ -103,7 +103,7 @@ class pe {
103
103
  * Inserts new list items `values` starting at position `index`.
104
104
  */
105
105
  insertAt(t, ...r) {
106
- if (this[ye])
106
+ if (this[pe])
107
107
  throw new RangeError("object cannot be modified outside of a change block");
108
108
  r.every((n) => typeof n == "string") ? this.elems.splice(t, 0, ...r.join("")) : this.elems.splice(t, 0, ...r);
109
109
  }
@@ -112,7 +112,7 @@ class pe {
112
112
  * if `numDelete` is not given, one item is deleted.
113
113
  */
114
114
  deleteAt(t, r = 1) {
115
- if (this[ye])
115
+ if (this[pe])
116
116
  throw new RangeError("object cannot be modified outside of a change block");
117
117
  this.elems.splice(t, r);
118
118
  }
@@ -123,13 +123,13 @@ class pe {
123
123
  this.elems.lastIndexOf(t, r);
124
124
  }
125
125
  concat(t) {
126
- return new pe(this.elems.concat(t.elems));
126
+ return new be(this.elems.concat(t.elems));
127
127
  }
128
128
  every(t) {
129
129
  return this.elems.every(t);
130
130
  }
131
131
  filter(t) {
132
- return new pe(this.elems.filter(t));
132
+ return new be(this.elems.filter(t));
133
133
  }
134
134
  find(t) {
135
135
  return this.elems.find(t);
@@ -156,7 +156,7 @@ class pe {
156
156
  this.elems.reduceRight(t);
157
157
  }
158
158
  slice(t, r) {
159
- return new pe(this.elems.slice(t, r));
159
+ return new be(this.elems.slice(t, r));
160
160
  }
161
161
  some(t) {
162
162
  return this.elems.some(t);
@@ -165,7 +165,7 @@ class pe {
165
165
  this.toString();
166
166
  }
167
167
  }
168
- class mr {
168
+ class vr {
169
169
  constructor(t) {
170
170
  this.value = t || 0, Reflect.defineProperty(this, Ht, { value: !0 });
171
171
  }
@@ -214,7 +214,7 @@ class mr {
214
214
  throw new Error("Counters should not be decremented outside of a change callback");
215
215
  }
216
216
  }
217
- class vr extends mr {
217
+ class Ar extends vr {
218
218
  constructor(t, r, n, s, o) {
219
219
  super(t), this.context = r, this.path = n, this.objectId = s, this.key = o;
220
220
  }
@@ -233,10 +233,10 @@ class vr extends mr {
233
233
  return this.increment(typeof t == "number" ? -t : -1);
234
234
  }
235
235
  }
236
- function Sr(e, t, r, n, s) {
237
- return new vr(e, t, r, n, s);
236
+ function Cr(e, t, r, n, s) {
237
+ return new Ar(e, t, r, n, s);
238
238
  }
239
- class Ar {
239
+ class Er {
240
240
  constructor(t) {
241
241
  this.val = t;
242
242
  }
@@ -261,60 +261,60 @@ function re(e, t) {
261
261
  const { context: r, objectId: n, path: s, textV2: o } = e, i = r.getWithType(n, t);
262
262
  if (i === null)
263
263
  return;
264
- const c = i[0], a = i[1];
264
+ const c = i[0], f = i[1];
265
265
  switch (c) {
266
266
  case void 0:
267
267
  return;
268
268
  case "map":
269
- return He(r, a, o, [...s, t]);
269
+ return He(r, f, o, [...s, t]);
270
270
  case "list":
271
- return $e(r, a, o, [...s, t]);
271
+ return Ke(r, f, o, [...s, t]);
272
272
  case "text":
273
- return o ? r.text(a) : Oe(r, a, [
273
+ return o ? r.text(f) : Ue(r, f, [
274
274
  ...s,
275
275
  t
276
276
  ]);
277
277
  case "str":
278
- return a;
278
+ return f;
279
279
  case "uint":
280
- return a;
280
+ return f;
281
281
  case "int":
282
- return a;
282
+ return f;
283
283
  case "f64":
284
- return a;
284
+ return f;
285
285
  case "boolean":
286
- return a;
286
+ return f;
287
287
  case "null":
288
288
  return null;
289
289
  case "bytes":
290
- return a;
290
+ return f;
291
291
  case "timestamp":
292
- return a;
292
+ return f;
293
293
  case "counter":
294
- return Sr(a, r, s, n, t);
294
+ return Cr(f, r, s, n, t);
295
295
  default:
296
296
  throw RangeError(`datatype ${c} unimplemented`);
297
297
  }
298
298
  }
299
- function Te(e, t, r, n) {
299
+ function Pe(e, t, r, n) {
300
300
  const s = typeof e;
301
301
  switch (s) {
302
302
  case "object":
303
303
  if (e == null)
304
304
  return [null, "null"];
305
- if (e[br])
305
+ if (e[xr])
306
306
  return [e.value, "uint"];
307
- if (e[gr])
307
+ if (e[wr])
308
308
  return [e.value, "int"];
309
- if (e[xr])
309
+ if (e[mr])
310
310
  return [e.value, "f64"];
311
311
  if (e[Ht])
312
312
  return [e.value, "counter"];
313
313
  if (e instanceof Date)
314
314
  return [e.getTime(), "timestamp"];
315
- if (e instanceof Ar)
315
+ if (e instanceof Er)
316
316
  return [e.toString(), "str"];
317
- if (e instanceof pe)
317
+ if (e instanceof be)
318
318
  return [e, "text"];
319
319
  if (e instanceof Uint8Array)
320
320
  return [e, "bytes"];
@@ -322,7 +322,7 @@ function Te(e, t, r, n) {
322
322
  return [e, "list"];
323
323
  if (Object.prototype.toString.call(e) === "[object Object]")
324
324
  return [e, "map"];
325
- throw Ne(e, n) ? new RangeError("Cannot create a reference to an existing document object") : new RangeError(`Cannot assign unknown object: ${e}`);
325
+ throw ze(e, n) ? new RangeError("Cannot create a reference to an existing document object") : new RangeError(`Cannot assign unknown object: ${e}`);
326
326
  case "boolean":
327
327
  return [e, "boolean"];
328
328
  case "number":
@@ -331,51 +331,51 @@ function Te(e, t, r, n) {
331
331
  return t ? [e, "text"] : [e, "str"];
332
332
  case "undefined":
333
333
  throw new RangeError([
334
- `Cannot assign undefined value at ${Ct(r)}, `,
334
+ `Cannot assign undefined value at ${Ot(r)}, `,
335
335
  "because `undefined` is not a valid JSON data type. ",
336
336
  "You might consider setting the property's value to `null`, ",
337
337
  "or using `delete` to remove it altogether."
338
338
  ].join(""));
339
339
  default:
340
340
  throw new RangeError([
341
- `Cannot assign ${s} value at ${Ct(r)}. `,
341
+ `Cannot assign ${s} value at ${Ot(r)}. `,
342
342
  "All JSON primitive datatypes (object, array, string, number, boolean, null) ",
343
343
  `are supported in an Automerge document; ${s} values are not. `
344
344
  ].join(""));
345
345
  }
346
346
  }
347
- function Ne(e, t) {
347
+ function ze(e, t) {
348
348
  var r, n;
349
- return e instanceof Date ? !1 : !!(e && ((n = (r = e[ye]) === null || r === void 0 ? void 0 : r.handle) === null || n === void 0 ? void 0 : n.__wbg_ptr) === t.__wbg_ptr);
349
+ return e instanceof Date ? !1 : !!(e && ((n = (r = e[pe]) === null || r === void 0 ? void 0 : r.handle) === null || n === void 0 ? void 0 : n.__wbg_ptr) === t.__wbg_ptr);
350
350
  }
351
- const Cr = {
351
+ const _r = {
352
352
  get(e, t) {
353
353
  const { context: r, objectId: n, cache: s } = e;
354
- return t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === _e ? n : t === yt ? !0 : t === Ee ? e.trace : t === ye ? { handle: r, textV2: e.textV2 } : (s[t] || (s[t] = re(e, t)), s[t]);
354
+ return t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r, textV2: e.textV2 } : (s[t] || (s[t] = re(e, t)), s[t]);
355
355
  },
356
356
  set(e, t, r) {
357
357
  const { context: n, objectId: s, path: o, textV2: i } = e;
358
- if (e.cache = {}, Ne(r, n))
358
+ if (e.cache = {}, ze(r, n))
359
359
  throw new RangeError("Cannot create a reference to an existing document object");
360
- if (t === Ee)
360
+ if (t === Oe)
361
361
  return e.trace = r, !0;
362
- if (t === Nt)
362
+ if (t === zt)
363
363
  return !0;
364
- const [c, a] = Te(r, i, [...o, t], n);
365
- switch (a) {
364
+ const [c, f] = Pe(r, i, [...o, t], n);
365
+ switch (f) {
366
366
  case "list": {
367
- const p = n.putObject(s, t, []), d = $e(n, p, i, [...o, t]);
367
+ const p = n.putObject(s, t, []), d = Ke(n, p, i, [...o, t]);
368
368
  for (let h = 0; h < c.length; h++)
369
369
  d[h] = c[h];
370
370
  break;
371
371
  }
372
372
  case "text": {
373
373
  if (i)
374
- De(c), n.putObject(s, t, c);
374
+ Le(c), n.putObject(s, t, c);
375
375
  else {
376
- bt(c);
376
+ wt(c);
377
377
  const p = n.putObject(s, t, "");
378
- Oe(n, p, [...o, t]).splice(0, 0, ...c);
378
+ Ue(n, p, [...o, t]).splice(0, 0, ...c);
379
379
  }
380
380
  break;
381
381
  }
@@ -386,7 +386,7 @@ const Cr = {
386
386
  break;
387
387
  }
388
388
  default:
389
- n.put(s, t, c, a);
389
+ n.put(s, t, c, f);
390
390
  }
391
391
  return !0;
392
392
  },
@@ -410,34 +410,34 @@ const Cr = {
410
410
  const { context: t, objectId: r } = e, n = t.keys(r);
411
411
  return [...new Set(n)];
412
412
  }
413
- }, $t = {
413
+ }, Kt = {
414
414
  get(e, t) {
415
415
  const { context: r, objectId: n } = e;
416
- return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === _e ? n : t === yt ? !0 : t === Ee ? e.trace : t === ye ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : pt(e)[t];
416
+ return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : xt(e)[t];
417
417
  },
418
418
  set(e, t, r) {
419
419
  const { context: n, objectId: s, path: o, textV2: i } = e;
420
- if (t = ae(t), Ne(r, n))
420
+ if (t = ae(t), ze(r, n))
421
421
  throw new RangeError("Cannot create a reference to an existing document object");
422
- if (t === Nt)
422
+ if (t === zt)
423
423
  return !0;
424
- if (t === Ee)
424
+ if (t === Oe)
425
425
  return e.trace = r, !0;
426
426
  if (typeof t == "string")
427
427
  throw new RangeError("list index must be a number");
428
- const [c, a] = Te(r, i, [...o, t], n);
429
- switch (a) {
428
+ const [c, f] = Pe(r, i, [...o, t], n);
429
+ switch (f) {
430
430
  case "list": {
431
431
  let p;
432
- t >= n.length(s) ? p = n.insertObject(s, t, []) : p = n.putObject(s, t, []), $e(n, p, i, [...o, t]).splice(0, 0, ...c);
432
+ t >= n.length(s) ? p = n.insertObject(s, t, []) : p = n.putObject(s, t, []), Ke(n, p, i, [...o, t]).splice(0, 0, ...c);
433
433
  break;
434
434
  }
435
435
  case "text": {
436
436
  if (i)
437
- De(c), t >= n.length(s) ? n.insertObject(s, t, c) : n.putObject(s, t, c);
437
+ Le(c), t >= n.length(s) ? n.insertObject(s, t, c) : n.putObject(s, t, c);
438
438
  else {
439
439
  let p;
440
- bt(c), t >= n.length(s) ? p = n.insertObject(s, t, "") : p = n.putObject(s, t, ""), Oe(n, p, [...o, t]).splice(0, 0, ...c);
440
+ wt(c), t >= n.length(s) ? p = n.insertObject(s, t, "") : p = n.putObject(s, t, ""), Ue(n, p, [...o, t]).splice(0, 0, ...c);
441
441
  }
442
442
  break;
443
443
  }
@@ -450,7 +450,7 @@ const Cr = {
450
450
  break;
451
451
  }
452
452
  default:
453
- t >= n.length(s) ? n.insert(s, t, c, a) : n.put(s, t, c, a);
453
+ t >= n.length(s) ? n.insert(s, t, c, f) : n.put(s, t, c, f);
454
454
  }
455
455
  return !0;
456
456
  },
@@ -468,7 +468,7 @@ const Cr = {
468
468
  },
469
469
  getOwnPropertyDescriptor(e, t) {
470
470
  const { context: r, objectId: n } = e;
471
- return t === "length" ? { writable: !0, value: r.length(n) } : t === _e ? { configurable: !1, enumerable: !1, value: n } : (t = ae(t), { configurable: !0, enumerable: !0, value: re(e, t) });
471
+ return t === "length" ? { writable: !0, value: r.length(n) } : t === Ie ? { configurable: !1, enumerable: !1, value: n } : (t = ae(t), { configurable: !0, enumerable: !0, value: re(e, t) });
472
472
  },
473
473
  getPrototypeOf(e) {
474
474
  return Object.getPrototypeOf(e);
@@ -477,13 +477,13 @@ const Cr = {
477
477
  const e = [];
478
478
  return e.push("length"), e;
479
479
  }
480
- }, Er = Object.assign({}, $t, {
480
+ }, Or = Object.assign({}, Kt, {
481
481
  get(e, t) {
482
482
  const { context: r, objectId: n } = e;
483
- return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === _e ? n : t === yt ? !0 : t === Ee ? e.trace : t === ye ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : _r(e)[t] || pt(e)[t];
483
+ return t = ae(t), t === Symbol.hasInstance ? (s) => Array.isArray(s) : t === Symbol.toStringTag ? e[Symbol.toStringTag] : t === Ie ? n : t === gt ? !0 : t === Oe ? e.trace : t === pe ? { handle: r } : t === "length" ? r.length(n) : typeof t == "number" ? re(e, t) : Ir(e)[t] || xt(e)[t];
484
484
  },
485
485
  getPrototypeOf() {
486
- return Object.getPrototypeOf(new pe());
486
+ return Object.getPrototypeOf(new be());
487
487
  }
488
488
  });
489
489
  function He(e, t, r, n) {
@@ -494,9 +494,9 @@ function He(e, t, r, n) {
494
494
  cache: {},
495
495
  textV2: r
496
496
  }, o = {};
497
- return Object.assign(o, s), new Proxy(o, Cr);
497
+ return Object.assign(o, s), new Proxy(o, _r);
498
498
  }
499
- function $e(e, t, r, n) {
499
+ function Ke(e, t, r, n) {
500
500
  const s = {
501
501
  context: e,
502
502
  objectId: t,
@@ -504,9 +504,9 @@ function $e(e, t, r, n) {
504
504
  cache: {},
505
505
  textV2: r
506
506
  }, o = [];
507
- return Object.assign(o, s), new Proxy(o, $t);
507
+ return Object.assign(o, s), new Proxy(o, Kt);
508
508
  }
509
- function Oe(e, t, r) {
509
+ function Ue(e, t, r) {
510
510
  const n = {
511
511
  context: e,
512
512
  objectId: t,
@@ -514,26 +514,26 @@ function Oe(e, t, r) {
514
514
  cache: {},
515
515
  textV2: !1
516
516
  }, s = {};
517
- return Object.assign(s, n), new Proxy(s, Er);
517
+ return Object.assign(s, n), new Proxy(s, Or);
518
518
  }
519
- function pt(e) {
519
+ function xt(e) {
520
520
  const { context: t, objectId: r, path: n, textV2: s } = e;
521
521
  return {
522
522
  deleteAt(i, c) {
523
523
  return typeof c == "number" ? t.splice(r, i, c) : t.delete(r, i), this;
524
524
  },
525
- fill(i, c, a) {
526
- const [p, d] = Te(i, s, [...n, c], t), h = t.length(r);
527
- c = ae(c || 0), a = ae(a || h);
528
- for (let g = c; g < Math.min(a, h); g++)
525
+ fill(i, c, f) {
526
+ const [p, d] = Pe(i, s, [...n, c], t), h = t.length(r);
527
+ c = ae(c || 0), f = ae(f || h);
528
+ for (let g = c; g < Math.min(f, h); g++)
529
529
  if (d === "list" || d === "map")
530
530
  t.putObject(r, g, p);
531
531
  else if (d === "text")
532
532
  if (s)
533
- De(p), t.putObject(r, g, p);
533
+ Le(p), t.putObject(r, g, p);
534
534
  else {
535
- bt(p);
536
- const u = t.putObject(r, g, ""), b = Oe(t, u, [...n, g]);
535
+ wt(p);
536
+ const u = t.putObject(r, g, ""), b = Ue(t, u, [...n, g]);
537
537
  for (let x = 0; x < p.length; x++)
538
538
  b[x] = p.get(x);
539
539
  }
@@ -542,10 +542,10 @@ function pt(e) {
542
542
  return this;
543
543
  },
544
544
  indexOf(i, c = 0) {
545
- const a = t.length(r);
546
- for (let p = c; p < a; p++) {
545
+ const f = t.length(r);
546
+ for (let p = c; p < f; p++) {
547
547
  const d = t.getWithType(r, p);
548
- if (d && (d[1] === i[_e] || d[1] === i))
548
+ if (d && (d[1] === i[Ie] || d[1] === i))
549
549
  return p;
550
550
  }
551
551
  return -1;
@@ -570,19 +570,19 @@ function pt(e) {
570
570
  const i = re(e, 0);
571
571
  return t.delete(r, 0), i;
572
572
  },
573
- splice(i, c, ...a) {
573
+ splice(i, c, ...f) {
574
574
  i = ae(i), typeof c != "number" && (c = t.length(r) - i), c = ae(c);
575
- for (const h of a)
576
- if (Ne(h, t))
575
+ for (const h of f)
576
+ if (ze(h, t))
577
577
  throw new RangeError("Cannot create a reference to an existing document object");
578
578
  const p = [];
579
579
  for (let h = 0; h < c; h++) {
580
580
  const g = re(e, i);
581
581
  g !== void 0 && p.push(g), t.delete(r, i);
582
582
  }
583
- const d = a.map((h, g) => {
583
+ const d = f.map((h, g) => {
584
584
  try {
585
- return Te(h, s, [...n], t);
585
+ return Pe(h, s, [...n], t);
586
586
  } catch (u) {
587
587
  throw u instanceof RangeError ? new RangeError(`${u.message} (at index ${g} in the input)`) : u;
588
588
  }
@@ -591,15 +591,15 @@ function pt(e) {
591
591
  switch (g) {
592
592
  case "list": {
593
593
  const u = t.insertObject(r, i, []);
594
- $e(t, u, s, [...n, i]).splice(0, 0, ...h);
594
+ Ke(t, u, s, [...n, i]).splice(0, 0, ...h);
595
595
  break;
596
596
  }
597
597
  case "text": {
598
598
  if (s)
599
- De(h), t.insertObject(r, i, h);
599
+ Le(h), t.insertObject(r, i, h);
600
600
  else {
601
601
  const u = t.insertObject(r, i, "");
602
- Oe(t, u, [...n, i]).splice(0, 0, ...h);
602
+ Ue(t, u, [...n, i]).splice(0, 0, ...h);
603
603
  }
604
604
  break;
605
605
  }
@@ -623,8 +623,8 @@ function pt(e) {
623
623
  let i = 0;
624
624
  return {
625
625
  next: () => {
626
- const a = re(e, i);
627
- return a === void 0 ? { value: void 0, done: !0 } : { value: [i++, a], done: !1 };
626
+ const f = re(e, i);
627
+ return f === void 0 ? { value: void 0, done: !0 } : { value: [i++, f], done: !1 };
628
628
  },
629
629
  [Symbol.iterator]() {
630
630
  return this;
@@ -645,8 +645,8 @@ function pt(e) {
645
645
  let i = 0;
646
646
  return {
647
647
  next: () => {
648
- const a = re(e, i++);
649
- return a === void 0 ? { value: void 0, done: !0 } : { value: a, done: !1 };
648
+ const f = re(e, i++);
649
+ return f === void 0 ? { value: void 0, done: !0 } : { value: f, done: !1 };
650
650
  },
651
651
  [Symbol.iterator]() {
652
652
  return this;
@@ -685,16 +685,16 @@ function pt(e) {
685
685
  },
686
686
  find(i) {
687
687
  let c = 0;
688
- for (const a of this) {
689
- if (i(a, c))
690
- return a;
688
+ for (const f of this) {
689
+ if (i(f, c))
690
+ return f;
691
691
  c += 1;
692
692
  }
693
693
  },
694
694
  findIndex(i) {
695
695
  let c = 0;
696
- for (const a of this) {
697
- if (i(a, c))
696
+ for (const f of this) {
697
+ if (i(f, c))
698
698
  return c;
699
699
  c += 1;
700
700
  }
@@ -720,8 +720,8 @@ function pt(e) {
720
720
  },
721
721
  some(i) {
722
722
  let c = 0;
723
- for (const a of this) {
724
- if (i(a, c))
723
+ for (const f of this) {
724
+ if (i(f, c))
725
725
  return !0;
726
726
  c += 1;
727
727
  }
@@ -734,7 +734,7 @@ function pt(e) {
734
734
  }
735
735
  };
736
736
  }
737
- function _r(e) {
737
+ function Ir(e) {
738
738
  const { context: t, objectId: r } = e;
739
739
  return {
740
740
  set(s, o) {
@@ -751,8 +751,8 @@ function _r(e) {
751
751
  let o = "";
752
752
  const i = t.length(r);
753
753
  for (let c = 0; c < i; c++) {
754
- const a = this[c];
755
- typeof a == "string" ? o += a : (o.length > 0 && (s.push(o), o = ""), s.push(a));
754
+ const f = this[c];
755
+ typeof f == "string" ? o += f : (o.length > 0 && (s.push(o), o = ""), s.push(f));
756
756
  }
757
757
  return o.length > 0 && s.push(o), s;
758
758
  },
@@ -763,19 +763,19 @@ function _r(e) {
763
763
  return t.text(r).indexOf(s, o);
764
764
  },
765
765
  insertAt(s, ...o) {
766
- o.every((i) => typeof i == "string") ? t.splice(r, s, 0, o.join("")) : pt(e).insertAt(s, ...o);
766
+ o.every((i) => typeof i == "string") ? t.splice(r, s, 0, o.join("")) : xt(e).insertAt(s, ...o);
767
767
  }
768
768
  };
769
769
  }
770
- function bt(e) {
771
- if (!(e instanceof pe))
770
+ function wt(e) {
771
+ if (!(e instanceof be))
772
772
  throw new Error("value was not a Text instance");
773
773
  }
774
- function De(e) {
774
+ function Le(e) {
775
775
  if (typeof e != "string")
776
776
  throw new Error("value was not a string");
777
777
  }
778
- function Ct(e) {
778
+ function Ot(e) {
779
779
  const t = e.map((r) => {
780
780
  if (typeof r == "number")
781
781
  return r.toString();
@@ -784,52 +784,52 @@ function Ct(e) {
784
784
  });
785
785
  return e.length === 0 ? "" : "/" + t.join("/");
786
786
  }
787
- const Or = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
788
- function zt(e) {
789
- return typeof e == "string" && Or.test(e);
787
+ const Ur = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
788
+ function Wt(e) {
789
+ return typeof e == "string" && Ur.test(e);
790
790
  }
791
791
  const Z = [];
792
792
  for (let e = 0; e < 256; ++e)
793
793
  Z.push((e + 256).toString(16).slice(1));
794
- function Ir(e, t = 0) {
794
+ function Fr(e, t = 0) {
795
795
  return Z[e[t + 0]] + Z[e[t + 1]] + Z[e[t + 2]] + Z[e[t + 3]] + "-" + Z[e[t + 4]] + Z[e[t + 5]] + "-" + Z[e[t + 6]] + Z[e[t + 7]] + "-" + Z[e[t + 8]] + Z[e[t + 9]] + "-" + Z[e[t + 10]] + Z[e[t + 11]] + Z[e[t + 12]] + Z[e[t + 13]] + Z[e[t + 14]] + Z[e[t + 15]];
796
796
  }
797
- function Ur(e, t = 0) {
798
- const r = Ir(e, t);
799
- if (!zt(r))
797
+ function kr(e, t = 0) {
798
+ const r = Fr(e, t);
799
+ if (!Wt(r))
800
800
  throw TypeError("Stringified UUID is invalid");
801
801
  return r;
802
802
  }
803
- let Kt;
804
- const Wt = new Array(128).fill(void 0);
805
- Wt.push(void 0, null, !0, !1);
806
- Wt.length;
807
- const Je = typeof TextEncoder < "u" ? new TextEncoder("utf-8") : { encode: () => {
803
+ let Jt;
804
+ const Gt = new Array(128).fill(void 0);
805
+ Gt.push(void 0, null, !0, !1);
806
+ Gt.length;
807
+ const Xe = typeof TextEncoder < "u" ? new TextEncoder("utf-8") : { encode: () => {
808
808
  throw Error("TextEncoder not available");
809
809
  } };
810
- Je.encodeInto;
811
- const Fr = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
810
+ Xe.encodeInto;
811
+ const jr = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
812
812
  throw Error("TextDecoder not available");
813
813
  } };
814
- typeof TextDecoder < "u" && Fr.decode();
815
- typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => Kt.__wbg_automerge_free(e >>> 0));
816
- typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => Kt.__wbg_syncstate_free(e >>> 0));
817
- var jr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
818
- function ze(e) {
814
+ typeof TextDecoder < "u" && jr.decode();
815
+ typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => Jt.__wbg_automerge_free(e >>> 0));
816
+ typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => Jt.__wbg_syncstate_free(e >>> 0));
817
+ var Mr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
818
+ function We(e) {
819
819
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
820
820
  }
821
- var nt = { exports: {} }, Ge, Et;
822
- function kr() {
823
- if (Et) return Ge;
824
- Et = 1;
821
+ var it = { exports: {} }, qe, It;
822
+ function Rr() {
823
+ if (It) return qe;
824
+ It = 1;
825
825
  var e = 1e3, t = e * 60, r = t * 60, n = r * 24, s = n * 7, o = n * 365.25;
826
- Ge = function(d, h) {
826
+ qe = function(d, h) {
827
827
  h = h || {};
828
828
  var g = typeof d;
829
829
  if (g === "string" && d.length > 0)
830
830
  return i(d);
831
831
  if (g === "number" && isFinite(d))
832
- return h.long ? a(d) : c(d);
832
+ return h.long ? f(d) : c(d);
833
833
  throw new Error(
834
834
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(d)
835
835
  );
@@ -890,7 +890,7 @@ function kr() {
890
890
  var h = Math.abs(d);
891
891
  return h >= n ? Math.round(d / n) + "d" : h >= r ? Math.round(d / r) + "h" : h >= t ? Math.round(d / t) + "m" : h >= e ? Math.round(d / e) + "s" : d + "ms";
892
892
  }
893
- function a(d) {
893
+ function f(d) {
894
894
  var h = Math.abs(d);
895
895
  return h >= n ? p(d, h, n, "day") : h >= r ? p(d, h, r, "hour") : h >= t ? p(d, h, t, "minute") : h >= e ? p(d, h, e, "second") : d + " ms";
896
896
  }
@@ -898,10 +898,10 @@ function kr() {
898
898
  var b = h >= g * 1.5;
899
899
  return Math.round(d / g) + " " + u + (b ? "s" : "");
900
900
  }
901
- return Ge;
901
+ return qe;
902
902
  }
903
- function Mr(e) {
904
- r.debug = r, r.default = r, r.coerce = a, r.disable = o, r.enable = s, r.enabled = i, r.humanize = kr(), r.destroy = p, Object.keys(e).forEach((d) => {
903
+ function Br(e) {
904
+ r.debug = r, r.default = r, r.coerce = f, r.disable = o, r.enable = s, r.enabled = i, r.humanize = Rr(), r.destroy = p, Object.keys(e).forEach((d) => {
905
905
  r[d] = e[d];
906
906
  }), r.names = [], r.skips = [], r.formatters = {};
907
907
  function t(d) {
@@ -913,30 +913,30 @@ function Mr(e) {
913
913
  r.selectColor = t;
914
914
  function r(d) {
915
915
  let h, g = null, u, b;
916
- function x(...A) {
916
+ function x(...C) {
917
917
  if (!x.enabled)
918
918
  return;
919
- const I = x, U = Number(/* @__PURE__ */ new Date()), S = U - (h || U);
920
- I.diff = S, I.prev = h, I.curr = U, h = U, A[0] = r.coerce(A[0]), typeof A[0] != "string" && A.unshift("%O");
919
+ const I = x, U = Number(/* @__PURE__ */ new Date()), v = U - (h || U);
920
+ I.diff = v, I.prev = h, I.curr = U, h = U, C[0] = r.coerce(C[0]), typeof C[0] != "string" && C.unshift("%O");
921
921
  let B = 0;
922
- A[0] = A[0].replace(/%([a-zA-Z%])/g, (F, N) => {
922
+ C[0] = C[0].replace(/%([a-zA-Z%])/g, (F, N) => {
923
923
  if (F === "%%")
924
924
  return "%";
925
925
  B++;
926
- const L = r.formatters[N];
927
- if (typeof L == "function") {
928
- const $ = A[B];
929
- F = L.call(I, $), A.splice(B, 1), B--;
926
+ const P = r.formatters[N];
927
+ if (typeof P == "function") {
928
+ const z = C[B];
929
+ F = P.call(I, z), C.splice(B, 1), B--;
930
930
  }
931
931
  return F;
932
- }), r.formatArgs.call(I, A), (I.log || r.log).apply(I, A);
932
+ }), r.formatArgs.call(I, C), (I.log || r.log).apply(I, C);
933
933
  }
934
934
  return x.namespace = d, x.useColors = r.useColors(), x.color = r.selectColor(d), x.extend = n, x.destroy = r.destroy, Object.defineProperty(x, "enabled", {
935
935
  enumerable: !0,
936
936
  configurable: !1,
937
937
  get: () => g !== null ? g : (u !== r.namespaces && (u = r.namespaces, b = r.enabled(d)), b),
938
- set: (A) => {
939
- g = A;
938
+ set: (C) => {
939
+ g = C;
940
940
  }
941
941
  }), typeof r.init == "function" && r.init(x), x;
942
942
  }
@@ -973,7 +973,7 @@ function Mr(e) {
973
973
  function c(d) {
974
974
  return d.toString().substring(2, d.toString().length - 2).replace(/\.\*\?$/, "*");
975
975
  }
976
- function a(d) {
976
+ function f(d) {
977
977
  return d instanceof Error ? d.stack || d.message : d;
978
978
  }
979
979
  function p() {
@@ -981,12 +981,12 @@ function Mr(e) {
981
981
  }
982
982
  return r.enable(r.load()), r;
983
983
  }
984
- var Rr = Mr;
984
+ var Tr = Br;
985
985
  (function(e, t) {
986
986
  t.formatArgs = n, t.save = s, t.load = o, t.useColors = r, t.storage = i(), t.destroy = /* @__PURE__ */ (() => {
987
- let a = !1;
987
+ let f = !1;
988
988
  return () => {
989
- a || (a = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
989
+ f || (f = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
990
990
  };
991
991
  })(), t.colors = [
992
992
  "#0000CC",
@@ -1067,37 +1067,42 @@ var Rr = Mr;
1067
1067
  "#FFCC33"
1068
1068
  ];
1069
1069
  function r() {
1070
- return typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs) ? !0 : typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/) ? !1 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
1070
+ if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs))
1071
+ return !0;
1072
+ if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
1073
+ return !1;
1074
+ let f;
1075
+ return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
1071
1076
  typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
1072
1077
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
1073
- typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
1078
+ typeof navigator < "u" && navigator.userAgent && (f = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(f[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
1074
1079
  typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
1075
1080
  }
1076
- function n(a) {
1077
- if (a[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + a[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors)
1081
+ function n(f) {
1082
+ if (f[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + f[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors)
1078
1083
  return;
1079
1084
  const p = "color: " + this.color;
1080
- a.splice(1, 0, p, "color: inherit");
1085
+ f.splice(1, 0, p, "color: inherit");
1081
1086
  let d = 0, h = 0;
1082
- a[0].replace(/%[a-zA-Z%]/g, (g) => {
1087
+ f[0].replace(/%[a-zA-Z%]/g, (g) => {
1083
1088
  g !== "%%" && (d++, g === "%c" && (h = d));
1084
- }), a.splice(h, 0, p);
1089
+ }), f.splice(h, 0, p);
1085
1090
  }
1086
1091
  t.log = console.debug || console.log || (() => {
1087
1092
  });
1088
- function s(a) {
1093
+ function s(f) {
1089
1094
  try {
1090
- a ? t.storage.setItem("debug", a) : t.storage.removeItem("debug");
1095
+ f ? t.storage.setItem("debug", f) : t.storage.removeItem("debug");
1091
1096
  } catch {
1092
1097
  }
1093
1098
  }
1094
1099
  function o() {
1095
- let a;
1100
+ let f;
1096
1101
  try {
1097
- a = t.storage.getItem("debug");
1102
+ f = t.storage.getItem("debug");
1098
1103
  } catch {
1099
1104
  }
1100
- return !a && typeof process < "u" && "env" in process && (a = process.env.DEBUG), a;
1105
+ return !f && typeof process < "u" && "env" in process && (f = process.env.DEBUG), f;
1101
1106
  }
1102
1107
  function i() {
1103
1108
  try {
@@ -1105,35 +1110,35 @@ var Rr = Mr;
1105
1110
  } catch {
1106
1111
  }
1107
1112
  }
1108
- e.exports = Rr(t);
1113
+ e.exports = Tr(t);
1109
1114
  const { formatters: c } = e.exports;
1110
- c.j = function(a) {
1115
+ c.j = function(f) {
1111
1116
  try {
1112
- return JSON.stringify(a);
1117
+ return JSON.stringify(f);
1113
1118
  } catch (p) {
1114
1119
  return "[UnexpectedJSONParseError]: " + p.message;
1115
1120
  }
1116
1121
  };
1117
- })(nt, nt.exports);
1118
- var Br = nt.exports;
1119
- const Tr = /* @__PURE__ */ ze(Br);
1120
- var Jt = { exports: {} };
1122
+ })(it, it.exports);
1123
+ var Dr = it.exports;
1124
+ const Pr = /* @__PURE__ */ We(Dr);
1125
+ var Xt = { exports: {} };
1121
1126
  (function(e) {
1122
1127
  var t = Object.prototype.hasOwnProperty, r = "~";
1123
1128
  function n() {
1124
1129
  }
1125
1130
  Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (r = !1));
1126
- function s(a, p, d) {
1127
- this.fn = a, this.context = p, this.once = d || !1;
1131
+ function s(f, p, d) {
1132
+ this.fn = f, this.context = p, this.once = d || !1;
1128
1133
  }
1129
- function o(a, p, d, h, g) {
1134
+ function o(f, p, d, h, g) {
1130
1135
  if (typeof d != "function")
1131
1136
  throw new TypeError("The listener must be a function");
1132
- var u = new s(d, h || a, g), b = r ? r + p : p;
1133
- return a._events[b] ? a._events[b].fn ? a._events[b] = [a._events[b], u] : a._events[b].push(u) : (a._events[b] = u, a._eventsCount++), a;
1137
+ var u = new s(d, h || f, g), b = r ? r + p : p;
1138
+ return f._events[b] ? f._events[b].fn ? f._events[b] = [f._events[b], u] : f._events[b].push(u) : (f._events[b] = u, f._eventsCount++), f;
1134
1139
  }
1135
- function i(a, p) {
1136
- --a._eventsCount === 0 ? a._events = new n() : delete a._events[p];
1140
+ function i(f, p) {
1141
+ --f._eventsCount === 0 ? f._events = new n() : delete f._events[p];
1137
1142
  }
1138
1143
  function c() {
1139
1144
  this._events = new n(), this._eventsCount = 0;
@@ -1157,45 +1162,45 @@ var Jt = { exports: {} };
1157
1162
  }, c.prototype.emit = function(p, d, h, g, u, b) {
1158
1163
  var x = r ? r + p : p;
1159
1164
  if (!this._events[x]) return !1;
1160
- var A = this._events[x], I = arguments.length, U, S;
1161
- if (A.fn) {
1162
- switch (A.once && this.removeListener(p, A.fn, void 0, !0), I) {
1165
+ var C = this._events[x], I = arguments.length, U, v;
1166
+ if (C.fn) {
1167
+ switch (C.once && this.removeListener(p, C.fn, void 0, !0), I) {
1163
1168
  case 1:
1164
- return A.fn.call(A.context), !0;
1169
+ return C.fn.call(C.context), !0;
1165
1170
  case 2:
1166
- return A.fn.call(A.context, d), !0;
1171
+ return C.fn.call(C.context, d), !0;
1167
1172
  case 3:
1168
- return A.fn.call(A.context, d, h), !0;
1173
+ return C.fn.call(C.context, d, h), !0;
1169
1174
  case 4:
1170
- return A.fn.call(A.context, d, h, g), !0;
1175
+ return C.fn.call(C.context, d, h, g), !0;
1171
1176
  case 5:
1172
- return A.fn.call(A.context, d, h, g, u), !0;
1177
+ return C.fn.call(C.context, d, h, g, u), !0;
1173
1178
  case 6:
1174
- return A.fn.call(A.context, d, h, g, u, b), !0;
1179
+ return C.fn.call(C.context, d, h, g, u, b), !0;
1175
1180
  }
1176
- for (S = 1, U = new Array(I - 1); S < I; S++)
1177
- U[S - 1] = arguments[S];
1178
- A.fn.apply(A.context, U);
1181
+ for (v = 1, U = new Array(I - 1); v < I; v++)
1182
+ U[v - 1] = arguments[v];
1183
+ C.fn.apply(C.context, U);
1179
1184
  } else {
1180
- var B = A.length, M;
1181
- for (S = 0; S < B; S++)
1182
- switch (A[S].once && this.removeListener(p, A[S].fn, void 0, !0), I) {
1185
+ var B = C.length, M;
1186
+ for (v = 0; v < B; v++)
1187
+ switch (C[v].once && this.removeListener(p, C[v].fn, void 0, !0), I) {
1183
1188
  case 1:
1184
- A[S].fn.call(A[S].context);
1189
+ C[v].fn.call(C[v].context);
1185
1190
  break;
1186
1191
  case 2:
1187
- A[S].fn.call(A[S].context, d);
1192
+ C[v].fn.call(C[v].context, d);
1188
1193
  break;
1189
1194
  case 3:
1190
- A[S].fn.call(A[S].context, d, h);
1195
+ C[v].fn.call(C[v].context, d, h);
1191
1196
  break;
1192
1197
  case 4:
1193
- A[S].fn.call(A[S].context, d, h, g);
1198
+ C[v].fn.call(C[v].context, d, h, g);
1194
1199
  break;
1195
1200
  default:
1196
1201
  if (!U) for (M = 1, U = new Array(I - 1); M < I; M++)
1197
1202
  U[M - 1] = arguments[M];
1198
- A[S].fn.apply(A[S].context, U);
1203
+ C[v].fn.apply(C[v].context, U);
1199
1204
  }
1200
1205
  }
1201
1206
  return !0;
@@ -1212,72 +1217,72 @@ var Jt = { exports: {} };
1212
1217
  if (b.fn)
1213
1218
  b.fn === d && (!g || b.once) && (!h || b.context === h) && i(this, u);
1214
1219
  else {
1215
- for (var x = 0, A = [], I = b.length; x < I; x++)
1216
- (b[x].fn !== d || g && !b[x].once || h && b[x].context !== h) && A.push(b[x]);
1217
- A.length ? this._events[u] = A.length === 1 ? A[0] : A : i(this, u);
1220
+ for (var x = 0, C = [], I = b.length; x < I; x++)
1221
+ (b[x].fn !== d || g && !b[x].once || h && b[x].context !== h) && C.push(b[x]);
1222
+ C.length ? this._events[u] = C.length === 1 ? C[0] : C : i(this, u);
1218
1223
  }
1219
1224
  return this;
1220
1225
  }, c.prototype.removeAllListeners = function(p) {
1221
1226
  var d;
1222
1227
  return p ? (d = r ? r + p : p, this._events[d] && i(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
1223
1228
  }, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, e.exports = c;
1224
- })(Jt);
1225
- var Dr = Jt.exports;
1226
- const Lr = /* @__PURE__ */ ze(Dr);
1227
- var ve = {}, he = {}, q = {};
1229
+ })(Xt);
1230
+ var Lr = Xt.exports;
1231
+ const Vr = /* @__PURE__ */ We(Lr);
1232
+ var ve = {}, de = {}, q = {};
1228
1233
  Object.defineProperty(q, "__esModule", { value: !0 });
1229
1234
  q.output = q.exists = q.hash = q.bytes = q.bool = q.number = q.isBytes = void 0;
1230
- function Le(e) {
1235
+ function Ve(e) {
1231
1236
  if (!Number.isSafeInteger(e) || e < 0)
1232
1237
  throw new Error(`positive integer expected, not ${e}`);
1233
1238
  }
1234
- q.number = Le;
1235
- function Gt(e) {
1239
+ q.number = Ve;
1240
+ function qt(e) {
1236
1241
  if (typeof e != "boolean")
1237
1242
  throw new Error(`boolean expected, not ${e}`);
1238
1243
  }
1239
- q.bool = Gt;
1240
- function Xt(e) {
1244
+ q.bool = qt;
1245
+ function Zt(e) {
1241
1246
  return e instanceof Uint8Array || e != null && typeof e == "object" && e.constructor.name === "Uint8Array";
1242
1247
  }
1243
- q.isBytes = Xt;
1244
- function gt(e, ...t) {
1245
- if (!Xt(e))
1248
+ q.isBytes = Zt;
1249
+ function mt(e, ...t) {
1250
+ if (!Zt(e))
1246
1251
  throw new Error("Uint8Array expected");
1247
1252
  if (t.length > 0 && !t.includes(e.length))
1248
1253
  throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`);
1249
1254
  }
1250
- q.bytes = gt;
1251
- function qt(e) {
1255
+ q.bytes = mt;
1256
+ function Yt(e) {
1252
1257
  if (typeof e != "function" || typeof e.create != "function")
1253
1258
  throw new Error("Hash should be wrapped by utils.wrapConstructor");
1254
- Le(e.outputLen), Le(e.blockLen);
1259
+ Ve(e.outputLen), Ve(e.blockLen);
1255
1260
  }
1256
- q.hash = qt;
1257
- function Zt(e, t = !0) {
1261
+ q.hash = Yt;
1262
+ function Qt(e, t = !0) {
1258
1263
  if (e.destroyed)
1259
1264
  throw new Error("Hash instance has been destroyed");
1260
1265
  if (t && e.finished)
1261
1266
  throw new Error("Hash#digest() has already been called");
1262
1267
  }
1263
- q.exists = Zt;
1264
- function Yt(e, t) {
1265
- gt(e);
1268
+ q.exists = Qt;
1269
+ function er(e, t) {
1270
+ mt(e);
1266
1271
  const r = t.outputLen;
1267
1272
  if (e.length < r)
1268
1273
  throw new Error(`digestInto() expects output buffer of length at least ${r}`);
1269
1274
  }
1270
- q.output = Yt;
1271
- const Pr = { number: Le, bool: Gt, bytes: gt, hash: qt, exists: Zt, output: Yt };
1272
- q.default = Pr;
1273
- var xt = {}, Ke = {};
1274
- Object.defineProperty(Ke, "__esModule", { value: !0 });
1275
- Ke.crypto = void 0;
1276
- Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
1275
+ q.output = er;
1276
+ const Nr = { number: Ve, bool: qt, bytes: mt, hash: Yt, exists: Qt, output: er };
1277
+ q.default = Nr;
1278
+ var St = {}, Je = {};
1279
+ Object.defineProperty(Je, "__esModule", { value: !0 });
1280
+ Je.crypto = void 0;
1281
+ Je.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
1277
1282
  (function(e) {
1278
1283
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
1279
1284
  Object.defineProperty(e, "__esModule", { value: !0 }), e.randomBytes = e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.checkOpts = e.Hash = e.concatBytes = e.toBytes = e.utf8ToBytes = e.asyncLoop = e.nextTick = e.hexToBytes = e.bytesToHex = e.byteSwap32 = e.byteSwapIfBE = e.byteSwap = e.isLE = e.rotl = e.rotr = e.createView = e.u32 = e.u8 = e.isBytes = void 0;
1280
- const t = Ke, r = q;
1285
+ const t = Je, r = q;
1281
1286
  function n(E) {
1282
1287
  return E instanceof Uint8Array || E != null && typeof E == "object" && E.constructor.name === "Uint8Array";
1283
1288
  }
@@ -1290,8 +1295,8 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
1290
1295
  e.createView = i;
1291
1296
  const c = (E, l) => E << 32 - l | E >>> l;
1292
1297
  e.rotr = c;
1293
- const a = (E, l) => E << l | E >>> 32 - l >>> 0;
1294
- e.rotl = a, e.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
1298
+ const f = (E, l) => E << l | E >>> 32 - l >>> 0;
1299
+ e.rotl = f, e.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
1295
1300
  const p = (E) => E << 24 & 4278190080 | E << 8 & 16711680 | E >>> 8 & 65280 | E >>> 24 & 255;
1296
1301
  e.byteSwap = p, e.byteSwapIfBE = e.isLE ? (E) => E : (E) => (0, e.byteSwap)(E);
1297
1302
  function d(E) {
@@ -1324,26 +1329,26 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
1324
1329
  if (l % 2)
1325
1330
  throw new Error("padded hex string expected, got unpadded hex of length " + l);
1326
1331
  const m = new Uint8Array(_);
1327
- for (let C = 0, v = 0; C < _; C++, v += 2) {
1328
- const j = b(E.charCodeAt(v)), k = b(E.charCodeAt(v + 1));
1329
- if (j === void 0 || k === void 0) {
1330
- const R = E[v] + E[v + 1];
1331
- throw new Error('hex string expected, got non-hex character "' + R + '" at index ' + v);
1332
+ for (let A = 0, S = 0; A < _; A++, S += 2) {
1333
+ const k = b(E.charCodeAt(S)), j = b(E.charCodeAt(S + 1));
1334
+ if (k === void 0 || j === void 0) {
1335
+ const R = E[S] + E[S + 1];
1336
+ throw new Error('hex string expected, got non-hex character "' + R + '" at index ' + S);
1332
1337
  }
1333
- m[C] = j * 16 + k;
1338
+ m[A] = k * 16 + j;
1334
1339
  }
1335
1340
  return m;
1336
1341
  }
1337
1342
  e.hexToBytes = x;
1338
- const A = async () => {
1343
+ const C = async () => {
1339
1344
  };
1340
- e.nextTick = A;
1345
+ e.nextTick = C;
1341
1346
  async function I(E, l, _) {
1342
1347
  let m = Date.now();
1343
- for (let C = 0; C < E; C++) {
1344
- _(C);
1345
- const v = Date.now() - m;
1346
- v >= 0 && v < l || (await (0, e.nextTick)(), m += v);
1348
+ for (let A = 0; A < E; A++) {
1349
+ _(A);
1350
+ const S = Date.now() - m;
1351
+ S >= 0 && S < l || (await (0, e.nextTick)(), m += S);
1347
1352
  }
1348
1353
  }
1349
1354
  e.asyncLoop = I;
@@ -1353,20 +1358,20 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
1353
1358
  return new Uint8Array(new TextEncoder().encode(E));
1354
1359
  }
1355
1360
  e.utf8ToBytes = U;
1356
- function S(E) {
1361
+ function v(E) {
1357
1362
  return typeof E == "string" && (E = U(E)), (0, r.bytes)(E), E;
1358
1363
  }
1359
- e.toBytes = S;
1364
+ e.toBytes = v;
1360
1365
  function B(...E) {
1361
1366
  let l = 0;
1362
1367
  for (let m = 0; m < E.length; m++) {
1363
- const C = E[m];
1364
- (0, r.bytes)(C), l += C.length;
1368
+ const A = E[m];
1369
+ (0, r.bytes)(A), l += A.length;
1365
1370
  }
1366
1371
  const _ = new Uint8Array(l);
1367
- for (let m = 0, C = 0; m < E.length; m++) {
1368
- const v = E[m];
1369
- _.set(v, C), C += v.length;
1372
+ for (let m = 0, A = 0; m < E.length; m++) {
1373
+ const S = E[m];
1374
+ _.set(S, A), A += S.length;
1370
1375
  }
1371
1376
  return _;
1372
1377
  }
@@ -1385,56 +1390,56 @@ Ke.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
1385
1390
  return Object.assign(E, l);
1386
1391
  }
1387
1392
  e.checkOpts = N;
1388
- function L(E) {
1389
- const l = (m) => E().update(S(m)).digest(), _ = E();
1393
+ function P(E) {
1394
+ const l = (m) => E().update(v(m)).digest(), _ = E();
1390
1395
  return l.outputLen = _.outputLen, l.blockLen = _.blockLen, l.create = () => E(), l;
1391
1396
  }
1392
- e.wrapConstructor = L;
1393
- function $(E) {
1394
- const l = (m, C) => E(C).update(S(m)).digest(), _ = E({});
1397
+ e.wrapConstructor = P;
1398
+ function z(E) {
1399
+ const l = (m, A) => E(A).update(v(m)).digest(), _ = E({});
1395
1400
  return l.outputLen = _.outputLen, l.blockLen = _.blockLen, l.create = (m) => E(m), l;
1396
1401
  }
1397
- e.wrapConstructorWithOpts = $;
1398
- function H(E) {
1399
- const l = (m, C) => E(C).update(S(m)).digest(), _ = E({});
1402
+ e.wrapConstructorWithOpts = z;
1403
+ function $(E) {
1404
+ const l = (m, A) => E(A).update(v(m)).digest(), _ = E({});
1400
1405
  return l.outputLen = _.outputLen, l.blockLen = _.blockLen, l.create = (m) => E(m), l;
1401
1406
  }
1402
- e.wrapXOFConstructorWithOpts = H;
1407
+ e.wrapXOFConstructorWithOpts = $;
1403
1408
  function ie(E = 32) {
1404
1409
  if (t.crypto && typeof t.crypto.getRandomValues == "function")
1405
1410
  return t.crypto.getRandomValues(new Uint8Array(E));
1406
1411
  throw new Error("crypto.getRandomValues must be defined");
1407
1412
  }
1408
1413
  e.randomBytes = ie;
1409
- })(xt);
1410
- Object.defineProperty(he, "__esModule", { value: !0 });
1411
- he.HashMD = he.Maj = he.Chi = void 0;
1412
- const Xe = q, Se = xt;
1413
- function Vr(e, t, r, n) {
1414
+ })(St);
1415
+ Object.defineProperty(de, "__esModule", { value: !0 });
1416
+ de.HashMD = de.Maj = de.Chi = void 0;
1417
+ const Ze = q, Ae = St;
1418
+ function $r(e, t, r, n) {
1414
1419
  if (typeof e.setBigUint64 == "function")
1415
1420
  return e.setBigUint64(t, r, n);
1416
- const s = BigInt(32), o = BigInt(4294967295), i = Number(r >> s & o), c = Number(r & o), a = n ? 4 : 0, p = n ? 0 : 4;
1417
- e.setUint32(t + a, i, n), e.setUint32(t + p, c, n);
1421
+ const s = BigInt(32), o = BigInt(4294967295), i = Number(r >> s & o), c = Number(r & o), f = n ? 4 : 0, p = n ? 0 : 4;
1422
+ e.setUint32(t + f, i, n), e.setUint32(t + p, c, n);
1418
1423
  }
1419
- const Nr = (e, t, r) => e & t ^ ~e & r;
1420
- he.Chi = Nr;
1424
+ const zr = (e, t, r) => e & t ^ ~e & r;
1425
+ de.Chi = zr;
1421
1426
  const Hr = (e, t, r) => e & t ^ e & r ^ t & r;
1422
- he.Maj = Hr;
1423
- class $r extends Se.Hash {
1427
+ de.Maj = Hr;
1428
+ class Kr extends Ae.Hash {
1424
1429
  constructor(t, r, n, s) {
1425
- super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = (0, Se.createView)(this.buffer);
1430
+ super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = (0, Ae.createView)(this.buffer);
1426
1431
  }
1427
1432
  update(t) {
1428
- (0, Xe.exists)(this);
1433
+ (0, Ze.exists)(this);
1429
1434
  const { view: r, buffer: n, blockLen: s } = this;
1430
- t = (0, Se.toBytes)(t);
1435
+ t = (0, Ae.toBytes)(t);
1431
1436
  const o = t.length;
1432
1437
  for (let i = 0; i < o; ) {
1433
1438
  const c = Math.min(s - this.pos, o - i);
1434
1439
  if (c === s) {
1435
- const a = (0, Se.createView)(t);
1440
+ const f = (0, Ae.createView)(t);
1436
1441
  for (; s <= o - i; i += s)
1437
- this.process(a, i);
1442
+ this.process(f, i);
1438
1443
  continue;
1439
1444
  }
1440
1445
  n.set(t.subarray(i, i + c), this.pos), this.pos += c, i += c, this.pos === s && (this.process(r, 0), this.pos = 0);
@@ -1442,17 +1447,17 @@ class $r extends Se.Hash {
1442
1447
  return this.length += t.length, this.roundClean(), this;
1443
1448
  }
1444
1449
  digestInto(t) {
1445
- (0, Xe.exists)(this), (0, Xe.output)(t, this), this.finished = !0;
1450
+ (0, Ze.exists)(this), (0, Ze.output)(t, this), this.finished = !0;
1446
1451
  const { buffer: r, view: n, blockLen: s, isLE: o } = this;
1447
1452
  let { pos: i } = this;
1448
1453
  r[i++] = 128, this.buffer.subarray(i).fill(0), this.padOffset > s - i && (this.process(n, 0), i = 0);
1449
1454
  for (let h = i; h < s; h++)
1450
1455
  r[h] = 0;
1451
- Vr(n, s - 8, BigInt(this.length * 8), o), this.process(n, 0);
1452
- const c = (0, Se.createView)(t), a = this.outputLen;
1453
- if (a % 4)
1456
+ $r(n, s - 8, BigInt(this.length * 8), o), this.process(n, 0);
1457
+ const c = (0, Ae.createView)(t), f = this.outputLen;
1458
+ if (f % 4)
1454
1459
  throw new Error("_sha2: outputLen should be aligned to 32bit");
1455
- const p = a / 4, d = this.get();
1460
+ const p = f / 4, d = this.get();
1456
1461
  if (p > d.length)
1457
1462
  throw new Error("_sha2: outputLen bigger than state");
1458
1463
  for (let h = 0; h < p; h++)
@@ -1470,10 +1475,10 @@ class $r extends Se.Hash {
1470
1475
  return t.length = s, t.pos = c, t.finished = o, t.destroyed = i, s % r && t.buffer.set(n), t;
1471
1476
  }
1472
1477
  }
1473
- he.HashMD = $r;
1478
+ de.HashMD = Kr;
1474
1479
  Object.defineProperty(ve, "__esModule", { value: !0 });
1475
1480
  ve.sha224 = ve.sha256 = void 0;
1476
- const qe = he, te = xt, zr = /* @__PURE__ */ new Uint32Array([
1481
+ const Ye = de, te = St, Wr = /* @__PURE__ */ new Uint32Array([
1477
1482
  1116352408,
1478
1483
  1899447441,
1479
1484
  3049323471,
@@ -1538,7 +1543,7 @@ const qe = he, te = xt, zr = /* @__PURE__ */ new Uint32Array([
1538
1543
  2756734187,
1539
1544
  3204031479,
1540
1545
  3329325298
1541
- ]), ce = /* @__PURE__ */ new Uint32Array([
1546
+ ]), le = /* @__PURE__ */ new Uint32Array([
1542
1547
  1779033703,
1543
1548
  3144134277,
1544
1549
  1013904242,
@@ -1547,48 +1552,48 @@ const qe = he, te = xt, zr = /* @__PURE__ */ new Uint32Array([
1547
1552
  2600822924,
1548
1553
  528734635,
1549
1554
  1541459225
1550
- ]), le = /* @__PURE__ */ new Uint32Array(64);
1551
- class Qt extends qe.HashMD {
1555
+ ]), ue = /* @__PURE__ */ new Uint32Array(64);
1556
+ class tr extends Ye.HashMD {
1552
1557
  constructor() {
1553
- super(64, 32, 8, !1), this.A = ce[0] | 0, this.B = ce[1] | 0, this.C = ce[2] | 0, this.D = ce[3] | 0, this.E = ce[4] | 0, this.F = ce[5] | 0, this.G = ce[6] | 0, this.H = ce[7] | 0;
1558
+ super(64, 32, 8, !1), this.A = le[0] | 0, this.B = le[1] | 0, this.C = le[2] | 0, this.D = le[3] | 0, this.E = le[4] | 0, this.F = le[5] | 0, this.G = le[6] | 0, this.H = le[7] | 0;
1554
1559
  }
1555
1560
  get() {
1556
- const { A: t, B: r, C: n, D: s, E: o, F: i, G: c, H: a } = this;
1557
- return [t, r, n, s, o, i, c, a];
1561
+ const { A: t, B: r, C: n, D: s, E: o, F: i, G: c, H: f } = this;
1562
+ return [t, r, n, s, o, i, c, f];
1558
1563
  }
1559
1564
  // prettier-ignore
1560
- set(t, r, n, s, o, i, c, a) {
1561
- this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D = s | 0, this.E = o | 0, this.F = i | 0, this.G = c | 0, this.H = a | 0;
1565
+ set(t, r, n, s, o, i, c, f) {
1566
+ this.A = t | 0, this.B = r | 0, this.C = n | 0, this.D = s | 0, this.E = o | 0, this.F = i | 0, this.G = c | 0, this.H = f | 0;
1562
1567
  }
1563
1568
  process(t, r) {
1564
1569
  for (let h = 0; h < 16; h++, r += 4)
1565
- le[h] = t.getUint32(r, !1);
1570
+ ue[h] = t.getUint32(r, !1);
1566
1571
  for (let h = 16; h < 64; h++) {
1567
- const g = le[h - 15], u = le[h - 2], b = (0, te.rotr)(g, 7) ^ (0, te.rotr)(g, 18) ^ g >>> 3, x = (0, te.rotr)(u, 17) ^ (0, te.rotr)(u, 19) ^ u >>> 10;
1568
- le[h] = x + le[h - 7] + b + le[h - 16] | 0;
1572
+ const g = ue[h - 15], u = ue[h - 2], b = (0, te.rotr)(g, 7) ^ (0, te.rotr)(g, 18) ^ g >>> 3, x = (0, te.rotr)(u, 17) ^ (0, te.rotr)(u, 19) ^ u >>> 10;
1573
+ ue[h] = x + ue[h - 7] + b + ue[h - 16] | 0;
1569
1574
  }
1570
- let { A: n, B: s, C: o, D: i, E: c, F: a, G: p, H: d } = this;
1575
+ let { A: n, B: s, C: o, D: i, E: c, F: f, G: p, H: d } = this;
1571
1576
  for (let h = 0; h < 64; h++) {
1572
- const g = (0, te.rotr)(c, 6) ^ (0, te.rotr)(c, 11) ^ (0, te.rotr)(c, 25), u = d + g + (0, qe.Chi)(c, a, p) + zr[h] + le[h] | 0, x = ((0, te.rotr)(n, 2) ^ (0, te.rotr)(n, 13) ^ (0, te.rotr)(n, 22)) + (0, qe.Maj)(n, s, o) | 0;
1573
- d = p, p = a, a = c, c = i + u | 0, i = o, o = s, s = n, n = u + x | 0;
1577
+ const g = (0, te.rotr)(c, 6) ^ (0, te.rotr)(c, 11) ^ (0, te.rotr)(c, 25), u = d + g + (0, Ye.Chi)(c, f, p) + Wr[h] + ue[h] | 0, x = ((0, te.rotr)(n, 2) ^ (0, te.rotr)(n, 13) ^ (0, te.rotr)(n, 22)) + (0, Ye.Maj)(n, s, o) | 0;
1578
+ d = p, p = f, f = c, c = i + u | 0, i = o, o = s, s = n, n = u + x | 0;
1574
1579
  }
1575
- n = n + this.A | 0, s = s + this.B | 0, o = o + this.C | 0, i = i + this.D | 0, c = c + this.E | 0, a = a + this.F | 0, p = p + this.G | 0, d = d + this.H | 0, this.set(n, s, o, i, c, a, p, d);
1580
+ n = n + this.A | 0, s = s + this.B | 0, o = o + this.C | 0, i = i + this.D | 0, c = c + this.E | 0, f = f + this.F | 0, p = p + this.G | 0, d = d + this.H | 0, this.set(n, s, o, i, c, f, p, d);
1576
1581
  }
1577
1582
  roundClean() {
1578
- le.fill(0);
1583
+ ue.fill(0);
1579
1584
  }
1580
1585
  destroy() {
1581
1586
  this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
1582
1587
  }
1583
1588
  }
1584
- class Kr extends Qt {
1589
+ class Jr extends tr {
1585
1590
  constructor() {
1586
1591
  super(), this.A = -1056596264, this.B = 914150663, this.C = 812702999, this.D = -150054599, this.E = -4191439, this.F = 1750603025, this.G = 1694076839, this.H = -1090891868, this.outputLen = 28;
1587
1592
  }
1588
1593
  }
1589
- ve.sha256 = (0, te.wrapConstructor)(() => new Qt());
1590
- ve.sha224 = (0, te.wrapConstructor)(() => new Kr());
1591
- function Wr(e) {
1594
+ ve.sha256 = (0, te.wrapConstructor)(() => new tr());
1595
+ ve.sha224 = (0, te.wrapConstructor)(() => new Jr());
1596
+ function Gr(e) {
1592
1597
  if (e.length >= 255)
1593
1598
  throw new TypeError("Alphabet too long");
1594
1599
  for (var t = new Uint8Array(256), r = 0; r < t.length; r++)
@@ -1599,48 +1604,48 @@ function Wr(e) {
1599
1604
  throw new TypeError(s + " is ambiguous");
1600
1605
  t[o] = n;
1601
1606
  }
1602
- var i = e.length, c = e.charAt(0), a = Math.log(i) / Math.log(256), p = Math.log(256) / Math.log(i);
1607
+ var i = e.length, c = e.charAt(0), f = Math.log(i) / Math.log(256), p = Math.log(256) / Math.log(i);
1603
1608
  function d(u) {
1604
1609
  if (u instanceof Uint8Array || (ArrayBuffer.isView(u) ? u = new Uint8Array(u.buffer, u.byteOffset, u.byteLength) : Array.isArray(u) && (u = Uint8Array.from(u))), !(u instanceof Uint8Array))
1605
1610
  throw new TypeError("Expected Uint8Array");
1606
1611
  if (u.length === 0)
1607
1612
  return "";
1608
- for (var b = 0, x = 0, A = 0, I = u.length; A !== I && u[A] === 0; )
1609
- A++, b++;
1610
- for (var U = (I - A) * p + 1 >>> 0, S = new Uint8Array(U); A !== I; ) {
1611
- for (var B = u[A], M = 0, F = U - 1; (B !== 0 || M < x) && F !== -1; F--, M++)
1612
- B += 256 * S[F] >>> 0, S[F] = B % i >>> 0, B = B / i >>> 0;
1613
+ for (var b = 0, x = 0, C = 0, I = u.length; C !== I && u[C] === 0; )
1614
+ C++, b++;
1615
+ for (var U = (I - C) * p + 1 >>> 0, v = new Uint8Array(U); C !== I; ) {
1616
+ for (var B = u[C], M = 0, F = U - 1; (B !== 0 || M < x) && F !== -1; F--, M++)
1617
+ B += 256 * v[F] >>> 0, v[F] = B % i >>> 0, B = B / i >>> 0;
1613
1618
  if (B !== 0)
1614
1619
  throw new Error("Non-zero carry");
1615
- x = M, A++;
1620
+ x = M, C++;
1616
1621
  }
1617
- for (var N = U - x; N !== U && S[N] === 0; )
1622
+ for (var N = U - x; N !== U && v[N] === 0; )
1618
1623
  N++;
1619
- for (var L = c.repeat(b); N < U; ++N)
1620
- L += e.charAt(S[N]);
1621
- return L;
1624
+ for (var P = c.repeat(b); N < U; ++N)
1625
+ P += e.charAt(v[N]);
1626
+ return P;
1622
1627
  }
1623
1628
  function h(u) {
1624
1629
  if (typeof u != "string")
1625
1630
  throw new TypeError("Expected String");
1626
1631
  if (u.length === 0)
1627
1632
  return new Uint8Array();
1628
- for (var b = 0, x = 0, A = 0; u[b] === c; )
1633
+ for (var b = 0, x = 0, C = 0; u[b] === c; )
1629
1634
  x++, b++;
1630
- for (var I = (u.length - b) * a + 1 >>> 0, U = new Uint8Array(I); u[b]; ) {
1631
- var S = t[u.charCodeAt(b)];
1632
- if (S === 255)
1635
+ for (var I = (u.length - b) * f + 1 >>> 0, U = new Uint8Array(I); u[b]; ) {
1636
+ var v = t[u.charCodeAt(b)];
1637
+ if (v === 255)
1633
1638
  return;
1634
- for (var B = 0, M = I - 1; (S !== 0 || B < A) && M !== -1; M--, B++)
1635
- S += i * U[M] >>> 0, U[M] = S % 256 >>> 0, S = S / 256 >>> 0;
1636
- if (S !== 0)
1639
+ for (var B = 0, M = I - 1; (v !== 0 || B < C) && M !== -1; M--, B++)
1640
+ v += i * U[M] >>> 0, U[M] = v % 256 >>> 0, v = v / 256 >>> 0;
1641
+ if (v !== 0)
1637
1642
  throw new Error("Non-zero carry");
1638
- A = B, b++;
1643
+ C = B, b++;
1639
1644
  }
1640
- for (var F = I - A; F !== I && U[F] === 0; )
1645
+ for (var F = I - C; F !== I && U[F] === 0; )
1641
1646
  F++;
1642
- for (var N = new Uint8Array(x + (I - F)), L = x; F !== I; )
1643
- N[L++] = U[F++];
1647
+ for (var N = new Uint8Array(x + (I - F)), P = x; F !== I; )
1648
+ N[P++] = U[F++];
1644
1649
  return N;
1645
1650
  }
1646
1651
  function g(u) {
@@ -1655,25 +1660,25 @@ function Wr(e) {
1655
1660
  decode: g
1656
1661
  };
1657
1662
  }
1658
- var Jr = Wr;
1659
- const Gr = Jr, Xr = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
1660
- var qr = Gr(Xr), Ze = qr, Zr = function(e) {
1663
+ var Xr = Gr;
1664
+ const qr = Xr, Zr = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
1665
+ var Yr = qr(Zr), Qe = Yr, Qr = function(e) {
1661
1666
  function t(o) {
1662
- var i = Uint8Array.from(o), c = e(i), a = i.length + 4, p = new Uint8Array(a);
1663
- return p.set(i, 0), p.set(c.subarray(0, 4), i.length), Ze.encode(p, a);
1667
+ var i = Uint8Array.from(o), c = e(i), f = i.length + 4, p = new Uint8Array(f);
1668
+ return p.set(i, 0), p.set(c.subarray(0, 4), i.length), Qe.encode(p, f);
1664
1669
  }
1665
1670
  function r(o) {
1666
- var i = o.slice(0, -4), c = o.slice(-4), a = e(i);
1667
- if (!(c[0] ^ a[0] | c[1] ^ a[1] | c[2] ^ a[2] | c[3] ^ a[3]))
1671
+ var i = o.slice(0, -4), c = o.slice(-4), f = e(i);
1672
+ if (!(c[0] ^ f[0] | c[1] ^ f[1] | c[2] ^ f[2] | c[3] ^ f[3]))
1668
1673
  return i;
1669
1674
  }
1670
1675
  function n(o) {
1671
- var i = Ze.decodeUnsafe(o);
1676
+ var i = Qe.decodeUnsafe(o);
1672
1677
  if (i)
1673
1678
  return r(i);
1674
1679
  }
1675
1680
  function s(o) {
1676
- var i = Ze.decode(o), c = r(i);
1681
+ var i = Qe.decode(o), c = r(i);
1677
1682
  if (!c) throw new Error("Invalid checksum");
1678
1683
  return c;
1679
1684
  }
@@ -1682,13 +1687,13 @@ var qr = Gr(Xr), Ze = qr, Zr = function(e) {
1682
1687
  decode: s,
1683
1688
  decodeUnsafe: n
1684
1689
  };
1685
- }, { sha256: _t } = ve, Yr = Zr;
1686
- function Qr(e) {
1687
- return _t(_t(e));
1690
+ }, { sha256: Ut } = ve, en = Qr;
1691
+ function tn(e) {
1692
+ return Ut(Ut(e));
1688
1693
  }
1689
- var en = Yr(Qr);
1690
- const tn = /* @__PURE__ */ ze(en), er = "automerge:", tr = (e) => {
1691
- const t = new RegExp(`^${er}(\\w+)$`), [, r] = e.match(t) || [], n = r, s = rr(n);
1694
+ var rn = en(tn);
1695
+ const nn = /* @__PURE__ */ We(rn), rr = "automerge:", nr = (e) => {
1696
+ const t = new RegExp(`^${rr}(\\w+)$`), [, r] = e.match(t) || [], n = r, s = sr(n);
1692
1697
  if (!s)
1693
1698
  throw new Error("Invalid document URL: " + e);
1694
1699
  return {
@@ -1697,42 +1702,42 @@ const tn = /* @__PURE__ */ ze(en), er = "automerge:", tr = (e) => {
1697
1702
  /** encoded DocumentId */
1698
1703
  documentId: n
1699
1704
  };
1700
- }, rn = (e) => {
1701
- if (typeof e != "string" || !e || !e.startsWith(er))
1705
+ }, sn = (e) => {
1706
+ if (typeof e != "string" || !e || !e.startsWith(rr))
1702
1707
  return !1;
1703
1708
  const t = e;
1704
1709
  try {
1705
- const { documentId: r } = tr(t);
1706
- return nn(r);
1710
+ const { documentId: r } = nr(t);
1711
+ return on(r);
1707
1712
  } catch {
1708
1713
  return !1;
1709
1714
  }
1710
- }, nn = (e) => {
1715
+ }, on = (e) => {
1711
1716
  if (typeof e != "string")
1712
1717
  return !1;
1713
- const t = rr(e);
1718
+ const t = sr(e);
1714
1719
  if (t === void 0)
1715
1720
  return !1;
1716
- const r = Ur(t);
1717
- return zt(r);
1718
- }, rr = (e) => tn.decodeUnsafe(e);
1719
- let st;
1721
+ const r = kr(t);
1722
+ return Wt(r);
1723
+ }, sr = (e) => nn.decodeUnsafe(e);
1724
+ let ot;
1720
1725
  try {
1721
- st = new TextDecoder();
1726
+ ot = new TextDecoder();
1722
1727
  } catch {
1723
1728
  }
1724
- let O, be, w = 0;
1725
- const sn = 105, on = 57342, fn = 57343, Ot = 57337, It = 6, xe = {};
1726
- let D = {}, K, Pe, Ve = 0, Ie = 0, G, ne, W = [], it = [], Q, Y, Ae, Ut = {
1729
+ let O, ge, w = 0;
1730
+ const fn = 105, an = 57342, cn = 57343, Ft = 57337, kt = 6, we = {};
1731
+ let Ce = 11281e4, ce = 1681e4, D = {}, K, Ne, $e = 0, Fe = 0, G, ne, W = [], ft = [], Q, Y, Ee, jt = {
1727
1732
  useRecords: !1,
1728
1733
  mapsAsObjects: !0
1729
- }, Ue = !1, nr = 2;
1734
+ }, ke = !1, ir = 2;
1730
1735
  try {
1731
1736
  new Function("");
1732
1737
  } catch {
1733
- nr = 1 / 0;
1738
+ ir = 1 / 0;
1734
1739
  }
1735
- class Fe {
1740
+ class je {
1736
1741
  constructor(t) {
1737
1742
  if (t && ((t.keyMap || t._keyMap) && !t.useRecords && (t.useRecords = !1, t.mapsAsObjects = !0), t.useRecords === !1 && t.mapsAsObjects === void 0 && (t.mapsAsObjects = !0), t.getStructures && (t.getShared = t.getStructures), t.getShared && !t.structures && ((t.structures = []).uninitialized = !0), t.keyMap)) {
1738
1743
  this.mapKey = /* @__PURE__ */ new Map();
@@ -1779,48 +1784,48 @@ class Fe {
1779
1784
  }
1780
1785
  decode(t, r) {
1781
1786
  if (O)
1782
- return fr(() => (ct(), this ? this.decode(t, r) : Fe.prototype.decode.call(Ut, t, r)));
1783
- be = r > -1 ? r : t.length, w = 0, Ie = 0, Pe = null, G = null, O = t;
1787
+ return cr(() => (ut(), this ? this.decode(t, r) : je.prototype.decode.call(jt, t, r)));
1788
+ ge = r > -1 ? r : t.length, w = 0, Fe = 0, Ne = null, G = null, O = t;
1784
1789
  try {
1785
1790
  Y = t.dataView || (t.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength));
1786
1791
  } catch (n) {
1787
1792
  throw O = null, t instanceof Uint8Array ? n : new Error("Source must be a Uint8Array or Buffer but was a " + (t && typeof t == "object" ? t.constructor.name : typeof t));
1788
1793
  }
1789
- if (this instanceof Fe) {
1794
+ if (this instanceof je) {
1790
1795
  if (D = this, Q = this.sharedValues && (this.pack ? new Array(this.maxPrivatePackedValues || 16).concat(this.sharedValues) : this.sharedValues), this.structures)
1791
- return K = this.structures, ke();
1796
+ return K = this.structures, Re();
1792
1797
  (!K || K.length > 0) && (K = []);
1793
1798
  } else
1794
- D = Ut, (!K || K.length > 0) && (K = []), Q = null;
1795
- return ke();
1799
+ D = jt, (!K || K.length > 0) && (K = []), Q = null;
1800
+ return Re();
1796
1801
  }
1797
1802
  decodeMultiple(t, r) {
1798
1803
  let n, s = 0;
1799
1804
  try {
1800
1805
  let o = t.length;
1801
- Ue = !0;
1802
- let i = this ? this.decode(t, o) : vt.decode(t, o);
1806
+ ke = !0;
1807
+ let i = this ? this.decode(t, o) : Ct.decode(t, o);
1803
1808
  if (r) {
1804
1809
  if (r(i) === !1)
1805
1810
  return;
1806
1811
  for (; w < o; )
1807
- if (s = w, r(ke()) === !1)
1812
+ if (s = w, r(Re()) === !1)
1808
1813
  return;
1809
1814
  } else {
1810
1815
  for (n = [i]; w < o; )
1811
- s = w, n.push(ke());
1816
+ s = w, n.push(Re());
1812
1817
  return n;
1813
1818
  }
1814
1819
  } catch (o) {
1815
1820
  throw o.lastPosition = s, o.values = n, o;
1816
1821
  } finally {
1817
- Ue = !1, ct();
1822
+ ke = !1, ut();
1818
1823
  }
1819
1824
  }
1820
1825
  }
1821
- function ke() {
1826
+ function Re() {
1822
1827
  try {
1823
- let e = P();
1828
+ let e = L();
1824
1829
  if (G) {
1825
1830
  if (w >= G.postBundlePosition) {
1826
1831
  let t = new Error("Unexpected bundle position");
@@ -1828,19 +1833,19 @@ function ke() {
1828
1833
  }
1829
1834
  w = G.postBundlePosition, G = null;
1830
1835
  }
1831
- if (w == be)
1836
+ if (w == ge)
1832
1837
  K = null, O = null, ne && (ne = null);
1833
- else if (w > be) {
1838
+ else if (w > ge) {
1834
1839
  let t = new Error("Unexpected end of CBOR data");
1835
1840
  throw t.incomplete = !0, t;
1836
- } else if (!Ue)
1841
+ } else if (!ke)
1837
1842
  throw new Error("Data read, but end of buffer not reached");
1838
1843
  return e;
1839
1844
  } catch (e) {
1840
- throw ct(), (e instanceof RangeError || e.message.startsWith("Unexpected end of buffer")) && (e.incomplete = !0), e;
1845
+ throw ut(), (e instanceof RangeError || e.message.startsWith("Unexpected end of buffer")) && (e.incomplete = !0), e;
1841
1846
  }
1842
1847
  }
1843
- function P() {
1848
+ function L() {
1844
1849
  let e = O[w++], t = e >> 5;
1845
1850
  if (e = e & 31, e > 23)
1846
1851
  switch (e) {
@@ -1849,14 +1854,14 @@ function P() {
1849
1854
  break;
1850
1855
  case 25:
1851
1856
  if (t == 7)
1852
- return un();
1857
+ return dn();
1853
1858
  e = Y.getUint16(w), w += 2;
1854
1859
  break;
1855
1860
  case 26:
1856
1861
  if (t == 7) {
1857
1862
  let r = Y.getFloat32(w);
1858
1863
  if (D.useFloat32 > 2) {
1859
- let n = mt[(O[w] & 127) << 1 | O[w + 1] >> 7];
1864
+ let n = At[(O[w] & 127) << 1 | O[w + 1] >> 7];
1860
1865
  return w += 4, (n * r + (r > 0 ? 0.5 : -0.5) >> 0) / n;
1861
1866
  }
1862
1867
  return w += 4, r;
@@ -1882,25 +1887,48 @@ function P() {
1882
1887
  throw new Error("Indefinite length not supported for byte or text strings");
1883
1888
  case 4:
1884
1889
  let r = [], n, s = 0;
1885
- for (; (n = P()) != xe; )
1890
+ for (; (n = L()) != we; ) {
1891
+ if (s >= Ce) throw new Error(`Array length exceeds ${Ce}`);
1886
1892
  r[s++] = n;
1893
+ }
1887
1894
  return t == 4 ? r : t == 3 ? r.join("") : Buffer.concat(r);
1888
1895
  case 5:
1889
1896
  let o;
1890
1897
  if (D.mapsAsObjects) {
1891
- let i = {};
1892
- if (D.keyMap) for (; (o = P()) != xe; ) i[se(D.decodeKey(o))] = P();
1893
- else for (; (o = P()) != xe; ) i[se(o)] = P();
1898
+ let i = {}, c = 0;
1899
+ if (D.keyMap)
1900
+ for (; (o = L()) != we; ) {
1901
+ if (c++ >= ce) throw new Error(`Property count exceeds ${ce}`);
1902
+ i[se(D.decodeKey(o))] = L();
1903
+ }
1904
+ else
1905
+ for (; (o = L()) != we; ) {
1906
+ if (c++ >= ce) throw new Error(`Property count exceeds ${ce}`);
1907
+ i[se(o)] = L();
1908
+ }
1894
1909
  return i;
1895
1910
  } else {
1896
- Ae && (D.mapsAsObjects = !0, Ae = !1);
1911
+ Ee && (D.mapsAsObjects = !0, Ee = !1);
1897
1912
  let i = /* @__PURE__ */ new Map();
1898
- if (D.keyMap) for (; (o = P()) != xe; ) i.set(D.decodeKey(o), P());
1899
- else for (; (o = P()) != xe; ) i.set(o, P());
1913
+ if (D.keyMap) {
1914
+ let c = 0;
1915
+ for (; (o = L()) != we; ) {
1916
+ if (c++ >= ce)
1917
+ throw new Error(`Map size exceeds ${ce}`);
1918
+ i.set(D.decodeKey(o), L());
1919
+ }
1920
+ } else {
1921
+ let c = 0;
1922
+ for (; (o = L()) != we; ) {
1923
+ if (c++ >= ce)
1924
+ throw new Error(`Map size exceeds ${ce}`);
1925
+ i.set(o, L());
1926
+ }
1927
+ }
1900
1928
  return i;
1901
1929
  }
1902
1930
  case 7:
1903
- return xe;
1931
+ return we;
1904
1932
  default:
1905
1933
  throw new Error("Invalid major type for indefinite length " + t);
1906
1934
  }
@@ -1913,74 +1941,76 @@ function P() {
1913
1941
  case 1:
1914
1942
  return ~e;
1915
1943
  case 2:
1916
- return ln(e);
1944
+ return hn(e);
1917
1945
  case 3:
1918
- if (Ie >= w)
1919
- return Pe.slice(w - Ve, (w += e) - Ve);
1920
- if (Ie == 0 && be < 140 && e < 32) {
1921
- let s = e < 16 ? sr(e) : cn(e);
1946
+ if (Fe >= w)
1947
+ return Ne.slice(w - $e, (w += e) - $e);
1948
+ if (Fe == 0 && ge < 140 && e < 32) {
1949
+ let s = e < 16 ? or(e) : un(e);
1922
1950
  if (s != null)
1923
1951
  return s;
1924
1952
  }
1925
- return an(e);
1953
+ return ln(e);
1926
1954
  case 4:
1955
+ if (e >= Ce) throw new Error(`Array length exceeds ${Ce}`);
1927
1956
  let r = new Array(e);
1928
- for (let s = 0; s < e; s++) r[s] = P();
1957
+ for (let s = 0; s < e; s++) r[s] = L();
1929
1958
  return r;
1930
1959
  case 5:
1960
+ if (e >= ce) throw new Error(`Map size exceeds ${Ce}`);
1931
1961
  if (D.mapsAsObjects) {
1932
1962
  let s = {};
1933
- if (D.keyMap) for (let o = 0; o < e; o++) s[se(D.decodeKey(P()))] = P();
1934
- else for (let o = 0; o < e; o++) s[se(P())] = P();
1963
+ if (D.keyMap) for (let o = 0; o < e; o++) s[se(D.decodeKey(L()))] = L();
1964
+ else for (let o = 0; o < e; o++) s[se(L())] = L();
1935
1965
  return s;
1936
1966
  } else {
1937
- Ae && (D.mapsAsObjects = !0, Ae = !1);
1967
+ Ee && (D.mapsAsObjects = !0, Ee = !1);
1938
1968
  let s = /* @__PURE__ */ new Map();
1939
- if (D.keyMap) for (let o = 0; o < e; o++) s.set(D.decodeKey(P()), P());
1940
- else for (let o = 0; o < e; o++) s.set(P(), P());
1969
+ if (D.keyMap) for (let o = 0; o < e; o++) s.set(D.decodeKey(L()), L());
1970
+ else for (let o = 0; o < e; o++) s.set(L(), L());
1941
1971
  return s;
1942
1972
  }
1943
1973
  case 6:
1944
- if (e >= Ot) {
1974
+ if (e >= Ft) {
1945
1975
  let s = K[e & 8191];
1946
1976
  if (s)
1947
- return s.read || (s.read = ot(s)), s.read();
1977
+ return s.read || (s.read = at(s)), s.read();
1948
1978
  if (e < 65536) {
1949
- if (e == fn) {
1950
- let o = me(), i = P(), c = P();
1951
- at(i, c);
1952
- let a = {};
1979
+ if (e == cn) {
1980
+ let o = Se(), i = L(), c = L();
1981
+ lt(i, c);
1982
+ let f = {};
1953
1983
  if (D.keyMap) for (let p = 2; p < o; p++) {
1954
1984
  let d = D.decodeKey(c[p - 2]);
1955
- a[se(d)] = P();
1985
+ f[se(d)] = L();
1956
1986
  }
1957
1987
  else for (let p = 2; p < o; p++) {
1958
1988
  let d = c[p - 2];
1959
- a[se(d)] = P();
1989
+ f[se(d)] = L();
1960
1990
  }
1961
- return a;
1962
- } else if (e == on) {
1963
- let o = me(), i = P();
1991
+ return f;
1992
+ } else if (e == an) {
1993
+ let o = Se(), i = L();
1964
1994
  for (let c = 2; c < o; c++)
1965
- at(i++, P());
1966
- return P();
1967
- } else if (e == Ot)
1968
- return gn();
1969
- if (D.getShared && (wt(), s = K[e & 8191], s))
1970
- return s.read || (s.read = ot(s)), s.read();
1995
+ lt(i++, L());
1996
+ return L();
1997
+ } else if (e == Ft)
1998
+ return wn();
1999
+ if (D.getShared && (vt(), s = K[e & 8191], s))
2000
+ return s.read || (s.read = at(s)), s.read();
1971
2001
  }
1972
2002
  }
1973
2003
  let n = W[e];
1974
2004
  if (n)
1975
- return n.handlesRead ? n(P) : n(P());
2005
+ return n.handlesRead ? n(L) : n(L());
1976
2006
  {
1977
- let s = P();
1978
- for (let o = 0; o < it.length; o++) {
1979
- let i = it[o](e, s);
2007
+ let s = L();
2008
+ for (let o = 0; o < ft.length; o++) {
2009
+ let i = ft[o](e, s);
1980
2010
  if (i !== void 0)
1981
2011
  return i;
1982
2012
  }
1983
- return new ge(s, e);
2013
+ return new xe(s, e);
1984
2014
  }
1985
2015
  case 7:
1986
2016
  switch (e) {
@@ -1994,7 +2024,7 @@ function P() {
1994
2024
  return;
1995
2025
  case 31:
1996
2026
  default:
1997
- let s = (Q || de())[e];
2027
+ let s = (Q || ye())[e];
1998
2028
  if (s !== void 0)
1999
2029
  return s;
2000
2030
  throw new Error("Unknown token " + e);
@@ -2007,8 +2037,9 @@ function P() {
2007
2037
  throw new Error("Unknown CBOR token " + e);
2008
2038
  }
2009
2039
  }
2010
- const Ft = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
2011
- function ot(e) {
2040
+ const Mt = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
2041
+ function at(e) {
2042
+ if (!e) throw new Error("Structure is required in record definition");
2012
2043
  function t() {
2013
2044
  let r = O[w++];
2014
2045
  if (r = r & 31, r > 23)
@@ -2028,17 +2059,17 @@ function ot(e) {
2028
2059
  let n = this.compiledReader;
2029
2060
  for (; n; ) {
2030
2061
  if (n.propertyCount === r)
2031
- return n(P);
2062
+ return n(L);
2032
2063
  n = n.next;
2033
2064
  }
2034
- if (this.slowReads++ >= nr) {
2065
+ if (this.slowReads++ >= ir) {
2035
2066
  let o = this.length == r ? this : this.slice(0, r);
2036
- return n = D.keyMap ? new Function("r", "return {" + o.map((i) => D.decodeKey(i)).map((i) => Ft.test(i) ? se(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}") : new Function("r", "return {" + o.map((i) => Ft.test(i) ? se(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}"), this.compiledReader && (n.next = this.compiledReader), n.propertyCount = r, this.compiledReader = n, n(P);
2067
+ return n = D.keyMap ? new Function("r", "return {" + o.map((i) => D.decodeKey(i)).map((i) => Mt.test(i) ? se(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}") : new Function("r", "return {" + o.map((i) => Mt.test(i) ? se(i) + ":r()" : "[" + JSON.stringify(i) + "]:r()").join(",") + "}"), this.compiledReader && (n.next = this.compiledReader), n.propertyCount = r, this.compiledReader = n, n(L);
2037
2068
  }
2038
2069
  let s = {};
2039
- if (D.keyMap) for (let o = 0; o < r; o++) s[se(D.decodeKey(this[o]))] = P();
2070
+ if (D.keyMap) for (let o = 0; o < r; o++) s[se(D.decodeKey(this[o]))] = L();
2040
2071
  else for (let o = 0; o < r; o++)
2041
- s[se(this[o])] = P();
2072
+ s[se(this[o])] = L();
2042
2073
  return s;
2043
2074
  }
2044
2075
  return e.slowReads = 0, t;
@@ -2049,13 +2080,13 @@ function se(e) {
2049
2080
  if (e == null) return e + "";
2050
2081
  throw new Error("Invalid property name type " + typeof e);
2051
2082
  }
2052
- let an = ft;
2053
- function ft(e) {
2083
+ let ln = ct;
2084
+ function ct(e) {
2054
2085
  let t;
2055
- if (e < 16 && (t = sr(e)))
2086
+ if (e < 16 && (t = or(e)))
2056
2087
  return t;
2057
- if (e > 64 && st)
2058
- return st.decode(O.subarray(w, w += e));
2088
+ if (e > 64 && ot)
2089
+ return ot.decode(O.subarray(w, w += e));
2059
2090
  const r = w + e, n = [];
2060
2091
  for (t = ""; w < r; ) {
2061
2092
  const s = O[w++];
@@ -2069,8 +2100,8 @@ function ft(e) {
2069
2100
  n.push((s & 31) << 12 | o << 6 | i);
2070
2101
  } else if ((s & 248) === 240) {
2071
2102
  const o = O[w++] & 63, i = O[w++] & 63, c = O[w++] & 63;
2072
- let a = (s & 7) << 18 | o << 12 | i << 6 | c;
2073
- a > 65535 && (a -= 65536, n.push(a >>> 10 & 1023 | 55296), a = 56320 | a & 1023), n.push(a);
2103
+ let f = (s & 7) << 18 | o << 12 | i << 6 | c;
2104
+ f > 65535 && (f -= 65536, n.push(f >>> 10 & 1023 | 55296), f = 56320 | f & 1023), n.push(f);
2074
2105
  } else
2075
2106
  n.push(s);
2076
2107
  n.length >= 4096 && (t += X.apply(String, n), n.length = 0);
@@ -2078,7 +2109,7 @@ function ft(e) {
2078
2109
  return n.length > 0 && (t += X.apply(String, n)), t;
2079
2110
  }
2080
2111
  let X = String.fromCharCode;
2081
- function cn(e) {
2112
+ function un(e) {
2082
2113
  let t = w, r = new Array(e);
2083
2114
  for (let n = 0; n < e; n++) {
2084
2115
  const s = O[w++];
@@ -2090,7 +2121,7 @@ function cn(e) {
2090
2121
  }
2091
2122
  return X.apply(String, r);
2092
2123
  }
2093
- function sr(e) {
2124
+ function or(e) {
2094
2125
  if (e < 4)
2095
2126
  if (e < 2) {
2096
2127
  if (e === 0)
@@ -2150,21 +2181,21 @@ function sr(e) {
2150
2181
  }
2151
2182
  return X(t, r, n, s, o, i, c);
2152
2183
  } else {
2153
- let o = O[w++], i = O[w++], c = O[w++], a = O[w++];
2154
- if ((o & 128) > 0 || (i & 128) > 0 || (c & 128) > 0 || (a & 128) > 0) {
2184
+ let o = O[w++], i = O[w++], c = O[w++], f = O[w++];
2185
+ if ((o & 128) > 0 || (i & 128) > 0 || (c & 128) > 0 || (f & 128) > 0) {
2155
2186
  w -= 8;
2156
2187
  return;
2157
2188
  }
2158
2189
  if (e < 10) {
2159
2190
  if (e === 8)
2160
- return X(t, r, n, s, o, i, c, a);
2191
+ return X(t, r, n, s, o, i, c, f);
2161
2192
  {
2162
2193
  let p = O[w++];
2163
2194
  if ((p & 128) > 0) {
2164
2195
  w -= 9;
2165
2196
  return;
2166
2197
  }
2167
- return X(t, r, n, s, o, i, c, a, p);
2198
+ return X(t, r, n, s, o, i, c, f, p);
2168
2199
  }
2169
2200
  } else if (e < 12) {
2170
2201
  let p = O[w++], d = O[w++];
@@ -2173,13 +2204,13 @@ function sr(e) {
2173
2204
  return;
2174
2205
  }
2175
2206
  if (e < 11)
2176
- return X(t, r, n, s, o, i, c, a, p, d);
2207
+ return X(t, r, n, s, o, i, c, f, p, d);
2177
2208
  let h = O[w++];
2178
2209
  if ((h & 128) > 0) {
2179
2210
  w -= 11;
2180
2211
  return;
2181
2212
  }
2182
- return X(t, r, n, s, o, i, c, a, p, d, h);
2213
+ return X(t, r, n, s, o, i, c, f, p, d, h);
2183
2214
  } else {
2184
2215
  let p = O[w++], d = O[w++], h = O[w++], g = O[w++];
2185
2216
  if ((p & 128) > 0 || (d & 128) > 0 || (h & 128) > 0 || (g & 128) > 0) {
@@ -2188,14 +2219,14 @@ function sr(e) {
2188
2219
  }
2189
2220
  if (e < 14) {
2190
2221
  if (e === 12)
2191
- return X(t, r, n, s, o, i, c, a, p, d, h, g);
2222
+ return X(t, r, n, s, o, i, c, f, p, d, h, g);
2192
2223
  {
2193
2224
  let u = O[w++];
2194
2225
  if ((u & 128) > 0) {
2195
2226
  w -= 13;
2196
2227
  return;
2197
2228
  }
2198
- return X(t, r, n, s, o, i, c, a, p, d, h, g, u);
2229
+ return X(t, r, n, s, o, i, c, f, p, d, h, g, u);
2199
2230
  }
2200
2231
  } else {
2201
2232
  let u = O[w++], b = O[w++];
@@ -2204,26 +2235,26 @@ function sr(e) {
2204
2235
  return;
2205
2236
  }
2206
2237
  if (e < 15)
2207
- return X(t, r, n, s, o, i, c, a, p, d, h, g, u, b);
2238
+ return X(t, r, n, s, o, i, c, f, p, d, h, g, u, b);
2208
2239
  let x = O[w++];
2209
2240
  if ((x & 128) > 0) {
2210
2241
  w -= 15;
2211
2242
  return;
2212
2243
  }
2213
- return X(t, r, n, s, o, i, c, a, p, d, h, g, u, b, x);
2244
+ return X(t, r, n, s, o, i, c, f, p, d, h, g, u, b, x);
2214
2245
  }
2215
2246
  }
2216
2247
  }
2217
2248
  }
2218
2249
  }
2219
- function ln(e) {
2250
+ function hn(e) {
2220
2251
  return D.copyBuffers ? (
2221
2252
  // specifically use the copying slice (not the node one)
2222
2253
  Uint8Array.prototype.slice.call(O, w, w += e)
2223
2254
  ) : O.subarray(w, w += e);
2224
2255
  }
2225
- let ir = new Float32Array(1), Me = new Uint8Array(ir.buffer, 0, 4);
2226
- function un() {
2256
+ let fr = new Float32Array(1), Be = new Uint8Array(fr.buffer, 0, 4);
2257
+ function dn() {
2227
2258
  let e = O[w++], t = O[w++], r = (e & 127) >> 2;
2228
2259
  if (r === 31)
2229
2260
  return t || e & 3 ? NaN : e & 128 ? -1 / 0 : 1 / 0;
@@ -2231,12 +2262,12 @@ function un() {
2231
2262
  let n = ((e & 3) << 8 | t) / 16777216;
2232
2263
  return e & 128 ? -n : n;
2233
2264
  }
2234
- return Me[3] = e & 128 | // sign bit
2235
- (r >> 1) + 56, Me[2] = (e & 7) << 5 | // last exponent bit and first two mantissa bits
2236
- t >> 3, Me[1] = t << 5, Me[0] = 0, ir[0];
2265
+ return Be[3] = e & 128 | // sign bit
2266
+ (r >> 1) + 56, Be[2] = (e & 7) << 5 | // last exponent bit and first two mantissa bits
2267
+ t >> 3, Be[1] = t << 5, Be[0] = 0, fr[0];
2237
2268
  }
2238
2269
  new Array(4096);
2239
- class ge {
2270
+ class xe {
2240
2271
  constructor(t, r) {
2241
2272
  this.value = t, this.tag = r;
2242
2273
  }
@@ -2246,20 +2277,20 @@ W[1] = (e) => new Date(Math.round(e * 1e3));
2246
2277
  W[2] = (e) => {
2247
2278
  let t = BigInt(0);
2248
2279
  for (let r = 0, n = e.byteLength; r < n; r++)
2249
- t = BigInt(e[r]) + t << BigInt(8);
2280
+ t = BigInt(e[r]) + (t << BigInt(8));
2250
2281
  return t;
2251
2282
  };
2252
2283
  W[3] = (e) => BigInt(-1) - W[2](e);
2253
2284
  W[4] = (e) => +(e[1] + "e" + e[0]);
2254
2285
  W[5] = (e) => e[1] * Math.exp(e[0] * Math.log(2));
2255
- const at = (e, t) => {
2286
+ const lt = (e, t) => {
2256
2287
  e = e - 57344;
2257
2288
  let r = K[e];
2258
- r && r.isShared && ((K.restoreStructures || (K.restoreStructures = []))[e] = r), K[e] = t, t.read = ot(t);
2289
+ r && r.isShared && ((K.restoreStructures || (K.restoreStructures = []))[e] = r), K[e] = t, t.read = at(t);
2259
2290
  };
2260
- W[sn] = (e) => {
2291
+ W[fn] = (e) => {
2261
2292
  let t = e.length, r = e[1];
2262
- at(e[0], r);
2293
+ lt(e[0], r);
2263
2294
  let n = {};
2264
2295
  for (let s = 2; s < t; s++) {
2265
2296
  let o = r[s - 2];
@@ -2267,11 +2298,11 @@ W[sn] = (e) => {
2267
2298
  }
2268
2299
  return n;
2269
2300
  };
2270
- W[14] = (e) => G ? G[0].slice(G.position0, G.position0 += e) : new ge(e, 14);
2271
- W[15] = (e) => G ? G[1].slice(G.position1, G.position1 += e) : new ge(e, 15);
2272
- let hn = { Error, RegExp };
2273
- W[27] = (e) => (hn[e[0]] || Error)(e[1], e[2]);
2274
- const or = (e) => {
2301
+ W[14] = (e) => G ? G[0].slice(G.position0, G.position0 += e) : new xe(e, 14);
2302
+ W[15] = (e) => G ? G[1].slice(G.position1, G.position1 += e) : new xe(e, 15);
2303
+ let yn = { Error, RegExp };
2304
+ W[27] = (e) => (yn[e[0]] || Error)(e[1], e[2]);
2305
+ const ar = (e) => {
2275
2306
  if (O[w++] != 132) {
2276
2307
  let r = new Error("Packed values structure must be followed by a 4 element array");
2277
2308
  throw O.length < w && (r.incomplete = !0), r;
@@ -2283,14 +2314,14 @@ const or = (e) => {
2283
2314
  }
2284
2315
  return Q = Q ? t.concat(Q.slice(t.length)) : t, Q.prefixes = e(), Q.suffixes = e(), e();
2285
2316
  };
2286
- or.handlesRead = !0;
2287
- W[51] = or;
2288
- W[It] = (e) => {
2317
+ ar.handlesRead = !0;
2318
+ W[51] = ar;
2319
+ W[kt] = (e) => {
2289
2320
  if (!Q)
2290
2321
  if (D.getShared)
2291
- wt();
2322
+ vt();
2292
2323
  else
2293
- return new ge(e, It);
2324
+ return new xe(e, kt);
2294
2325
  if (typeof e == "number")
2295
2326
  return Q[16 + (e >= 0 ? 2 * e : -2 * e - 1)];
2296
2327
  let t = new Error("No support for non-integer packed references yet");
@@ -2311,33 +2342,33 @@ W[29] = (e) => {
2311
2342
  return t.used = !0, t.target;
2312
2343
  };
2313
2344
  W[258] = (e) => new Set(e);
2314
- (W[259] = (e) => (D.mapsAsObjects && (D.mapsAsObjects = !1, Ae = !0), e())).handlesRead = !0;
2315
- function we(e, t) {
2345
+ (W[259] = (e) => (D.mapsAsObjects && (D.mapsAsObjects = !1, Ee = !0), e())).handlesRead = !0;
2346
+ function me(e, t) {
2316
2347
  return typeof e == "string" ? e + t : e instanceof Array ? e.concat(t) : Object.assign({}, e, t);
2317
2348
  }
2318
- function de() {
2349
+ function ye() {
2319
2350
  if (!Q)
2320
2351
  if (D.getShared)
2321
- wt();
2352
+ vt();
2322
2353
  else
2323
2354
  throw new Error("No packed values available");
2324
2355
  return Q;
2325
2356
  }
2326
- const dn = 1399353956;
2327
- it.push((e, t) => {
2357
+ const pn = 1399353956;
2358
+ ft.push((e, t) => {
2328
2359
  if (e >= 225 && e <= 255)
2329
- return we(de().prefixes[e - 224], t);
2360
+ return me(ye().prefixes[e - 224], t);
2330
2361
  if (e >= 28704 && e <= 32767)
2331
- return we(de().prefixes[e - 28672], t);
2362
+ return me(ye().prefixes[e - 28672], t);
2332
2363
  if (e >= 1879052288 && e <= 2147483647)
2333
- return we(de().prefixes[e - 1879048192], t);
2364
+ return me(ye().prefixes[e - 1879048192], t);
2334
2365
  if (e >= 216 && e <= 223)
2335
- return we(t, de().suffixes[e - 216]);
2366
+ return me(t, ye().suffixes[e - 216]);
2336
2367
  if (e >= 27647 && e <= 28671)
2337
- return we(t, de().suffixes[e - 27639]);
2368
+ return me(t, ye().suffixes[e - 27639]);
2338
2369
  if (e >= 1811940352 && e <= 1879048191)
2339
- return we(t, de().suffixes[e - 1811939328]);
2340
- if (e == dn)
2370
+ return me(t, ye().suffixes[e - 1811939328]);
2371
+ if (e == pn)
2341
2372
  return {
2342
2373
  packedValues: Q,
2343
2374
  structures: K.slice(0),
@@ -2346,7 +2377,7 @@ it.push((e, t) => {
2346
2377
  if (e == 55799)
2347
2378
  return t;
2348
2379
  });
2349
- const yn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1, jt = [
2380
+ const bn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1, Rt = [
2350
2381
  Uint8Array,
2351
2382
  Uint8ClampedArray,
2352
2383
  Uint16Array,
@@ -2358,40 +2389,40 @@ const yn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1, jt = [
2358
2389
  typeof BigInt64Array > "u" ? { name: "BigInt64Array" } : BigInt64Array,
2359
2390
  Float32Array,
2360
2391
  Float64Array
2361
- ], pn = [64, 68, 69, 70, 71, 72, 77, 78, 79, 85, 86];
2362
- for (let e = 0; e < jt.length; e++)
2363
- bn(jt[e], pn[e]);
2364
- function bn(e, t) {
2392
+ ], gn = [64, 68, 69, 70, 71, 72, 77, 78, 79, 85, 86];
2393
+ for (let e = 0; e < Rt.length; e++)
2394
+ xn(Rt[e], gn[e]);
2395
+ function xn(e, t) {
2365
2396
  let r = "get" + e.name.slice(0, -5), n;
2366
2397
  typeof e == "function" ? n = e.BYTES_PER_ELEMENT : e = null;
2367
2398
  for (let s = 0; s < 2; s++) {
2368
2399
  if (!s && n == 1)
2369
2400
  continue;
2370
2401
  let o = n == 2 ? 1 : n == 4 ? 2 : n == 8 ? 3 : 0;
2371
- W[s ? t : t - 4] = n == 1 || s == yn ? (i) => {
2402
+ W[s ? t : t - 4] = n == 1 || s == bn ? (i) => {
2372
2403
  if (!e)
2373
2404
  throw new Error("Could not find typed array for code " + t);
2374
2405
  return !D.copyBuffers && (n === 1 || n === 2 && !(i.byteOffset & 1) || n === 4 && !(i.byteOffset & 3) || n === 8 && !(i.byteOffset & 7)) ? new e(i.buffer, i.byteOffset, i.byteLength >> o) : new e(Uint8Array.prototype.slice.call(i, 0).buffer);
2375
2406
  } : (i) => {
2376
2407
  if (!e)
2377
2408
  throw new Error("Could not find typed array for code " + t);
2378
- let c = new DataView(i.buffer, i.byteOffset, i.byteLength), a = i.length >> o, p = new e(a), d = c[r];
2379
- for (let h = 0; h < a; h++)
2409
+ let c = new DataView(i.buffer, i.byteOffset, i.byteLength), f = i.length >> o, p = new e(f), d = c[r];
2410
+ for (let h = 0; h < f; h++)
2380
2411
  p[h] = d.call(c, h << o, s);
2381
2412
  return p;
2382
2413
  };
2383
2414
  }
2384
2415
  }
2385
- function gn() {
2386
- let e = me(), t = w + P();
2416
+ function wn() {
2417
+ let e = Se(), t = w + L();
2387
2418
  for (let n = 2; n < e; n++) {
2388
- let s = me();
2419
+ let s = Se();
2389
2420
  w += s;
2390
2421
  }
2391
2422
  let r = w;
2392
- return w = t, G = [ft(me()), ft(me())], G.position0 = 0, G.position1 = 0, G.postBundlePosition = w, w = r, P();
2423
+ return w = t, G = [ct(Se()), ct(Se())], G.position0 = 0, G.position1 = 0, G.postBundlePosition = w, w = r, L();
2393
2424
  }
2394
- function me() {
2425
+ function Se() {
2395
2426
  let e = O[w++] & 31;
2396
2427
  if (e > 23)
2397
2428
  switch (e) {
@@ -2407,44 +2438,44 @@ function me() {
2407
2438
  }
2408
2439
  return e;
2409
2440
  }
2410
- function wt() {
2441
+ function vt() {
2411
2442
  if (D.getShared) {
2412
- let e = fr(() => (O = null, D.getShared())) || {}, t = e.structures || [];
2443
+ let e = cr(() => (O = null, D.getShared())) || {}, t = e.structures || [];
2413
2444
  D.sharedVersion = e.version, Q = D.sharedValues = e.packedValues, K === !0 ? D.structures = K = t : K.splice.apply(K, [0, t.length].concat(t));
2414
2445
  }
2415
2446
  }
2416
- function fr(e) {
2417
- let t = be, r = w, n = Ve, s = Ie, o = Pe, i = ne, c = G, a = new Uint8Array(O.slice(0, be)), p = K, d = D, h = Ue, g = e();
2418
- return be = t, w = r, Ve = n, Ie = s, Pe = o, ne = i, G = c, O = a, Ue = h, K = p, D = d, Y = new DataView(O.buffer, O.byteOffset, O.byteLength), g;
2447
+ function cr(e) {
2448
+ let t = ge, r = w, n = $e, s = Fe, o = Ne, i = ne, c = G, f = new Uint8Array(O.slice(0, ge)), p = K, d = D, h = ke, g = e();
2449
+ return ge = t, w = r, $e = n, Fe = s, Ne = o, ne = i, G = c, O = f, ke = h, K = p, D = d, Y = new DataView(O.buffer, O.byteOffset, O.byteLength), g;
2419
2450
  }
2420
- function ct() {
2451
+ function ut() {
2421
2452
  O = null, ne = null, K = null;
2422
2453
  }
2423
- const mt = new Array(147);
2454
+ const At = new Array(147);
2424
2455
  for (let e = 0; e < 256; e++)
2425
- mt[e] = +("1e" + Math.floor(45.15 - e * 0.30103));
2426
- let vt = new Fe({ useRecords: !1 });
2427
- vt.decode;
2428
- vt.decodeMultiple;
2429
- let Re;
2456
+ At[e] = +("1e" + Math.floor(45.15 - e * 0.30103));
2457
+ let Ct = new je({ useRecords: !1 });
2458
+ Ct.decode;
2459
+ Ct.decodeMultiple;
2460
+ let Te;
2430
2461
  try {
2431
- Re = new TextEncoder();
2462
+ Te = new TextEncoder();
2432
2463
  } catch {
2433
2464
  }
2434
- let lt, ar;
2435
- const We = typeof globalThis == "object" && globalThis.Buffer, je = typeof We < "u", Ye = je ? We.allocUnsafeSlow : Uint8Array, kt = je ? We : Uint8Array, Mt = 256, Rt = je ? 4294967296 : 2144337920;
2436
- let Qe, y, z, f = 0, ue, J = null;
2437
- const xn = 61440, wn = /[\u0080-\uFFFF]/, ee = Symbol("record-id");
2438
- class mn extends Fe {
2465
+ let ht, lr;
2466
+ const Ge = typeof globalThis == "object" && globalThis.Buffer, Me = typeof Ge < "u", et = Me ? Ge.allocUnsafeSlow : Uint8Array, Bt = Me ? Ge : Uint8Array, Tt = 256, Dt = Me ? 4294967296 : 2144337920;
2467
+ let tt, y, H, a = 0, he, J = null;
2468
+ const mn = 61440, Sn = /[\u0080-\uFFFF]/, ee = Symbol("record-id");
2469
+ class vn extends je {
2439
2470
  constructor(t) {
2440
2471
  super(t), this.offset = 0;
2441
2472
  let r, n, s, o, i;
2442
2473
  t = t || {};
2443
- let c = kt.prototype.utf8Write ? function(l, _, m) {
2474
+ let c = Bt.prototype.utf8Write ? function(l, _, m) {
2444
2475
  return y.utf8Write(l, _, m);
2445
- } : Re && Re.encodeInto ? function(l, _) {
2446
- return Re.encodeInto(l, y.subarray(_)).written;
2447
- } : !1, a = this, p = t.structures || t.saveStructures, d = t.maxSharedStructures;
2476
+ } : Te && Te.encodeInto ? function(l, _) {
2477
+ return Te.encodeInto(l, y.subarray(_)).written;
2478
+ } : !1, f = this, p = t.structures || t.saveStructures, d = t.maxSharedStructures;
2448
2479
  if (d == null && (d = p ? 128 : 0), d > 8190)
2449
2480
  throw new Error("Maximum maxSharedStructure is 8190");
2450
2481
  let h = t.sequential;
@@ -2455,7 +2486,7 @@ class mn extends Fe {
2455
2486
  for (let l = 0, _ = b.length; l < _; l++)
2456
2487
  x[b[l]] = l;
2457
2488
  }
2458
- let A = [], I = 0, U = 0;
2489
+ let C = [], I = 0, U = 0;
2459
2490
  this.mapEncode = function(l, _) {
2460
2491
  if (this._keyMap && !this._mapped)
2461
2492
  switch (l.constructor.name) {
@@ -2465,89 +2496,89 @@ class mn extends Fe {
2465
2496
  }
2466
2497
  return this.encode(l, _);
2467
2498
  }, this.encode = function(l, _) {
2468
- if (y || (y = new Ye(8192), z = new DataView(y.buffer, 0, 8192), f = 0), ue = y.length - 10, ue - f < 2048 ? (y = new Ye(y.length), z = new DataView(y.buffer, 0, y.length), ue = y.length - 10, f = 0) : _ === Lt && (f = f + 7 & 2147483640), r = f, a.useSelfDescribedHeader && (z.setUint32(f, 3654940416), f += 3), i = a.structuredClone ? /* @__PURE__ */ new Map() : null, a.bundleStrings && typeof l != "string" ? (J = [], J.size = 1 / 0) : J = null, n = a.structures, n) {
2499
+ if (y || (y = new et(8192), H = new DataView(y.buffer, 0, 8192), a = 0), he = y.length - 10, he - a < 2048 ? (y = new et(y.length), H = new DataView(y.buffer, 0, y.length), he = y.length - 10, a = 0) : _ === Vt && (a = a + 7 & 2147483640), r = a, f.useSelfDescribedHeader && (H.setUint32(a, 3654940416), a += 3), i = f.structuredClone ? /* @__PURE__ */ new Map() : null, f.bundleStrings && typeof l != "string" ? (J = [], J.size = 1 / 0) : J = null, n = f.structures, n) {
2469
2500
  if (n.uninitialized) {
2470
- let C = a.getShared() || {};
2471
- a.structures = n = C.structures || [], a.sharedVersion = C.version;
2472
- let v = a.sharedValues = C.packedValues;
2473
- if (v) {
2501
+ let A = f.getShared() || {};
2502
+ f.structures = n = A.structures || [], f.sharedVersion = A.version;
2503
+ let S = f.sharedValues = A.packedValues;
2504
+ if (S) {
2474
2505
  x = {};
2475
- for (let j = 0, k = v.length; j < k; j++)
2476
- x[v[j]] = j;
2506
+ for (let k = 0, j = S.length; k < j; k++)
2507
+ x[S[k]] = k;
2477
2508
  }
2478
2509
  }
2479
2510
  let m = n.length;
2480
2511
  if (m > d && !h && (m = d), !n.transitions) {
2481
2512
  n.transitions = /* @__PURE__ */ Object.create(null);
2482
- for (let C = 0; C < m; C++) {
2483
- let v = n[C];
2484
- if (!v)
2513
+ for (let A = 0; A < m; A++) {
2514
+ let S = n[A];
2515
+ if (!S)
2485
2516
  continue;
2486
- let j, k = n.transitions;
2487
- for (let R = 0, T = v.length; R < T; R++) {
2488
- k[ee] === void 0 && (k[ee] = C);
2489
- let V = v[R];
2490
- j = k[V], j || (j = k[V] = /* @__PURE__ */ Object.create(null)), k = j;
2517
+ let k, j = n.transitions;
2518
+ for (let R = 0, T = S.length; R < T; R++) {
2519
+ j[ee] === void 0 && (j[ee] = A);
2520
+ let V = S[R];
2521
+ k = j[V], k || (k = j[V] = /* @__PURE__ */ Object.create(null)), j = k;
2491
2522
  }
2492
- k[ee] = C | 1048576;
2523
+ j[ee] = A | 1048576;
2493
2524
  }
2494
2525
  }
2495
2526
  h || (n.nextId = m);
2496
2527
  }
2497
2528
  if (s && (s = !1), o = n || [], u = x, t.pack) {
2498
2529
  let m = /* @__PURE__ */ new Map();
2499
- if (m.values = [], m.encoder = a, m.maxValues = t.maxPrivatePackedValues || (x ? 16 : 1 / 0), m.objectMap = x || !1, m.samplingPackedValues = g, Be(l, m), m.values.length > 0) {
2500
- y[f++] = 216, y[f++] = 51, fe(4);
2501
- let C = m.values;
2502
- S(C), fe(0), fe(0), u = Object.create(x || null);
2503
- for (let v = 0, j = C.length; v < j; v++)
2504
- u[C[v]] = v;
2530
+ if (m.values = [], m.encoder = f, m.maxValues = t.maxPrivatePackedValues || (x ? 16 : 1 / 0), m.objectMap = x || !1, m.samplingPackedValues = g, De(l, m), m.values.length > 0) {
2531
+ y[a++] = 216, y[a++] = 51, fe(4);
2532
+ let A = m.values;
2533
+ v(A), fe(0), fe(0), u = Object.create(x || null);
2534
+ for (let S = 0, k = A.length; S < k; S++)
2535
+ u[A[S]] = S;
2505
2536
  }
2506
2537
  }
2507
- Qe = _ & tt;
2538
+ tt = _ & nt;
2508
2539
  try {
2509
- if (Qe)
2540
+ if (tt)
2510
2541
  return;
2511
- if (S(l), J && Dt(r, S), a.offset = f, i && i.idsToInsert) {
2512
- f += i.idsToInsert.length * 2, f > ue && M(f), a.offset = f;
2513
- let m = An(y.subarray(r, f), i.idsToInsert);
2542
+ if (v(l), J && Lt(r, v), f.offset = a, i && i.idsToInsert) {
2543
+ a += i.idsToInsert.length * 2, a > he && M(a), f.offset = a;
2544
+ let m = En(y.subarray(r, a), i.idsToInsert);
2514
2545
  return i = null, m;
2515
2546
  }
2516
- return _ & Lt ? (y.start = r, y.end = f, y) : y.subarray(r, f);
2547
+ return _ & Vt ? (y.start = r, y.end = a, y) : y.subarray(r, a);
2517
2548
  } finally {
2518
2549
  if (n) {
2519
2550
  if (U < 10 && U++, n.length > d && (n.length = d), I > 1e4)
2520
- n.transitions = null, U = 0, I = 0, A.length > 0 && (A = []);
2521
- else if (A.length > 0 && !h) {
2522
- for (let m = 0, C = A.length; m < C; m++)
2523
- A[m][ee] = void 0;
2524
- A = [];
2551
+ n.transitions = null, U = 0, I = 0, C.length > 0 && (C = []);
2552
+ else if (C.length > 0 && !h) {
2553
+ for (let m = 0, A = C.length; m < A; m++)
2554
+ C[m][ee] = void 0;
2555
+ C = [];
2525
2556
  }
2526
2557
  }
2527
- if (s && a.saveShared) {
2528
- a.structures.length > d && (a.structures = a.structures.slice(0, d));
2529
- let m = y.subarray(r, f);
2530
- return a.updateSharedData() === !1 ? a.encode(l) : m;
2558
+ if (s && f.saveShared) {
2559
+ f.structures.length > d && (f.structures = f.structures.slice(0, d));
2560
+ let m = y.subarray(r, a);
2561
+ return f.updateSharedData() === !1 ? f.encode(l) : m;
2531
2562
  }
2532
- _ & Cn && (f = r);
2563
+ _ & _n && (a = r);
2533
2564
  }
2534
2565
  }, this.findCommonStringsToPack = () => (g = /* @__PURE__ */ new Map(), x || (x = /* @__PURE__ */ Object.create(null)), (l) => {
2535
2566
  let _ = l && l.threshold || 4, m = this.pack ? l.maxPrivatePackedValues || 16 : 0;
2536
2567
  b || (b = this.sharedValues = []);
2537
- for (let [C, v] of g)
2538
- v.count > _ && (x[C] = m++, b.push(C), s = !0);
2568
+ for (let [A, S] of g)
2569
+ S.count > _ && (x[A] = m++, b.push(A), s = !0);
2539
2570
  for (; this.saveShared && this.updateSharedData() === !1; )
2540
2571
  ;
2541
2572
  g = null;
2542
2573
  });
2543
- const S = (l) => {
2544
- f > ue && (y = M(f));
2574
+ const v = (l) => {
2575
+ a > he && (y = M(a));
2545
2576
  var _ = typeof l, m;
2546
2577
  if (_ === "string") {
2547
2578
  if (u) {
2548
- let k = u[l];
2549
- if (k >= 0) {
2550
- k < 16 ? y[f++] = k + 224 : (y[f++] = 198, k & 1 ? S(15 - k >> 1) : S(k - 16 >> 1));
2579
+ let j = u[l];
2580
+ if (j >= 0) {
2581
+ j < 16 ? y[a++] = j + 224 : (y[a++] = 198, j & 1 ? v(15 - j >> 1) : v(j - 16 >> 1));
2551
2582
  return;
2552
2583
  } else if (g && !t.pack) {
2553
2584
  let R = g.get(l);
@@ -2556,248 +2587,254 @@ class mn extends Fe {
2556
2587
  });
2557
2588
  }
2558
2589
  }
2559
- let C = l.length;
2560
- if (J && C >= 4 && C < 1024) {
2561
- if ((J.size += C) > xn) {
2590
+ let A = l.length;
2591
+ if (J && A >= 4 && A < 1024) {
2592
+ if ((J.size += A) > mn) {
2562
2593
  let R, T = (J[0] ? J[0].length * 3 + J[1].length : 0) + 10;
2563
- f + T > ue && (y = M(f + T)), y[f++] = 217, y[f++] = 223, y[f++] = 249, y[f++] = J.position ? 132 : 130, y[f++] = 26, R = f - r, f += 4, J.position && Dt(r, S), J = ["", ""], J.size = 0, J.position = R;
2594
+ a + T > he && (y = M(a + T)), y[a++] = 217, y[a++] = 223, y[a++] = 249, y[a++] = J.position ? 132 : 130, y[a++] = 26, R = a - r, a += 4, J.position && Lt(r, v), J = ["", ""], J.size = 0, J.position = R;
2564
2595
  }
2565
- let k = wn.test(l);
2566
- J[k ? 0 : 1] += l, y[f++] = k ? 206 : 207, S(C);
2596
+ let j = Sn.test(l);
2597
+ J[j ? 0 : 1] += l, y[a++] = j ? 206 : 207, v(A);
2567
2598
  return;
2568
2599
  }
2569
- let v;
2570
- C < 32 ? v = 1 : C < 256 ? v = 2 : C < 65536 ? v = 3 : v = 5;
2571
- let j = C * 3;
2572
- if (f + j > ue && (y = M(f + j)), C < 64 || !c) {
2573
- let k, R, T, V = f + v;
2574
- for (k = 0; k < C; k++)
2575
- R = l.charCodeAt(k), R < 128 ? y[V++] = R : R < 2048 ? (y[V++] = R >> 6 | 192, y[V++] = R & 63 | 128) : (R & 64512) === 55296 && ((T = l.charCodeAt(k + 1)) & 64512) === 56320 ? (R = 65536 + ((R & 1023) << 10) + (T & 1023), k++, y[V++] = R >> 18 | 240, y[V++] = R >> 12 & 63 | 128, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128) : (y[V++] = R >> 12 | 224, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128);
2576
- m = V - f - v;
2600
+ let S;
2601
+ A < 32 ? S = 1 : A < 256 ? S = 2 : A < 65536 ? S = 3 : S = 5;
2602
+ let k = A * 3;
2603
+ if (a + k > he && (y = M(a + k)), A < 64 || !c) {
2604
+ let j, R, T, V = a + S;
2605
+ for (j = 0; j < A; j++)
2606
+ R = l.charCodeAt(j), R < 128 ? y[V++] = R : R < 2048 ? (y[V++] = R >> 6 | 192, y[V++] = R & 63 | 128) : (R & 64512) === 55296 && ((T = l.charCodeAt(j + 1)) & 64512) === 56320 ? (R = 65536 + ((R & 1023) << 10) + (T & 1023), j++, y[V++] = R >> 18 | 240, y[V++] = R >> 12 & 63 | 128, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128) : (y[V++] = R >> 12 | 224, y[V++] = R >> 6 & 63 | 128, y[V++] = R & 63 | 128);
2607
+ m = V - a - S;
2577
2608
  } else
2578
- m = c(l, f + v, j);
2579
- m < 24 ? y[f++] = 96 | m : m < 256 ? (v < 2 && y.copyWithin(f + 2, f + 1, f + 1 + m), y[f++] = 120, y[f++] = m) : m < 65536 ? (v < 3 && y.copyWithin(f + 3, f + 2, f + 2 + m), y[f++] = 121, y[f++] = m >> 8, y[f++] = m & 255) : (v < 5 && y.copyWithin(f + 5, f + 3, f + 3 + m), y[f++] = 122, z.setUint32(f, m), f += 4), f += m;
2609
+ m = c(l, a + S, k);
2610
+ m < 24 ? y[a++] = 96 | m : m < 256 ? (S < 2 && y.copyWithin(a + 2, a + 1, a + 1 + m), y[a++] = 120, y[a++] = m) : m < 65536 ? (S < 3 && y.copyWithin(a + 3, a + 2, a + 2 + m), y[a++] = 121, y[a++] = m >> 8, y[a++] = m & 255) : (S < 5 && y.copyWithin(a + 5, a + 3, a + 3 + m), y[a++] = 122, H.setUint32(a, m), a += 4), a += m;
2580
2611
  } else if (_ === "number")
2581
2612
  if (!this.alwaysUseFloat && l >>> 0 === l)
2582
- l < 24 ? y[f++] = l : l < 256 ? (y[f++] = 24, y[f++] = l) : l < 65536 ? (y[f++] = 25, y[f++] = l >> 8, y[f++] = l & 255) : (y[f++] = 26, z.setUint32(f, l), f += 4);
2613
+ l < 24 ? y[a++] = l : l < 256 ? (y[a++] = 24, y[a++] = l) : l < 65536 ? (y[a++] = 25, y[a++] = l >> 8, y[a++] = l & 255) : (y[a++] = 26, H.setUint32(a, l), a += 4);
2583
2614
  else if (!this.alwaysUseFloat && l >> 0 === l)
2584
- l >= -24 ? y[f++] = 31 - l : l >= -256 ? (y[f++] = 56, y[f++] = ~l) : l >= -65536 ? (y[f++] = 57, z.setUint16(f, ~l), f += 2) : (y[f++] = 58, z.setUint32(f, ~l), f += 4);
2615
+ l >= -24 ? y[a++] = 31 - l : l >= -256 ? (y[a++] = 56, y[a++] = ~l) : l >= -65536 ? (y[a++] = 57, H.setUint16(a, ~l), a += 2) : (y[a++] = 58, H.setUint32(a, ~l), a += 4);
2585
2616
  else {
2586
- let C;
2587
- if ((C = this.useFloat32) > 0 && l < 4294967296 && l >= -2147483648) {
2588
- y[f++] = 250, z.setFloat32(f, l);
2589
- let v;
2590
- if (C < 4 || // this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
2591
- (v = l * mt[(y[f] & 127) << 1 | y[f + 1] >> 7]) >> 0 === v) {
2592
- f += 4;
2617
+ let A;
2618
+ if ((A = this.useFloat32) > 0 && l < 4294967296 && l >= -2147483648) {
2619
+ y[a++] = 250, H.setFloat32(a, l);
2620
+ let S;
2621
+ if (A < 4 || // this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
2622
+ (S = l * At[(y[a] & 127) << 1 | y[a + 1] >> 7]) >> 0 === S) {
2623
+ a += 4;
2593
2624
  return;
2594
2625
  } else
2595
- f--;
2626
+ a--;
2596
2627
  }
2597
- y[f++] = 251, z.setFloat64(f, l), f += 8;
2628
+ y[a++] = 251, H.setFloat64(a, l), a += 8;
2598
2629
  }
2599
2630
  else if (_ === "object")
2600
2631
  if (!l)
2601
- y[f++] = 246;
2632
+ y[a++] = 246;
2602
2633
  else {
2603
2634
  if (i) {
2604
- let v = i.get(l);
2605
- if (v) {
2606
- if (y[f++] = 216, y[f++] = 29, y[f++] = 25, !v.references) {
2607
- let j = i.idsToInsert || (i.idsToInsert = []);
2608
- v.references = [], j.push(v);
2635
+ let S = i.get(l);
2636
+ if (S) {
2637
+ if (y[a++] = 216, y[a++] = 29, y[a++] = 25, !S.references) {
2638
+ let k = i.idsToInsert || (i.idsToInsert = []);
2639
+ S.references = [], k.push(S);
2609
2640
  }
2610
- v.references.push(f - r), f += 2;
2641
+ S.references.push(a - r), a += 2;
2611
2642
  return;
2612
2643
  } else
2613
- i.set(l, { offset: f - r });
2644
+ i.set(l, { offset: a - r });
2614
2645
  }
2615
- let C = l.constructor;
2616
- if (C === Object)
2646
+ let A = l.constructor;
2647
+ if (A === Object)
2617
2648
  B(l);
2618
- else if (C === Array) {
2619
- m = l.length, m < 24 ? y[f++] = 128 | m : fe(m);
2620
- for (let v = 0; v < m; v++)
2621
- S(l[v]);
2622
- } else if (C === Map)
2623
- if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (y[f++] = 217, y[f++] = 1, y[f++] = 3), m = l.size, m < 24 ? y[f++] = 160 | m : m < 256 ? (y[f++] = 184, y[f++] = m) : m < 65536 ? (y[f++] = 185, y[f++] = m >> 8, y[f++] = m & 255) : (y[f++] = 186, z.setUint32(f, m), f += 4), a.keyMap)
2624
- for (let [v, j] of l)
2625
- S(a.encodeKey(v)), S(j);
2649
+ else if (A === Array) {
2650
+ m = l.length, m < 24 ? y[a++] = 128 | m : fe(m);
2651
+ for (let S = 0; S < m; S++)
2652
+ v(l[S]);
2653
+ } else if (A === Map)
2654
+ if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (y[a++] = 217, y[a++] = 1, y[a++] = 3), m = l.size, m < 24 ? y[a++] = 160 | m : m < 256 ? (y[a++] = 184, y[a++] = m) : m < 65536 ? (y[a++] = 185, y[a++] = m >> 8, y[a++] = m & 255) : (y[a++] = 186, H.setUint32(a, m), a += 4), f.keyMap)
2655
+ for (let [S, k] of l)
2656
+ v(f.encodeKey(S)), v(k);
2626
2657
  else
2627
- for (let [v, j] of l)
2628
- S(v), S(j);
2658
+ for (let [S, k] of l)
2659
+ v(S), v(k);
2629
2660
  else {
2630
- for (let v = 0, j = lt.length; v < j; v++) {
2631
- let k = ar[v];
2632
- if (l instanceof k) {
2633
- let R = lt[v], T = R.tag;
2634
- T == null && (T = R.getTag && R.getTag.call(this, l)), T < 24 ? y[f++] = 192 | T : T < 256 ? (y[f++] = 216, y[f++] = T) : T < 65536 ? (y[f++] = 217, y[f++] = T >> 8, y[f++] = T & 255) : T > -1 && (y[f++] = 218, z.setUint32(f, T), f += 4), R.encode.call(this, l, S, M);
2661
+ for (let S = 0, k = ht.length; S < k; S++) {
2662
+ let j = lr[S];
2663
+ if (l instanceof j) {
2664
+ let R = ht[S], T = R.tag;
2665
+ T == null && (T = R.getTag && R.getTag.call(this, l)), T < 24 ? y[a++] = 192 | T : T < 256 ? (y[a++] = 216, y[a++] = T) : T < 65536 ? (y[a++] = 217, y[a++] = T >> 8, y[a++] = T & 255) : T > -1 && (y[a++] = 218, H.setUint32(a, T), a += 4), R.encode.call(this, l, v, M);
2635
2666
  return;
2636
2667
  }
2637
2668
  }
2638
2669
  if (l[Symbol.iterator]) {
2639
- if (Qe) {
2640
- let v = new Error("Iterable should be serialized as iterator");
2641
- throw v.iteratorNotHandled = !0, v;
2670
+ if (tt) {
2671
+ let S = new Error("Iterable should be serialized as iterator");
2672
+ throw S.iteratorNotHandled = !0, S;
2642
2673
  }
2643
- y[f++] = 159;
2644
- for (let v of l)
2645
- S(v);
2646
- y[f++] = 255;
2674
+ y[a++] = 159;
2675
+ for (let S of l)
2676
+ v(S);
2677
+ y[a++] = 255;
2647
2678
  return;
2648
2679
  }
2649
- if (l[Symbol.asyncIterator] || et(l)) {
2650
- let v = new Error("Iterable/blob should be serialized as iterator");
2651
- throw v.iteratorNotHandled = !0, v;
2680
+ if (l[Symbol.asyncIterator] || rt(l)) {
2681
+ let S = new Error("Iterable/blob should be serialized as iterator");
2682
+ throw S.iteratorNotHandled = !0, S;
2652
2683
  }
2653
2684
  if (this.useToJSON && l.toJSON) {
2654
- const v = l.toJSON();
2655
- if (v !== l)
2656
- return S(v);
2685
+ const S = l.toJSON();
2686
+ if (S !== l)
2687
+ return v(S);
2657
2688
  }
2658
2689
  B(l);
2659
2690
  }
2660
2691
  }
2661
2692
  else if (_ === "boolean")
2662
- y[f++] = l ? 245 : 244;
2693
+ y[a++] = l ? 245 : 244;
2663
2694
  else if (_ === "bigint") {
2664
2695
  if (l < BigInt(1) << BigInt(64) && l >= 0)
2665
- y[f++] = 27, z.setBigUint64(f, l);
2696
+ y[a++] = 27, H.setBigUint64(a, l);
2666
2697
  else if (l > -(BigInt(1) << BigInt(64)) && l < 0)
2667
- y[f++] = 59, z.setBigUint64(f, -l - BigInt(1));
2698
+ y[a++] = 59, H.setBigUint64(a, -l - BigInt(1));
2668
2699
  else if (this.largeBigIntToFloat)
2669
- y[f++] = 251, z.setFloat64(f, Number(l));
2670
- else
2671
- throw new RangeError(l + " was too large to fit in CBOR 64-bit integer format, set largeBigIntToFloat to convert to float-64");
2672
- f += 8;
2700
+ y[a++] = 251, H.setFloat64(a, Number(l));
2701
+ else {
2702
+ l >= BigInt(0) ? y[a++] = 194 : (y[a++] = 195, l = BigInt(-1) - l);
2703
+ let A = [];
2704
+ for (; l; )
2705
+ A.push(Number(l & BigInt(255))), l >>= BigInt(8);
2706
+ dt(new Uint8Array(A.reverse()), M);
2707
+ return;
2708
+ }
2709
+ a += 8;
2673
2710
  } else if (_ === "undefined")
2674
- y[f++] = 247;
2711
+ y[a++] = 247;
2675
2712
  else
2676
2713
  throw new Error("Unknown type: " + _);
2677
2714
  }, B = this.useRecords === !1 ? this.variableMapSize ? (l) => {
2678
- let _ = Object.keys(l), m = Object.values(l), C = _.length;
2679
- if (C < 24 ? y[f++] = 160 | C : C < 256 ? (y[f++] = 184, y[f++] = C) : C < 65536 ? (y[f++] = 185, y[f++] = C >> 8, y[f++] = C & 255) : (y[f++] = 186, z.setUint32(f, C), f += 4), a.keyMap)
2680
- for (let v = 0; v < C; v++)
2681
- S(a.encodeKey(_[v])), S(m[v]);
2715
+ let _ = Object.keys(l), m = Object.values(l), A = _.length;
2716
+ if (A < 24 ? y[a++] = 160 | A : A < 256 ? (y[a++] = 184, y[a++] = A) : A < 65536 ? (y[a++] = 185, y[a++] = A >> 8, y[a++] = A & 255) : (y[a++] = 186, H.setUint32(a, A), a += 4), f.keyMap)
2717
+ for (let S = 0; S < A; S++)
2718
+ v(f.encodeKey(_[S])), v(m[S]);
2682
2719
  else
2683
- for (let v = 0; v < C; v++)
2684
- S(_[v]), S(m[v]);
2720
+ for (let S = 0; S < A; S++)
2721
+ v(_[S]), v(m[S]);
2685
2722
  } : (l) => {
2686
- y[f++] = 185;
2687
- let _ = f - r;
2688
- f += 2;
2723
+ y[a++] = 185;
2724
+ let _ = a - r;
2725
+ a += 2;
2689
2726
  let m = 0;
2690
- if (a.keyMap)
2691
- for (let C in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(C)) && (S(a.encodeKey(C)), S(l[C]), m++);
2727
+ if (f.keyMap)
2728
+ for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(f.encodeKey(A)), v(l[A]), m++);
2692
2729
  else
2693
- for (let C in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(C)) && (S(C), S(l[C]), m++);
2730
+ for (let A in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(A)) && (v(A), v(l[A]), m++);
2694
2731
  y[_++ + r] = m >> 8, y[_ + r] = m & 255;
2695
2732
  } : (l, _) => {
2696
- let m, C = o.transitions || (o.transitions = /* @__PURE__ */ Object.create(null)), v = 0, j = 0, k, R;
2733
+ let m, A = o.transitions || (o.transitions = /* @__PURE__ */ Object.create(null)), S = 0, k = 0, j, R;
2697
2734
  if (this.keyMap) {
2698
- R = Object.keys(l).map((V) => this.encodeKey(V)), j = R.length;
2699
- for (let V = 0; V < j; V++) {
2700
- let At = R[V];
2701
- m = C[At], m || (m = C[At] = /* @__PURE__ */ Object.create(null), v++), C = m;
2735
+ R = Object.keys(l).map((V) => this.encodeKey(V)), k = R.length;
2736
+ for (let V = 0; V < k; V++) {
2737
+ let _t = R[V];
2738
+ m = A[_t], m || (m = A[_t] = /* @__PURE__ */ Object.create(null), S++), A = m;
2702
2739
  }
2703
2740
  } else
2704
- for (let V in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && (m = C[V], m || (C[ee] & 1048576 && (k = C[ee] & 65535), m = C[V] = /* @__PURE__ */ Object.create(null), v++), C = m, j++);
2705
- let T = C[ee];
2741
+ for (let V in l) (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && (m = A[V], m || (A[ee] & 1048576 && (j = A[ee] & 65535), m = A[V] = /* @__PURE__ */ Object.create(null), S++), A = m, k++);
2742
+ let T = A[ee];
2706
2743
  if (T !== void 0)
2707
- T &= 65535, y[f++] = 217, y[f++] = T >> 8 | 224, y[f++] = T & 255;
2708
- else if (R || (R = C.__keys__ || (C.__keys__ = Object.keys(l))), k === void 0 ? (T = o.nextId++, T || (T = 0, o.nextId = 1), T >= Mt && (o.nextId = (T = d) + 1)) : T = k, o[T] = R, T < d) {
2709
- y[f++] = 217, y[f++] = T >> 8 | 224, y[f++] = T & 255, C = o.transitions;
2710
- for (let V = 0; V < j; V++)
2711
- (C[ee] === void 0 || C[ee] & 1048576) && (C[ee] = T), C = C[R[V]];
2712
- C[ee] = T | 1048576, s = !0;
2744
+ T &= 65535, y[a++] = 217, y[a++] = T >> 8 | 224, y[a++] = T & 255;
2745
+ else if (R || (R = A.__keys__ || (A.__keys__ = Object.keys(l))), j === void 0 ? (T = o.nextId++, T || (T = 0, o.nextId = 1), T >= Tt && (o.nextId = (T = d) + 1)) : T = j, o[T] = R, T < d) {
2746
+ y[a++] = 217, y[a++] = T >> 8 | 224, y[a++] = T & 255, A = o.transitions;
2747
+ for (let V = 0; V < k; V++)
2748
+ (A[ee] === void 0 || A[ee] & 1048576) && (A[ee] = T), A = A[R[V]];
2749
+ A[ee] = T | 1048576, s = !0;
2713
2750
  } else {
2714
- if (C[ee] = T, z.setUint32(f, 3655335680), f += 3, v && (I += U * v), A.length >= Mt - d && (A.shift()[ee] = void 0), A.push(C), fe(j + 2), S(57344 + T), S(R), _) return;
2751
+ if (A[ee] = T, H.setUint32(a, 3655335680), a += 3, S && (I += U * S), C.length >= Tt - d && (C.shift()[ee] = void 0), C.push(A), fe(k + 2), v(57344 + T), v(R), _) return;
2715
2752
  for (let V in l)
2716
- (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && S(l[V]);
2753
+ (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
2717
2754
  return;
2718
2755
  }
2719
- if (j < 24 ? y[f++] = 128 | j : fe(j), !_)
2756
+ if (k < 24 ? y[a++] = 128 | k : fe(k), !_)
2720
2757
  for (let V in l)
2721
- (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && S(l[V]);
2758
+ (typeof l.hasOwnProperty != "function" || l.hasOwnProperty(V)) && v(l[V]);
2722
2759
  }, M = (l) => {
2723
2760
  let _;
2724
2761
  if (l > 16777216) {
2725
- if (l - r > Rt)
2762
+ if (l - r > Dt)
2726
2763
  throw new Error("Encoded buffer would be larger than maximum buffer size");
2727
2764
  _ = Math.min(
2728
- Rt,
2765
+ Dt,
2729
2766
  Math.round(Math.max((l - r) * (l > 67108864 ? 1.25 : 2), 4194304) / 4096) * 4096
2730
2767
  );
2731
2768
  } else
2732
2769
  _ = (Math.max(l - r << 2, y.length - 1) >> 12) + 1 << 12;
2733
- let m = new Ye(_);
2734
- return z = new DataView(m.buffer, 0, _), y.copy ? y.copy(m, 0, r, l) : m.set(y.slice(r, l)), f -= r, r = 0, ue = m.length - 10, y = m;
2770
+ let m = new et(_);
2771
+ return H = new DataView(m.buffer, 0, _), y.copy ? y.copy(m, 0, r, l) : m.set(y.slice(r, l)), a -= r, r = 0, he = m.length - 10, y = m;
2735
2772
  };
2736
2773
  let F = 100, N = 1e3;
2737
2774
  this.encodeAsIterable = function(l, _) {
2738
- return ie(l, _, L);
2775
+ return ie(l, _, P);
2739
2776
  }, this.encodeAsAsyncIterable = function(l, _) {
2740
2777
  return ie(l, _, E);
2741
2778
  };
2742
- function* L(l, _, m) {
2743
- let C = l.constructor;
2744
- if (C === Object) {
2745
- let v = a.useRecords !== !1;
2746
- v ? B(l, !0) : Bt(Object.keys(l).length, 160);
2747
- for (let j in l) {
2748
- let k = l[j];
2749
- v || S(j), k && typeof k == "object" ? _[j] ? yield* L(k, _[j]) : yield* $(k, _, j) : S(k);
2779
+ function* P(l, _, m) {
2780
+ let A = l.constructor;
2781
+ if (A === Object) {
2782
+ let S = f.useRecords !== !1;
2783
+ S ? B(l, !0) : Pt(Object.keys(l).length, 160);
2784
+ for (let k in l) {
2785
+ let j = l[k];
2786
+ S || v(k), j && typeof j == "object" ? _[k] ? yield* P(j, _[k]) : yield* z(j, _, k) : v(j);
2750
2787
  }
2751
- } else if (C === Array) {
2752
- let v = l.length;
2753
- fe(v);
2754
- for (let j = 0; j < v; j++) {
2755
- let k = l[j];
2756
- k && (typeof k == "object" || f - r > F) ? _.element ? yield* L(k, _.element) : yield* $(k, _, "element") : S(k);
2788
+ } else if (A === Array) {
2789
+ let S = l.length;
2790
+ fe(S);
2791
+ for (let k = 0; k < S; k++) {
2792
+ let j = l[k];
2793
+ j && (typeof j == "object" || a - r > F) ? _.element ? yield* P(j, _.element) : yield* z(j, _, "element") : v(j);
2757
2794
  }
2758
- } else if (l[Symbol.iterator]) {
2759
- y[f++] = 159;
2760
- for (let v of l)
2761
- v && (typeof v == "object" || f - r > F) ? _.element ? yield* L(v, _.element) : yield* $(v, _, "element") : S(v);
2762
- y[f++] = 255;
2763
- } else et(l) ? (Bt(l.size, 64), yield y.subarray(r, f), yield l, H()) : l[Symbol.asyncIterator] ? (y[f++] = 159, yield y.subarray(r, f), yield l, H(), y[f++] = 255) : S(l);
2764
- m && f > r ? yield y.subarray(r, f) : f - r > F && (yield y.subarray(r, f), H());
2795
+ } else if (l[Symbol.iterator] && !l.buffer) {
2796
+ y[a++] = 159;
2797
+ for (let S of l)
2798
+ S && (typeof S == "object" || a - r > F) ? _.element ? yield* P(S, _.element) : yield* z(S, _, "element") : v(S);
2799
+ y[a++] = 255;
2800
+ } else rt(l) ? (Pt(l.size, 64), yield y.subarray(r, a), yield l, $()) : l[Symbol.asyncIterator] ? (y[a++] = 159, yield y.subarray(r, a), yield l, $(), y[a++] = 255) : v(l);
2801
+ m && a > r ? yield y.subarray(r, a) : a - r > F && (yield y.subarray(r, a), $());
2765
2802
  }
2766
- function* $(l, _, m) {
2767
- let C = f - r;
2803
+ function* z(l, _, m) {
2804
+ let A = a - r;
2768
2805
  try {
2769
- S(l), f - r > F && (yield y.subarray(r, f), H());
2770
- } catch (v) {
2771
- if (v.iteratorNotHandled)
2772
- _[m] = {}, f = r + C, yield* L.call(this, l, _[m]);
2773
- else throw v;
2806
+ v(l), a - r > F && (yield y.subarray(r, a), $());
2807
+ } catch (S) {
2808
+ if (S.iteratorNotHandled)
2809
+ _[m] = {}, a = r + A, yield* P.call(this, l, _[m]);
2810
+ else throw S;
2774
2811
  }
2775
2812
  }
2776
- function H() {
2777
- F = N, a.encode(null, tt);
2813
+ function $() {
2814
+ F = N, f.encode(null, nt);
2778
2815
  }
2779
2816
  function ie(l, _, m) {
2780
- return _ && _.chunkThreshold ? F = N = _.chunkThreshold : F = 100, l && typeof l == "object" ? (a.encode(null, tt), m(l, a.iterateProperties || (a.iterateProperties = {}), !0)) : [a.encode(l)];
2817
+ return _ && _.chunkThreshold ? F = N = _.chunkThreshold : F = 100, l && typeof l == "object" ? (f.encode(null, nt), m(l, f.iterateProperties || (f.iterateProperties = {}), !0)) : [f.encode(l)];
2781
2818
  }
2782
2819
  async function* E(l, _) {
2783
- for (let m of L(l, _, !0)) {
2784
- let C = m.constructor;
2785
- if (C === kt || C === Uint8Array)
2820
+ for (let m of P(l, _, !0)) {
2821
+ let A = m.constructor;
2822
+ if (A === Bt || A === Uint8Array)
2786
2823
  yield m;
2787
- else if (et(m)) {
2788
- let v = m.stream().getReader(), j;
2789
- for (; !(j = await v.read()).done; )
2790
- yield j.value;
2824
+ else if (rt(m)) {
2825
+ let S = m.stream().getReader(), k;
2826
+ for (; !(k = await S.read()).done; )
2827
+ yield k.value;
2791
2828
  } else if (m[Symbol.asyncIterator])
2792
- for await (let v of m)
2793
- H(), v ? yield* E(v, _.async || (_.async = {})) : yield a.encode(v);
2829
+ for await (let S of m)
2830
+ $(), S ? yield* E(S, _.async || (_.async = {})) : yield f.encode(S);
2794
2831
  else
2795
2832
  yield m;
2796
2833
  }
2797
2834
  }
2798
2835
  }
2799
2836
  useBuffer(t) {
2800
- y = t, z = new DataView(y.buffer, y.byteOffset, y.byteLength), f = 0;
2837
+ y = t, H = new DataView(y.buffer, y.byteOffset, y.byteLength), a = 0;
2801
2838
  }
2802
2839
  clearSharedData() {
2803
2840
  this.structures && (this.structures = []), this.sharedValues && (this.sharedValues = void 0);
@@ -2805,33 +2842,33 @@ class mn extends Fe {
2805
2842
  updateSharedData() {
2806
2843
  let t = this.sharedVersion || 0;
2807
2844
  this.sharedVersion = t + 1;
2808
- let r = this.structures.slice(0), n = new cr(r, this.sharedValues, this.sharedVersion), s = this.saveShared(
2845
+ let r = this.structures.slice(0), n = new ur(r, this.sharedValues, this.sharedVersion), s = this.saveShared(
2809
2846
  n,
2810
2847
  (o) => (o && o.version || 0) == t
2811
2848
  );
2812
2849
  return s === !1 ? (n = this.getShared() || {}, this.structures = n.structures || [], this.sharedValues = n.packedValues, this.sharedVersion = n.version, this.structures.nextId = this.structures.length) : r.forEach((o, i) => this.structures[i] = o), s;
2813
2850
  }
2814
2851
  }
2815
- function Bt(e, t) {
2816
- e < 24 ? y[f++] = t | e : e < 256 ? (y[f++] = t | 24, y[f++] = e) : e < 65536 ? (y[f++] = t | 25, y[f++] = e >> 8, y[f++] = e & 255) : (y[f++] = t | 26, z.setUint32(f, e), f += 4);
2852
+ function Pt(e, t) {
2853
+ e < 24 ? y[a++] = t | e : e < 256 ? (y[a++] = t | 24, y[a++] = e) : e < 65536 ? (y[a++] = t | 25, y[a++] = e >> 8, y[a++] = e & 255) : (y[a++] = t | 26, H.setUint32(a, e), a += 4);
2817
2854
  }
2818
- class cr {
2855
+ class ur {
2819
2856
  constructor(t, r, n) {
2820
2857
  this.structures = t, this.packedValues = r, this.version = n;
2821
2858
  }
2822
2859
  }
2823
2860
  function fe(e) {
2824
- e < 24 ? y[f++] = 128 | e : e < 256 ? (y[f++] = 152, y[f++] = e) : e < 65536 ? (y[f++] = 153, y[f++] = e >> 8, y[f++] = e & 255) : (y[f++] = 154, z.setUint32(f, e), f += 4);
2861
+ e < 24 ? y[a++] = 128 | e : e < 256 ? (y[a++] = 152, y[a++] = e) : e < 65536 ? (y[a++] = 153, y[a++] = e >> 8, y[a++] = e & 255) : (y[a++] = 154, H.setUint32(a, e), a += 4);
2825
2862
  }
2826
- const vn = typeof Blob > "u" ? function() {
2863
+ const An = typeof Blob > "u" ? function() {
2827
2864
  } : Blob;
2828
- function et(e) {
2829
- if (e instanceof vn)
2865
+ function rt(e) {
2866
+ if (e instanceof An)
2830
2867
  return !0;
2831
2868
  let t = e[Symbol.toStringTag];
2832
2869
  return t === "Blob" || t === "File";
2833
2870
  }
2834
- function Be(e, t) {
2871
+ function De(e, t) {
2835
2872
  switch (typeof e) {
2836
2873
  case "string":
2837
2874
  if (e.length > 3) {
@@ -2854,24 +2891,24 @@ function Be(e, t) {
2854
2891
  if (e)
2855
2892
  if (e instanceof Array)
2856
2893
  for (let n = 0, s = e.length; n < s; n++)
2857
- Be(e[n], t);
2894
+ De(e[n], t);
2858
2895
  else {
2859
2896
  let n = !t.encoder.useRecords;
2860
2897
  for (var r in e)
2861
- e.hasOwnProperty(r) && (n && Be(r, t), Be(e[r], t));
2898
+ e.hasOwnProperty(r) && (n && De(r, t), De(e[r], t));
2862
2899
  }
2863
2900
  break;
2864
2901
  case "function":
2865
2902
  console.log(e);
2866
2903
  }
2867
2904
  }
2868
- const Sn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1;
2869
- ar = [
2905
+ const Cn = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1;
2906
+ lr = [
2870
2907
  Date,
2871
2908
  Set,
2872
2909
  Error,
2873
2910
  RegExp,
2874
- ge,
2911
+ xe,
2875
2912
  ArrayBuffer,
2876
2913
  Uint8Array,
2877
2914
  Uint8ClampedArray,
@@ -2886,15 +2923,15 @@ ar = [
2886
2923
  } : BigInt64Array,
2887
2924
  Float32Array,
2888
2925
  Float64Array,
2889
- cr
2926
+ ur
2890
2927
  ];
2891
- lt = [
2928
+ ht = [
2892
2929
  {
2893
2930
  // Date
2894
2931
  tag: 1,
2895
2932
  encode(e, t) {
2896
2933
  let r = e.getTime() / 1e3;
2897
- (this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[f++] = 26, z.setUint32(f, r), f += 4) : (y[f++] = 251, z.setFloat64(f, r), f += 8);
2934
+ (this.useTimestamp32 || e.getMilliseconds() === 0) && r >= 0 && r < 4294967296 ? (y[a++] = 26, H.setUint32(a, r), a += 4) : (y[a++] = 251, H.setFloat64(a, r), a += 8);
2898
2935
  }
2899
2936
  },
2900
2937
  {
@@ -2934,17 +2971,17 @@ lt = [
2934
2971
  {
2935
2972
  // ArrayBuffer
2936
2973
  encode(e, t, r) {
2937
- Tt(e, r);
2974
+ dt(e, r);
2938
2975
  }
2939
2976
  },
2940
2977
  {
2941
2978
  // Uint8Array
2942
2979
  getTag(e) {
2943
- if (e.constructor === Uint8Array && (this.tagUint8Array || je && this.tagUint8Array !== !1))
2980
+ if (e.constructor === Uint8Array && (this.tagUint8Array || Me && this.tagUint8Array !== !1))
2944
2981
  return 64;
2945
2982
  },
2946
2983
  encode(e, t, r) {
2947
- Tt(e, r);
2984
+ dt(e, r);
2948
2985
  }
2949
2986
  },
2950
2987
  oe(68, 1),
@@ -2961,35 +2998,35 @@ lt = [
2961
2998
  encode(e, t) {
2962
2999
  let r = e.packedValues || [], n = e.structures || [];
2963
3000
  if (r.values.length > 0) {
2964
- y[f++] = 216, y[f++] = 51, fe(4);
3001
+ y[a++] = 216, y[a++] = 51, fe(4);
2965
3002
  let s = r.values;
2966
3003
  t(s), fe(0), fe(0), packedObjectMap = Object.create(sharedPackedObjectMap || null);
2967
3004
  for (let o = 0, i = s.length; o < i; o++)
2968
3005
  packedObjectMap[s[o]] = o;
2969
3006
  }
2970
3007
  if (n) {
2971
- z.setUint32(f, 3655335424), f += 3;
3008
+ H.setUint32(a, 3655335424), a += 3;
2972
3009
  let s = n.slice(0);
2973
- s.unshift(57344), s.push(new ge(e.version, 1399353956)), t(s);
3010
+ s.unshift(57344), s.push(new xe(e.version, 1399353956)), t(s);
2974
3011
  } else
2975
- t(new ge(e.version, 1399353956));
3012
+ t(new xe(e.version, 1399353956));
2976
3013
  }
2977
3014
  }
2978
3015
  ];
2979
3016
  function oe(e, t) {
2980
- return !Sn && t > 1 && (e -= 4), {
3017
+ return !Cn && t > 1 && (e -= 4), {
2981
3018
  tag: e,
2982
3019
  encode: function(n, s) {
2983
3020
  let o = n.byteLength, i = n.byteOffset || 0, c = n.buffer || n;
2984
- s(je ? We.from(c, i, o) : new Uint8Array(c, i, o));
3021
+ s(Me ? Ge.from(c, i, o) : new Uint8Array(c, i, o));
2985
3022
  }
2986
3023
  };
2987
3024
  }
2988
- function Tt(e, t) {
3025
+ function dt(e, t) {
2989
3026
  let r = e.byteLength;
2990
- r < 24 ? y[f++] = 64 + r : r < 256 ? (y[f++] = 88, y[f++] = r) : r < 65536 ? (y[f++] = 89, y[f++] = r >> 8, y[f++] = r & 255) : (y[f++] = 90, z.setUint32(f, r), f += 4), f + r >= y.length && t(f + r), y.set(e.buffer ? e : new Uint8Array(e), f), f += r;
3027
+ r < 24 ? y[a++] = 64 + r : r < 256 ? (y[a++] = 88, y[a++] = r) : r < 65536 ? (y[a++] = 89, y[a++] = r >> 8, y[a++] = r & 255) : (y[a++] = 90, H.setUint32(a, r), a += 4), a + r >= y.length && t(a + r), y.set(e.buffer ? e : new Uint8Array(e), a), a += r;
2991
3028
  }
2992
- function An(e, t) {
3029
+ function En(e, t) {
2993
3030
  let r, n = t.length * 2, s = e.length - n;
2994
3031
  t.sort((o, i) => o.offset > i.offset ? 1 : -1);
2995
3032
  for (let o = 0; o < t.length; o++) {
@@ -3006,17 +3043,17 @@ function An(e, t) {
3006
3043
  }
3007
3044
  return e;
3008
3045
  }
3009
- function Dt(e, t) {
3010
- z.setUint32(J.position + e, f - J.position - e + 1);
3046
+ function Lt(e, t) {
3047
+ H.setUint32(J.position + e, a - J.position - e + 1);
3011
3048
  let r = J;
3012
3049
  J = null, t(r[0]), t(r[1]);
3013
3050
  }
3014
- let St = new mn({ useRecords: !1 });
3015
- St.encode;
3016
- St.encodeAsIterable;
3017
- St.encodeAsAsyncIterable;
3018
- const Lt = 512, Cn = 1024, tt = 2048;
3019
- var En = { exports: {} };
3051
+ let Et = new vn({ useRecords: !1 });
3052
+ Et.encode;
3053
+ Et.encodeAsIterable;
3054
+ Et.encodeAsAsyncIterable;
3055
+ const Vt = 512, _n = 1024, nt = 2048;
3056
+ var On = { exports: {} };
3020
3057
  (function(e) {
3021
3058
  (function(t, r) {
3022
3059
  var n = {};
@@ -3025,7 +3062,7 @@ var En = { exports: {} };
3025
3062
  for (var o in n)
3026
3063
  s[o] = n[o];
3027
3064
  e.exports = s;
3028
- })(jr, function(t) {
3065
+ })(Mr, function(t) {
3029
3066
  t.__esModule = !0, t.digestLength = 32, t.blockSize = 64;
3030
3067
  var r = new Uint32Array([
3031
3068
  1116352408,
@@ -3093,15 +3130,15 @@ var En = { exports: {} };
3093
3130
  3204031479,
3094
3131
  3329325298
3095
3132
  ]);
3096
- function n(g, u, b, x, A) {
3097
- for (var I, U, S, B, M, F, N, L, $, H, ie, E, l; A >= 64; ) {
3098
- for (I = u[0], U = u[1], S = u[2], B = u[3], M = u[4], F = u[5], N = u[6], L = u[7], H = 0; H < 16; H++)
3099
- ie = x + H * 4, g[H] = (b[ie] & 255) << 24 | (b[ie + 1] & 255) << 16 | (b[ie + 2] & 255) << 8 | b[ie + 3] & 255;
3100
- for (H = 16; H < 64; H++)
3101
- $ = g[H - 2], E = ($ >>> 17 | $ << 15) ^ ($ >>> 19 | $ << 13) ^ $ >>> 10, $ = g[H - 15], l = ($ >>> 7 | $ << 25) ^ ($ >>> 18 | $ << 14) ^ $ >>> 3, g[H] = (E + g[H - 7] | 0) + (l + g[H - 16] | 0);
3102
- for (H = 0; H < 64; H++)
3103
- E = (((M >>> 6 | M << 26) ^ (M >>> 11 | M << 21) ^ (M >>> 25 | M << 7)) + (M & F ^ ~M & N) | 0) + (L + (r[H] + g[H] | 0) | 0) | 0, l = ((I >>> 2 | I << 30) ^ (I >>> 13 | I << 19) ^ (I >>> 22 | I << 10)) + (I & U ^ I & S ^ U & S) | 0, L = N, N = F, F = M, M = B + E | 0, B = S, S = U, U = I, I = E + l | 0;
3104
- u[0] += I, u[1] += U, u[2] += S, u[3] += B, u[4] += M, u[5] += F, u[6] += N, u[7] += L, x += 64, A -= 64;
3133
+ function n(g, u, b, x, C) {
3134
+ for (var I, U, v, B, M, F, N, P, z, $, ie, E, l; C >= 64; ) {
3135
+ for (I = u[0], U = u[1], v = u[2], B = u[3], M = u[4], F = u[5], N = u[6], P = u[7], $ = 0; $ < 16; $++)
3136
+ ie = x + $ * 4, g[$] = (b[ie] & 255) << 24 | (b[ie + 1] & 255) << 16 | (b[ie + 2] & 255) << 8 | b[ie + 3] & 255;
3137
+ for ($ = 16; $ < 64; $++)
3138
+ z = g[$ - 2], E = (z >>> 17 | z << 15) ^ (z >>> 19 | z << 13) ^ z >>> 10, z = g[$ - 15], l = (z >>> 7 | z << 25) ^ (z >>> 18 | z << 14) ^ z >>> 3, g[$] = (E + g[$ - 7] | 0) + (l + g[$ - 16] | 0);
3139
+ for ($ = 0; $ < 64; $++)
3140
+ E = (((M >>> 6 | M << 26) ^ (M >>> 11 | M << 21) ^ (M >>> 25 | M << 7)) + (M & F ^ ~M & N) | 0) + (P + (r[$] + g[$] | 0) | 0) | 0, l = ((I >>> 2 | I << 30) ^ (I >>> 13 | I << 19) ^ (I >>> 22 | I << 10)) + (I & U ^ I & v ^ U & v) | 0, P = N, N = F, F = M, M = B + E | 0, B = v, v = U, U = I, I = E + l | 0;
3141
+ u[0] += I, u[1] += U, u[2] += v, u[3] += B, u[4] += M, u[5] += F, u[6] += N, u[7] += P, x += 64, C -= 64;
3105
3142
  }
3106
3143
  return x;
3107
3144
  }
@@ -3133,14 +3170,14 @@ var En = { exports: {} };
3133
3170
  return this;
3134
3171
  }, g.prototype.finish = function(u) {
3135
3172
  if (!this.finished) {
3136
- var b = this.bytesHashed, x = this.bufferLength, A = b / 536870912 | 0, I = b << 3, U = b % 64 < 56 ? 64 : 128;
3173
+ var b = this.bytesHashed, x = this.bufferLength, C = b / 536870912 | 0, I = b << 3, U = b % 64 < 56 ? 64 : 128;
3137
3174
  this.buffer[x] = 128;
3138
- for (var S = x + 1; S < U - 8; S++)
3139
- this.buffer[S] = 0;
3140
- this.buffer[U - 8] = A >>> 24 & 255, this.buffer[U - 7] = A >>> 16 & 255, this.buffer[U - 6] = A >>> 8 & 255, this.buffer[U - 5] = A >>> 0 & 255, this.buffer[U - 4] = I >>> 24 & 255, this.buffer[U - 3] = I >>> 16 & 255, this.buffer[U - 2] = I >>> 8 & 255, this.buffer[U - 1] = I >>> 0 & 255, n(this.temp, this.state, this.buffer, 0, U), this.finished = !0;
3175
+ for (var v = x + 1; v < U - 8; v++)
3176
+ this.buffer[v] = 0;
3177
+ this.buffer[U - 8] = C >>> 24 & 255, this.buffer[U - 7] = C >>> 16 & 255, this.buffer[U - 6] = C >>> 8 & 255, this.buffer[U - 5] = C >>> 0 & 255, this.buffer[U - 4] = I >>> 24 & 255, this.buffer[U - 3] = I >>> 16 & 255, this.buffer[U - 2] = I >>> 8 & 255, this.buffer[U - 1] = I >>> 0 & 255, n(this.temp, this.state, this.buffer, 0, U), this.finished = !0;
3141
3178
  }
3142
- for (var S = 0; S < 8; S++)
3143
- u[S * 4 + 0] = this.state[S] >>> 24 & 255, u[S * 4 + 1] = this.state[S] >>> 16 & 255, u[S * 4 + 2] = this.state[S] >>> 8 & 255, u[S * 4 + 3] = this.state[S] >>> 0 & 255;
3179
+ for (var v = 0; v < 8; v++)
3180
+ u[v * 4 + 0] = this.state[v] >>> 24 & 255, u[v * 4 + 1] = this.state[v] >>> 16 & 255, u[v * 4 + 2] = this.state[v] >>> 8 & 255, u[v * 4 + 3] = this.state[v] >>> 0 & 255;
3144
3181
  return this;
3145
3182
  }, g.prototype.digest = function() {
3146
3183
  var u = new Uint8Array(this.digestLength);
@@ -3203,73 +3240,73 @@ var En = { exports: {} };
3203
3240
  return b.clean(), x;
3204
3241
  }
3205
3242
  t.hmac = c;
3206
- function a(g, u, b, x) {
3207
- var A = x[0];
3208
- if (A === 0)
3243
+ function f(g, u, b, x) {
3244
+ var C = x[0];
3245
+ if (C === 0)
3209
3246
  throw new Error("hkdf: cannot expand more");
3210
- u.reset(), A > 1 && u.update(g), b && u.update(b), u.update(x), u.finish(g), x[0]++;
3247
+ u.reset(), C > 1 && u.update(g), b && u.update(b), u.update(x), u.finish(g), x[0]++;
3211
3248
  }
3212
3249
  var p = new Uint8Array(t.digestLength);
3213
3250
  function d(g, u, b, x) {
3214
3251
  u === void 0 && (u = p), x === void 0 && (x = 32);
3215
- for (var A = new Uint8Array([1]), I = c(u, g), U = new o(I), S = new Uint8Array(U.digestLength), B = S.length, M = new Uint8Array(x), F = 0; F < x; F++)
3216
- B === S.length && (a(S, U, b, A), B = 0), M[F] = S[B++];
3217
- return U.clean(), S.fill(0), A.fill(0), M;
3252
+ for (var C = new Uint8Array([1]), I = c(u, g), U = new o(I), v = new Uint8Array(U.digestLength), B = v.length, M = new Uint8Array(x), F = 0; F < x; F++)
3253
+ B === v.length && (f(v, U, b, C), B = 0), M[F] = v[B++];
3254
+ return U.clean(), v.fill(0), C.fill(0), M;
3218
3255
  }
3219
3256
  t.hkdf = d;
3220
3257
  function h(g, u, b, x) {
3221
- for (var A = new o(g), I = A.digestLength, U = new Uint8Array(4), S = new Uint8Array(I), B = new Uint8Array(I), M = new Uint8Array(x), F = 0; F * I < x; F++) {
3258
+ for (var C = new o(g), I = C.digestLength, U = new Uint8Array(4), v = new Uint8Array(I), B = new Uint8Array(I), M = new Uint8Array(x), F = 0; F * I < x; F++) {
3222
3259
  var N = F + 1;
3223
- U[0] = N >>> 24 & 255, U[1] = N >>> 16 & 255, U[2] = N >>> 8 & 255, U[3] = N >>> 0 & 255, A.reset(), A.update(u), A.update(U), A.finish(B);
3224
- for (var L = 0; L < I; L++)
3225
- S[L] = B[L];
3226
- for (var L = 2; L <= b; L++) {
3227
- A.reset(), A.update(B).finish(B);
3228
- for (var $ = 0; $ < I; $++)
3229
- S[$] ^= B[$];
3260
+ U[0] = N >>> 24 & 255, U[1] = N >>> 16 & 255, U[2] = N >>> 8 & 255, U[3] = N >>> 0 & 255, C.reset(), C.update(u), C.update(U), C.finish(B);
3261
+ for (var P = 0; P < I; P++)
3262
+ v[P] = B[P];
3263
+ for (var P = 2; P <= b; P++) {
3264
+ C.reset(), C.update(B).finish(B);
3265
+ for (var z = 0; z < I; z++)
3266
+ v[z] ^= B[z];
3230
3267
  }
3231
- for (var L = 0; L < I && F * I + L < x; L++)
3232
- M[F * I + L] = S[L];
3268
+ for (var P = 0; P < I && F * I + P < x; P++)
3269
+ M[F * I + P] = v[P];
3233
3270
  }
3234
3271
  for (var F = 0; F < I; F++)
3235
- S[F] = B[F] = 0;
3272
+ v[F] = B[F] = 0;
3236
3273
  for (var F = 0; F < 4; F++)
3237
3274
  U[F] = 0;
3238
- return A.clean(), M;
3275
+ return C.clean(), M;
3239
3276
  }
3240
3277
  t.pbkdf2 = h;
3241
3278
  });
3242
- })(En);
3243
- Tr("automerge-repo:collectionsync");
3244
- const jn = (e) => {
3245
- const [t, r] = Vt({}), n = dt(), s = yr(
3279
+ })(On);
3280
+ Pr("automerge-repo:collectionsync");
3281
+ const Mn = (e) => {
3282
+ const [t, r] = $t({}), n = bt(), s = br(
3246
3283
  () => e?.map((i) => {
3247
- if (rn(i)) {
3248
- const { documentId: c } = tr(i);
3284
+ if (sn(i)) {
3285
+ const { documentId: c } = nr(i);
3249
3286
  return c;
3250
3287
  } else
3251
3288
  return i;
3252
3289
  }) ?? [],
3253
3290
  [e]
3254
- ), o = Pt([]);
3255
- return Ce(() => {
3291
+ ), o = Nt([]);
3292
+ return _e(() => {
3256
3293
  const i = {}, c = (u, b) => {
3257
3294
  b && r((x) => ({ ...x, [u]: b }));
3258
- }, a = (u) => {
3295
+ }, f = (u) => {
3259
3296
  const b = u.documentId, x = {
3260
- change: ({ doc: A }) => c(b, A),
3297
+ change: ({ doc: C }) => c(b, C),
3261
3298
  delete: () => p(b)
3262
3299
  };
3263
3300
  u.on("change", x.change), u.on("delete", x.delete), i[b] = x;
3264
3301
  }, p = (u) => {
3265
3302
  r((b) => {
3266
- const { [u]: x, ...A } = b;
3267
- return A;
3303
+ const { [u]: x, ...C } = b;
3304
+ return C;
3268
3305
  });
3269
3306
  }, d = (u) => {
3270
3307
  const b = n.find(u);
3271
- b.docSync() ? (c(u, b.docSync()), a(b)) : b.doc().then((x) => {
3272
- c(u, x), a(b);
3308
+ b.docSync() ? (c(u, b.docSync()), f(b)) : b.doc().then((x) => {
3309
+ c(u, x), f(b);
3273
3310
  }).catch((x) => {
3274
3311
  console.error(`Error loading document ${u} in useDocuments: `, x);
3275
3312
  });
@@ -3283,45 +3320,45 @@ const jn = (e) => {
3283
3320
  return h;
3284
3321
  for (const u of s) {
3285
3322
  const b = n.find(u);
3286
- o.current.includes(u) ? a(b) : d(u);
3323
+ o.current.includes(u) ? f(b) : d(u);
3287
3324
  }
3288
3325
  return o.current.filter((u) => !s.includes(u)).forEach(p), o.current = s, h;
3289
3326
  }, [s, n]), t;
3290
3327
  };
3291
- function kn(e) {
3292
- const t = dt();
3328
+ function Rn(e) {
3329
+ const t = bt();
3293
3330
  return e ? t.find(e) : void 0;
3294
3331
  }
3295
- var rt = lr, _n = function(e) {
3332
+ var st = hr, In = function(e) {
3296
3333
  return typeof e == "function";
3297
- }, On = function(e) {
3298
- var t = rt.useState(e), r = t[0], n = t[1], s = rt.useRef(r), o = rt.useCallback(function(i) {
3299
- s.current = _n(i) ? i(s.current) : i, n(s.current);
3334
+ }, Un = function(e) {
3335
+ var t = st.useState(e), r = t[0], n = t[1], s = st.useRef(r), o = st.useCallback(function(i) {
3336
+ s.current = In(i) ? i(s.current) : i, n(s.current);
3300
3337
  }, []);
3301
3338
  return [r, o, s];
3302
- }, In = On;
3303
- const ut = /* @__PURE__ */ ze(In), ht = new Lr(), Mn = ({
3339
+ }, Fn = Un;
3340
+ const yt = /* @__PURE__ */ We(Fn), pt = new Vr(), Bn = ({
3304
3341
  handle: e,
3305
3342
  localUserId: t,
3306
3343
  offlineTimeout: r = 3e4,
3307
3344
  getTime: n = () => (/* @__PURE__ */ new Date()).getTime()
3308
3345
  }) => {
3309
- const [s, o, i] = ut({}), [c, a, p] = ut({});
3310
- return Ce(() => {
3346
+ const [s, o, i] = yt({}), [c, f, p] = yt({});
3347
+ return _e(() => {
3311
3348
  const d = (u) => {
3312
3349
  const [b, x] = u.message;
3313
- b !== t && (p.current[b] || ht.emit("new_peer", u), o({
3350
+ b !== t && (p.current[b] || pt.emit("new_peer", u), o({
3314
3351
  ...i.current,
3315
3352
  [b]: x
3316
- }), a({
3353
+ }), f({
3317
3354
  ...p.current,
3318
3355
  [b]: n()
3319
3356
  }));
3320
3357
  }, h = () => {
3321
3358
  const u = i.current, b = p.current, x = n();
3322
- for (const A in b)
3323
- x - b[A] > r && (delete u[A], delete b[A]);
3324
- o(u), a(b);
3359
+ for (const C in b)
3360
+ x - b[C] > r && (delete u[C], delete b[C]);
3361
+ o(u), f(b);
3325
3362
  };
3326
3363
  e.on("ephemeral-message", d);
3327
3364
  const g = setInterval(
@@ -3332,43 +3369,43 @@ const ut = /* @__PURE__ */ ze(In), ht = new Lr(), Mn = ({
3332
3369
  e.removeListener("ephemeral-message", d), clearInterval(g);
3333
3370
  };
3334
3371
  }, [e, t, r, n]), [s, c];
3335
- }, Rn = ({
3372
+ }, Tn = ({
3336
3373
  handle: e,
3337
3374
  userId: t,
3338
3375
  initialState: r,
3339
3376
  heartbeatTime: n = 15e3
3340
3377
  }) => {
3341
- const [s, o, i] = ut(r), c = (a) => {
3342
- const p = typeof a == "function" ? a(i.current) : a;
3378
+ const [s, o, i] = yt(r), c = (f) => {
3379
+ const p = typeof f == "function" ? f(i.current) : f;
3343
3380
  o(p), e.broadcast([t, p]);
3344
3381
  };
3345
- return Ce(() => {
3382
+ return _e(() => {
3346
3383
  if (!t)
3347
3384
  return;
3348
- const a = () => void e.broadcast([t, i.current]);
3349
- a();
3350
- const p = setInterval(a, n);
3385
+ const f = () => void e.broadcast([t, i.current]);
3386
+ f();
3387
+ const p = setInterval(f, n);
3351
3388
  return () => void clearInterval(p);
3352
- }, [e, t, n]), Ce(() => {
3353
- let a;
3354
- const p = ht.on("new_peer", () => {
3355
- a = setTimeout(
3389
+ }, [e, t, n]), _e(() => {
3390
+ let f;
3391
+ const p = pt.on("new_peer", () => {
3392
+ f = setTimeout(
3356
3393
  () => e.broadcast([t, i.current]),
3357
3394
  500
3358
3395
  // Wait for the peer to be ready
3359
3396
  );
3360
3397
  });
3361
3398
  return () => {
3362
- p.off("new_peer"), a && clearTimeout(a);
3399
+ p.off("new_peer"), f && clearTimeout(f);
3363
3400
  };
3364
- }, [e, t, ht]), [s, c];
3401
+ }, [e, t, pt]), [s, c];
3365
3402
  };
3366
3403
  export {
3367
- pr as RepoContext,
3368
- Fn as useDocument,
3369
- jn as useDocuments,
3370
- kn as useHandle,
3371
- Rn as useLocalAwareness,
3372
- Mn as useRemoteAwareness,
3373
- dt as useRepo
3404
+ gr as RepoContext,
3405
+ jn as useDocument,
3406
+ Mn as useDocuments,
3407
+ Rn as useHandle,
3408
+ Tn as useLocalAwareness,
3409
+ Bn as useRemoteAwareness,
3410
+ bt as useRepo
3374
3411
  };