playhtml 2.0.11 → 2.0.12

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.
@@ -45,7 +45,7 @@ var Gt = 1e6, wr = "y-pk-batch", An = !1, mr = (n, t) => {
45
45
  function Ln(n) {
46
46
  return `${wr}#${JSON.stringify(n)}`;
47
47
  }
48
- const O = () => /* @__PURE__ */ new Map(), Re = (n) => {
48
+ const O = () => /* @__PURE__ */ new Map(), Be = (n) => {
49
49
  const t = O();
50
50
  return n.forEach((e, s) => {
51
51
  t.set(s, e);
@@ -63,7 +63,7 @@ const O = () => /* @__PURE__ */ new Map(), Re = (n) => {
63
63
  if (t(s, e))
64
64
  return !0;
65
65
  return !1;
66
- }, lt = () => /* @__PURE__ */ new Set(), Se = (n) => n[n.length - 1], kr = (n, t) => {
66
+ }, lt = () => /* @__PURE__ */ new Set(), De = (n) => n[n.length - 1], kr = (n, t) => {
67
67
  for (let e = 0; e < t.length; e++)
68
68
  n.push(t[e]);
69
69
  }, tt = Array.from, _r = Array.isArray;
@@ -112,7 +112,7 @@ class fe {
112
112
  this._observers = O();
113
113
  }
114
114
  }
115
- const X = Math.floor, te = Math.abs, Ge = (n, t) => n < t ? n : t, ft = (n, t) => n > t ? n : t, Sr = Math.pow, es = (n) => n !== 0 ? n < 0 : 1 / n < 0, Dr = String.fromCharCode, Er = (n) => n.toLowerCase(), Cr = /^\s*/g, Ar = (n) => n.replace(Cr, ""), Lr = /([A-Z])/g, In = (n, t) => Ar(n.replace(Lr, (e) => `${t}${Er(e)}`)), Ir = (n) => {
115
+ const X = Math.floor, te = Math.abs, Pe = (n, t) => n < t ? n : t, ft = (n, t) => n > t ? n : t, Sr = Math.pow, es = (n) => n !== 0 ? n < 0 : 1 / n < 0, Dr = String.fromCharCode, Er = (n) => n.toLowerCase(), Cr = /^\s*/g, Ar = (n) => n.replace(Cr, ""), Lr = /([A-Z])/g, In = (n, t) => Ar(n.replace(Lr, (e) => `${t}${Er(e)}`)), Ir = (n) => {
116
116
  const t = unescape(encodeURIComponent(n)), e = t.length, s = new Uint8Array(e);
117
117
  for (let r = 0; r < e; r++)
118
118
  s[r] = /** @type {number} */
@@ -173,12 +173,12 @@ const ss = ns, Ur = (n) => qe || addEventListener(
173
173
  if (!t(n[e], e))
174
174
  return !1;
175
175
  return !0;
176
- }, rs = (n, t) => Object.prototype.hasOwnProperty.call(n, t), Hr = (n, t) => n === t || re(n) === re(t) && Vr(n, (e, s) => (e !== void 0 || rs(t, s)) && t[s] === e), Pe = (n, t, e = 0) => {
176
+ }, rs = (n, t) => Object.prototype.hasOwnProperty.call(n, t), Hr = (n, t) => n === t || re(n) === re(t) && Vr(n, (e, s) => (e !== void 0 || rs(t, s)) && t[s] === e), Ze = (n, t, e = 0) => {
177
177
  try {
178
178
  for (; e < n.length; e++)
179
179
  n[e](...t);
180
180
  } finally {
181
- e < n.length && Pe(n, t, e + 1);
181
+ e < n.length && Ze(n, t, e + 1);
182
182
  }
183
183
  }, $r = (n) => n, jr = (n, t) => n === t, xt = (n, t) => {
184
184
  if (n == null || t == null)
@@ -253,9 +253,9 @@ const zr = () => {
253
253
  }
254
254
  })) : R = O();
255
255
  return R;
256
- }, Be = (n) => zr().has(n), Ne = (n) => vn(_t ? process.env[n.toUpperCase()] : ss.getItem(n)), Yr = (n) => Be("--" + n) || Ne(n) !== null;
256
+ }, Ne = (n) => zr().has(n), Fe = (n) => vn(_t ? process.env[n.toUpperCase()] : ss.getItem(n)), Yr = (n) => Ne("--" + n) || Fe(n) !== null;
257
257
  Yr("production");
258
- const Mn = _t && Kr(process.env.FORCE_COLOR, ["true", "1", "2"]), Xr = !Be("no-colors") && (!_t || process.stdout.isTTY || Mn) && (!_t || Be("color") || Mn || Ne("COLORTERM") !== null || (Ne("TERM") || "").includes("color")), xn = 1, Un = 2, De = 4, Ee = 8, Ot = 32, z = 64, x = 128, ge = 31, Fe = 63, it = 127, Jr = 2147483647, os = Number.MAX_SAFE_INTEGER, Wr = Number.isInteger || ((n) => typeof n == "number" && isFinite(n) && X(n) === n), J = (n) => new Error(n), B = () => {
258
+ const Mn = _t && Kr(process.env.FORCE_COLOR, ["true", "1", "2"]), Xr = !Ne("no-colors") && (!_t || process.stdout.isTTY || Mn) && (!_t || Ne("color") || Mn || Fe("COLORTERM") !== null || (Fe("TERM") || "").includes("color")), xn = 1, Un = 2, Ee = 4, Ce = 8, Ot = 32, z = 64, x = 128, ge = 31, Ve = 63, it = 127, Jr = 2147483647, os = Number.MAX_SAFE_INTEGER, Wr = Number.isInteger || ((n) => typeof n == "number" && isFinite(n) && X(n) === n), J = (n) => new Error(n), B = () => {
259
259
  throw J("Method unimplemented");
260
260
  }, V = () => {
261
261
  throw J("Unexpected case");
@@ -268,10 +268,10 @@ class pe {
268
268
  this.arr = t, this.pos = 0;
269
269
  }
270
270
  }
271
- const nt = (n) => new pe(n), Gr = (n) => n.pos !== n.arr.length, qr = (n, t) => {
272
- const e = tn(n.arr.buffer, n.pos + n.arr.byteOffset, t);
271
+ const nt = (n) => new pe(n), Gr = (n) => n.pos !== n.arr.length, Pr = (n, t) => {
272
+ const e = en(n.arr.buffer, n.pos + n.arr.byteOffset, t);
273
273
  return n.pos += t, e;
274
- }, v = (n) => qr(n, m(n)), St = (n) => n.arr[n.pos++], m = (n) => {
274
+ }, v = (n) => Pr(n, m(n)), St = (n) => n.arr[n.pos++], m = (n) => {
275
275
  let t = 0, e = 1;
276
276
  const s = n.arr.length;
277
277
  for (; n.pos < s; ) {
@@ -282,8 +282,8 @@ const nt = (n) => new pe(n), Gr = (n) => n.pos !== n.arr.length, qr = (n, t) =>
282
282
  throw cs;
283
283
  }
284
284
  throw ls;
285
- }, Ze = (n) => {
286
- let t = n.arr[n.pos++], e = t & Fe, s = 64;
285
+ }, Qe = (n) => {
286
+ let t = n.arr[n.pos++], e = t & Ve, s = 64;
287
287
  const r = (t & z) > 0 ? -1 : 1;
288
288
  if (!(t & x))
289
289
  return r * e;
@@ -295,7 +295,7 @@ const nt = (n) => new pe(n), Gr = (n) => n.pos !== n.arr.length, qr = (n, t) =>
295
295
  throw cs;
296
296
  }
297
297
  throw ls;
298
- }, Pr = (n) => {
298
+ }, qr = (n) => {
299
299
  let t = m(n);
300
300
  if (t === 0)
301
301
  return "";
@@ -318,19 +318,19 @@ const nt = (n) => new pe(n), Gr = (n) => n.pos !== n.arr.length, qr = (n, t) =>
318
318
  }, Zr = (n) => (
319
319
  /** @type any */
320
320
  Mt.decode(v(n))
321
- ), Q = Mt ? Zr : Pr, Qe = (n, t) => {
321
+ ), Q = Mt ? Zr : qr, tn = (n, t) => {
322
322
  const e = new DataView(n.arr.buffer, n.arr.byteOffset + n.pos, t);
323
323
  return n.pos += t, e;
324
- }, Qr = (n) => Qe(n, 4).getFloat32(0, !1), ti = (n) => Qe(n, 8).getFloat64(0, !1), ei = (n) => (
324
+ }, Qr = (n) => tn(n, 4).getFloat32(0, !1), ti = (n) => tn(n, 8).getFloat64(0, !1), ei = (n) => (
325
325
  /** @type {any} */
326
- Qe(n, 8).getBigInt64(0, !1)
326
+ tn(n, 8).getBigInt64(0, !1)
327
327
  ), ni = [
328
328
  (n) => {
329
329
  },
330
330
  // CASE 127: undefined
331
331
  (n) => null,
332
332
  // CASE 126: null
333
- Ze,
333
+ Qe,
334
334
  // CASE 125: integer
335
335
  Qr,
336
336
  // CASE 124: float32
@@ -383,7 +383,7 @@ class ee extends pe {
383
383
  }
384
384
  read() {
385
385
  if (this.count === 0) {
386
- this.s = Ze(this);
386
+ this.s = Qe(this);
387
387
  const t = es(this.s);
388
388
  this.count = 1, t && (this.s = -this.s, this.count = m(this) + 2);
389
389
  }
@@ -391,7 +391,7 @@ class ee extends pe {
391
391
  this.s;
392
392
  }
393
393
  }
394
- class Ce extends pe {
394
+ class Ae extends pe {
395
395
  /**
396
396
  * @param {Uint8Array} uint8Array
397
397
  */
@@ -403,7 +403,7 @@ class Ce extends pe {
403
403
  */
404
404
  read() {
405
405
  if (this.count === 0) {
406
- const t = Ze(this), e = t & 1;
406
+ const t = Qe(this), e = t & 1;
407
407
  this.diff = X(t / 2), this.count = 1, e && (this.count = m(this) + 2);
408
408
  }
409
409
  return this.s += this.diff, this.count--, this.s;
@@ -424,7 +424,7 @@ class si {
424
424
  return this.spos = t, e;
425
425
  }
426
426
  }
427
- const as = (n) => new Uint8Array(n), tn = (n, t, e) => new Uint8Array(n, t, e), ri = (n) => new Uint8Array(n), ii = (n) => {
427
+ const as = (n) => new Uint8Array(n), en = (n, t, e) => new Uint8Array(n, t, e), ri = (n) => new Uint8Array(n), ii = (n) => {
428
428
  let t = "";
429
429
  for (let e = 0; e < n.byteLength; e++)
430
430
  t += Dr(n[e]);
@@ -446,39 +446,39 @@ class $t {
446
446
  this.cpos = 0, this.cbuf = new Uint8Array(100), this.bufs = [];
447
447
  }
448
448
  }
449
- const M = () => new $t(), en = (n) => {
449
+ const M = () => new $t(), nn = (n) => {
450
450
  let t = n.cpos;
451
451
  for (let e = 0; e < n.bufs.length; e++)
452
452
  t += n.bufs[e].length;
453
453
  return t;
454
454
  }, _ = (n) => {
455
- const t = new Uint8Array(en(n));
455
+ const t = new Uint8Array(nn(n));
456
456
  let e = 0;
457
457
  for (let s = 0; s < n.bufs.length; s++) {
458
458
  const r = n.bufs[s];
459
459
  t.set(r, e), e += r.length;
460
460
  }
461
- return t.set(tn(n.cbuf.buffer, 0, n.cpos), e), t;
461
+ return t.set(en(n.cbuf.buffer, 0, n.cpos), e), t;
462
462
  }, di = (n, t) => {
463
463
  const e = n.cbuf.length;
464
- e - n.cpos < t && (n.bufs.push(tn(n.cbuf.buffer, 0, n.cpos)), n.cbuf = new Uint8Array(ft(e, t) * 2), n.cpos = 0);
464
+ e - n.cpos < t && (n.bufs.push(en(n.cbuf.buffer, 0, n.cpos)), n.cbuf = new Uint8Array(ft(e, t) * 2), n.cpos = 0);
465
465
  }, A = (n, t) => {
466
466
  const e = n.cbuf.length;
467
467
  n.cpos === e && (n.bufs.push(n.cbuf), n.cbuf = new Uint8Array(e * 2), n.cpos = 0), n.cbuf[n.cpos++] = t;
468
- }, Ve = A, p = (n, t) => {
468
+ }, He = A, p = (n, t) => {
469
469
  for (; t > it; )
470
470
  A(n, x | it & t), t = X(t / 128);
471
471
  A(n, it & t);
472
- }, nn = (n, t) => {
472
+ }, sn = (n, t) => {
473
473
  const e = es(t);
474
- for (e && (t = -t), A(n, (t > Fe ? x : 0) | (e ? z : 0) | Fe & t), t = X(t / 64); t > 0; )
474
+ for (e && (t = -t), A(n, (t > Ve ? x : 0) | (e ? z : 0) | Ve & t), t = X(t / 64); t > 0; )
475
475
  A(n, (t > it ? x : 0) | it & t), t = X(t / 128);
476
- }, He = new Uint8Array(3e4), fi = He.length / 3, gi = (n, t) => {
476
+ }, $e = new Uint8Array(3e4), fi = $e.length / 3, gi = (n, t) => {
477
477
  if (t.length < fi) {
478
- const e = Tt.encodeInto(t, He).written || 0;
478
+ const e = Tt.encodeInto(t, $e).written || 0;
479
479
  p(n, e);
480
480
  for (let s = 0; s < e; s++)
481
- A(n, He[s]);
481
+ A(n, $e[s]);
482
482
  } else
483
483
  D(n, Mr(t));
484
484
  }, pi = (n, t) => {
@@ -492,24 +492,24 @@ const M = () => new $t(), en = (n) => {
492
492
  );
493
493
  }, ot = Tt && /** @type {any} */
494
494
  Tt.encodeInto ? gi : pi, we = (n, t) => {
495
- const e = n.cbuf.length, s = n.cpos, r = Ge(e - s, t.length), i = t.length - r;
495
+ const e = n.cbuf.length, s = n.cpos, r = Pe(e - s, t.length), i = t.length - r;
496
496
  n.cbuf.set(t.subarray(0, r), s), n.cpos += r, i > 0 && (n.bufs.push(n.cbuf), n.cbuf = new Uint8Array(ft(e * 2, i)), n.cbuf.set(t.subarray(r)), n.cpos = i);
497
497
  }, D = (n, t) => {
498
498
  p(n, t.byteLength), we(n, t);
499
- }, sn = (n, t) => {
499
+ }, rn = (n, t) => {
500
500
  di(n, t);
501
501
  const e = new DataView(n.cbuf.buffer, n.cpos, t);
502
502
  return n.cpos += t, e;
503
- }, wi = (n, t) => sn(n, 4).setFloat32(0, t, !1), mi = (n, t) => sn(n, 8).setFloat64(0, t, !1), yi = (n, t) => (
503
+ }, wi = (n, t) => rn(n, 4).setFloat32(0, t, !1), mi = (n, t) => rn(n, 8).setFloat64(0, t, !1), yi = (n, t) => (
504
504
  /** @type {any} */
505
- sn(n, 8).setBigInt64(0, t, !1)
505
+ rn(n, 8).setBigInt64(0, t, !1)
506
506
  ), On = new DataView(new ArrayBuffer(4)), bi = (n) => (On.setFloat32(0, n), On.getFloat32(0) === n), Bt = (n, t) => {
507
507
  switch (typeof t) {
508
508
  case "string":
509
509
  A(n, 119), ot(n, t);
510
510
  break;
511
511
  case "number":
512
- Wr(t) && te(t) <= Jr ? (A(n, 125), nn(n, t)) : bi(t) ? (A(n, 124), wi(n, t)) : (A(n, 123), mi(n, t));
512
+ Wr(t) && te(t) <= Jr ? (A(n, 125), sn(n, t)) : bi(t) ? (A(n, 124), wi(n, t)) : (A(n, 123), mi(n, t));
513
513
  break;
514
514
  case "bigint":
515
515
  A(n, 122), yi(n, t);
@@ -555,7 +555,7 @@ class Rn extends $t {
555
555
  }
556
556
  }
557
557
  const Bn = (n) => {
558
- n.count > 0 && (nn(n.encoder, n.count === 1 ? n.s : -n.s), n.count > 1 && p(n.encoder, n.count - 2));
558
+ n.count > 0 && (sn(n.encoder, n.count === 1 ? n.s : -n.s), n.count > 1 && p(n.encoder, n.count - 2));
559
559
  };
560
560
  class ne {
561
561
  constructor() {
@@ -574,10 +574,10 @@ class ne {
574
574
  const Nn = (n) => {
575
575
  if (n.count > 0) {
576
576
  const t = n.diff * 2 + (n.count === 1 ? 0 : 1);
577
- nn(n.encoder, t), n.count > 1 && p(n.encoder, n.count - 2);
577
+ sn(n.encoder, t), n.count > 1 && p(n.encoder, n.count - 2);
578
578
  }
579
579
  };
580
- class Ae {
580
+ class Le {
581
581
  constructor() {
582
582
  this.encoder = new $t(), this.s = 0, this.count = 0, this.diff = 0;
583
583
  }
@@ -680,11 +680,11 @@ const Ci = (n) => yr(n, (t, e) => `${e}:${t};`).join(""), G = Symbol, us = G(),
680
680
  e = n.next();
681
681
  while (!e.done && !t(e.value));
682
682
  return e;
683
- }), Le = (n, t) => ps(() => {
683
+ }), Ie = (n, t) => ps(() => {
684
684
  const { done: e, value: s } = n.next();
685
685
  return { done: e, value: e ? void 0 : t(s) };
686
686
  });
687
- class rn {
687
+ class on {
688
688
  /**
689
689
  * @param {number} clock
690
690
  * @param {number} len
@@ -722,7 +722,7 @@ const ws = (n, t, e) => t.clients.forEach((s, r) => {
722
722
  }, ms = (n, t) => {
723
723
  const e = n.clients.get(t.client);
724
724
  return e !== void 0 && Fi(e, t.clock) !== null;
725
- }, on = (n) => {
725
+ }, ln = (n) => {
726
726
  n.clients.forEach((t) => {
727
727
  t.sort((r, i) => r.clock - i.clock);
728
728
  let e, s;
@@ -743,12 +743,12 @@ const ws = (n, t, e) => t.clients.forEach((s, r) => {
743
743
  t.clients.set(r, i);
744
744
  }
745
745
  });
746
- return on(t), t;
746
+ return ln(t), t;
747
747
  }, ie = (n, t, e, s) => {
748
748
  W(n.clients, t, () => (
749
749
  /** @type {Array<DeleteItem>} */
750
750
  []
751
- )).push(new rn(e, s));
751
+ )).push(new on(e, s));
752
752
  }, Hi = () => new jt(), $i = (n) => {
753
753
  const t = Hi();
754
754
  return n.clients.forEach((e, s) => {
@@ -761,7 +761,7 @@ const ws = (n, t, e) => t.clients.forEach((s, r) => {
761
761
  if (i + 1 < e.length)
762
762
  for (let a = e[i + 1]; i + 1 < e.length && a.deleted; a = e[++i + 1])
763
763
  c += a.length;
764
- r.push(new rn(l, c));
764
+ r.push(new on(l, c));
765
765
  }
766
766
  }
767
767
  r.length > 0 && t.clients.set(s, r);
@@ -776,7 +776,7 @@ const ws = (n, t, e) => t.clients.forEach((s, r) => {
776
776
  n.writeDsClock(o.clock), n.writeDsLen(o.len);
777
777
  }
778
778
  });
779
- }, ln = (n) => {
779
+ }, cn = (n) => {
780
780
  const t = new jt(), e = m(n.restDecoder);
781
781
  for (let s = 0; s < e; s++) {
782
782
  n.resetDsCurVal();
@@ -787,7 +787,7 @@ const ws = (n, t, e) => t.clients.forEach((s, r) => {
787
787
  []
788
788
  ));
789
789
  for (let l = 0; l < i; l++)
790
- o.push(new rn(n.readDsClock(), n.readDsLen()));
790
+ o.push(new on(n.readDsClock(), n.readDsLen()));
791
791
  }
792
792
  }
793
793
  return t;
@@ -1144,7 +1144,7 @@ class Et extends ji {
1144
1144
  * @param {decoding.Decoder} decoder
1145
1145
  */
1146
1146
  constructor(t) {
1147
- super(t), this.keys = [], m(t), this.keyClockDecoder = new Ce(v(t)), this.clientDecoder = new ee(v(t)), this.leftClockDecoder = new Ce(v(t)), this.rightClockDecoder = new Ce(v(t)), this.infoDecoder = new Tn(v(t), St), this.stringDecoder = new si(v(t)), this.parentInfoDecoder = new Tn(v(t), St), this.typeRefDecoder = new ee(v(t)), this.lenDecoder = new ee(v(t));
1147
+ super(t), this.keys = [], m(t), this.keyClockDecoder = new Ae(v(t)), this.clientDecoder = new ee(v(t)), this.leftClockDecoder = new Ae(v(t)), this.rightClockDecoder = new Ae(v(t)), this.infoDecoder = new Tn(v(t), St), this.stringDecoder = new si(v(t)), this.parentInfoDecoder = new Tn(v(t), St), this.typeRefDecoder = new ee(v(t)), this.lenDecoder = new ee(v(t));
1148
1148
  }
1149
1149
  /**
1150
1150
  * @return {ID}
@@ -1281,7 +1281,7 @@ class Kt extends _s {
1281
1281
  * @param {number} info An unsigned 8-bit integer
1282
1282
  */
1283
1283
  writeInfo(t) {
1284
- Ve(this.restEncoder, t);
1284
+ He(this.restEncoder, t);
1285
1285
  }
1286
1286
  /**
1287
1287
  * @param {string} s
@@ -1360,7 +1360,7 @@ class Ss {
1360
1360
  }
1361
1361
  class at extends Ss {
1362
1362
  constructor() {
1363
- super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new Ae(), this.clientEncoder = new ne(), this.leftClockEncoder = new Ae(), this.rightClockEncoder = new Ae(), this.infoEncoder = new Rn(Ve), this.stringEncoder = new ki(), this.parentInfoEncoder = new Rn(Ve), this.typeRefEncoder = new ne(), this.lenEncoder = new ne();
1363
+ super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new Le(), this.clientEncoder = new ne(), this.leftClockEncoder = new Le(), this.rightClockEncoder = new Le(), this.infoEncoder = new Rn(He), this.stringEncoder = new ki(), this.parentInfoEncoder = new Rn(He), this.typeRefEncoder = new ne(), this.lenEncoder = new ne();
1364
1364
  }
1365
1365
  toUint8Array() {
1366
1366
  const t = M();
@@ -1459,7 +1459,7 @@ const Ki = (n, t, e, s) => {
1459
1459
  i.write(n, s - i.id.clock);
1460
1460
  for (let o = r + 1; o < t.length; o++)
1461
1461
  t[o].write(n, 0);
1462
- }, cn = (n, t, e) => {
1462
+ }, an = (n, t, e) => {
1463
1463
  const s = /* @__PURE__ */ new Map();
1464
1464
  e.forEach((r, i) => {
1465
1465
  L(t, i) > r && s.set(i, r);
@@ -1600,10 +1600,10 @@ const Ki = (n, t, e, s) => {
1600
1600
  }
1601
1601
  if (l.clients.size > 0) {
1602
1602
  const f = new at();
1603
- return cn(f, l, /* @__PURE__ */ new Map()), p(f.restEncoder, 0), { missing: c, update: f.toUint8Array() };
1603
+ return an(f, l, /* @__PURE__ */ new Map()), p(f.restEncoder, 0), { missing: c, update: f.toUint8Array() };
1604
1604
  }
1605
1605
  return null;
1606
- }, Xi = (n, t) => cn(n, t.doc.store, t.beforeState), Ji = (n, t, e, s = new Et(n)) => k(t, (r) => {
1606
+ }, Xi = (n, t) => an(n, t.doc.store, t.beforeState), Ji = (n, t, e, s = new Et(n)) => k(t, (r) => {
1607
1607
  r.local = !1;
1608
1608
  let i = !1;
1609
1609
  const o = r.doc, l = o.store, c = zi(s, o), a = Yi(r, l, c), h = l.pendingStructs;
@@ -1641,7 +1641,7 @@ const Ki = (n, t, e, s) => {
1641
1641
  const r = nt(t);
1642
1642
  Ji(r, n, e, new s(r));
1643
1643
  }, Es = (n, t, e) => Ds(n, t, e, ks), Wi = (n, t, e = /* @__PURE__ */ new Map()) => {
1644
- cn(n, t.store, e), At(n, $i(t.store));
1644
+ an(n, t.store, e), At(n, $i(t.store));
1645
1645
  }, Gi = (n, t = new Uint8Array([0]), e = new at()) => {
1646
1646
  const s = Cs(t);
1647
1647
  Wi(e, n, s);
@@ -1653,16 +1653,16 @@ const Ki = (n, t, e, s) => {
1653
1653
  return oe(r);
1654
1654
  }
1655
1655
  return r[0];
1656
- }, an = (n, t) => Gi(n, t, new Kt()), qi = (n) => {
1656
+ }, hn = (n, t) => Gi(n, t, new Kt()), Pi = (n) => {
1657
1657
  const t = /* @__PURE__ */ new Map(), e = m(n.restDecoder);
1658
1658
  for (let s = 0; s < e; s++) {
1659
1659
  const r = m(n.restDecoder), i = m(n.restDecoder);
1660
1660
  t.set(r, i);
1661
1661
  }
1662
1662
  return t;
1663
- }, Cs = (n) => qi(new bs(nt(n))), As = (n, t) => (p(n.restEncoder, t.size), tt(t.entries()).sort((e, s) => s[0] - e[0]).forEach(([e, s]) => {
1663
+ }, Cs = (n) => Pi(new bs(nt(n))), As = (n, t) => (p(n.restEncoder, t.size), tt(t.entries()).sort((e, s) => s[0] - e[0]).forEach(([e, s]) => {
1664
1664
  p(n.restEncoder, e), p(n.restEncoder, s);
1665
- }), n), Pi = (n, t) => As(n, me(t.store)), Zi = (n, t = new Ss()) => (n instanceof Map ? As(t, n) : Pi(t, n), t.toUint8Array()), Qi = (n) => Zi(n, new _s());
1665
+ }), n), qi = (n, t) => As(n, me(t.store)), Zi = (n, t = new Ss()) => (n instanceof Map ? As(t, n) : qi(t, n), t.toUint8Array()), Qi = (n) => Zi(n, new _s());
1666
1666
  class to {
1667
1667
  constructor() {
1668
1668
  this.l = [];
@@ -1671,7 +1671,7 @@ class to {
1671
1671
  const Vn = () => new to(), Hn = (n, t) => n.l.push(t), $n = (n, t) => {
1672
1672
  const e = n.l, s = e.length;
1673
1673
  n.l = e.filter((r) => t !== r), s === n.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
1674
- }, Ls = (n, t, e) => Pe(n.l, [t, e]);
1674
+ }, Ls = (n, t, e) => Ze(n.l, [t, e]);
1675
1675
  class yt {
1676
1676
  /**
1677
1677
  * @param {number} client client id
@@ -1681,13 +1681,13 @@ class yt {
1681
1681
  this.client = t, this.clock = e;
1682
1682
  }
1683
1683
  }
1684
- const qt = (n, t) => n === t || n !== null && t !== null && n.client === t.client && n.clock === t.clock, b = (n, t) => new yt(n, t), eo = (n) => {
1684
+ const Pt = (n, t) => n === t || n !== null && t !== null && n.client === t.client && n.clock === t.clock, b = (n, t) => new yt(n, t), eo = (n) => {
1685
1685
  for (const [t, e] of n.doc.share.entries())
1686
1686
  if (e === n)
1687
1687
  return t;
1688
1688
  throw V();
1689
- }, It = (n, t) => t === void 0 ? !n.deleted : t.sv.has(n.id.client) && (t.sv.get(n.id.client) || 0) > n.id.clock && !ms(t.ds, n.id), $e = (n, t) => {
1690
- const e = W(n.meta, $e, lt), s = n.doc.store;
1689
+ }, It = (n, t) => t === void 0 ? !n.deleted : t.sv.has(n.id.client) && (t.sv.get(n.id.client) || 0) > n.id.clock && !ms(t.ds, n.id), je = (n, t) => {
1690
+ const e = W(n.meta, je, lt), s = n.doc.store;
1691
1691
  e.has(t) || (t.sv.forEach((r, i) => {
1692
1692
  r < L(s, i) && et(n, b(i, r));
1693
1693
  }), ws(n, t.ds, (r) => {
@@ -1738,10 +1738,10 @@ const me = (n) => {
1738
1738
  }, no = (n, t) => {
1739
1739
  const e = n.clients.get(t.client);
1740
1740
  return e[H(e, t.clock)];
1741
- }, Ie = (
1741
+ }, ve = (
1742
1742
  /** @type {function(StructStore,ID):Item} */
1743
1743
  no
1744
- ), je = (n, t, e) => {
1744
+ ), Ke = (n, t, e) => {
1745
1745
  const s = H(t, e), r = t[s];
1746
1746
  return r.id.clock < e && r instanceof E ? (t.splice(s + 1, 0, de(n, r, e - r.id.clock)), s + 1) : s;
1747
1747
  }, et = (n, t) => {
@@ -1749,7 +1749,7 @@ const me = (n) => {
1749
1749
  /** @type {Array<Item>} */
1750
1750
  n.doc.store.clients.get(t.client)
1751
1751
  );
1752
- return e[je(n, e, t.clock)];
1752
+ return e[Ke(n, e, t.clock)];
1753
1753
  }, jn = (n, t, e) => {
1754
1754
  const s = t.clients.get(e.client), r = H(s, e.clock), i = s[r];
1755
1755
  return e.clock !== i.id.clock + i.length - 1 && i.constructor !== U && s.splice(r + 1, 0, de(n, i, e.clock - i.id.clock + 1)), i;
@@ -1763,9 +1763,9 @@ const me = (n) => {
1763
1763
  if (s === 0)
1764
1764
  return;
1765
1765
  const i = e + s;
1766
- let o = je(n, t, e), l;
1766
+ let o = Ke(n, t, e), l;
1767
1767
  do
1768
- l = t[o++], i < l.id.clock + l.length && je(n, t, i), r(l);
1768
+ l = t[o++], i < l.id.clock + l.length && Ke(n, t, i), r(l);
1769
1769
  while (o < t.length && t[o].id.clock < i);
1770
1770
  };
1771
1771
  class ro {
@@ -1778,7 +1778,7 @@ class ro {
1778
1778
  this.doc = t, this.deleteSet = new jt(), this.beforeState = me(t.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = e, this.meta = /* @__PURE__ */ new Map(), this.local = s, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
1779
1779
  }
1780
1780
  }
1781
- const Kn = (n, t) => t.deleteSet.clients.size === 0 && !br(t.afterState, (e, s) => t.beforeState.get(s) !== e) ? !1 : (on(t.deleteSet), Xi(n, t), At(n, t.deleteSet), !0), zn = (n, t, e) => {
1781
+ const Kn = (n, t) => t.deleteSet.clients.size === 0 && !br(t.afterState, (e, s) => t.beforeState.get(s) !== e) ? !1 : (ln(t.deleteSet), Xi(n, t), At(n, t.deleteSet), !0), zn = (n, t, e) => {
1782
1782
  const s = t._item;
1783
1783
  (s === null || s.id.clock < (n.beforeState.get(s.id.client) || 0) && !s.deleted) && W(n.changed, t, lt).add(e);
1784
1784
  }, se = (n, t) => {
@@ -1820,7 +1820,7 @@ const Kn = (n, t) => t.deleteSet.clients.size === 0 && !br(t.afterState, (e, s)
1820
1820
  t.clients.get(s)
1821
1821
  );
1822
1822
  for (let i = e.length - 1; i >= 0; i--) {
1823
- const o = e[i], l = Ge(r.length - 1, 1 + H(r, o.clock + o.len - 1));
1823
+ const o = e[i], l = Pe(r.length - 1, 1 + H(r, o.clock + o.len - 1));
1824
1824
  for (let c = l, a = r[c]; c > 0 && a.id.clock >= o.clock; a = r[c])
1825
1825
  c -= 1 + se(r, c);
1826
1826
  }
@@ -1829,7 +1829,7 @@ const Kn = (n, t) => t.deleteSet.clients.size === 0 && !br(t.afterState, (e, s)
1829
1829
  if (t < n.length) {
1830
1830
  const e = n[t], s = e.doc, r = s.store, i = e.deleteSet, o = e._mergeStructs;
1831
1831
  try {
1832
- on(i), e.afterState = me(e.doc.store), s.emit("beforeObserverCalls", [e, s]);
1832
+ ln(i), e.afterState = me(e.doc.store), s.emit("beforeObserverCalls", [e, s]);
1833
1833
  const l = [];
1834
1834
  e.changed.forEach(
1835
1835
  (c, a) => l.push(() => {
@@ -1843,7 +1843,7 @@ const Kn = (n, t) => t.deleteSet.clients.size === 0 && !br(t.afterState, (e, s)
1843
1843
  h.currentTarget = a, h._path = null;
1844
1844
  }), c.sort((h, d) => h.path.length - d.path.length), Ls(a._dEH, c, e));
1845
1845
  });
1846
- }), l.push(() => s.emit("afterTransaction", [e, s])), Pe(l, []), e._needFormattingCleanup && Ao(e);
1846
+ }), l.push(() => s.emit("afterTransaction", [e, s])), Ze(l, []), e._needFormattingCleanup && Ao(e);
1847
1847
  } finally {
1848
1848
  s.gc && io(i, r, s.gcFilter), oo(i, r), e.afterState.forEach((h, d) => {
1849
1849
  const u = e.beforeState.get(d) || 0;
@@ -1928,7 +1928,7 @@ function* lo(n) {
1928
1928
  }
1929
1929
  }
1930
1930
  }
1931
- class hn {
1931
+ class un {
1932
1932
  /**
1933
1933
  * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder
1934
1934
  * @param {boolean} filterSkips
@@ -1946,7 +1946,7 @@ class hn {
1946
1946
  return this.curr;
1947
1947
  }
1948
1948
  }
1949
- class un {
1949
+ class dn {
1950
1950
  /**
1951
1951
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
1952
1952
  */
@@ -1981,8 +1981,8 @@ const co = (n) => oe(n, ks, Kt), ao = (n, t) => {
1981
1981
  if (n.length === 1)
1982
1982
  return n[0];
1983
1983
  const s = n.map((h) => new t(nt(h)));
1984
- let r = s.map((h) => new hn(h, !0)), i = null;
1985
- const o = new e(), l = new un(o);
1984
+ let r = s.map((h) => new un(h, !0)), i = null;
1985
+ const o = new e(), l = new dn(o);
1986
1986
  for (; r = r.filter((u) => u.curr !== null), r.sort(
1987
1987
  /** @type {function(any,any):number} */
1988
1988
  (u, f) => {
@@ -2009,12 +2009,12 @@ const co = (n) => oe(n, ks, Kt), ao = (n, t) => {
2009
2009
  f && u.id.clock > i.struct.id.clock + i.struct.length)
2010
2010
  continue;
2011
2011
  if (d !== i.struct.id.client)
2012
- P(l, i.struct, i.offset), i = { struct: u, offset: 0 }, h.next();
2012
+ q(l, i.struct, i.offset), i = { struct: u, offset: 0 }, h.next();
2013
2013
  else if (i.struct.id.clock + i.struct.length < u.id.clock)
2014
2014
  if (i.struct.constructor === T)
2015
2015
  i.struct.length = u.id.clock + u.length - i.struct.id.clock;
2016
2016
  else {
2017
- P(l, i.struct, i.offset);
2017
+ q(l, i.struct, i.offset);
2018
2018
  const g = u.id.clock - i.struct.id.clock - i.struct.length;
2019
2019
  i = { struct: new T(b(d, i.struct.id.clock + i.struct.length), g), offset: 0 };
2020
2020
  }
@@ -2023,7 +2023,7 @@ const co = (n) => oe(n, ks, Kt), ao = (n, t) => {
2023
2023
  g > 0 && (i.struct.constructor === T ? i.struct.length -= g : u = ao(u, g)), i.struct.mergeWith(
2024
2024
  /** @type {any} */
2025
2025
  u
2026
- ) || (P(l, i.struct, i.offset), i = { struct: u, offset: 0 }, h.next());
2026
+ ) || (q(l, i.struct, i.offset), i = { struct: u, offset: 0 }, h.next());
2027
2027
  }
2028
2028
  } else
2029
2029
  i = { struct: (
@@ -2031,13 +2031,13 @@ const co = (n) => oe(n, ks, Kt), ao = (n, t) => {
2031
2031
  h.curr
2032
2032
  ), offset: 0 }, h.next();
2033
2033
  for (let u = h.curr; u !== null && u.id.client === d && u.id.clock === i.struct.id.clock + i.struct.length && u.constructor !== T; u = h.next())
2034
- P(l, i.struct, i.offset), i = { struct: u, offset: 0 };
2034
+ q(l, i.struct, i.offset), i = { struct: u, offset: 0 };
2035
2035
  }
2036
- i !== null && (P(l, i.struct, i.offset), i = null), dn(l);
2037
- const c = s.map((h) => ln(h)), a = Vi(c);
2036
+ i !== null && (q(l, i.struct, i.offset), i = null), fn(l);
2037
+ const c = s.map((h) => cn(h)), a = Vi(c);
2038
2038
  return At(o, a), o.toUint8Array();
2039
2039
  }, ho = (n, t, e = Et, s = at) => {
2040
- const r = Cs(t), i = new s(), o = new un(i), l = new e(nt(n)), c = new hn(l, !1);
2040
+ const r = Cs(t), i = new s(), o = new dn(i), l = new e(nt(n)), c = new un(l, !1);
2041
2041
  for (; c.curr; ) {
2042
2042
  const h = c.curr, d = h.id.client, u = r.get(d) || 0;
2043
2043
  if (c.curr.constructor === T) {
@@ -2045,20 +2045,20 @@ const co = (n) => oe(n, ks, Kt), ao = (n, t) => {
2045
2045
  continue;
2046
2046
  }
2047
2047
  if (h.id.clock + h.length > u)
2048
- for (P(o, h, ft(u - h.id.clock, 0)), c.next(); c.curr && c.curr.id.client === d; )
2049
- P(o, c.curr, 0), c.next();
2048
+ for (q(o, h, ft(u - h.id.clock, 0)), c.next(); c.curr && c.curr.id.client === d; )
2049
+ q(o, c.curr, 0), c.next();
2050
2050
  else
2051
2051
  for (; c.curr && c.curr.id.client === d && c.curr.id.clock + c.curr.length <= u; )
2052
2052
  c.next();
2053
2053
  }
2054
- dn(o);
2055
- const a = ln(l);
2054
+ fn(o);
2055
+ const a = cn(l);
2056
2056
  return At(i, a), i.toUint8Array();
2057
2057
  }, Us = (n) => {
2058
2058
  n.written > 0 && (n.clientStructs.push({ written: n.written, restEncoder: _(n.encoder.restEncoder) }), n.encoder.restEncoder = M(), n.written = 0);
2059
- }, P = (n, t, e) => {
2059
+ }, q = (n, t, e) => {
2060
2060
  n.written > 0 && n.currClient !== t.id.client && Us(n), n.written === 0 && (n.currClient = t.id.client, n.encoder.writeClient(t.id.client), p(n.encoder.restEncoder, t.id.clock + e)), t.write(n.encoder, e), n.written++;
2061
- }, dn = (n) => {
2061
+ }, fn = (n) => {
2062
2062
  Us(n);
2063
2063
  const t = n.encoder.restEncoder;
2064
2064
  p(t, n.clientStructs.length);
@@ -2067,11 +2067,11 @@ const co = (n) => oe(n, ks, Kt), ao = (n, t) => {
2067
2067
  p(t, s.written), we(t, s.restEncoder);
2068
2068
  }
2069
2069
  }, uo = (n, t, e, s) => {
2070
- const r = new e(nt(n)), i = new hn(r, !1), o = new s(), l = new un(o);
2070
+ const r = new e(nt(n)), i = new un(r, !1), o = new s(), l = new dn(o);
2071
2071
  for (let a = i.curr; a !== null; a = i.next())
2072
- P(l, t(a), 0);
2073
- dn(l);
2074
- const c = ln(r);
2072
+ q(l, t(a), 0);
2073
+ fn(l);
2074
+ const c = cn(r);
2075
2075
  return At(o, c), o.toUint8Array();
2076
2076
  }, fo = (n) => uo(n, $r, Et, Kt), Yn = "You must not compute changes after the event-handler fired.";
2077
2077
  class ye {
@@ -2131,13 +2131,13 @@ class ye {
2131
2131
  c = c.left;
2132
2132
  if (this.deletes(i))
2133
2133
  if (c !== null && this.deletes(c))
2134
- o = "delete", l = Se(c.content.getContent());
2134
+ o = "delete", l = De(c.content.getContent());
2135
2135
  else
2136
2136
  return;
2137
2137
  else
2138
- c !== null && this.deletes(c) ? (o = "update", l = Se(c.content.getContent())) : (o = "add", l = void 0);
2138
+ c !== null && this.deletes(c) ? (o = "update", l = De(c.content.getContent())) : (o = "add", l = void 0);
2139
2139
  } else if (this.deletes(i))
2140
- o = "delete", l = Se(
2140
+ o = "delete", l = De(
2141
2141
  /** @type {Item} */
2142
2142
  i.content.getContent()
2143
2143
  );
@@ -2227,20 +2227,20 @@ const go = (n, t) => {
2227
2227
  }
2228
2228
  return e;
2229
2229
  }, Ts = 80;
2230
- let fn = 0;
2230
+ let gn = 0;
2231
2231
  class po {
2232
2232
  /**
2233
2233
  * @param {Item} p
2234
2234
  * @param {number} index
2235
2235
  */
2236
2236
  constructor(t, e) {
2237
- t.marker = !0, this.p = t, this.index = e, this.timestamp = fn++;
2237
+ t.marker = !0, this.p = t, this.index = e, this.timestamp = gn++;
2238
2238
  }
2239
2239
  }
2240
2240
  const wo = (n) => {
2241
- n.timestamp = fn++;
2241
+ n.timestamp = gn++;
2242
2242
  }, Os = (n, t, e) => {
2243
- n.p.marker = !1, n.p = t, t.marker = !0, n.index = e, n.timestamp = fn++;
2243
+ n.p.marker = !1, n.p = t, t.marker = !0, n.index = e, n.timestamp = gn++;
2244
2244
  }, mo = (n, t, e) => {
2245
2245
  if (n.length >= Ts) {
2246
2246
  const s = n.reduce((r, i) => r.timestamp < i.timestamp ? r : i);
@@ -2506,7 +2506,7 @@ const Rs = (n, t, e) => {
2506
2506
  break;
2507
2507
  default:
2508
2508
  if (d instanceof I)
2509
- r = new E(b(o, L(l, o)), r, r && r.lastId, c, c && c.id, t, null, new q(d)), r.integrate(n, 0);
2509
+ r = new E(b(o, L(l, o)), r, r && r.lastId, c, c && c.id, t, null, new P(d)), r.integrate(n, 0);
2510
2510
  else
2511
2511
  throw new Error("Unexpected content type in insert operation");
2512
2512
  }
@@ -2554,7 +2554,7 @@ const Rs = (n, t, e) => {
2554
2554
  }, ce = (n, t, e) => {
2555
2555
  const s = t._map.get(e);
2556
2556
  s !== void 0 && s.delete(n);
2557
- }, gn = (n, t, e, s) => {
2557
+ }, pn = (n, t, e, s) => {
2558
2558
  const r = t._map.get(e) || null, i = n.doc, o = i.clientID;
2559
2559
  let l;
2560
2560
  if (s == null)
@@ -2582,12 +2582,12 @@ const Rs = (n, t, e) => {
2582
2582
  break;
2583
2583
  default:
2584
2584
  if (s instanceof I)
2585
- l = new q(s);
2585
+ l = new P(s);
2586
2586
  else
2587
2587
  throw new Error("Unexpected content type");
2588
2588
  }
2589
2589
  new E(b(o, L(i.store, o)), r, r && r.lastId, null, null, t, e, l).integrate(n, 0);
2590
- }, pn = (n, t) => {
2590
+ }, wn = (n, t) => {
2591
2591
  const e = n._map.get(t);
2592
2592
  return e !== void 0 && !e.deleted ? e.content.getContent()[e.length - 1] : void 0;
2593
2593
  }, js = (n) => {
@@ -2598,7 +2598,7 @@ const Rs = (n, t, e) => {
2598
2598
  }, Ks = (n, t) => {
2599
2599
  const e = n._map.get(t);
2600
2600
  return e !== void 0 && !e.deleted;
2601
- }, Pt = (n) => Ni(
2601
+ }, qt = (n) => Ni(
2602
2602
  n.entries(),
2603
2603
  /** @param {any} entry */
2604
2604
  (t) => !t[1].deleted
@@ -2889,7 +2889,7 @@ class ht extends I {
2889
2889
  * @return {number}
2890
2890
  */
2891
2891
  get size() {
2892
- return [...Pt(this._map)].length;
2892
+ return [...qt(this._map)].length;
2893
2893
  }
2894
2894
  /**
2895
2895
  * Returns the keys for each element in the YMap Type.
@@ -2897,8 +2897,8 @@ class ht extends I {
2897
2897
  * @return {IterableIterator<string>}
2898
2898
  */
2899
2899
  keys() {
2900
- return Le(
2901
- Pt(this._map),
2900
+ return Ie(
2901
+ qt(this._map),
2902
2902
  /** @param {any} v */
2903
2903
  (t) => t[0]
2904
2904
  );
@@ -2909,8 +2909,8 @@ class ht extends I {
2909
2909
  * @return {IterableIterator<any>}
2910
2910
  */
2911
2911
  values() {
2912
- return Le(
2913
- Pt(this._map),
2912
+ return Ie(
2913
+ qt(this._map),
2914
2914
  /** @param {any} v */
2915
2915
  (t) => t[1].content.getContent()[t[1].length - 1]
2916
2916
  );
@@ -2921,8 +2921,8 @@ class ht extends I {
2921
2921
  * @return {IterableIterator<any>}
2922
2922
  */
2923
2923
  entries() {
2924
- return Le(
2925
- Pt(this._map),
2924
+ return Ie(
2925
+ qt(this._map),
2926
2926
  /** @param {any} v */
2927
2927
  (t) => [t[0], t[1].content.getContent()[t[1].length - 1]]
2928
2928
  );
@@ -2965,7 +2965,7 @@ class ht extends I {
2965
2965
  */
2966
2966
  set(t, e) {
2967
2967
  return this.doc !== null ? k(this.doc, (s) => {
2968
- gn(
2968
+ pn(
2969
2969
  s,
2970
2970
  this,
2971
2971
  t,
@@ -2983,7 +2983,7 @@ class ht extends I {
2983
2983
  get(t) {
2984
2984
  return (
2985
2985
  /** @type {any} */
2986
- pn(this, t)
2986
+ wn(this, t)
2987
2987
  );
2988
2988
  }
2989
2989
  /**
@@ -3013,7 +3013,7 @@ class ht extends I {
3013
3013
  }
3014
3014
  }
3015
3015
  const Do = (n) => new ht(), Z = (n, t) => n === t || typeof n == "object" && typeof t == "object" && n && t && Hr(n, t);
3016
- class Ke {
3016
+ class ze {
3017
3017
  /**
3018
3018
  * @param {Item|null} left
3019
3019
  * @param {Item|null} right
@@ -3062,10 +3062,10 @@ const Xn = (n, t, e) => {
3062
3062
  }, Zt = (n, t, e) => {
3063
3063
  const s = /* @__PURE__ */ new Map(), r = be(t, e);
3064
3064
  if (r) {
3065
- const i = new Ke(r.p.left, r.p, r.index, s);
3065
+ const i = new ze(r.p.left, r.p, r.index, s);
3066
3066
  return Xn(n, i, e - r.index);
3067
3067
  } else {
3068
- const i = new Ke(null, t._start, 0, s);
3068
+ const i = new ze(null, t._start, 0, s);
3069
3069
  return Xn(n, i, e);
3070
3070
  }
3071
3071
  }, zs = (n, t, e, s) => {
@@ -3113,7 +3113,7 @@ const Xn = (n, t, e) => {
3113
3113
  }
3114
3114
  }
3115
3115
  return o;
3116
- }, ve = (n, t, e, s, r) => {
3116
+ }, Me = (n, t, e, s, r) => {
3117
3117
  e.currentAttributes.forEach((u, f) => {
3118
3118
  r[f] === void 0 && (r[f] = null);
3119
3119
  });
@@ -3122,7 +3122,7 @@ const Xn = (n, t, e) => {
3122
3122
  const l = Xs(n, t, e, r), c = s.constructor === String ? new $(
3123
3123
  /** @type {string} */
3124
3124
  s
3125
- ) : s instanceof I ? new q(s) : new pt(s);
3125
+ ) : s instanceof I ? new P(s) : new pt(s);
3126
3126
  let { left: a, right: h, index: d } = e;
3127
3127
  t._searchMarker && Nt(t._searchMarker, e.index, c.getLength()), h = new E(b(o, L(i.store, o)), a, a && a.lastId, h, h && h.id, t, null, c), h.integrate(n, 0), e.right = h, e.index = d, e.forward(), zs(n, t, e, l);
3128
3128
  }, Jn = (n, t, e, s, r) => {
@@ -3225,7 +3225,7 @@ const Xn = (n, t, e) => {
3225
3225
  /** @type {Item} */
3226
3226
  n._start
3227
3227
  ), r = n._start, i = O();
3228
- const o = Re(i);
3228
+ const o = Be(i);
3229
3229
  for (; r; ) {
3230
3230
  if (r.deleted === !1)
3231
3231
  switch (r.content.constructor) {
@@ -3237,7 +3237,7 @@ const Xn = (n, t, e) => {
3237
3237
  );
3238
3238
  break;
3239
3239
  default:
3240
- t += Js(e, s, r, i, o), i = Re(o), s = r;
3240
+ t += Js(e, s, r, i, o), i = Be(o), s = r;
3241
3241
  break;
3242
3242
  }
3243
3243
  r = r.right;
@@ -3281,11 +3281,11 @@ const Xn = (n, t, e) => {
3281
3281
  Co(r);
3282
3282
  });
3283
3283
  }, Wn = (n, t, e) => {
3284
- const s = e, r = Re(t.currentAttributes), i = t.right;
3284
+ const s = e, r = Be(t.currentAttributes), i = t.right;
3285
3285
  for (; e > 0 && t.right !== null; ) {
3286
3286
  if (t.right.deleted === !1)
3287
3287
  switch (t.right.content.constructor) {
3288
- case q:
3288
+ case P:
3289
3289
  case pt:
3290
3290
  case $:
3291
3291
  e < t.right.length && et(n, b(t.right.id.client, t.right.id.clock + e)), e -= t.right.length, t.right.delete(n);
@@ -3370,7 +3370,7 @@ class Lo extends ye {
3370
3370
  };
3371
3371
  for (; o !== null; ) {
3372
3372
  switch (o.content.constructor) {
3373
- case q:
3373
+ case P:
3374
3374
  case pt:
3375
3375
  this.adds(o) ? this.deletes(o) || (u(), l = "insert", a = o.content.getContent()[0], u()) : this.deletes(o) ? (l !== "delete" && (u(), l = "delete"), d += 1) : o.deleted || (l !== "retain" && (u(), l = "retain"), h += 1);
3376
3376
  break;
@@ -3504,13 +3504,13 @@ class Ct extends I {
3504
3504
  */
3505
3505
  applyDelta(t, { sanitize: e = !0 } = {}) {
3506
3506
  this.doc !== null ? k(this.doc, (s) => {
3507
- const r = new Ke(null, this._start, 0, /* @__PURE__ */ new Map());
3507
+ const r = new ze(null, this._start, 0, /* @__PURE__ */ new Map());
3508
3508
  for (let i = 0; i < t.length; i++) {
3509
3509
  const o = t[i];
3510
3510
  if (o.insert !== void 0) {
3511
3511
  const l = !e && typeof o.insert == "string" && i === t.length - 1 && r.right === null && o.insert.slice(-1) === `
3512
3512
  ` ? o.insert.slice(0, -1) : o.insert;
3513
- (typeof l != "string" || l.length > 0) && ve(s, this, r, l, o.attributes || {});
3513
+ (typeof l != "string" || l.length > 0) && Me(s, this, r, l, o.attributes || {});
3514
3514
  } else
3515
3515
  o.retain !== void 0 ? Jn(s, this, r, o.retain, o.attributes || {}) : o.delete !== void 0 && Wn(s, r, o.delete);
3516
3516
  }
@@ -3553,7 +3553,7 @@ class Ct extends I {
3553
3553
  c.content.str;
3554
3554
  break;
3555
3555
  }
3556
- case q:
3556
+ case P:
3557
3557
  case pt: {
3558
3558
  a();
3559
3559
  const d = {
@@ -3584,7 +3584,7 @@ class Ct extends I {
3584
3584
  a();
3585
3585
  };
3586
3586
  return t || e ? k(o, (d) => {
3587
- t && $e(d, t), e && $e(d, e), h();
3587
+ t && je(d, t), e && je(d, e), h();
3588
3588
  }, "cleanup") : h(), r;
3589
3589
  }
3590
3590
  /**
@@ -3605,7 +3605,7 @@ class Ct extends I {
3605
3605
  const o = Zt(i, this, t);
3606
3606
  s || (s = {}, o.currentAttributes.forEach((l, c) => {
3607
3607
  s[c] = l;
3608
- })), ve(i, this, o, e, s);
3608
+ })), Me(i, this, o, e, s);
3609
3609
  }) : this._pending.push(() => this.insert(t, e, s));
3610
3610
  }
3611
3611
  /**
@@ -3622,7 +3622,7 @@ class Ct extends I {
3622
3622
  const r = this.doc;
3623
3623
  r !== null ? k(r, (i) => {
3624
3624
  const o = Zt(i, this, t);
3625
- ve(i, this, o, e, s);
3625
+ Me(i, this, o, e, s);
3626
3626
  }) : this._pending.push(() => this.insertEmbed(t, e, s));
3627
3627
  }
3628
3628
  /**
@@ -3686,7 +3686,7 @@ class Ct extends I {
3686
3686
  */
3687
3687
  setAttribute(t, e) {
3688
3688
  this.doc !== null ? k(this.doc, (s) => {
3689
- gn(s, this, t, e);
3689
+ pn(s, this, t, e);
3690
3690
  }) : this._pending.push(() => this.setAttribute(t, e));
3691
3691
  }
3692
3692
  /**
@@ -3703,7 +3703,7 @@ class Ct extends I {
3703
3703
  getAttribute(t) {
3704
3704
  return (
3705
3705
  /** @type {any} */
3706
- pn(this, t)
3706
+ wn(this, t)
3707
3707
  );
3708
3708
  }
3709
3709
  /**
@@ -3726,7 +3726,7 @@ class Ct extends I {
3726
3726
  }
3727
3727
  }
3728
3728
  const Io = (n) => new Ct();
3729
- class Me {
3729
+ class xe {
3730
3730
  /**
3731
3731
  * @param {YXmlFragment | YXmlElement} root
3732
3732
  * @param {function(AbstractType<any>):boolean} [f]
@@ -3830,7 +3830,7 @@ class ut extends I {
3830
3830
  * @public
3831
3831
  */
3832
3832
  createTreeWalker(t) {
3833
- return new Me(this, t);
3833
+ return new xe(this, t);
3834
3834
  }
3835
3835
  /**
3836
3836
  * Returns the first YXmlElement that matches the query.
@@ -3849,7 +3849,7 @@ class ut extends I {
3849
3849
  */
3850
3850
  querySelector(t) {
3851
3851
  t = t.toUpperCase();
3852
- const s = new Me(this, (r) => r.nodeName && r.nodeName.toUpperCase() === t).next();
3852
+ const s = new xe(this, (r) => r.nodeName && r.nodeName.toUpperCase() === t).next();
3853
3853
  return s.done ? null : s.value;
3854
3854
  }
3855
3855
  /**
@@ -3864,7 +3864,7 @@ class ut extends I {
3864
3864
  * @public
3865
3865
  */
3866
3866
  querySelectorAll(t) {
3867
- return t = t.toUpperCase(), tt(new Me(this, (e) => e.nodeName && e.nodeName.toUpperCase() === t));
3867
+ return t = t.toUpperCase(), tt(new xe(this, (e) => e.nodeName && e.nodeName.toUpperCase() === t));
3868
3868
  }
3869
3869
  /**
3870
3870
  * Creates YXmlEvent and calls observers.
@@ -4131,7 +4131,7 @@ class Vt extends ut {
4131
4131
  */
4132
4132
  setAttribute(t, e) {
4133
4133
  this.doc !== null ? k(this.doc, (s) => {
4134
- gn(s, this, t, e);
4134
+ pn(s, this, t, e);
4135
4135
  }) : this._prelimAttrs.set(t, e);
4136
4136
  }
4137
4137
  /**
@@ -4148,7 +4148,7 @@ class Vt extends ut {
4148
4148
  getAttribute(t) {
4149
4149
  return (
4150
4150
  /** @type {any} */
4151
- pn(this, t)
4151
+ wn(this, t)
4152
4152
  );
4153
4153
  }
4154
4154
  /**
@@ -4373,11 +4373,11 @@ class he extends Ct {
4373
4373
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
4374
4374
  */
4375
4375
  _write(t) {
4376
- t.writeTypeRef(qo);
4376
+ t.writeTypeRef(Po);
4377
4377
  }
4378
4378
  }
4379
4379
  const To = (n) => new he();
4380
- class wn {
4380
+ class mn {
4381
4381
  /**
4382
4382
  * @param {ID} id
4383
4383
  * @param {number} length
@@ -4418,7 +4418,7 @@ class wn {
4418
4418
  }
4419
4419
  }
4420
4420
  const Oo = 0;
4421
- class U extends wn {
4421
+ class U extends mn {
4422
4422
  get deleted() {
4423
4423
  return !0;
4424
4424
  }
@@ -5108,8 +5108,8 @@ const jo = (n) => new $(n.readString()), Ko = [
5108
5108
  vo,
5109
5109
  Uo,
5110
5110
  To
5111
- ], zo = 0, Yo = 1, Xo = 2, Jo = 3, Wo = 4, Go = 5, qo = 6;
5112
- class q {
5111
+ ], zo = 0, Yo = 1, Xo = 2, Jo = 3, Wo = 4, Go = 5, Po = 6;
5112
+ class P {
5113
5113
  /**
5114
5114
  * @param {AbstractType<any>} type
5115
5115
  */
@@ -5138,7 +5138,7 @@ class q {
5138
5138
  * @return {ContentType}
5139
5139
  */
5140
5140
  copy() {
5141
- return new q(this.type._copy());
5141
+ return new P(this.type._copy());
5142
5142
  }
5143
5143
  /**
5144
5144
  * @param {number} offset
@@ -5201,7 +5201,7 @@ class q {
5201
5201
  return 7;
5202
5202
  }
5203
5203
  }
5204
- const Po = (n) => new q(Ko[n.readTypeRef()](n)), de = (n, t, e) => {
5204
+ const qo = (n) => new P(Ko[n.readTypeRef()](n)), de = (n, t, e) => {
5205
5205
  const { client: s, clock: r } = t.id, i = new E(
5206
5206
  b(s, r + e),
5207
5207
  t,
@@ -5214,7 +5214,7 @@ const Po = (n) => new q(Ko[n.readTypeRef()](n)), de = (n, t, e) => {
5214
5214
  );
5215
5215
  return t.deleted && i.markDeleted(), t.keep && (i.keep = !0), t.redone !== null && (i.redone = b(t.redone.client, t.redone.clock + e)), t.right = i, i.right !== null && (i.right.left = i), n._mergeStructs.push(i), i.parentSub !== null && i.right === null && i.parent._map.set(i.parentSub, i), t.length = e, i;
5216
5216
  };
5217
- class E extends wn {
5217
+ class E extends mn {
5218
5218
  /**
5219
5219
  * @param {ID} id
5220
5220
  * @param {Item | null} left
@@ -5234,10 +5234,10 @@ class E extends wn {
5234
5234
  * @type {boolean}
5235
5235
  */
5236
5236
  set marker(t) {
5237
- (this.info & Ee) > 0 !== t && (this.info ^= Ee);
5237
+ (this.info & Ce) > 0 !== t && (this.info ^= Ce);
5238
5238
  }
5239
5239
  get marker() {
5240
- return (this.info & Ee) > 0;
5240
+ return (this.info & Ce) > 0;
5241
5241
  }
5242
5242
  /**
5243
5243
  * If true, do not garbage collect this Item.
@@ -5256,13 +5256,13 @@ class E extends wn {
5256
5256
  * @type {Boolean}
5257
5257
  */
5258
5258
  get deleted() {
5259
- return (this.info & De) > 0;
5259
+ return (this.info & Ee) > 0;
5260
5260
  }
5261
5261
  set deleted(t) {
5262
- this.deleted !== t && (this.info ^= De);
5262
+ this.deleted !== t && (this.info ^= Ee);
5263
5263
  }
5264
5264
  markDeleted() {
5265
- this.info |= De;
5265
+ this.info |= Ee;
5266
5266
  }
5267
5267
  /**
5268
5268
  * Return the creator clientID of the missing op or define missing items and return null.
@@ -5283,7 +5283,7 @@ class E extends wn {
5283
5283
  else if (!this.parent)
5284
5284
  this.left && this.left.constructor === E && (this.parent = this.left.parent, this.parentSub = this.left.parentSub), this.right && this.right.constructor === E && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
5285
5285
  else if (this.parent.constructor === yt) {
5286
- const s = Ie(e, this.parent);
5286
+ const s = ve(e, this.parent);
5287
5287
  s.constructor === U ? this.parent = null : this.parent = /** @type {ContentType} */
5288
5288
  s.content.type;
5289
5289
  }
@@ -5308,13 +5308,13 @@ class E extends wn {
5308
5308
  this.parent._start;
5309
5309
  const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
5310
5310
  for (; r !== null && r !== this.right; ) {
5311
- if (o.add(r), i.add(r), qt(this.origin, r.origin)) {
5311
+ if (o.add(r), i.add(r), Pt(this.origin, r.origin)) {
5312
5312
  if (r.id.client < this.id.client)
5313
5313
  s = r, i.clear();
5314
- else if (qt(this.rightOrigin, r.rightOrigin))
5314
+ else if (Pt(this.rightOrigin, r.rightOrigin))
5315
5315
  break;
5316
- } else if (r.origin !== null && o.has(Ie(t.doc.store, r.origin)))
5317
- i.has(Ie(t.doc.store, r.origin)) || (s = r, i.clear());
5316
+ } else if (r.origin !== null && o.has(ve(t.doc.store, r.origin)))
5317
+ i.has(ve(t.doc.store, r.origin)) || (s = r, i.clear());
5318
5318
  else
5319
5319
  break;
5320
5320
  r = r.right;
@@ -5377,7 +5377,7 @@ class E extends wn {
5377
5377
  * @return {boolean}
5378
5378
  */
5379
5379
  mergeWith(t) {
5380
- if (this.constructor === t.constructor && qt(t.origin, this.lastId) && this.right === t && qt(this.rightOrigin, t.rightOrigin) && this.id.client === t.id.client && this.id.clock + this.length === t.id.clock && this.deleted === t.deleted && this.redone === null && t.redone === null && this.content.constructor === t.content.constructor && this.content.mergeWith(t.content)) {
5380
+ if (this.constructor === t.constructor && Pt(t.origin, this.lastId) && this.right === t && Pt(this.rightOrigin, t.rightOrigin) && this.id.client === t.id.client && this.id.clock + this.length === t.id.clock && this.deleted === t.deleted && this.redone === null && t.redone === null && this.content.constructor === t.content.constructor && this.content.mergeWith(t.content)) {
5381
5381
  const e = (
5382
5382
  /** @type {AbstractType<any>} */
5383
5383
  this.parent._searchMarker
@@ -5460,7 +5460,7 @@ const Gs = (n, t) => Zo[t & ge](n), Zo = [
5460
5460
  // 5
5461
5461
  Vo,
5462
5462
  // 6
5463
- Po,
5463
+ qo,
5464
5464
  // 7
5465
5465
  $o,
5466
5466
  // 8
@@ -5471,7 +5471,7 @@ const Gs = (n, t) => Zo[t & ge](n), Zo = [
5471
5471
  }
5472
5472
  // 10 - Skip is not ItemContent
5473
5473
  ], Qo = 10;
5474
- class T extends wn {
5474
+ class T extends mn {
5475
5475
  get deleted() {
5476
5476
  return !0;
5477
5477
  }
@@ -5507,12 +5507,12 @@ class T extends wn {
5507
5507
  return null;
5508
5508
  }
5509
5509
  }
5510
- const qs = (
5510
+ const Ps = (
5511
5511
  /** @type {any} */
5512
5512
  typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}
5513
- ), Ps = "__ $YJS$ __";
5514
- qs[Ps] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");
5515
- qs[Ps] = !0;
5513
+ ), qs = "__ $YJS$ __";
5514
+ Ps[qs] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");
5515
+ Ps[qs] = !0;
5516
5516
  const Zs = /* @__PURE__ */ new Map();
5517
5517
  class tl {
5518
5518
  /**
@@ -5531,24 +5531,24 @@ class tl {
5531
5531
  Tr(this._onChange);
5532
5532
  }
5533
5533
  }
5534
- const el = typeof BroadcastChannel > "u" ? tl : BroadcastChannel, mn = (n) => W(Zs, n, () => {
5534
+ const el = typeof BroadcastChannel > "u" ? tl : BroadcastChannel, yn = (n) => W(Zs, n, () => {
5535
5535
  const t = lt(), e = new el(n);
5536
5536
  return e.onmessage = (s) => t.forEach((r) => r(s.data, "broadcastchannel")), {
5537
5537
  bc: e,
5538
5538
  subs: t
5539
5539
  };
5540
- }), nl = (n, t) => (mn(n).subs.add(t), t), sl = (n, t) => {
5541
- const e = mn(n), s = e.subs.delete(t);
5540
+ }), nl = (n, t) => (yn(n).subs.add(t), t), sl = (n, t) => {
5541
+ const e = yn(n), s = e.subs.delete(t);
5542
5542
  return s && e.subs.size === 0 && (e.bc.close(), Zs.delete(n)), s;
5543
5543
  }, mt = (n, t, e = null) => {
5544
- const s = mn(n);
5544
+ const s = yn(n);
5545
5545
  s.bc.postMessage(t), s.subs.forEach((r) => r(t, e));
5546
- }, Qs = 0, yn = 1, tr = 2, ze = (n, t) => {
5546
+ }, Qs = 0, bn = 1, tr = 2, Ye = (n, t) => {
5547
5547
  p(n, Qs);
5548
5548
  const e = Qi(t);
5549
5549
  D(n, e);
5550
5550
  }, er = (n, t, e) => {
5551
- p(n, yn), D(n, an(t, e));
5551
+ p(n, bn), D(n, hn(t, e));
5552
5552
  }, rl = (n, t, e) => er(t, e, v(n)), nr = (n, t, e) => {
5553
5553
  try {
5554
5554
  Es(t, v(n), e);
@@ -5563,7 +5563,7 @@ const el = typeof BroadcastChannel > "u" ? tl : BroadcastChannel, mn = (n) => W(
5563
5563
  case Qs:
5564
5564
  rl(n, t, e);
5565
5565
  break;
5566
- case yn:
5566
+ case bn:
5567
5567
  nr(n, e, s);
5568
5568
  break;
5569
5569
  case tr:
@@ -5578,7 +5578,7 @@ const el = typeof BroadcastChannel > "u" ? tl : BroadcastChannel, mn = (n) => W(
5578
5578
  case cl:
5579
5579
  e(t, Q(n));
5580
5580
  }
5581
- }, xe = 3e4;
5581
+ }, Ue = 3e4;
5582
5582
  class hl extends fe {
5583
5583
  /**
5584
5584
  * @param {Y.Doc} doc
@@ -5587,13 +5587,13 @@ class hl extends fe {
5587
5587
  super(), this.doc = t, this.clientID = t.clientID, this.states = /* @__PURE__ */ new Map(), this.meta = /* @__PURE__ */ new Map(), this._checkInterval = /** @type {any} */
5588
5588
  setInterval(() => {
5589
5589
  const e = ct();
5590
- this.getLocalState() !== null && xe / 2 <= e - /** @type {{lastUpdated:number}} */
5590
+ this.getLocalState() !== null && Ue / 2 <= e - /** @type {{lastUpdated:number}} */
5591
5591
  this.meta.get(this.clientID).lastUpdated && this.setLocalState(this.getLocalState());
5592
5592
  const s = [];
5593
5593
  this.meta.forEach((r, i) => {
5594
- i !== this.clientID && xe <= e - r.lastUpdated && this.states.has(i) && s.push(i);
5595
- }), s.length > 0 && bn(this, s, "timeout");
5596
- }, X(xe / 10)), t.on("destroy", () => {
5594
+ i !== this.clientID && Ue <= e - r.lastUpdated && this.states.has(i) && s.push(i);
5595
+ }), s.length > 0 && kn(this, s, "timeout");
5596
+ }, X(Ue / 10)), t.on("destroy", () => {
5597
5597
  this.destroy();
5598
5598
  }), this.setLocalState({});
5599
5599
  }
@@ -5636,7 +5636,7 @@ class hl extends fe {
5636
5636
  return this.states;
5637
5637
  }
5638
5638
  }
5639
- const bn = (n, t, e) => {
5639
+ const kn = (n, t, e) => {
5640
5640
  const s = [];
5641
5641
  for (let r = 0; r < t.length; r++) {
5642
5642
  const i = t[r];
@@ -5701,7 +5701,7 @@ Xt[st] = (n, t, e, s, r) => {
5701
5701
  e.doc,
5702
5702
  e
5703
5703
  );
5704
- s && i === yn && !e.synced && (e.synced = !0);
5704
+ s && i === bn && !e.synced && (e.synced = !0);
5705
5705
  };
5706
5706
  Xt[sr] = (n, t, e, s, r) => {
5707
5707
  p(n, kt), D(
@@ -5743,11 +5743,11 @@ function ir(n) {
5743
5743
  return;
5744
5744
  n.wsLastMessageReceived = ct();
5745
5745
  const s = rr(n, new Uint8Array(e.data), !0);
5746
- en(s) > 1 && t.send(_(s));
5746
+ nn(s) > 1 && t.send(_(s));
5747
5747
  }, t.onerror = (e) => {
5748
5748
  n.emit("connection-error", [e, n]);
5749
5749
  }, t.onclose = (e) => {
5750
- n.emit("connection-close", [e, n]), n.ws = null, n.wsconnecting = !1, n.wsconnected ? (n.wsconnected = !1, n.synced = !1, bn(
5750
+ n.emit("connection-close", [e, n]), n.ws = null, n.wsconnecting = !1, n.wsconnected ? (n.wsconnected = !1, n.synced = !1, kn(
5751
5751
  n.awareness,
5752
5752
  Array.from(n.awareness.getStates().keys()).filter(
5753
5753
  (s) => s !== n.doc.clientID
@@ -5759,7 +5759,7 @@ function ir(n) {
5759
5759
  }
5760
5760
  ])) : n.wsUnsuccessfulReconnects++, setTimeout(
5761
5761
  ir,
5762
- Ge(
5762
+ Pe(
5763
5763
  Sr(2, n.wsUnsuccessfulReconnects) * 100,
5764
5764
  n.maxBackoffTime
5765
5765
  ),
@@ -5772,7 +5772,7 @@ function ir(n) {
5772
5772
  }
5773
5773
  ]);
5774
5774
  const e = M();
5775
- if (p(e, st), ze(e, n.doc), t.send(_(e)), n.awareness.getLocalState() !== null) {
5775
+ if (p(e, st), Ye(e, n.doc), t.send(_(e)), n.awareness.getLocalState() !== null) {
5776
5776
  const s = M();
5777
5777
  p(s, kt), D(
5778
5778
  s,
@@ -5788,7 +5788,7 @@ function ir(n) {
5788
5788
  ]);
5789
5789
  }
5790
5790
  }
5791
- function Ue(n, t) {
5791
+ function Te(n, t) {
5792
5792
  const e = n.ws;
5793
5793
  n.wsconnected && e && e.readyState === e.OPEN && e.send(t), n.bcconnected && mt(n.bcChannel, t, n);
5794
5794
  }
@@ -5838,26 +5838,26 @@ var ml = class extends fe {
5838
5838
  setInterval(() => {
5839
5839
  if (this.ws && this.ws.readyState === WebSocket.OPEN) {
5840
5840
  const u = M();
5841
- p(u, st), ze(u, s), this.ws.send(_(u));
5841
+ p(u, st), Ye(u, s), this.ws.send(_(u));
5842
5842
  }
5843
5843
  }, c)), this._bcSubscriber = (u, f) => {
5844
5844
  if (f !== this) {
5845
5845
  const g = rr(this, new Uint8Array(u), !1);
5846
- en(g) > 1 && mt(this.bcChannel, _(g), this);
5846
+ nn(g) > 1 && mt(this.bcChannel, _(g), this);
5847
5847
  }
5848
5848
  }, this._updateHandler = (u, f) => {
5849
5849
  if (f !== this) {
5850
5850
  const g = M();
5851
- p(g, st), il(g, u), Ue(this, _(g));
5851
+ p(g, st), il(g, u), Te(this, _(g));
5852
5852
  }
5853
5853
  }, this.doc.on("update", this._updateHandler), this._awarenessUpdateHandler = ({ added: u, updated: f, removed: g }, w) => {
5854
5854
  const S = u.concat(f).concat(g), j = M();
5855
5855
  p(j, kt), D(
5856
5856
  j,
5857
5857
  Ut(i, S)
5858
- ), Ue(this, _(j));
5858
+ ), Te(this, _(j));
5859
5859
  }, this._unloadHandler = () => {
5860
- bn(
5860
+ kn(
5861
5861
  this.awareness,
5862
5862
  [s.clientID],
5863
5863
  "window unload"
@@ -5884,7 +5884,7 @@ var ml = class extends fe {
5884
5884
  return;
5885
5885
  this.bcconnected || (nl(this.bcChannel, this._bcSubscriber), this.bcconnected = !0);
5886
5886
  const t = M();
5887
- p(t, st), ze(t, this.doc), mt(this.bcChannel, _(t), this);
5887
+ p(t, st), Ye(t, this.doc), mt(this.bcChannel, _(t), this);
5888
5888
  const e = M();
5889
5889
  p(e, st), er(e, this.doc), mt(this.bcChannel, _(e), this);
5890
5890
  const s = M();
@@ -5914,7 +5914,7 @@ var ml = class extends fe {
5914
5914
  [this.doc.clientID],
5915
5915
  /* @__PURE__ */ new Map()
5916
5916
  )
5917
- ), Ue(this, _(t)), this.bcconnected && (sl(this.bcChannel, this._bcSubscriber), this.bcconnected = !1);
5917
+ ), Te(this, _(t)), this.bcconnected && (sl(this.bcChannel, this._bcSubscriber), this.bcconnected = !1);
5918
5918
  }
5919
5919
  disconnect() {
5920
5920
  this.shouldConnect = !1, this.disconnectBc(), this.ws !== null && this.ws.close();
@@ -5932,7 +5932,7 @@ function yl() {
5932
5932
  return n > 0 ? (s = (n + s) % 16 | 0, n = Math.floor(n / 16)) : (s = (t + s) % 16 | 0, t = Math.floor(t / 16)), (e === "x" ? s : s & 3 | 8).toString(16);
5933
5933
  });
5934
5934
  }
5935
- function qn(n, t, e) {
5935
+ function Pn(n, t, e) {
5936
5936
  if (typeof n !== e)
5937
5937
  throw new Error(
5938
5938
  `Invalid "${t}" parameter provided to YPartyKitProvider. Expected: ${e}, received: ${n}`
@@ -5944,7 +5944,7 @@ var bl = class extends WebSocket {
5944
5944
  }
5945
5945
  }, rt, ts, kl = (ts = class extends ml {
5946
5946
  constructor(t, e, s, r = {}) {
5947
- qn(t, "host", "string"), qn(e, "room", "string"), t = t.replace(/^(http|https|ws|wss):\/\//, ""), t.endsWith("/") && t.slice(0, -1);
5947
+ Pn(t, "host", "string"), Pn(e, "room", "string"), t = t.replace(/^(http|https|ws|wss):\/\//, ""), t.endsWith("/") && t.slice(0, -1);
5948
5948
  const i = `${t.startsWith("localhost:") || t.startsWith("127.0.0.1:") ? "ws" : "wss"}://${t}${r.party ? `/parties/${r.party}` : "/party"}`, o = r.connectionId ?? yl(), { params: l, connect: c = !0, ...a } = r, h = {
5949
5949
  ...a,
5950
5950
  connect: !1,
@@ -5988,7 +5988,7 @@ const wt = (n) => Dt((t, e) => {
5988
5988
  ), vt = (n, t, e = "readwrite") => {
5989
5989
  const s = n.transaction(t, e);
5990
5990
  return t.map((r) => xl(s, r));
5991
- }, or = (n, t) => wt(n.count(t)), El = (n, t) => wt(n.get(t)), lr = (n, t) => wt(n.delete(t)), Cl = (n, t, e) => wt(n.put(t, e)), Ye = (n, t) => wt(n.add(t)), Al = (n, t, e) => wt(n.getAll(t, e)), Ll = (n, t, e) => {
5991
+ }, or = (n, t) => wt(n.count(t)), El = (n, t) => wt(n.get(t)), lr = (n, t) => wt(n.delete(t)), Cl = (n, t, e) => wt(n.put(t, e)), Xe = (n, t) => wt(n.add(t)), Al = (n, t, e) => wt(n.getAll(t, e)), Ll = (n, t, e) => {
5992
5992
  let s = null;
5993
5993
  return Ml(n, t, (r) => (s = r, !1), e).then(() => s);
5994
5994
  }, Il = (n, t = null) => Ll(n, t, "prev"), vl = (n, t) => Dt((e, s) => {
@@ -5998,7 +5998,7 @@ const wt = (n) => Dt((t, e) => {
5998
5998
  return e();
5999
5999
  i.continue();
6000
6000
  };
6001
- }), Ml = (n, t, e, s = "next") => vl(n.openKeyCursor(t, s), (r) => e(r.key)), xl = (n, t) => n.objectStore(t), Ul = (n, t) => IDBKeyRange.upperBound(n, t), Tl = (n, t) => IDBKeyRange.lowerBound(n, t), Te = "custom", cr = "updates", ar = 500, hr = (n, t = () => {
6001
+ }), Ml = (n, t, e, s = "next") => vl(n.openKeyCursor(t, s), (r) => e(r.key)), xl = (n, t) => n.objectStore(t), Ul = (n, t) => IDBKeyRange.upperBound(n, t), Tl = (n, t) => IDBKeyRange.lowerBound(n, t), Oe = "custom", cr = "updates", ar = 500, hr = (n, t = () => {
6002
6002
  }, e = () => {
6003
6003
  }) => {
6004
6004
  const [s] = vt(
@@ -6016,7 +6016,7 @@ const wt = (n) => Dt((t, e) => {
6016
6016
  n._dbsize = r;
6017
6017
  })).then(() => s);
6018
6018
  }, Ol = (n, t = !0) => hr(n).then((e) => {
6019
- (t || n._dbsize >= ar) && Ye(e, an(n.doc)).then(() => lr(e, Ul(n._dbref, !0))).then(() => or(e).then((s) => {
6019
+ (t || n._dbsize >= ar) && Xe(e, hn(n.doc)).then(() => lr(e, Ul(n._dbref, !0))).then(() => or(e).then((s) => {
6020
6020
  n._dbsize = s;
6021
6021
  }));
6022
6022
  });
@@ -6033,7 +6033,7 @@ class Rl extends fe {
6033
6033
  ["custom"]
6034
6034
  ])
6035
6035
  ), this.whenSynced = Dt((s) => this.on("synced", () => s(this))), this._db.then((s) => {
6036
- this.db = s, hr(this, (o) => Ye(o, an(e)), () => {
6036
+ this.db = s, hr(this, (o) => Xe(o, hn(e)), () => {
6037
6037
  if (this._destroyed)
6038
6038
  return this;
6039
6039
  this.synced = !0, this.emit("synced", [this]);
@@ -6045,7 +6045,7 @@ class Rl extends fe {
6045
6045
  this.db,
6046
6046
  [cr]
6047
6047
  );
6048
- Ye(i, s), ++this._dbsize >= ar && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
6048
+ Xe(i, s), ++this._dbsize >= ar && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
6049
6049
  Ol(this, !1), this._storeTimeoutId = null;
6050
6050
  }, this._storeTimeout));
6051
6051
  }
@@ -6072,7 +6072,7 @@ class Rl extends fe {
6072
6072
  */
6073
6073
  get(t) {
6074
6074
  return this._db.then((e) => {
6075
- const [s] = vt(e, [Te], "readonly");
6075
+ const [s] = vt(e, [Oe], "readonly");
6076
6076
  return El(s, t);
6077
6077
  });
6078
6078
  }
@@ -6083,7 +6083,7 @@ class Rl extends fe {
6083
6083
  */
6084
6084
  set(t, e) {
6085
6085
  return this._db.then((s) => {
6086
- const [r] = vt(s, [Te]);
6086
+ const [r] = vt(s, [Oe]);
6087
6087
  return Cl(r, e, t);
6088
6088
  });
6089
6089
  }
@@ -6093,7 +6093,7 @@ class Rl extends fe {
6093
6093
  */
6094
6094
  del(t) {
6095
6095
  return this._db.then((e) => {
6096
- const [s] = vt(e, [Te]);
6096
+ const [s] = vt(e, [Oe]);
6097
6097
  return lr(s, t);
6098
6098
  });
6099
6099
  }
@@ -6104,14 +6104,14 @@ const Bl = {
6104
6104
  shiftKey: "Shift",
6105
6105
  metaKey: "Meta"
6106
6106
  }, Nl = "can-duplicate-to";
6107
- var kn = /* @__PURE__ */ ((n) => (n.CanPlay = "can-play", n.CanMove = "can-move", n.CanSpin = "can-spin", n.CanGrow = "can-grow", n.CanToggle = "can-toggle", n.CanDuplicate = "can-duplicate", n))(kn || {});
6107
+ var _e = /* @__PURE__ */ ((n) => (n.CanPlay = "can-play", n.CanMove = "can-move", n.CanSpin = "can-spin", n.CanGrow = "can-grow", n.CanToggle = "can-toggle", n.CanDuplicate = "can-duplicate", n))(_e || {});
6108
6108
  function Fl(n) {
6109
6109
  return n.id;
6110
6110
  }
6111
6111
  const ur = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='53' viewport='0 0 100 100' style='fill:black;font-size:26px;'><text y='40%'>🚿</text></svg>")
6112
6112
  16 0,
6113
6113
  auto`, Vl = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>✂️</text></svg>") 16 0,auto`;
6114
- function Pn(n, { getData: t, getElement: e, getLocalData: s, setLocalData: r }) {
6114
+ function qn(n, { getData: t, getElement: e, getLocalData: s, setLocalData: r }) {
6115
6115
  const i = t(), o = s(), l = e();
6116
6116
  if (o.isHovering = !0, n.altKey) {
6117
6117
  if (i.scale <= 0.5) {
@@ -6220,8 +6220,8 @@ const Hl = {
6220
6220
  },
6221
6221
  additionalSetup: (n) => {
6222
6222
  n.getElement().addEventListener("mouseenter", (t) => {
6223
- Pn(t, n);
6224
- const e = (s) => Pn(s, n);
6223
+ qn(t, n);
6224
+ const e = (s) => qn(s, n);
6225
6225
  document.addEventListener("keydown", e), document.addEventListener("keyup", e), n.getElement().addEventListener("mouseleave", (s) => {
6226
6226
  document.removeEventListener("keydown", e), document.removeEventListener("keyup", e);
6227
6227
  });
@@ -6466,24 +6466,24 @@ class $l {
6466
6466
  this.setData(this.defaultData);
6467
6467
  }
6468
6468
  }
6469
- const jl = "playhtml.spencerc99.partykit.dev", Oe = new gt();
6469
+ const jl = "playhtml.spencerc99.partykit.dev", Re = new gt();
6470
6470
  function Kl() {
6471
6471
  return window.location.pathname + window.location.search;
6472
6472
  }
6473
6473
  let Y, N, F;
6474
6474
  const Qn = /* @__PURE__ */ new Map();
6475
6475
  let Jt = Hl;
6476
- function Xe() {
6477
- return Object.keys(Jt);
6476
+ function Je() {
6477
+ return [_e.CanPlay, ...Object.keys(Jt)];
6478
6478
  }
6479
- let _n = !1, Je = !0;
6479
+ let _n = !1, We = !0;
6480
6480
  function dr({
6481
6481
  // TODO: if it is a localhost url, need to make some deterministic way to connect to the same room.
6482
6482
  room: n = Kl(),
6483
6483
  host: t = jl,
6484
6484
  extraCapabilities: e
6485
6485
  } = {}) {
6486
- if (!Je) {
6486
+ if (!We) {
6487
6487
  console.error("playhtml already set up!");
6488
6488
  return;
6489
6489
  }
@@ -6495,7 +6495,7 @@ function dr({
6495
6495
  ࿂࿂࿂࿂ https://playhtml.fun ࿂࿂࿂࿂
6496
6496
  ࿂࿂࿂࿂ ࿂ ࿂ ࿂ ࿂ ࿂࿂࿂࿂
6497
6497
  ࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂`
6498
- ), Y = new kl(r, s, Oe), N = Oe.getMap("playhtml-global"), F = /* @__PURE__ */ new Map(), new Rl(s, Oe), We.globalData = N, We.elementHandlers = F, e)
6498
+ ), Y = new kl(r, s, Re), N = Re.getMap("playhtml-global"), F = /* @__PURE__ */ new Map(), new Rl(s, Re), Ge.globalData = N, Ge.elementHandlers = F, e)
6499
6499
  for (const [i, o] of Object.entries(e))
6500
6500
  Jt[i] = o;
6501
6501
  return Y.on("sync", (i) => {
@@ -6538,7 +6538,7 @@ function Xl(n) {
6538
6538
  return n.defaultData !== void 0 && n.updateElement !== void 0;
6539
6539
  }
6540
6540
  function Jl(n, t) {
6541
- if (n === kn.CanPlay) {
6541
+ if (n === _e.CanPlay) {
6542
6542
  const e = t;
6543
6543
  return {
6544
6544
  defaultData: e.defaultData,
@@ -6595,36 +6595,36 @@ function fr() {
6595
6595
  });
6596
6596
  }
6597
6597
  function Wl() {
6598
- console.log("[PLAYHTML]: Setting up elements... Time to have some fun 🛝"), console.log(Xe());
6599
- for (const n of Xe()) {
6598
+ console.log("[PLAYHTML]: Setting up elements... Time to have some fun 🛝"), console.log(Je());
6599
+ for (const n of Je()) {
6600
6600
  const t = Array.from(
6601
6601
  document.querySelectorAll(`[${n}]`)
6602
6602
  ).filter(Sn);
6603
6603
  if (t.length)
6604
6604
  for (let e = 0; e < t.length; e++) {
6605
6605
  const s = t[e];
6606
- _e(s, n);
6606
+ Se(s, n);
6607
6607
  }
6608
6608
  }
6609
- Je && (N.observe((n) => {
6609
+ We && (N.observe((n) => {
6610
6610
  n.changes.keys.forEach((t, e) => {
6611
6611
  t.action === "add" && N.set(e, N.get(e));
6612
6612
  });
6613
- }), Y.awareness.on("change", () => fr()), Je = !1);
6613
+ }), Y.awareness.on("change", () => fr()), We = !1);
6614
6614
  }
6615
- const We = {
6615
+ const Ge = {
6616
6616
  init: dr,
6617
- setupPlayElement: Pl,
6617
+ setupPlayElement: ql,
6618
6618
  removePlayElement: Zl,
6619
- setupPlayElementForTag: _e,
6619
+ setupPlayElementForTag: Se,
6620
6620
  globalData: void 0,
6621
6621
  elementHandlers: void 0
6622
6622
  };
6623
- window.playhtml = We;
6623
+ window.playhtml = Ge;
6624
6624
  function Gl(n) {
6625
6625
  if (F.has(n) || !_n)
6626
6626
  return;
6627
- F.set(n, /* @__PURE__ */ new Map()), n !== kn.CanPlay && Jt[n], N.get(n) || N.set(n, new ht());
6627
+ F.set(n, /* @__PURE__ */ new Map()), n !== _e.CanPlay && Jt[n], N.get(n) || N.set(n, new ht());
6628
6628
  const t = N.get(n);
6629
6629
  t.observe((e) => {
6630
6630
  e.changes.keys.forEach((s, r) => {
@@ -6635,7 +6635,7 @@ function Gl(n) {
6635
6635
  console.log(`Element ${r} not an HTML element. Ignoring.`);
6636
6636
  return;
6637
6637
  }
6638
- _e(o, n);
6638
+ Se(o, n);
6639
6639
  } else if (s.action === "update") {
6640
6640
  const o = i.get(r);
6641
6641
  o.__data = t.get(r);
@@ -6644,13 +6644,13 @@ function Gl(n) {
6644
6644
  });
6645
6645
  });
6646
6646
  }
6647
- function ql(n, t) {
6647
+ function Pl(n, t) {
6648
6648
  var e, s;
6649
6649
  return ((s = (e = Jt[t]) == null ? void 0 : e.isValidElementForTag) == null ? void 0 : s.call(e, n)) ?? !0;
6650
6650
  }
6651
- function _e(n, t) {
6651
+ function Se(n, t) {
6652
6652
  var l;
6653
- if (!ql(n, t) || !_n)
6653
+ if (!Pl(n, t) || !_n)
6654
6654
  return;
6655
6655
  if (!n.id) {
6656
6656
  const c = n.getAttribute("selector-id");
@@ -6691,13 +6691,13 @@ function _e(n, t) {
6691
6691
  s.set(e, new $l(o));
6692
6692
  i.get(e) === void 0 && r.defaultData !== void 0 && i.set(e, r.defaultData), (l = o.triggerAwarenessUpdate) == null || l.call(o), n.classList.add("__playhtml-element"), n.classList.add(`__playhtml-${t}`), n.style.setProperty("--jiggle-delay", `${Math.random() * 1}s;}`);
6693
6693
  }
6694
- function Pl(n) {
6694
+ function ql(n) {
6695
6695
  if (!Sn(n)) {
6696
6696
  console.log(`Element ${n.id} not an HTML element. Ignoring.`);
6697
6697
  return;
6698
6698
  }
6699
- for (const t of Xe())
6700
- n.hasAttribute(t) && _e(n, t);
6699
+ for (const t of Je())
6700
+ n.hasAttribute(t) && Se(n, t);
6701
6701
  }
6702
6702
  function Zl(n) {
6703
6703
  if (!(!n || !n.id))
@@ -6707,5 +6707,5 @@ function Zl(n) {
6707
6707
  }
6708
6708
  }
6709
6709
  export {
6710
- We as playhtml
6710
+ Ge as playhtml
6711
6711
  };