@instantdb/react 0.22.119-experimental.streams.21539576498.1 → 0.22.120-experimental.drewh-admin-db-warn.21600986993.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var gi = Object.defineProperty;
2
- var wi = (t, e, n) => e in t ? gi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
1
+ var _i = Object.defineProperty;
2
+ var wi = (t, e, n) => e in t ? _i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var p = (t, e, n) => wi(t, typeof e != "symbol" ? e + "" : e, n);
4
- import ts, { useRef as it, useCallback as ge, useSyncExternalStore as tn, useEffect as Oe, useMemo as nn, useState as ns, createElement as mi } from "react";
4
+ import ts, { useRef as it, useCallback as _e, useSyncExternalStore as tn, useEffect as Oe, useMemo as nn, useState as ns, createElement as Ti } from "react";
5
5
  function q(t) {
6
6
  if (typeof t == "number")
7
7
  return (Math.abs(t * 2654435761) >>> 0).toString(16);
@@ -44,10 +44,10 @@ const U = {
44
44
  Remove: "remove",
45
45
  Replace: "replace",
46
46
  Add: "add"
47
- }, rs = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Ti = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), wt = Symbol.iterator, ne = {
47
+ }, rs = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), mi = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), wt = Symbol.iterator, ne = {
48
48
  mutable: "mutable",
49
49
  immutable: "immutable"
50
- }, Pn = {};
50
+ }, In = {};
51
51
  function et(t, e) {
52
52
  return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
53
53
  }
@@ -65,7 +65,7 @@ function pr(t, e) {
65
65
  function Mn(t) {
66
66
  return Object.getPrototypeOf(t) === Set.prototype;
67
67
  }
68
- function Rn(t) {
68
+ function jn(t) {
69
69
  return Object.getPrototypeOf(t) === Map.prototype;
70
70
  }
71
71
  function te(t) {
@@ -73,14 +73,14 @@ function te(t) {
73
73
  return (e = t.copy) !== null && e !== void 0 ? e : t.original;
74
74
  }
75
75
  function Ae(t) {
76
- return !!I(t);
76
+ return !!P(t);
77
77
  }
78
- function I(t) {
78
+ function P(t) {
79
79
  return typeof t != "object" ? null : t == null ? void 0 : t[rs];
80
80
  }
81
- function jn(t) {
81
+ function Rn(t) {
82
82
  var e;
83
- const n = I(t);
83
+ const n = P(t);
84
84
  return n ? (e = n.copy) !== null && e !== void 0 ? e : n.original : t;
85
85
  }
86
86
  function ce(t, e) {
@@ -91,7 +91,7 @@ function ce(t, e) {
91
91
  }
92
92
  function ss(t, e = []) {
93
93
  if (Object.hasOwnProperty.call(t, "key")) {
94
- const n = t.parent.copy, r = I(ye(n, t.key));
94
+ const n = t.parent.copy, r = P(ye(n, t.key));
95
95
  if (r !== null && (r == null ? void 0 : r.original) !== t.original)
96
96
  return null;
97
97
  const s = t.parent.type === 3, i = s ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
@@ -119,7 +119,7 @@ function at(t, e, n) {
119
119
  ke(t) === 2 ? t.set(e, n) : t[e] = n;
120
120
  }
121
121
  function Gt(t, e) {
122
- const n = I(t);
122
+ const n = P(t);
123
123
  return (n ? te(n) : t)[e];
124
124
  }
125
125
  function pe(t, e) {
@@ -172,7 +172,7 @@ function is(t, e) {
172
172
  }
173
173
  return Set.prototype.difference ? Set.prototype.difference.call(t, /* @__PURE__ */ new Set()) : new Set(t.values());
174
174
  } else if (t instanceof Map) {
175
- if (!Rn(t)) {
175
+ if (!jn(t)) {
176
176
  const r = Object.getPrototypeOf(t).constructor;
177
177
  return new r(t);
178
178
  }
@@ -201,7 +201,7 @@ function Q(t) {
201
201
  }
202
202
  function Qe(t) {
203
203
  if (!ce(t))
204
- return jn(t);
204
+ return Rn(t);
205
205
  if (Array.isArray(t))
206
206
  return t.map(Qe);
207
207
  if (t instanceof Map) {
@@ -209,7 +209,7 @@ function Qe(t) {
209
209
  r,
210
210
  Qe(s)
211
211
  ]);
212
- if (!Rn(t)) {
212
+ if (!jn(t)) {
213
213
  const r = Object.getPrototypeOf(t).constructor;
214
214
  return new r(n);
215
215
  }
@@ -228,7 +228,7 @@ function Qe(t) {
228
228
  e[n] = Qe(t[n]);
229
229
  return e;
230
230
  }
231
- function mt(t) {
231
+ function Tt(t) {
232
232
  return Ae(t) ? Qe(t) : t;
233
233
  }
234
234
  function fe(t) {
@@ -304,7 +304,7 @@ function os(t, e, n) {
304
304
  if (e.add(t), xn(t, (i, o) => {
305
305
  var a;
306
306
  if (Ae(o)) {
307
- const c = I(o);
307
+ const c = P(o);
308
308
  Q(c);
309
309
  const u = !((a = c.assignedMap) === null || a === void 0) && a.size || c.operated ? c.copy : c.original;
310
310
  at(r ? s : t, i, u);
@@ -323,7 +323,7 @@ function Oi(t, e) {
323
323
  }
324
324
  function sn(t) {
325
325
  t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
326
- t.copy.add(jn(e));
326
+ t.copy.add(Rn(e));
327
327
  }));
328
328
  }
329
329
  function on(t, e, n, r) {
@@ -336,7 +336,7 @@ function on(t, e, n, r) {
336
336
  }
337
337
  }
338
338
  function $n(t, e, n, r) {
339
- const s = I(n);
339
+ const s = P(n);
340
340
  s && (s.callbacks || (s.callbacks = []), s.callbacks.push((i, o) => {
341
341
  var a;
342
342
  const c = t.type === 3 ? t.setMap : t.copy;
@@ -359,12 +359,12 @@ function Ai(t, e, n, r, s) {
359
359
  op: U.Replace,
360
360
  path: f,
361
361
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
362
- value: mt(c[u])
362
+ value: Tt(c[u])
363
363
  }), r.push({
364
364
  op: U.Replace,
365
365
  path: f,
366
366
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
367
- value: mt(i[u])
367
+ value: Tt(i[u])
368
368
  });
369
369
  }
370
370
  for (let u = i.length; u < c.length; u += 1) {
@@ -373,7 +373,7 @@ function Ai(t, e, n, r, s) {
373
373
  op: U.Add,
374
374
  path: f,
375
375
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
376
- value: mt(c[u])
376
+ value: Tt(c[u])
377
377
  });
378
378
  }
379
379
  if (i.length < c.length) {
@@ -387,20 +387,20 @@ function Ai(t, e, n, r, s) {
387
387
  });
388
388
  } else
389
389
  for (let l = c.length; i.length < l; l -= 1) {
390
- const f = e.concat([l - 1]), d = ve(f, s);
390
+ const f = e.concat([l - 1]), h = ve(f, s);
391
391
  r.push({
392
392
  op: U.Remove,
393
- path: d
393
+ path: h
394
394
  });
395
395
  }
396
396
  }
397
397
  }
398
398
  function ki({ original: t, copy: e, assignedMap: n }, r, s, i, o) {
399
399
  n.forEach((a, c) => {
400
- const u = ye(t, c), l = mt(ye(e, c)), f = a ? et(t, c) ? U.Replace : U.Add : U.Remove;
400
+ const u = ye(t, c), l = Tt(ye(e, c)), f = a ? et(t, c) ? U.Replace : U.Add : U.Remove;
401
401
  if (pe(u, l) && f === U.Replace)
402
402
  return;
403
- const d = r.concat(c), y = ve(d, o);
403
+ const h = r.concat(c), y = ve(h, o);
404
404
  s.push(f === U.Remove ? { op: f, path: y } : { op: f, path: y, value: l }), i.push(f === U.Add ? { op: U.Remove, path: y } : f === U.Remove ? { op: U.Add, path: y, value: u } : { op: U.Replace, path: y, value: u });
405
405
  });
406
406
  }
@@ -453,23 +453,23 @@ const At = (t, e, n = !1) => {
453
453
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
454
454
  }, an = {
455
455
  get size() {
456
- return te(I(this)).size;
456
+ return te(P(this)).size;
457
457
  },
458
458
  has(t) {
459
- return te(I(this)).has(t);
459
+ return te(P(this)).has(t);
460
460
  },
461
461
  set(t, e) {
462
- const n = I(this), r = te(n);
462
+ const n = P(this), r = te(n);
463
463
  return (!r.has(t) || !pe(r.get(t), e)) && (Q(n), fe(n), n.assignedMap.set(t, !0), n.copy.set(t, e), $n(n, t, e, ot)), this;
464
464
  },
465
465
  delete(t) {
466
466
  if (!this.has(t))
467
467
  return !1;
468
- const e = I(this);
468
+ const e = P(this);
469
469
  return Q(e), fe(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
470
470
  },
471
471
  clear() {
472
- const t = I(this);
472
+ const t = P(this);
473
473
  if (this.size) {
474
474
  Q(t), fe(t), t.assignedMap = /* @__PURE__ */ new Map();
475
475
  for (const [e] of t.original)
@@ -478,17 +478,17 @@ const At = (t, e, n = !1) => {
478
478
  }
479
479
  },
480
480
  forEach(t, e) {
481
- const n = I(this);
481
+ const n = P(this);
482
482
  te(n).forEach((r, s) => {
483
483
  t.call(e, this.get(s), s, this);
484
484
  });
485
485
  },
486
486
  get(t) {
487
487
  var e, n;
488
- const r = I(this), s = te(r).get(t), i = ((n = (e = r.options).mark) === null || n === void 0 ? void 0 : n.call(e, s, ne)) === ne.mutable;
488
+ const r = P(this), s = te(r).get(t), i = ((n = (e = r.options).mark) === null || n === void 0 ? void 0 : n.call(e, s, ne)) === ne.mutable;
489
489
  if (r.options.strict && At(s, r.options, i), i || r.finalized || !ce(s, r.options) || s !== r.original.get(t))
490
490
  return s;
491
- const o = Pn.createDraft({
491
+ const o = In.createDraft({
492
492
  original: s,
493
493
  parentDraft: r,
494
494
  key: t,
@@ -498,7 +498,7 @@ const At = (t, e, n = !1) => {
498
498
  return Q(r), r.copy.set(t, o), o;
499
499
  },
500
500
  keys() {
501
- return te(I(this)).keys();
501
+ return te(P(this)).keys();
502
502
  },
503
503
  values() {
504
504
  const t = this.keys();
@@ -532,16 +532,16 @@ const At = (t, e, n = !1) => {
532
532
  [wt]() {
533
533
  return this.entries();
534
534
  }
535
- }, Ii = Reflect.ownKeys(an), br = (t, e, { isValuesIterator: n }) => () => {
535
+ }, Pi = Reflect.ownKeys(an), br = (t, e, { isValuesIterator: n }) => () => {
536
536
  var r, s;
537
537
  const i = e.next();
538
538
  if (i.done)
539
539
  return i;
540
540
  const o = i.value;
541
541
  let a = t.setMap.get(o);
542
- const c = I(a), u = ((s = (r = t.options).mark) === null || s === void 0 ? void 0 : s.call(r, a, ne)) === ne.mutable;
542
+ const c = P(a), u = ((s = (r = t.options).mark) === null || s === void 0 ? void 0 : s.call(r, a, ne)) === ne.mutable;
543
543
  if (t.options.strict && At(o, t.options, u), !u && !c && ce(o, t.options) && !t.finalized && t.original.has(o)) {
544
- const l = Pn.createDraft({
544
+ const l = In.createDraft({
545
545
  original: o,
546
546
  parentDraft: t,
547
547
  key: o,
@@ -556,39 +556,39 @@ const At = (t, e, n = !1) => {
556
556
  };
557
557
  }, kt = {
558
558
  get size() {
559
- return I(this).setMap.size;
559
+ return P(this).setMap.size;
560
560
  },
561
561
  has(t) {
562
- const e = I(this);
562
+ const e = P(this);
563
563
  if (e.setMap.has(t))
564
564
  return !0;
565
565
  Q(e);
566
- const n = I(t);
566
+ const n = P(t);
567
567
  return !!(n && e.setMap.has(n.original));
568
568
  },
569
569
  add(t) {
570
- const e = I(this);
570
+ const e = P(this);
571
571
  return this.has(t) || (Q(e), fe(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), $n(e, t, t, ot)), this;
572
572
  },
573
573
  delete(t) {
574
574
  if (!this.has(t))
575
575
  return !1;
576
- const e = I(this);
576
+ const e = P(this);
577
577
  Q(e), fe(e);
578
- const n = I(t);
578
+ const n = P(t);
579
579
  return n && e.setMap.has(n.original) ? (e.assignedMap.set(n.original, !1), e.setMap.delete(n.original)) : (!n && e.setMap.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.setMap.delete(t));
580
580
  },
581
581
  clear() {
582
582
  if (!this.size)
583
583
  return;
584
- const t = I(this);
584
+ const t = P(this);
585
585
  Q(t), fe(t);
586
586
  for (const e of t.original)
587
587
  t.assignedMap.set(e, !1);
588
588
  t.setMap.clear();
589
589
  },
590
590
  values() {
591
- const t = I(this);
591
+ const t = P(this);
592
592
  Q(t);
593
593
  const e = t.setMap.keys();
594
594
  return {
@@ -597,7 +597,7 @@ const At = (t, e, n = !1) => {
597
597
  };
598
598
  },
599
599
  entries() {
600
- const t = I(this);
600
+ const t = P(this);
601
601
  Q(t);
602
602
  const e = t.setMap.keys();
603
603
  return {
@@ -643,7 +643,7 @@ Set.prototype.difference && Object.assign(kt, {
643
643
  return Set.prototype.isDisjointFrom.call(new Set(this.values()), t);
644
644
  }
645
645
  });
646
- const Pi = Reflect.ownKeys(kt), as = /* @__PURE__ */ new WeakSet(), cs = {
646
+ const Ii = Reflect.ownKeys(kt), as = /* @__PURE__ */ new WeakSet(), cs = {
647
647
  get(t, e, n) {
648
648
  var r, s;
649
649
  const i = (r = t.copy) === null || r === void 0 ? void 0 : r[e];
@@ -658,14 +658,14 @@ const Pi = Reflect.ownKeys(kt), as = /* @__PURE__ */ new WeakSet(), cs = {
658
658
  return t.options.strict && At(u, t.options, !0), u;
659
659
  }
660
660
  const a = te(t);
661
- if (a instanceof Map && Ii.includes(e)) {
661
+ if (a instanceof Map && Pi.includes(e)) {
662
662
  if (e === "size")
663
663
  return Object.getOwnPropertyDescriptor(an, "size").get.call(t.proxy);
664
664
  const u = an[e];
665
665
  if (u)
666
666
  return u.bind(t.proxy);
667
667
  }
668
- if (a instanceof Set && Pi.includes(e)) {
668
+ if (a instanceof Set && Ii.includes(e)) {
669
669
  if (e === "size")
670
670
  return Object.getOwnPropertyDescriptor(kt, "size").get.call(t.proxy);
671
671
  const u = kt[e];
@@ -690,7 +690,7 @@ const Pi = Reflect.ownKeys(kt), as = /* @__PURE__ */ new WeakSet(), cs = {
690
690
  finalities: t.finalities,
691
691
  options: t.options
692
692
  }), typeof o == "function") {
693
- const u = I(t.copy[e]);
693
+ const u = P(t.copy[e]);
694
694
  return Q(u), fe(u), u.copy;
695
695
  }
696
696
  return t.copy[e];
@@ -707,7 +707,7 @@ const Pi = Reflect.ownKeys(kt), as = /* @__PURE__ */ new WeakSet(), cs = {
707
707
  const i = pr(te(t), e);
708
708
  if (i != null && i.set)
709
709
  return i.set.call(t.proxy, n), !0;
710
- const o = Gt(te(t), e), a = I(o);
710
+ const o = Gt(te(t), e), a = P(o);
711
711
  return a && pe(a.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (pe(n, o) && (n !== void 0 || et(t.original, e)) || (Q(t), fe(t), et(t.original, e) && pe(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, $n(t, e, n, ot)), !0);
712
712
  },
713
713
  has(t, e) {
@@ -756,31 +756,31 @@ function Dn(t) {
756
756
  const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a, cs);
757
757
  if (s.revoke.push(u), as.add(c), a.proxy = c, n) {
758
758
  const l = n;
759
- l.finalities.draft.push((f, d) => {
759
+ l.finalities.draft.push((f, h) => {
760
760
  var y, b;
761
- const _ = I(c);
761
+ const g = P(c);
762
762
  let w = l.type === 3 ? l.setMap : l.copy;
763
- const T = ye(w, r), g = I(T);
764
- if (g) {
765
- let S = g.original;
766
- g.operated && (S = jn(T)), sn(g), on(g, ot, f, d), l.options.enableAutoFreeze && (l.options.updatedValues = (y = l.options.updatedValues) !== null && y !== void 0 ? y : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(S, g.original)), at(w, r, S);
763
+ const m = ye(w, r), _ = P(m);
764
+ if (_) {
765
+ let S = _.original;
766
+ _.operated && (S = Rn(m)), sn(_), on(_, ot, f, h), l.options.enableAutoFreeze && (l.options.updatedValues = (y = l.options.updatedValues) !== null && y !== void 0 ? y : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(S, _.original)), at(w, r, S);
767
767
  }
768
- (b = _.callbacks) === null || b === void 0 || b.forEach((S) => {
769
- S(f, d);
768
+ (b = g.callbacks) === null || b === void 0 || b.forEach((S) => {
769
+ S(f, h);
770
770
  });
771
771
  });
772
772
  } else {
773
- const l = I(c);
774
- l.finalities.draft.push((f, d) => {
775
- sn(l), on(l, ot, f, d);
773
+ const l = P(c);
774
+ l.finalities.draft.push((f, h) => {
775
+ sn(l), on(l, ot, f, h);
776
776
  });
777
777
  }
778
778
  return c;
779
779
  }
780
- Pn.createDraft = Dn;
780
+ In.createDraft = Dn;
781
781
  function Mi(t, e, n, r, s) {
782
782
  var i;
783
- const o = I(t), a = (i = o == null ? void 0 : o.original) !== null && i !== void 0 ? i : t, c = !!e.length;
783
+ const o = P(t), a = (i = o == null ? void 0 : o.original) !== null && i !== void 0 ? i : t, c = !!e.length;
784
784
  if (o != null && o.operated)
785
785
  for (; o.finalities.draft.length > 0; )
786
786
  o.finalities.draft.pop()(n, r);
@@ -791,7 +791,7 @@ function Mi(t, e, n, r, s) {
791
791
  r && c ? [{ op: U.Replace, path: [], value: a }] : r
792
792
  ];
793
793
  }
794
- function Ri(t, e) {
794
+ function ji(t, e) {
795
795
  var n;
796
796
  const r = {
797
797
  draft: [],
@@ -817,7 +817,7 @@ function Ri(t, e) {
817
817
  function cn(t) {
818
818
  const { rootDraft: e, value: n, useRawReturn: r = !1, isRoot: s = !0 } = t;
819
819
  xn(n, (i, o, a) => {
820
- const c = I(o);
820
+ const c = P(o);
821
821
  if (c && e && c.finalities === e.finalities) {
822
822
  t.isContainDraft = !0;
823
823
  const u = c.original;
@@ -831,7 +831,7 @@ function cn(t) {
831
831
  }
832
832
  function us(t) {
833
833
  var e;
834
- const n = I(t);
834
+ const n = P(t);
835
835
  if (!ce(t, n == null ? void 0 : n.options))
836
836
  return t;
837
837
  const r = ke(t);
@@ -839,7 +839,7 @@ function us(t) {
839
839
  return n.original;
840
840
  let s;
841
841
  function i() {
842
- s = r === 2 ? Rn(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : is(t, n == null ? void 0 : n.options);
842
+ s = r === 2 ? jn(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : is(t, n == null ? void 0 : n.options);
843
843
  }
844
844
  if (n) {
845
845
  n.finalized = !0;
@@ -861,91 +861,91 @@ function us(t) {
861
861
  }
862
862
  return s;
863
863
  }
864
- function _r(t) {
864
+ function gr(t) {
865
865
  if (!Ae(t))
866
866
  throw new Error(`current() is only used for Draft, parameter: ${t}`);
867
867
  return us(t);
868
868
  }
869
- const ji = (t) => function e(n, r, s) {
869
+ const Ri = (t) => function e(n, r, s) {
870
870
  var i, o, a;
871
871
  if (typeof n == "function" && typeof r != "function")
872
- return function(E, ...R) {
873
- return e(E, (F) => n.call(this, F, ...R), r);
872
+ return function(E, ...j) {
873
+ return e(E, (L) => n.call(this, L, ...j), r);
874
874
  };
875
875
  const c = n, u = r;
876
876
  let l = s;
877
877
  if (typeof r != "function" && (l = r), l !== void 0 && Object.prototype.toString.call(l) !== "[object Object]")
878
878
  throw new Error(`Invalid options: ${l}, 'options' should be an object.`);
879
879
  l = Object.assign(Object.assign({}, t), l);
880
- const f = Ae(c) ? _r(c) : c, d = Array.isArray(l.mark) ? (E, R) => {
881
- for (const F of l.mark) {
882
- if (typeof F != "function")
883
- throw new Error(`Invalid mark: ${F}, 'mark' should be a function.`);
884
- const B = F(E, R);
880
+ const f = Ae(c) ? gr(c) : c, h = Array.isArray(l.mark) ? (E, j) => {
881
+ for (const L of l.mark) {
882
+ if (typeof L != "function")
883
+ throw new Error(`Invalid mark: ${L}, 'mark' should be a function.`);
884
+ const B = L(E, j);
885
885
  if (B)
886
886
  return B;
887
887
  }
888
888
  } : l.mark, y = (i = l.enablePatches) !== null && i !== void 0 ? i : !1, b = (o = l.strict) !== null && o !== void 0 ? o : !1, w = {
889
889
  enableAutoFreeze: (a = l.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
890
- mark: d,
890
+ mark: h,
891
891
  strict: b,
892
892
  enablePatches: y
893
893
  };
894
894
  if (!ce(f, w) && typeof f == "object" && f !== null)
895
895
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
896
- const [T, g] = Ri(f, w);
896
+ const [m, _] = ji(f, w);
897
897
  if (typeof r != "function") {
898
898
  if (!ce(f, w))
899
899
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
900
- return [T, g];
900
+ return [m, _];
901
901
  }
902
902
  let S;
903
903
  try {
904
- S = u(T);
904
+ S = u(m);
905
905
  } catch (E) {
906
- throw rn(I(T)), E;
906
+ throw rn(P(m)), E;
907
907
  }
908
908
  const O = (E) => {
909
- const R = I(T);
909
+ const j = P(m);
910
910
  if (!Ae(E)) {
911
- if (E !== void 0 && !pe(E, T) && (R != null && R.operated))
911
+ if (E !== void 0 && !pe(E, m) && (j != null && j.operated))
912
912
  throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
913
- const B = E == null ? void 0 : E[Ti];
913
+ const B = E == null ? void 0 : E[mi];
914
914
  if (B) {
915
- const We = B[0];
915
+ const qe = B[0];
916
916
  return w.strict && typeof E == "object" && E !== null && cn({
917
- rootDraft: R,
917
+ rootDraft: j,
918
918
  value: E,
919
919
  useRawReturn: !0
920
- }), g([We]);
920
+ }), _([qe]);
921
921
  }
922
922
  if (E !== void 0)
923
- return typeof E == "object" && E !== null && cn({ rootDraft: R, value: E }), g([E]);
923
+ return typeof E == "object" && E !== null && cn({ rootDraft: j, value: E }), _([E]);
924
924
  }
925
- if (E === T || E === void 0)
926
- return g([]);
927
- const F = I(E);
928
- if (w === F.options) {
929
- if (F.operated)
925
+ if (E === m || E === void 0)
926
+ return _([]);
927
+ const L = P(E);
928
+ if (w === L.options) {
929
+ if (L.operated)
930
930
  throw new Error("Cannot return a modified child draft.");
931
- return g([_r(E)]);
931
+ return _([gr(E)]);
932
932
  }
933
- return g([E]);
933
+ return _([E]);
934
934
  };
935
935
  return S instanceof Promise ? S.then(O, (E) => {
936
- throw rn(I(T)), E;
936
+ throw rn(P(m)), E;
937
937
  }) : O(S);
938
- }, Ct = ji();
938
+ }, Ct = Ri();
939
939
  Object.prototype.constructor.toString();
940
940
  function ls(t, e) {
941
941
  const n = Object.keys(t), r = Object.keys(e);
942
942
  return n.length === r.length && Object.keys(t).every((s) => e.hasOwnProperty(s));
943
943
  }
944
- function gr(t, e) {
944
+ function _r(t, e) {
945
945
  return Object.keys(t).length === Object.keys(e).length && Object.keys(t).every((n) => e.hasOwnProperty(n) && t[n] === e[n]);
946
946
  }
947
- function Tt(t, e) {
948
- return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : ls(t, e) ? Object.keys(t).every((n) => Tt(t[n], e[n])) : !1;
947
+ function mt(t, e) {
948
+ return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : ls(t, e) ? Object.keys(t).every((n) => mt(t[n], e[n])) : !1;
949
949
  }
950
950
  function Un(t) {
951
951
  if (!He(t))
@@ -1010,7 +1010,7 @@ function ds(t, e) {
1010
1010
  function $i(t) {
1011
1011
  return t && Object.keys(t).length === 0;
1012
1012
  }
1013
- const mr = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|WAST|WAKT|WADT|VUT|VOLT|VLAT|VLAST|VET|UZT|UZST|UYT|UYST|UTC|UT|ULAT|ULAST|UCT|TVT|TRUT|TOT|TMT|TKT|TJT|TFT|TAHT|SGT|SCT|SAST|SADT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PKST|PHT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZT|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|MYT|MVT|MUT|MUST|MST|MSK|MSD|MPT|MMT|MHT|MEZ|METDST|MET|MESZ|MEST|MDT|MAWT|MART|MAGT|MAGST|LKT|LINT|LIGT|LHST|LHDT|KST|KRAT|KRAST|KOST|KGT|KGST|KDT|JST|JAYT|IST|IRT|IRKT|IRKST|IOT|IDT|ICT|HST|HKT|GYT|GMT|GILT|GFT|GET|GEST|GAMT|GALT|FNT|FNST|FKT|FKST|FJT|FJST|FET|EST|EGT|EGST|EETDST|EET|EEST|EDT|EAT|EAST|EASST|DDUT|DAVT|CXT|CST|COT|CLT|CLST|CKT|CHUT|CHAST|CHADT|CETDST|CET|CEST|CDT|CCT|CAST|CADT|BTT|BST|BRT|BRST|BRA|BOT|BORT|BNT|BDT|BDST|AZT|AZST|AZOT|AZOST|AWST|AWSST|AST|ART|ARST|ANAT|ANAST|AMT|AMST|ALMT|ALMST|AKST|AKDT|AFT|AEST|AESST|AEDT|ADT|ACWST|ACT|ACST|ACSST|ACDT$/, Di = {
1013
+ const Tr = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|WAST|WAKT|WADT|VUT|VOLT|VLAT|VLAST|VET|UZT|UZST|UYT|UYST|UTC|UT|ULAT|ULAST|UCT|TVT|TRUT|TOT|TMT|TKT|TJT|TFT|TAHT|SGT|SCT|SAST|SADT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PKST|PHT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZT|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|MYT|MVT|MUT|MUST|MST|MSK|MSD|MPT|MMT|MHT|MEZ|METDST|MET|MESZ|MEST|MDT|MAWT|MART|MAGT|MAGST|LKT|LINT|LIGT|LHST|LHDT|KST|KRAT|KRAST|KOST|KGT|KGST|KDT|JST|JAYT|IST|IRT|IRKT|IRKST|IOT|IDT|ICT|HST|HKT|GYT|GMT|GILT|GFT|GET|GEST|GAMT|GALT|FNT|FNST|FKT|FKST|FJT|FJST|FET|EST|EGT|EGST|EETDST|EET|EEST|EDT|EAT|EAST|EASST|DDUT|DAVT|CXT|CST|COT|CLT|CLST|CKT|CHUT|CHAST|CHADT|CETDST|CET|CEST|CDT|CCT|CAST|CADT|BTT|BST|BRT|BRST|BRA|BOT|BORT|BNT|BDT|BDST|AZT|AZST|AZOT|AZOST|AWST|AWSST|AST|ART|ARST|ANAT|ANAST|AMT|AMST|ALMT|ALMST|AKST|AKDT|AFT|AEST|AESST|AEDT|ADT|ACWST|ACT|ACST|ACSST|ACDT$/, Di = {
1014
1014
  ZULU: 0,
1015
1015
  YEKT: 18e3,
1016
1016
  YEKST: 21600,
@@ -1224,11 +1224,11 @@ function Ki(t) {
1224
1224
  const [e, n] = t.split(" ");
1225
1225
  return /* @__PURE__ */ new Date(e + "T" + n + "Z");
1226
1226
  }
1227
- function Wi(t) {
1227
+ function qi(t) {
1228
1228
  const [e, n] = t.split(" ");
1229
1229
  return /* @__PURE__ */ new Date(e + "T" + n + "Z");
1230
1230
  }
1231
- function qi(t) {
1231
+ function Wi(t) {
1232
1232
  return new Date(t);
1233
1233
  }
1234
1234
  function zi(t) {
@@ -1274,18 +1274,18 @@ function Qi(t) {
1274
1274
  }
1275
1275
  }
1276
1276
  function Hi(t) {
1277
- const e = t.match(mr);
1277
+ const e = t.match(Tr);
1278
1278
  if (!e)
1279
1279
  return null;
1280
- const [n] = e, r = Di[n], s = new Date(t.replace(mr, "Z"));
1280
+ const [n] = e, r = Di[n], s = new Date(t.replace(Tr, "Z"));
1281
1281
  return new Date(s.getTime() - r * 1e3);
1282
1282
  }
1283
1283
  const Ji = [
1284
1284
  Ni,
1285
- Wi,
1285
+ qi,
1286
1286
  zi,
1287
1287
  Gi,
1288
- qi,
1288
+ Wi,
1289
1289
  Li,
1290
1290
  Vi,
1291
1291
  Ki,
@@ -1318,7 +1318,7 @@ function Zi(t) {
1318
1318
  return null;
1319
1319
  }
1320
1320
  }
1321
- function Rt(t) {
1321
+ function jt(t) {
1322
1322
  if (t !== void 0) {
1323
1323
  if (t === null)
1324
1324
  return null;
@@ -1450,7 +1450,7 @@ function hs(t, e, n) {
1450
1450
  console.warn("no such attr", c, a);
1451
1451
  continue;
1452
1452
  }
1453
- l["checked-data-type"] === "date" && n && (u = Rt(u), o[2] = u), Ln(l) && Z(i, [u, c, a], o), Z(r, [a, c, u], o), Z(s, [c, a, u], o);
1453
+ l["checked-data-type"] === "date" && n && (u = jt(u), o[2] = u), Ln(l) && Z(i, [u, c, a], o), Z(r, [a, c, u], o), Z(s, [c, a, u], o);
1454
1454
  }
1455
1455
  return { eav: r, aev: s, vae: i };
1456
1456
  }
@@ -1495,17 +1495,17 @@ function ct(t, e) {
1495
1495
  const [o, a] = r, c = t.aev.get(o);
1496
1496
  if (!c)
1497
1497
  return null;
1498
- const l = (i = X(c, 2).find((_) => _[2] === a)) == null ? void 0 : i[0];
1498
+ const l = (i = X(c, 2).find((g) => g[2] === a)) == null ? void 0 : i[0];
1499
1499
  if (!l)
1500
1500
  return null;
1501
- const [f, d, y, ...b] = e;
1502
- return [n, d, l, ...b];
1501
+ const [f, h, y, ...b] = e;
1502
+ return [n, h, l, ...b];
1503
1503
  } else {
1504
1504
  const [o, ...a] = e;
1505
1505
  return [n, ...a];
1506
1506
  }
1507
1507
  }
1508
- function _s(t, e, n) {
1508
+ function gs(t, e, n) {
1509
1509
  const r = ct(t, n);
1510
1510
  if (!r)
1511
1511
  return;
@@ -1513,7 +1513,7 @@ function _s(t, e, n) {
1513
1513
  a && (ae(t.eav, [s, i, o]), ae(t.aev, [i, s, o]), Ln(a) && ae(t.vae, [o, i, s]));
1514
1514
  }
1515
1515
  let to = 0;
1516
- function gs(t, e, n) {
1516
+ function _s(t, e, n) {
1517
1517
  const [r, s, i] = n;
1518
1518
  let o;
1519
1519
  const a = Ke(t.eav, [r, s, i]);
@@ -1527,8 +1527,8 @@ function ws(t, e, n) {
1527
1527
  const a = e.getAttr(i);
1528
1528
  if (!a)
1529
1529
  return;
1530
- a["checked-data-type"] === "date" && t.useDateObjects && (o = Rt(o));
1531
- const c = Ke(t.eav, [s, i, o]), u = (c == null ? void 0 : c[3]) ?? gs(t, a, r), l = [s, i, o, u];
1530
+ a["checked-data-type"] === "date" && t.useDateObjects && (o = jt(o));
1531
+ const c = Ke(t.eav, [s, i, o]), u = (c == null ? void 0 : c[3]) ?? _s(t, a, r), l = [s, i, o, u];
1532
1532
  Xi(a) ? (Z(t.eav, [s, i], /* @__PURE__ */ new Map([[o, l]])), Z(t.aev, [i, s], /* @__PURE__ */ new Map([[o, l]]))) : (Z(t.eav, [s, i, o], l), Z(t.aev, [i, s, o], l)), Ln(a) && Z(t.vae, [o, i, s], l);
1533
1533
  }
1534
1534
  function no(t, e, n) {
@@ -1547,13 +1547,13 @@ function no(t, e, n) {
1547
1547
  const u = (y = c.values().next()) == null ? void 0 : y.value;
1548
1548
  if (!u)
1549
1549
  return;
1550
- const l = u[2], f = fs(l, o), d = [
1550
+ const l = u[2], f = fs(l, o), h = [
1551
1551
  s,
1552
1552
  i,
1553
1553
  f,
1554
- gs(t, a, u)
1554
+ _s(t, a, u)
1555
1555
  ];
1556
- Z(t.eav, [s, i], /* @__PURE__ */ new Map([[f, d]])), Z(t.aev, [i, s], /* @__PURE__ */ new Map([[f, d]]));
1556
+ Z(t.eav, [s, i], /* @__PURE__ */ new Map([[f, h]])), Z(t.aev, [i, s], /* @__PURE__ */ new Map([[f, h]]));
1557
1557
  }
1558
1558
  function ln(t, e, n) {
1559
1559
  var u, l;
@@ -1563,26 +1563,26 @@ function ln(t, e, n) {
1563
1563
  const [o] = i, a = t.eav.get(o);
1564
1564
  if (a) {
1565
1565
  for (const f of a.keys()) {
1566
- const d = e.getAttr(f);
1567
- d && d["on-delete-reverse"] === "cascade" && X(a.get(f), 1).forEach(([y, b, _]) => {
1566
+ const h = e.getAttr(f);
1567
+ h && h["on-delete-reverse"] === "cascade" && X(a.get(f), 1).forEach(([y, b, g]) => {
1568
1568
  var w;
1569
- return ln(t, e, [_, (w = d["reverse-identity"]) == null ? void 0 : w[1]]);
1569
+ return ln(t, e, [g, (w = h["reverse-identity"]) == null ? void 0 : w[1]]);
1570
1570
  }), // Fall back to deleting everything if we've rehydrated tx-steps from
1571
1571
  // the store that didn't set `etype` in deleteEntity
1572
1572
  (!s || // If we don't know about the attr, let's just get rid of it
1573
- !d || // Make sure it matches the etype
1574
- ((u = d["forward-identity"]) == null ? void 0 : u[1]) === s) && (ae(t.aev, [f, o]), ae(t.eav, [o, f]));
1573
+ !h || // Make sure it matches the etype
1574
+ ((u = h["forward-identity"]) == null ? void 0 : u[1]) === s) && (ae(t.aev, [f, o]), ae(t.eav, [o, f]));
1575
1575
  }
1576
1576
  a.size === 0 && ae(t.eav, [o]);
1577
1577
  }
1578
1578
  const c = t.vae.get(o) && X(t.vae.get(o), 2);
1579
1579
  c && c.forEach((f) => {
1580
- var w, T, g;
1581
- const [d, y, b] = f, _ = e.getAttr(y);
1582
- (!s || !_ || ((w = _["reverse-identity"]) == null ? void 0 : w[1]) === s) && (ae(t.eav, [d, y, b]), ae(t.aev, [y, d, b]), ae(t.vae, [b, y, d])), _ && _["on-delete"] === "cascade" && ((T = _["reverse-identity"]) == null ? void 0 : T[1]) === s && ln(t, e, [d, (g = _["forward-identity"]) == null ? void 0 : g[1]]);
1580
+ var w, m, _;
1581
+ const [h, y, b] = f, g = e.getAttr(y);
1582
+ (!s || !g || ((w = g["reverse-identity"]) == null ? void 0 : w[1]) === s) && (ae(t.eav, [h, y, b]), ae(t.aev, [y, h, b]), ae(t.vae, [b, y, h])), g && g["on-delete"] === "cascade" && ((m = g["reverse-identity"]) == null ? void 0 : m[1]) === s && ln(t, e, [h, (_ = g["forward-identity"]) == null ? void 0 : _[1]]);
1583
1583
  }), ((l = t.vae.get(o)) == null ? void 0 : l.size) === 0 && ae(t.vae, [o]);
1584
1584
  }
1585
- function ms(t, e, n) {
1585
+ function Ts(t, e, n) {
1586
1586
  const r = hs(e, n, t.useDateObjects);
1587
1587
  Object.keys(r).forEach((s) => {
1588
1588
  t[s] = r[s];
@@ -1591,17 +1591,17 @@ function ms(t, e, n) {
1591
1591
  function ro(t, [e]) {
1592
1592
  t.addAttr(e);
1593
1593
  }
1594
- function Ts(t) {
1594
+ function ms(t) {
1595
1595
  return X(t.eav, 3);
1596
1596
  }
1597
1597
  function so(t, e, [n]) {
1598
1598
  if (!e.getAttr(n))
1599
1599
  return;
1600
- const r = Ts(t).filter(([s, i]) => i !== n);
1601
- e.deleteAttr(n), ms(t, e, r);
1600
+ const r = ms(t).filter(([s, i]) => i !== n);
1601
+ e.deleteAttr(n), Ts(t, e, r);
1602
1602
  }
1603
1603
  function io(t, e, [n]) {
1604
- e.getAttr(n.id) && (e.updateAttr(n), ms(t, e, Ts(t)));
1604
+ e.getAttr(n.id) && (e.updateAttr(n), Ts(t, e, ms(t)));
1605
1605
  }
1606
1606
  function oo(t, e, n) {
1607
1607
  const [r, ...s] = n;
@@ -1613,7 +1613,7 @@ function oo(t, e, n) {
1613
1613
  no(t, e, s);
1614
1614
  break;
1615
1615
  case "retract-triple":
1616
- _s(t, e, s);
1616
+ gs(t, e, s);
1617
1617
  break;
1618
1618
  case "delete-entity":
1619
1619
  ln(t, e, s);
@@ -1744,7 +1744,7 @@ function uo(t, e, n) {
1744
1744
  }
1745
1745
  return r;
1746
1746
  }
1747
- function K(t, e, n) {
1747
+ function N(t, e, n) {
1748
1748
  var r;
1749
1749
  return (r = t.forwardIdents.get(e)) == null ? void 0 : r.get(n);
1750
1750
  }
@@ -1778,10 +1778,10 @@ function ho(t, e, n) {
1778
1778
  let l = !1;
1779
1779
  const f = e.getAttr(o);
1780
1780
  if (f) {
1781
- const d = Ss(e, f["forward-identity"][1]);
1781
+ const h = Ss(e, f["forward-identity"][1]);
1782
1782
  l = !!fo(t, e, [
1783
1783
  i,
1784
- d == null ? void 0 : d.id,
1784
+ h == null ? void 0 : h.id,
1785
1785
  i
1786
1786
  ]);
1787
1787
  }
@@ -1808,18 +1808,18 @@ function yo(t, e, n) {
1808
1808
  }
1809
1809
  return { ...n, [t]: e };
1810
1810
  }
1811
- function Tr(t, e, n) {
1811
+ function mr(t, e, n) {
1812
1812
  return t === e ? n : null;
1813
1813
  }
1814
1814
  function bo(t) {
1815
1815
  switch (typeof t) {
1816
1816
  case "string":
1817
- return t.startsWith("?") ? yo : Tr;
1817
+ return t.startsWith("?") ? yo : mr;
1818
1818
  default:
1819
- return Tr;
1819
+ return mr;
1820
1820
  }
1821
1821
  }
1822
- const _o = [
1822
+ const go = [
1823
1823
  "in",
1824
1824
  "$in",
1825
1825
  "$not",
@@ -1827,14 +1827,14 @@ const _o = [
1827
1827
  "$comparator"
1828
1828
  // covers all of $gt, $lt, etc.
1829
1829
  ];
1830
- function go(t) {
1831
- for (const e of _o)
1830
+ function _o(t) {
1831
+ for (const e of go)
1832
1832
  if (t.hasOwnProperty(e))
1833
1833
  return !0;
1834
1834
  return !1;
1835
1835
  }
1836
1836
  function vs(t, e, n) {
1837
- return n ? typeof t == "object" ? go(t) ? n : null : bo(t)(t, e, n) : null;
1837
+ return n ? typeof t == "object" ? _o(t) ? n : null : bo(t)(t, e, n) : null;
1838
1838
  }
1839
1839
  function wo(t, e, n) {
1840
1840
  return t.reduce((r, s, i) => {
@@ -1842,14 +1842,14 @@ function wo(t, e, n) {
1842
1842
  return vs(s, o, r);
1843
1843
  }, n);
1844
1844
  }
1845
- function mo(t, e, n) {
1845
+ function To(t, e, n) {
1846
1846
  return vo(t, e, n).map((r) => wo(e, r, n)).filter((r) => r);
1847
1847
  }
1848
- function To(t, e, n) {
1849
- return e.or ? e.or.patterns.flatMap((r) => fn(t, r, n)) : e.and ? e.and.patterns.reduce((r, s) => fn(t, s, r), n) : n.flatMap((r) => mo(t, e, r));
1848
+ function mo(t, e, n) {
1849
+ return e.or ? e.or.patterns.flatMap((r) => fn(t, r, n)) : e.and ? e.and.patterns.reduce((r, s) => fn(t, s, r), n) : n.flatMap((r) => To(t, e, r));
1850
1850
  }
1851
1851
  function fn(t, e, n = [{}]) {
1852
- return e.reduce((r, s) => To(t, s, r), n);
1852
+ return e.reduce((r, s) => mo(t, s, r), n);
1853
1853
  }
1854
1854
  function Nn(t, e) {
1855
1855
  return Array.isArray(e) ? e.map((n) => Nn(t, n)) : po(e) ? t[e] : e;
@@ -1881,7 +1881,7 @@ function ko() {
1881
1881
  return Qt(Ao);
1882
1882
  }
1883
1883
  const Co = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Sr = { randomUUID: Co };
1884
- function Io(t, e, n) {
1884
+ function Po(t, e, n) {
1885
1885
  var s;
1886
1886
  if (Sr.randomUUID && !t)
1887
1887
  return Sr.randomUUID();
@@ -1897,7 +1897,7 @@ function vr(t) {
1897
1897
  n.push(parseInt(e.substring(r, r + 2), 16));
1898
1898
  return n;
1899
1899
  }
1900
- function Po(t, e) {
1900
+ function Io(t, e) {
1901
1901
  for (let n = 0; n < t.length; n++) {
1902
1902
  if (t[n] < e[n])
1903
1903
  return -1;
@@ -1907,16 +1907,16 @@ function Po(t, e) {
1907
1907
  return 0;
1908
1908
  }
1909
1909
  function Mo(t, e) {
1910
- return Po(vr(t), vr(e));
1910
+ return Io(vr(t), vr(e));
1911
1911
  }
1912
- function L() {
1913
- return Io();
1912
+ function W() {
1913
+ return Po();
1914
1914
  }
1915
- function Ro(t, e) {
1915
+ function jo(t, e) {
1916
1916
  return t.localeCompare(e);
1917
1917
  }
1918
- function jo() {
1919
- let t = Ro;
1918
+ function Ro() {
1919
+ let t = jo;
1920
1920
  if (typeof Intl == "object" && Intl.hasOwnProperty("Collator"))
1921
1921
  try {
1922
1922
  t = Intl.Collator("en-US").compare;
@@ -1924,12 +1924,12 @@ function jo() {
1924
1924
  }
1925
1925
  return t;
1926
1926
  }
1927
- const xo = jo();
1927
+ const xo = Ro();
1928
1928
  let $o = 0;
1929
1929
  function tt(t) {
1930
- return jt(`_${t}`, $o++);
1930
+ return Rt(`_${t}`, $o++);
1931
1931
  }
1932
- function jt(t, e) {
1932
+ function Rt(t, e) {
1933
1933
  return `?${t}-${e}`;
1934
1934
  }
1935
1935
  class Fe extends Error {
@@ -1958,23 +1958,23 @@ function Lo(t, e, n) {
1958
1958
  return t.map((r) => r === e ? n : r);
1959
1959
  }
1960
1960
  function Es(t, e, n, r, s) {
1961
- const i = K(e, n, s), o = Ce(e, n, s), a = i || o;
1961
+ const i = N(e, n, s), o = Ce(e, n, s), a = i || o;
1962
1962
  if (!a)
1963
1963
  throw new Fe(`Could not find attr for ${[n, s]}`);
1964
1964
  if (a["value-type"] !== "ref")
1965
1965
  throw new Error(`Attr ${a.id} is not a ref`);
1966
- const [c, u] = a["forward-identity"], [l, f] = a["reverse-identity"], d = r + 1, y = i ? [
1966
+ const [c, u] = a["forward-identity"], [l, f] = a["reverse-identity"], h = r + 1, y = i ? [
1967
1967
  t(u, r),
1968
1968
  a.id,
1969
- t(f, d),
1969
+ t(f, h),
1970
1970
  tt("time")
1971
1971
  ] : [
1972
- t(u, d),
1972
+ t(u, h),
1973
1973
  a.id,
1974
1974
  t(f, r),
1975
1975
  tt("time")
1976
1976
  ];
1977
- return [i ? f : u, d, y, a, !!i];
1977
+ return [i ? f : u, h, y, a, !!i];
1978
1978
  }
1979
1979
  function Or(t, e) {
1980
1980
  if (typeof e != "string")
@@ -2047,11 +2047,11 @@ function Fo(t, e) {
2047
2047
  return e;
2048
2048
  }
2049
2049
  function No(t, e, n, r, s, i) {
2050
- const o = K(e, n, s), a = Ce(e, n, s), c = o || a;
2050
+ const o = N(e, n, s), a = Ce(e, n, s), c = o || a;
2051
2051
  if (!c)
2052
2052
  throw new Fe(`No attr for etype = ${n} label = ${s}`);
2053
2053
  if (i != null && i.hasOwnProperty("$isNull")) {
2054
- const u = K(e, n, "id");
2054
+ const u = N(e, n, "id");
2055
2055
  if (!u)
2056
2056
  throw new Fe(`No attr for etype = ${n} label = id`);
2057
2057
  return [
@@ -2070,8 +2070,8 @@ function No(t, e, n, r, s, i) {
2070
2070
  }
2071
2071
  function Ko(t, e, n, r, s) {
2072
2072
  const [i, o, a] = s.reduce((c, u) => {
2073
- const [l, f, d] = c, [y, b, _] = Es(t, e, l, f, u);
2074
- return [y, b, [...d, _]];
2073
+ const [l, f, h] = c, [y, b, g] = Es(t, e, l, f, u);
2074
+ return [y, b, [...h, g]];
2075
2075
  }, [n, r, []]);
2076
2076
  return [i, o, a];
2077
2077
  }
@@ -2079,10 +2079,10 @@ function dn(t, e, n, r, s, i) {
2079
2079
  const o = s.slice(0, s.length - 1), a = s[s.length - 1], [c, u, l] = Ko(t, e, n, r, o), f = No(t, e, c, u, a, i);
2080
2080
  return l.concat([f]);
2081
2081
  }
2082
- function Wo(t, e) {
2082
+ function qo(t, e) {
2083
2083
  return e ? [e].concat(t) : t;
2084
2084
  }
2085
- function qo([t, e]) {
2085
+ function Wo([t, e]) {
2086
2086
  return t === "or" && Array.isArray(e);
2087
2087
  }
2088
2088
  function zo([t, e]) {
@@ -2114,7 +2114,7 @@ function kr(t, e, n, r, s) {
2114
2114
  }
2115
2115
  function Os(t, e, n, r, s) {
2116
2116
  return Object.entries(s).flatMap(([i, o]) => {
2117
- if (qo([i, o]))
2117
+ if (Wo([i, o]))
2118
2118
  return Ar(t, "or", e, n, r, o);
2119
2119
  if (zo([i, o]))
2120
2120
  return Ar(t, "and", e, n, r, o);
@@ -2143,7 +2143,7 @@ function Os(t, e, n, r, s) {
2143
2143
  });
2144
2144
  }
2145
2145
  function Go(t, e, n, r) {
2146
- const s = jt;
2146
+ const s = Rt;
2147
2147
  return r ? Os(s, t, e, n, r).concat(Er(s, t, e, n)) : Er(s, t, e, n);
2148
2148
  }
2149
2149
  function Qo(t, e, n) {
@@ -2157,20 +2157,20 @@ function Jo(t, e, n, { etype: r, level: s, form: i }, o) {
2157
2157
  const a = Object.keys(i).filter((c) => c !== "$");
2158
2158
  return a.length ? Object.entries(o).map(function([u, l]) {
2159
2159
  return a.map(function(y) {
2160
- var _, w, T;
2161
- const b = !!(e.cardinalityInference && ((T = (w = (_ = n.linkIndex) == null ? void 0 : _[r]) == null ? void 0 : w[y]) != null && T.isSingular));
2160
+ var g, w, m;
2161
+ const b = !!(e.cardinalityInference && ((m = (w = (g = n.linkIndex) == null ? void 0 : g[r]) == null ? void 0 : w[y]) != null && m.isSingular));
2162
2162
  try {
2163
- const [g, S, O] = Ho(t, n, r, s, y, u), E = ks(e, n, {
2164
- etype: g,
2163
+ const [_, S, O] = Ho(t, n, r, s, y, u), E = ks(e, n, {
2164
+ etype: _,
2165
2165
  level: S,
2166
2166
  form: i[y],
2167
2167
  join: O
2168
- }), R = b ? E[0] : E;
2169
- return { [y]: R };
2170
- } catch (g) {
2171
- if (g instanceof Fe)
2168
+ }), j = b ? E[0] : E;
2169
+ return { [y]: j };
2170
+ } catch (_) {
2171
+ if (_ instanceof Fe)
2172
2172
  return { [y]: b ? void 0 : [] };
2173
- throw g;
2173
+ throw _;
2174
2174
  }
2175
2175
  }).reduce(function(y, b) {
2176
2176
  return { ...y, ...b };
@@ -2183,7 +2183,7 @@ function Yo(t, e, n) {
2183
2183
  function Ye(t, e, n, r, s) {
2184
2184
  return e === r || e == null && r == null ? Mo(t, n) : r == null ? 1 : e == null ? -1 : Yo(e, r, s);
2185
2185
  }
2186
- function It([t, e], [n, r], s) {
2186
+ function Pt([t, e], [n, r], s) {
2187
2187
  return Ye(t, e, n, r, s);
2188
2188
  }
2189
2189
  function hn(t) {
@@ -2193,9 +2193,9 @@ function Zo(t, e, n, r) {
2193
2193
  var b;
2194
2194
  const [s, i, o, a] = t, c = n === "desc" ? 1 : -1;
2195
2195
  if (((b = e["forward-identity"]) == null ? void 0 : b[2]) === "id")
2196
- return It(r, [s, a], null) === c;
2197
- const [u, l] = r, f = e["checked-data-type"], d = f === "date" ? hn(l) : l, y = f === "date" ? hn(o) : o;
2198
- return It([u, d], [s, y], f) === c;
2196
+ return Pt(r, [s, a], null) === c;
2197
+ const [u, l] = r, f = e["checked-data-type"], h = f === "date" ? hn(l) : l, y = f === "date" ? hn(o) : o;
2198
+ return Pt([u, h], [s, y], f) === c;
2199
2199
  }
2200
2200
  function Xo(t, e) {
2201
2201
  const n = e[1];
@@ -2203,7 +2203,7 @@ function Xo(t, e) {
2203
2203
  }
2204
2204
  function ea(t, e, n) {
2205
2205
  const r = Object.keys(n)[0];
2206
- return K(t, e, r);
2206
+ return N(t, e, r);
2207
2207
  }
2208
2208
  function ta(t, e, n, r) {
2209
2209
  if (n)
@@ -2217,43 +2217,43 @@ function na(t, e, n) {
2217
2217
  return lo(t, e);
2218
2218
  const r = /* @__PURE__ */ new Map();
2219
2219
  for (const o of n.fields) {
2220
- const a = K(t, e, o), c = (s = a == null ? void 0 : a["forward-identity"]) == null ? void 0 : s[2];
2220
+ const a = N(t, e, o), c = (s = a == null ? void 0 : a["forward-identity"]) == null ? void 0 : s[2];
2221
2221
  c && Fn(a) && r.set(c, a);
2222
2222
  }
2223
2223
  if (!r.has("id")) {
2224
- const o = K(t, e, "id"), a = (i = o == null ? void 0 : o["forward-identity"]) == null ? void 0 : i[2];
2224
+ const o = N(t, e, "id"), a = (i = o == null ? void 0 : o["forward-identity"]) == null ? void 0 : i[2];
2225
2225
  a && r.set(a, o);
2226
2226
  }
2227
2227
  return r;
2228
2228
  }
2229
2229
  function ra(t, e, { etype: n, pageInfo: r, dq: s, form: i }) {
2230
- var b, _;
2230
+ var b, g;
2231
2231
  const o = (b = i == null ? void 0 : i.$) == null ? void 0 : b.order, a = As(i), c = sa(i);
2232
2232
  let u = So(t, s);
2233
2233
  const l = r == null ? void 0 : r["start-cursor"], f = ta(e, n, l, o);
2234
- if (f && ((_ = f == null ? void 0 : f["forward-identity"]) == null ? void 0 : _[2]) !== "id") {
2235
- const w = f["checked-data-type"] === "date", T = f.id;
2236
- u = u.map(([g]) => {
2237
- var O, E, R, F, B;
2238
- let S = (B = (F = (R = (E = (O = t.eav.get(g)) == null ? void 0 : O.get(T)) == null ? void 0 : E.values()) == null ? void 0 : R.next()) == null ? void 0 : F.value) == null ? void 0 : B[2];
2239
- return w && (S = hn(S)), [g, S];
2234
+ if (f && ((g = f == null ? void 0 : f["forward-identity"]) == null ? void 0 : g[2]) !== "id") {
2235
+ const w = f["checked-data-type"] === "date", m = f.id;
2236
+ u = u.map(([_]) => {
2237
+ var O, E, j, L, B;
2238
+ let S = (B = (L = (j = (E = (O = t.eav.get(_)) == null ? void 0 : O.get(m)) == null ? void 0 : E.values()) == null ? void 0 : j.next()) == null ? void 0 : L.value) == null ? void 0 : B[2];
2239
+ return w && (S = hn(S)), [_, S];
2240
2240
  });
2241
2241
  }
2242
- u.sort(c === "asc" ? function(T, g) {
2243
- return It(T, g, f == null ? void 0 : f["checked-data-type"]);
2244
- } : function(T, g) {
2245
- return It(g, T, f == null ? void 0 : f["checked-data-type"]);
2242
+ u.sort(c === "asc" ? function(m, _) {
2243
+ return Pt(m, _, f == null ? void 0 : f["checked-data-type"]);
2244
+ } : function(m, _) {
2245
+ return Pt(_, m, f == null ? void 0 : f["checked-data-type"]);
2246
2246
  });
2247
- let d = {};
2247
+ let h = {};
2248
2248
  const y = na(e, n, s);
2249
2249
  for (const w of u) {
2250
- const [T] = w;
2251
- if (d[T] || !a && l && f && Zo(l, f, c, w))
2250
+ const [m] = w;
2251
+ if (h[m] || !a && l && f && Zo(l, f, c, w))
2252
2252
  continue;
2253
- const g = uo(t, y, T);
2254
- g && (d[T] = g);
2253
+ const _ = uo(t, y, m);
2254
+ _ && (h[m] = _);
2255
2255
  }
2256
- return d;
2256
+ return h;
2257
2257
  }
2258
2258
  function sa(t) {
2259
2259
  var n;
@@ -2266,19 +2266,19 @@ function As(t) {
2266
2266
  return !e && !n && !r;
2267
2267
  }
2268
2268
  function ia(t, e, { etype: n, level: r, form: s, join: i, pageInfo: o }) {
2269
- var d, y, b, _, w;
2269
+ var h, y, b, g, w;
2270
2270
  if (!As(s) && (!o || !o["start-cursor"]))
2271
2271
  return [];
2272
- const a = Wo(Go(e, n, r, (d = s.$) == null ? void 0 : d.where), i), c = Qo(jt, n, r), u = (y = s.$) == null ? void 0 : y.fields, l = ra(t, e, {
2272
+ const a = qo(Go(e, n, r, (h = s.$) == null ? void 0 : h.where), i), c = Qo(Rt, n, r), u = (y = s.$) == null ? void 0 : y.fields, l = ra(t, e, {
2273
2273
  etype: n,
2274
2274
  pageInfo: o,
2275
2275
  form: s,
2276
2276
  dq: { where: a, find: c, fields: u }
2277
- }), f = ((b = s.$) == null ? void 0 : b.limit) || ((_ = s.$) == null ? void 0 : _.first) || ((w = s.$) == null ? void 0 : w.last);
2277
+ }), f = ((b = s.$) == null ? void 0 : b.limit) || ((g = s.$) == null ? void 0 : g.first) || ((w = s.$) == null ? void 0 : w.last);
2278
2278
  if (f != null) {
2279
2279
  r > 0 && console.warn("WARNING: Limits in child queries are only run client-side. Data returned from the server will not have a limit.");
2280
- const T = Object.entries(l);
2281
- return T.length <= f ? l : Object.fromEntries(T.slice(0, f));
2280
+ const m = Object.entries(l);
2281
+ return m.length <= f ? l : Object.fromEntries(m.slice(0, f));
2282
2282
  }
2283
2283
  return l;
2284
2284
  }
@@ -2293,7 +2293,7 @@ function oa(t, e, n) {
2293
2293
  }
2294
2294
  function ks(t, e, n) {
2295
2295
  const r = oa(t, e, n);
2296
- return Jo(jt, t, e, n, r);
2296
+ return Jo(Rt, t, e, n, r);
2297
2297
  }
2298
2298
  function aa(t) {
2299
2299
  const e = {};
@@ -2354,7 +2354,7 @@ function St(t, e, n) {
2354
2354
  function la(t, e) {
2355
2355
  return `lookup__${t}__${JSON.stringify(e)}`;
2356
2356
  }
2357
- function Pt(t) {
2357
+ function It(t) {
2358
2358
  return t.startsWith("lookup__");
2359
2359
  }
2360
2360
  function pn(t) {
@@ -2371,7 +2371,7 @@ function fa(t) {
2371
2371
  if (n === "__etype")
2372
2372
  return t;
2373
2373
  const r = n;
2374
- return Pt(r) ? St(t, pn(r), []) : St(t, r, []);
2374
+ return It(r) ? St(t, pn(r), []) : St(t, r, []);
2375
2375
  }
2376
2376
  });
2377
2377
  }
@@ -2382,7 +2382,7 @@ function Kn() {
2382
2382
  }
2383
2383
  });
2384
2384
  }
2385
- const Uu = Kn();
2385
+ const Ru = Kn();
2386
2386
  function da(t) {
2387
2387
  return t.__ops;
2388
2388
  }
@@ -2416,7 +2416,7 @@ function pa(t) {
2416
2416
  function ya(t, e, n) {
2417
2417
  return n.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
2418
2418
  // before assuming it's a ref lookup.
2419
- !K(t, e, n);
2419
+ !N(t, e, n);
2420
2420
  }
2421
2421
  function yn(t) {
2422
2422
  const [e, n, ...r] = t.split(".");
@@ -2426,14 +2426,14 @@ function yn(t) {
2426
2426
  }
2427
2427
  function ba(t, e, n) {
2428
2428
  if (!ya(t, e, n))
2429
- return K(t, e, n);
2430
- const r = yn(n), s = K(t, e, r) || Ce(t, e, r);
2429
+ return N(t, e, n);
2430
+ const r = yn(n), s = N(t, e, r) || Ce(t, e, r);
2431
2431
  if (s && s["value-type"] !== "ref")
2432
2432
  throw new Error(`${n} does not reference a valid link attribute.`);
2433
2433
  return s;
2434
2434
  }
2435
2435
  function bn(t) {
2436
- return typeof t == "string" && !Pt(t) ? null : typeof t == "string" && Pt(t) ? pn(t) : pa(t);
2436
+ return typeof t == "string" && !It(t) ? null : typeof t == "string" && It(t) ? pn(t) : pa(t);
2437
2437
  }
2438
2438
  function ee(t, e, n) {
2439
2439
  const r = bn(n);
@@ -2444,19 +2444,19 @@ function ee(t, e, n) {
2444
2444
  throw new Error(`${s} is not a unique attribute.`);
2445
2445
  return [o.id, i];
2446
2446
  }
2447
- function Is(t, e, n, r) {
2447
+ function Ps(t, e, n, r) {
2448
2448
  var o;
2449
2449
  const s = ee(t, e, n);
2450
2450
  return Array.isArray(s) ? [[
2451
2451
  "add-triple",
2452
2452
  s,
2453
- (o = K(t, e, "id")) == null ? void 0 : o.id,
2453
+ (o = N(t, e, "id")) == null ? void 0 : o.id,
2454
2454
  s
2455
2455
  ]].concat(r) : r;
2456
2456
  }
2457
- function _a({ attrsStore: t }, [e, n, r]) {
2457
+ function ga({ attrsStore: t }, [e, n, r]) {
2458
2458
  const s = Object.entries(r).flatMap(([i, o]) => {
2459
- const a = Array.isArray(o) ? o : [o], c = K(t, e, i), u = Ce(t, e, i);
2459
+ const a = Array.isArray(o) ? o : [o], c = N(t, e, i), u = Ce(t, e, i);
2460
2460
  return a.map((l) => c ? [
2461
2461
  "add-triple",
2462
2462
  ee(t, e, n),
@@ -2473,11 +2473,11 @@ function _a({ attrsStore: t }, [e, n, r]) {
2473
2473
  ee(t, e, n)
2474
2474
  ]);
2475
2475
  });
2476
- return Is(t, e, n, s);
2476
+ return Ps(t, e, n, s);
2477
2477
  }
2478
- function ga({ attrsStore: t }, [e, n, r]) {
2478
+ function _a({ attrsStore: t }, [e, n, r]) {
2479
2479
  const s = Object.entries(r).flatMap(([i, o]) => {
2480
- const a = Array.isArray(o) ? o : [o], c = K(t, e, i), u = Ce(t, e, i);
2480
+ const a = Array.isArray(o) ? o : [o], c = N(t, e, i), u = Ce(t, e, i);
2481
2481
  return a.map((l) => c ? [
2482
2482
  "retract-triple",
2483
2483
  ee(t, e, n),
@@ -2494,7 +2494,7 @@ function ga({ attrsStore: t }, [e, n, r]) {
2494
2494
  ee(t, e, n)
2495
2495
  ]);
2496
2496
  });
2497
- return Is(t, e, n, s);
2497
+ return Ps(t, e, n, s);
2498
2498
  }
2499
2499
  function wa(t, e, n, r) {
2500
2500
  var s;
@@ -2519,25 +2519,25 @@ function wa(t, e, n, r) {
2519
2519
  }
2520
2520
  return !1;
2521
2521
  }
2522
- function Ps({ stores: t, attrsStore: e }, [n, r, s, i]) {
2522
+ function Is({ stores: t, attrsStore: e }, [n, r, s, i]) {
2523
2523
  return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null : wa(t, e, n, r) ? { mode: "update" } : null;
2524
2524
  }
2525
- function ma(t, e) {
2525
+ function Ta(t, e) {
2526
2526
  const { attrsStore: n } = t, [r, s, i, o] = e, a = Un(i), c = ee(n, r, s);
2527
2527
  return [["id", c]].concat(Object.entries(a)).map(([l, f]) => {
2528
- const d = K(n, r, l);
2529
- return d["checked-data-type"] === "date" && t.useDateObjects && (f = Rt(f)), ["add-triple", c, d.id, f, { mode: "create" }];
2528
+ const h = N(n, r, l);
2529
+ return h["checked-data-type"] === "date" && t.useDateObjects && (f = jt(f)), ["add-triple", c, h.id, f, { mode: "create" }];
2530
2530
  });
2531
2531
  }
2532
- function Ta(t, e) {
2533
- const { attrsStore: n } = t, [r, s, i, o] = e, a = Un(i), c = ee(n, r, s), u = Ps(t, [r, c, i, o]);
2534
- return [["id", c]].concat(Object.entries(a)).map(([f, d]) => {
2535
- const y = K(n, r, f);
2536
- return y["checked-data-type"] === "date" && t.useDateObjects && (d = Rt(d)), [
2532
+ function ma(t, e) {
2533
+ const { attrsStore: n } = t, [r, s, i, o] = e, a = Un(i), c = ee(n, r, s), u = Is(t, [r, c, i, o]);
2534
+ return [["id", c]].concat(Object.entries(a)).map(([f, h]) => {
2535
+ const y = N(n, r, f);
2536
+ return y["checked-data-type"] === "date" && t.useDateObjects && (h = jt(h)), [
2537
2537
  "add-triple",
2538
2538
  c,
2539
2539
  y.id,
2540
- d,
2540
+ h,
2541
2541
  ...u ? [u] : []
2542
2542
  ];
2543
2543
  });
@@ -2546,8 +2546,8 @@ function Sa({ attrsStore: t }, [e, n]) {
2546
2546
  return [["delete-entity", ee(t, e, n), e]];
2547
2547
  }
2548
2548
  function va(t, e) {
2549
- const { attrsStore: n } = t, [r, s, i, o] = e, a = Un(i), c = ee(n, r, s), u = Ps(t, [r, c, i, o]), l = Object.entries(a).map(([d, y]) => {
2550
- const b = K(n, r, d);
2549
+ const { attrsStore: n } = t, [r, s, i, o] = e, a = Un(i), c = ee(n, r, s), u = Is(t, [r, c, i, o]), l = Object.entries(a).map(([h, y]) => {
2550
+ const b = N(n, r, h);
2551
2551
  return [
2552
2552
  "deep-merge-triple",
2553
2553
  c,
@@ -2559,7 +2559,7 @@ function va(t, e) {
2559
2559
  return [[
2560
2560
  "add-triple",
2561
2561
  c,
2562
- K(n, r, "id").id,
2562
+ N(n, r, "id").id,
2563
2563
  c,
2564
2564
  ...u ? [u] : []
2565
2565
  ]].concat(l);
@@ -2580,13 +2580,13 @@ function Aa(t, e) {
2580
2580
  case "merge":
2581
2581
  return va(t, r);
2582
2582
  case "create":
2583
- return ma(t, r);
2584
- case "update":
2585
2583
  return Ta(t, r);
2584
+ case "update":
2585
+ return ma(t, r);
2586
2586
  case "link":
2587
- return _a(t, r);
2588
- case "unlink":
2589
2587
  return ga(t, r);
2588
+ case "unlink":
2589
+ return _a(t, r);
2590
2590
  case "delete":
2591
2591
  return Sa(t, r);
2592
2592
  case "ruleParams":
@@ -2621,7 +2621,7 @@ function Ca(t, e, n) {
2621
2621
  };
2622
2622
  }
2623
2623
  function yt(t, e, n, r) {
2624
- const s = t ? Ca(t, e, n) : null, i = L(), a = [L(), e, n];
2624
+ const s = t ? Ca(t, e, n) : null, i = W(), a = [W(), e, n];
2625
2625
  return {
2626
2626
  id: i,
2627
2627
  "forward-identity": a,
@@ -2634,17 +2634,17 @@ function yt(t, e, n, r) {
2634
2634
  ...r || {}
2635
2635
  };
2636
2636
  }
2637
- function Ia(t, e, n) {
2637
+ function Pa(t, e, n) {
2638
2638
  return Object.values(t.links).find((i) => i.forward.on === e && i.forward.label === n || i.reverse.on === e && i.reverse.label === n);
2639
2639
  }
2640
- function Pa(t, e, n) {
2641
- const r = Ia(t, e, n);
2640
+ function Ia(t, e, n) {
2641
+ const r = Pa(t, e, n);
2642
2642
  if (!r)
2643
2643
  throw new Error(`Couldn't find the link ${e}.${n} in your schema`);
2644
2644
  const { forward: s, reverse: i } = r;
2645
2645
  return {
2646
- "forward-identity": [L(), s.on, s.label],
2647
- "reverse-identity": [L(), i.on, i.label],
2646
+ "forward-identity": [W(), s.on, s.label],
2647
+ "reverse-identity": [W(), i.on, i.label],
2648
2648
  cardinality: s.has === "one" ? "one" : "many",
2649
2649
  "unique?": i.has === "one",
2650
2650
  "on-delete": s.onDelete,
@@ -2652,7 +2652,7 @@ function Pa(t, e, n) {
2652
2652
  };
2653
2653
  }
2654
2654
  function Cr(t, e, n, r) {
2655
- const s = t ? Pa(t, e, n) : null, i = L(), o = [L(), e, n], a = [L(), n, e];
2655
+ const s = t ? Ia(t, e, n) : null, i = W(), o = [W(), e, n], a = [W(), n, e];
2656
2656
  return {
2657
2657
  id: i,
2658
2658
  // @ts-ignore: ts thinks it's any[]
@@ -2669,7 +2669,7 @@ function Cr(t, e, n, r) {
2669
2669
  ...r || {}
2670
2670
  };
2671
2671
  }
2672
- const Ma = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink"]), Ra = /* @__PURE__ */ new Set(["link", "unlink"]), ja = /* @__PURE__ */ new Set(["create", "update", "merge"]), xa = /* @__PURE__ */ new Set([
2672
+ const Ma = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink"]), ja = /* @__PURE__ */ new Set(["link", "unlink"]), Ra = /* @__PURE__ */ new Set(["create", "update", "merge"]), xa = /* @__PURE__ */ new Set([
2673
2673
  "link",
2674
2674
  "unlink",
2675
2675
  "create",
@@ -2677,8 +2677,8 @@ const Ma = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink
2677
2677
  "merge",
2678
2678
  "delete",
2679
2679
  "ruleParams"
2680
- ]), _n = { "unique?": !0, "index?": !0 }, $a = {
2681
- ..._n,
2680
+ ]), gn = { "unique?": !0, "index?": !0 }, $a = {
2681
+ ...gn,
2682
2682
  cardinality: "one"
2683
2683
  };
2684
2684
  function Da(t) {
@@ -2701,15 +2701,15 @@ function Da(t) {
2701
2701
  return e;
2702
2702
  }
2703
2703
  function Ua({ attrsStore: t, schema: e }, n) {
2704
- var d, y;
2704
+ var h, y;
2705
2705
  const r = /* @__PURE__ */ new Set(), s = [], i = [];
2706
- function o(b, _) {
2707
- return K(t, b, _) || s.find((w) => w["forward-identity"][1] === b && w["forward-identity"][2] === _);
2706
+ function o(b, g) {
2707
+ return N(t, b, g) || s.find((w) => w["forward-identity"][1] === b && w["forward-identity"][2] === g);
2708
2708
  }
2709
- function a(b, _) {
2710
- return Ce(t, b, _) || s.find((w) => {
2711
- var T, g;
2712
- return ((T = w["reverse-identity"]) == null ? void 0 : T[1]) === b && ((g = w["reverse-identity"]) == null ? void 0 : g[2]) === _;
2709
+ function a(b, g) {
2710
+ return Ce(t, b, g) || s.find((w) => {
2711
+ var m, _;
2712
+ return ((m = w["reverse-identity"]) == null ? void 0 : m[1]) === b && ((_ = w["reverse-identity"]) == null ? void 0 : _[2]) === g;
2713
2713
  });
2714
2714
  }
2715
2715
  function c(b) {
@@ -2718,54 +2718,54 @@ function Ua({ attrsStore: t, schema: e }, n) {
2718
2718
  function u(b) {
2719
2719
  b && "isUnsynced" in b && b.isUnsynced && !r.has(b.id) && (s.push(b), i.push(["add-attr", b]), r.add(b.id));
2720
2720
  }
2721
- function l(b, _) {
2722
- return _.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
2721
+ function l(b, g) {
2722
+ return g.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
2723
2723
  // before assuming it's a ref lookup.
2724
- !o(b, _);
2724
+ !o(b, g);
2725
2725
  }
2726
- function f(b, _) {
2727
- const w = o(b, _), T = a(b, _);
2728
- u(w), u(T), !w && !T && c(Cr(e, b, _, $a));
2726
+ function f(b, g) {
2727
+ const w = o(b, g), m = a(b, g);
2728
+ u(w), u(m), !w && !m && c(Cr(e, b, g, $a));
2729
2729
  }
2730
2730
  for (const b of n)
2731
- for (const { etype: _, lookupPair: w, linkLabel: T } of Da(b)) {
2732
- const g = w[0];
2733
- if (T) {
2734
- f(_, T);
2735
- const S = o(_, T), O = a(_, T);
2731
+ for (const { etype: g, lookupPair: w, linkLabel: m } of Da(b)) {
2732
+ const _ = w[0];
2733
+ if (m) {
2734
+ f(g, m);
2735
+ const S = o(g, m), O = a(g, m);
2736
2736
  u(S), u(O);
2737
- const E = ((d = S == null ? void 0 : S["reverse-identity"]) == null ? void 0 : d[1]) || ((y = O == null ? void 0 : O["forward-identity"]) == null ? void 0 : y[1]) || T;
2738
- if (l(E, g))
2739
- f(E, yn(g));
2737
+ const E = ((h = S == null ? void 0 : S["reverse-identity"]) == null ? void 0 : h[1]) || ((y = O == null ? void 0 : O["forward-identity"]) == null ? void 0 : y[1]) || m;
2738
+ if (l(E, _))
2739
+ f(E, yn(_));
2740
2740
  else {
2741
- const R = o(E, g);
2742
- R || c(yt(e, E, g, _n)), u(R);
2741
+ const j = o(E, _);
2742
+ j || c(yt(e, E, _, gn)), u(j);
2743
2743
  }
2744
- } else if (l(_, g))
2745
- f(_, yn(g));
2744
+ } else if (l(g, _))
2745
+ f(g, yn(_));
2746
2746
  else {
2747
- const S = o(_, g);
2748
- S || c(yt(e, _, g, _n)), u(S);
2747
+ const S = o(g, _);
2748
+ S || c(yt(e, g, _, gn)), u(S);
2749
2749
  }
2750
2750
  }
2751
2751
  for (const b of n) {
2752
- const [_, w, T, g] = b;
2753
- if (Ma.has(_)) {
2752
+ const [g, w, m, _] = b;
2753
+ if (Ma.has(g)) {
2754
2754
  const S = o(w, "id");
2755
2755
  u(S), S || c(yt(e, w, "id", { "unique?": !0 }));
2756
- for (const O of Object.keys(g)) {
2756
+ for (const O of Object.keys(_)) {
2757
2757
  const E = o(w, O);
2758
- if (u(E), ja.has(_) && (E || c(yt(e, w, O, O === "id" ? { "unique?": !0 } : null))), Ra.has(_)) {
2759
- const R = a(w, O);
2760
- !E && !R && c(Cr(e, w, O)), u(R);
2758
+ if (u(E), Ra.has(g) && (E || c(yt(e, w, O, O === "id" ? { "unique?": !0 } : null))), ja.has(g)) {
2759
+ const j = a(w, O);
2760
+ !E && !j && c(Cr(e, w, O)), u(j);
2761
2761
  }
2762
2762
  }
2763
2763
  }
2764
2764
  }
2765
2765
  if (s.length) {
2766
2766
  const b = { ...t.attrs };
2767
- for (const _ of s)
2768
- b[_.id] = _;
2767
+ for (const g of s)
2768
+ b[g.id] = g;
2769
2769
  return [new Ee(b, t.linkIndex), i];
2770
2770
  }
2771
2771
  return [t, i];
@@ -2774,7 +2774,7 @@ function La(t, e) {
2774
2774
  const r = (Array.isArray(e) ? e : [e]).flatMap((c) => da(c)), [s, i] = Ua(t, r), o = { ...t, attrsStore: s }, a = r.flatMap((c) => Aa(o, c));
2775
2775
  return [...i, ...a];
2776
2776
  }
2777
- function Ir(t, e) {
2777
+ function Pr(t, e) {
2778
2778
  typeof requestIdleCallback > "u" ? t() : requestIdleCallback(t, { timeout: e });
2779
2779
  }
2780
2780
  const nt = "__meta";
@@ -2782,7 +2782,7 @@ class Fa {
2782
2782
  constructor(e, n) {
2783
2783
  }
2784
2784
  }
2785
- class gn {
2785
+ class _n {
2786
2786
  constructor(e) {
2787
2787
  p(this, "currentValue");
2788
2788
  p(this, "_subs", []);
@@ -2882,10 +2882,10 @@ class gn {
2882
2882
  _writeToStorage(e) {
2883
2883
  const n = [], r = e == null ? void 0 : e.skipGc;
2884
2884
  if (this._meta.isLoading) {
2885
- const f = new Promise((d, y) => {
2886
- setTimeout(() => this._enqueuePersist(e ? { ...e, attempts: (e.attempts || 0) + 1 } : { attempts: 1 }).then(d).catch(y), 10 + ((e == null ? void 0 : e.attempts) ?? 0) * 1e3);
2885
+ const f = new Promise((h, y) => {
2886
+ setTimeout(() => this._enqueuePersist(e ? { ...e, attempts: (e.attempts || 0) + 1 } : { attempts: 1 }).then(h).catch(y), 10 + ((e == null ? void 0 : e.attempts) ?? 0) * 1e3);
2887
2887
  });
2888
- return n.push(f), Promise.all(n).then((d) => d.reduce((y, b) => y + b, 0));
2888
+ return n.push(f), Promise.all(n).then((h) => h.reduce((y, b) => y + b, 0));
2889
2889
  }
2890
2890
  const s = this._meta.value;
2891
2891
  if (!s)
@@ -2894,16 +2894,16 @@ class gn {
2894
2894
  for (const f of this._pendingSaveKeys)
2895
2895
  f in this.currentValue ? o.push(f) : (i.push(f), delete s.objects[f]);
2896
2896
  for (const f of i) {
2897
- const d = this._persister.removeItem(f);
2898
- n.push(d.then(() => 1)), this._loadedKeys.delete(f), this._pendingSaveKeys.delete(f);
2897
+ const h = this._persister.removeItem(f);
2898
+ n.push(h.then(() => 1)), this._loadedKeys.delete(f), this._pendingSaveKeys.delete(f);
2899
2899
  }
2900
2900
  const a = [], c = [[nt, s]], u = s.objects ?? {};
2901
2901
  s.objects = u;
2902
2902
  for (const f of o)
2903
2903
  if (this._loadedKeys.has(f)) {
2904
- const d = this.serialize(f, this.currentValue[f]);
2905
- c.push([f, d]);
2906
- const y = this._objectSize(d), b = u[f] ?? {
2904
+ const h = this.serialize(f, this.currentValue[f]);
2905
+ c.push([f, h]);
2906
+ const y = this._objectSize(h), b = u[f] ?? {
2907
2907
  createdAt: Date.now(),
2908
2908
  updatedAt: Date.now(),
2909
2909
  size: y
@@ -2914,10 +2914,10 @@ class gn {
2914
2914
  const l = this._persister.multiSet(c);
2915
2915
  n.push(l.then(() => 1));
2916
2916
  for (const f of a) {
2917
- const d = this._loadKey(f).then(() => this._enqueuePersist(e));
2918
- n.push(d);
2917
+ const h = this._loadKey(f).then(() => this._enqueuePersist(e));
2918
+ n.push(h);
2919
2919
  }
2920
- return r || this.gc(), Promise.all(n).then((f) => f.reduce((d, y) => d + y, 0));
2920
+ return r || this.gc(), Promise.all(n).then((f) => f.reduce((h, y) => h + y, 0));
2921
2921
  }
2922
2922
  async flush() {
2923
2923
  return this._nextSave ? (clearTimeout(this._nextSave), this._nextSave = null, this._writeToStorage()) : void 0;
@@ -2928,10 +2928,10 @@ class gn {
2928
2928
  const e = new Set(await this._persister.getAllKeys());
2929
2929
  e.delete(nt);
2930
2930
  const n = new Set(Object.keys(this.currentValue));
2931
- for (const d of Object.keys(this._loadingKeys))
2932
- n.add(d);
2933
- for (const d of this._loadedKeys)
2934
- n.add(d);
2931
+ for (const h of Object.keys(this._loadingKeys))
2932
+ n.add(h);
2933
+ for (const h of this._loadedKeys)
2934
+ n.add(h);
2935
2935
  const r = await this._refreshMeta();
2936
2936
  if (!r) {
2937
2937
  this._log.info("Could not gc because we were not able to load meta");
@@ -2948,34 +2948,34 @@ class gn {
2948
2948
  removedThresholdCount: 0,
2949
2949
  removedSizeCount: 0
2950
2950
  };
2951
- for (const d of e)
2952
- n.has(d) || d in r.objects || (this._log.info("Lost track of key in meta", d), s.push(this._persister.removeItem(d)), i.removed.push(d), i.removedMissingCount++);
2951
+ for (const h of e)
2952
+ n.has(h) || h in r.objects || (this._log.info("Lost track of key in meta", h), s.push(this._persister.removeItem(h)), i.removed.push(h), i.removedMissingCount++);
2953
2953
  const o = Date.now();
2954
- for (const [d, y] of Object.entries(r.objects))
2955
- !n.has(d) && y.updatedAt < o - this._gcOpts.maxAgeMs && (s.push(this._persister.removeItem(d)), delete r.objects[d], i.removed.push(d), i.removedOldCount++);
2954
+ for (const [h, y] of Object.entries(r.objects))
2955
+ !n.has(h) && y.updatedAt < o - this._gcOpts.maxAgeMs && (s.push(this._persister.removeItem(h)), delete r.objects[h], i.removed.push(h), i.removedOldCount++);
2956
2956
  const a = Object.entries(r.objects);
2957
- a.sort(([d, y], [b, _]) => y.updatedAt - _.updatedAt);
2958
- const c = a.filter(([d]) => !n.has(d));
2957
+ a.sort(([h, y], [b, g]) => y.updatedAt - g.updatedAt);
2958
+ const c = a.filter(([h]) => !n.has(h));
2959
2959
  if (a.length > this._gcOpts.maxEntries)
2960
- for (const [d] of c.slice(0, a.length - this._gcOpts.maxEntries))
2961
- s.push(this._persister.removeItem(d)), delete r.objects[d], i.removed.push(d), i.removedThresholdCount++;
2960
+ for (const [h] of c.slice(0, a.length - this._gcOpts.maxEntries))
2961
+ s.push(this._persister.removeItem(h)), delete r.objects[h], i.removed.push(h), i.removedThresholdCount++;
2962
2962
  const u = Object.entries(r.objects);
2963
- u.sort(([d, y], [b, _]) => y.updatedAt - _.updatedAt);
2964
- const l = u.filter(([d]) => !n.has(d));
2965
- let f = u.reduce((d, [y, b]) => d + b.size, 0);
2963
+ u.sort(([h, y], [b, g]) => y.updatedAt - g.updatedAt);
2964
+ const l = u.filter(([h]) => !n.has(h));
2965
+ let f = u.reduce((h, [y, b]) => h + b.size, 0);
2966
2966
  for (; f > 0 && f > this._gcOpts.maxSize && l.length; ) {
2967
- const [[d, y]] = l.splice(0, 1);
2968
- f -= y.size, s.push(this._persister.removeItem(d)), delete r.objects[d], i.removed.push(d), i.removedSizeCount++;
2967
+ const [[h, y]] = l.splice(0, 1);
2968
+ f -= y.size, s.push(this._persister.removeItem(h)), delete r.objects[h], i.removed.push(h), i.removedSizeCount++;
2969
2969
  }
2970
- for (const d of Object.keys(r.objects))
2971
- !e.has(d) && !n.has(d) && delete r.objects[d];
2970
+ for (const h of Object.keys(r.objects))
2971
+ !e.has(h) && !n.has(h) && delete r.objects[h];
2972
2972
  return (i.removed.length || i.metaRemoved.length) && s.push(this._enqueuePersist({ skipGc: !0 })), this._log.info("Completed GC", i), await Promise.all(s), i;
2973
2973
  }
2974
2974
  // Schedules a GC to run in one minute (unless it is already scheduled)
2975
2975
  gc() {
2976
2976
  this._nextGc || (this._nextGc = setTimeout(
2977
2977
  () => {
2978
- Ir(() => {
2978
+ Pr(() => {
2979
2979
  this._nextGc = null, this._gc();
2980
2980
  }, 30 * 1e3);
2981
2981
  },
@@ -2990,7 +2990,7 @@ class gn {
2990
2990
  return;
2991
2991
  }
2992
2992
  this._nextSave = setTimeout(() => {
2993
- Ir(() => {
2993
+ Pr(() => {
2994
2994
  this._nextSave = null, this._writeToStorage(e).then(n).catch(r);
2995
2995
  }, this._idleCallbackMaxWaitMs);
2996
2996
  }, this._saveThrottleMs);
@@ -3023,12 +3023,12 @@ class gn {
3023
3023
  }
3024
3024
  }
3025
3025
  const Na = 6, Ka = ["kv", "querySubs", "syncSubs"];
3026
- function Wa(t) {
3026
+ function qa(t) {
3027
3027
  return function(n) {
3028
3028
  console.error("Error in IndexedDB event", { source: t, event: n });
3029
3029
  };
3030
3030
  }
3031
- async function qa(t) {
3031
+ async function Wa(t) {
3032
3032
  return new Promise((e) => {
3033
3033
  const n = indexedDB.open(t);
3034
3034
  n.onerror = (r) => {
@@ -3051,19 +3051,19 @@ async function za(t, e, n) {
3051
3051
  return;
3052
3052
  const s = /* @__PURE__ */ new Set();
3053
3053
  return new Promise((i, o) => {
3054
- var l, f, d;
3054
+ var l, f, h;
3055
3055
  const a = {};
3056
3056
  for (const [y, b] of Object.entries(r)) {
3057
- const _ = typeof b == "string" ? JSON.parse(b) : b;
3058
- if (_.lastAccessed) {
3059
- const T = {
3060
- createdAt: _.lastAccessed,
3061
- updatedAt: _.lastAccessed,
3062
- size: ((d = (f = (l = _.result) == null ? void 0 : l.store) == null ? void 0 : f.triples) == null ? void 0 : d.length) ?? 0
3057
+ const g = typeof b == "string" ? JSON.parse(b) : b;
3058
+ if (g.lastAccessed) {
3059
+ const m = {
3060
+ createdAt: g.lastAccessed,
3061
+ updatedAt: g.lastAccessed,
3062
+ size: ((h = (f = (l = g.result) == null ? void 0 : l.store) == null ? void 0 : f.triples) == null ? void 0 : h.length) ?? 0
3063
3063
  };
3064
- a[y] = T;
3064
+ a[y] = m;
3065
3065
  }
3066
- const w = n.put(_, y);
3066
+ const w = n.put(g, y);
3067
3067
  s.add(w);
3068
3068
  }
3069
3069
  const c = { objects: a }, u = n.put(c, nt);
@@ -3076,14 +3076,14 @@ async function za(t, e, n) {
3076
3076
  };
3077
3077
  });
3078
3078
  }
3079
- async function Pr(t, e, n) {
3079
+ async function Ir(t, e, n) {
3080
3080
  const r = n.put(e, t);
3081
3081
  return new Promise((s, i) => {
3082
3082
  r.onsuccess = () => s(), r.onerror = (o) => i(o);
3083
3083
  });
3084
3084
  }
3085
3085
  async function Va(t, e) {
3086
- const n = await qa(`instant_${t}_5`);
3086
+ const n = await Wa(`instant_${t}_5`);
3087
3087
  if (!n)
3088
3088
  return;
3089
3089
  const r = await new Promise((l, f) => {
@@ -3091,14 +3091,14 @@ async function Va(t, e) {
3091
3091
  b.onerror = (w) => {
3092
3092
  f(w);
3093
3093
  };
3094
- const _ = [];
3094
+ const g = [];
3095
3095
  b.onsuccess = () => {
3096
3096
  const w = b.result;
3097
3097
  if (w) {
3098
- const T = w.key, g = w.value;
3099
- _.push([T, g]), w.continue();
3098
+ const m = w.key, _ = w.value;
3099
+ g.push([m, _]), w.continue();
3100
3100
  } else
3101
- l(_);
3101
+ l(g);
3102
3102
  }, b.onerror = (w) => {
3103
3103
  f(w);
3104
3104
  };
@@ -3106,13 +3106,13 @@ async function Va(t, e) {
3106
3106
  for (const [l, f] of r)
3107
3107
  switch (l) {
3108
3108
  case "querySubs": {
3109
- const d = za(l, f, o);
3110
- a.push(d);
3109
+ const h = za(l, f, o);
3110
+ a.push(h);
3111
3111
  break;
3112
3112
  }
3113
3113
  default: {
3114
- const d = Pr(l, f, i);
3115
- a.push(d);
3114
+ const h = Ir(l, f, i);
3115
+ a.push(h);
3116
3116
  const y = {
3117
3117
  createdAt: Date.now(),
3118
3118
  updatedAt: Date.now(),
@@ -3122,9 +3122,9 @@ async function Va(t, e) {
3122
3122
  break;
3123
3123
  }
3124
3124
  }
3125
- const u = Pr(nt, c, i);
3125
+ const u = Ir(nt, c, i);
3126
3126
  a.push(u), await Promise.all(a), await new Promise((l, f) => {
3127
- s.oncomplete = (d) => l(d), s.onerror = (d) => f(d), s.onabort = (d) => f(d);
3127
+ s.oncomplete = (h) => l(h), s.onerror = (h) => f(h), s.onabort = (h) => f(h);
3128
3128
  });
3129
3129
  }
3130
3130
  const Mr = /* @__PURE__ */ new Map();
@@ -3148,7 +3148,7 @@ class Ms extends Fa {
3148
3148
  const c = o.target.result;
3149
3149
  if (s) {
3150
3150
  const u = Va(this._appId, c).catch((l) => {
3151
- Wa("Error upgrading store from version 5 to 6.")(l);
3151
+ qa("Error upgrading store from version 5 to 6.")(l);
3152
3152
  });
3153
3153
  Mr.set(this.dbName, u), u.then(() => n(c)).catch(() => n(c));
3154
3154
  } else {
@@ -3227,7 +3227,7 @@ class Ms extends Fa {
3227
3227
  });
3228
3228
  }
3229
3229
  }
3230
- class Rs {
3230
+ class js {
3231
3231
  static async getIsOnline() {
3232
3232
  return navigator.onLine;
3233
3233
  }
@@ -3310,7 +3310,7 @@ async function Ha({ apiURI: t, appId: e }) {
3310
3310
  })
3311
3311
  });
3312
3312
  }
3313
- async function Rr({ apiURI: t, appId: e, code: n, codeVerifier: r, refreshToken: s }) {
3313
+ async function jr({ apiURI: t, appId: e, code: n, codeVerifier: r, refreshToken: s }) {
3314
3314
  return await ue(`${t}/runtime/oauth/token`, {
3315
3315
  method: "POST",
3316
3316
  headers: { "content-type": "application/json" },
@@ -3403,9 +3403,9 @@ async function nc({ apiURI: t, appId: e, path: n, refreshToken: r }) {
3403
3403
  });
3404
3404
  return s;
3405
3405
  }
3406
- let Wn = !1, js = !1, xs = !1;
3407
- typeof window < "u" && typeof window.localStorage < "u" && (Wn = !!window.localStorage.getItem("devBackend"), js = !!window.localStorage.getItem("__instantLogging"), xs = !!window.localStorage.getItem("__devtoolLocalDash"));
3408
- function jr(t, e) {
3406
+ let qn = !1, Rs = !1, xs = !1;
3407
+ typeof window < "u" && typeof window.localStorage < "u" && (qn = !!window.localStorage.getItem("devBackend"), Rs = !!window.localStorage.getItem("__instantLogging"), xs = !!window.localStorage.getItem("__devtoolLocalDash"));
3408
+ function Rr(t, e) {
3409
3409
  if (!e)
3410
3410
  return t;
3411
3411
  const n = {};
@@ -3418,23 +3418,23 @@ function rc(t, e, n) {
3418
3418
  peers: {}
3419
3419
  };
3420
3420
  if (e && "user" in e ? e.user : !0) {
3421
- const i = jr(t.user ?? {}, e == null ? void 0 : e.keys);
3421
+ const i = Rr(t.user ?? {}, e == null ? void 0 : e.keys);
3422
3422
  r.user = { ...i, peerId: n };
3423
3423
  }
3424
3424
  for (const i of Object.keys(t.peers ?? {})) {
3425
3425
  const o = (e == null ? void 0 : e.peers) === void 0, a = Array.isArray(e == null ? void 0 : e.peers) && (e == null ? void 0 : e.peers.includes(i));
3426
3426
  if (o || a) {
3427
- const c = jr(t.peers[i], e == null ? void 0 : e.keys);
3427
+ const c = Rr(t.peers[i], e == null ? void 0 : e.keys);
3428
3428
  r.peers[i] = { ...c, peerId: i };
3429
3429
  }
3430
3430
  }
3431
3431
  return r;
3432
3432
  }
3433
3433
  function sc(t, e) {
3434
- if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !gr(t.user, e.user)) || !ls(t.peers, e.peers))
3434
+ if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !_r(t.user, e.user)) || !ls(t.peers, e.peers))
3435
3435
  return !0;
3436
3436
  for (const r of Object.keys(t.peers))
3437
- if (!gr(t.peers[r], e.peers[r]))
3437
+ if (!_r(t.peers[r], e.peers[r]))
3438
3438
  return !0;
3439
3439
  return !1;
3440
3440
  }
@@ -3481,7 +3481,7 @@ function Dr(t) {
3481
3481
  }, e;
3482
3482
  }, {});
3483
3483
  }
3484
- const qn = "v0.22.119-experimental.streams.21539576498.1";
3484
+ const Wn = "v0.22.120-experimental.drewh-admin-db-warn.21600986993.1";
3485
3485
  function ic(t, e) {
3486
3486
  return {
3487
3487
  info: t ? (...n) => console.info(...n, e()) : () => {
@@ -3645,12 +3645,12 @@ const Ur = [
3645
3645
  throw new x(`Invalid dot notation path '${t}'. Must contain at least one dot.`, s);
3646
3646
  let o = n;
3647
3647
  for (let l = 0; l < i.length - 1; l++) {
3648
- const f = i[l], d = r.entities[o];
3649
- if (!d)
3648
+ const f = i[l], h = r.entities[o];
3649
+ if (!h)
3650
3650
  throw new x(`Entity '${o}' does not exist in schema while traversing dot notation path '${t}'.`, s);
3651
- const y = d.links[f];
3651
+ const y = h.links[f];
3652
3652
  if (!y) {
3653
- const b = Object.keys(d.links);
3653
+ const b = Object.keys(h.links);
3654
3654
  throw new x(`Link '${f}' does not exist on entity '${o}' in dot notation path '${t}'. Available links: ${b.length > 0 ? b.join(", ") : "none"}`, s);
3655
3655
  }
3656
3656
  o = y.entityName;
@@ -3769,7 +3769,7 @@ const Ur = [
3769
3769
  Ls(n[r], r, e, r, 0);
3770
3770
  }
3771
3771
  }
3772
- }, Fr = (t) => typeof t != "string" ? !1 : Pt(t) ? !0 : Le(t);
3772
+ }, Fr = (t) => typeof t != "string" ? !1 : It(t) ? !0 : Le(t);
3773
3773
  class se extends Error {
3774
3774
  constructor(e) {
3775
3775
  super(e), this.name = "TransactionValidationError";
@@ -3994,7 +3994,7 @@ function bc(t, e) {
3994
3994
  }
3995
3995
  return t;
3996
3996
  }
3997
- function _c(t, e) {
3997
+ function gc(t, e) {
3998
3998
  var n;
3999
3999
  if (e.values) {
4000
4000
  const r = [];
@@ -4009,7 +4009,7 @@ function _c(t, e) {
4009
4009
  } else
4010
4010
  return e;
4011
4011
  }
4012
- function gc(t, e, n) {
4012
+ function _c(t, e, n) {
4013
4013
  var i, o;
4014
4014
  const r = (i = e == null ? void 0 : e.state) == null ? void 0 : i.txId, s = (o = n == null ? void 0 : n.state) == null ? void 0 : o.txId;
4015
4015
  return r && (!s || r > s) ? e : s && (!r || s > r) ? n : e || n;
@@ -4017,22 +4017,22 @@ function gc(t, e, n) {
4017
4017
  function Yt(t, e, n) {
4018
4018
  return Cs({ store: e, attrsStore: n, pageInfo: null, aggregate: null }, t.query).data[t.table][0];
4019
4019
  }
4020
- function Wr(t, e, n, r) {
4020
+ function qr(t, e, n, r) {
4021
4021
  var o;
4022
- const s = (o = K(n, t.table, "id")) == null ? void 0 : o.id;
4022
+ const s = (o = N(n, t.table, "id")) == null ? void 0 : o.id;
4023
4023
  if (!s)
4024
4024
  return -1;
4025
4025
  const i = Ke(e.eav, [r, s, r]);
4026
4026
  return i ? i[3] : -1;
4027
4027
  }
4028
- function qr(t, e, n) {
4028
+ function Wr(t, e, n) {
4029
4029
  for (const { action: r, triple: s } of n)
4030
4030
  switch (r) {
4031
4031
  case "added":
4032
4032
  ws(t, e, s);
4033
4033
  break;
4034
4034
  case "removed":
4035
- _s(t, e, s);
4035
+ gs(t, e, s);
4036
4036
  break;
4037
4037
  }
4038
4038
  }
@@ -4043,9 +4043,9 @@ function wc(t, e, n) {
4043
4043
  const [c, u, l] = a, f = (i = (s = e.getAttr(u)) == null ? void 0 : s["forward-identity"]) == null ? void 0 : i[2];
4044
4044
  if (!f)
4045
4045
  continue;
4046
- const d = r[c] ?? {};
4047
- r[c] = d;
4048
- const y = d[f] ?? {};
4046
+ const h = r[c] ?? {};
4047
+ r[c] = h;
4048
+ const y = h[f] ?? {};
4049
4049
  switch (o) {
4050
4050
  case "added":
4051
4051
  y.newValue = l;
@@ -4054,7 +4054,7 @@ function wc(t, e, n) {
4054
4054
  y.oldValue === void 0 && (y.oldValue = l);
4055
4055
  break;
4056
4056
  }
4057
- d[f] = y;
4057
+ h[f] = y;
4058
4058
  }
4059
4059
  for (const [o, a] of Object.entries(r))
4060
4060
  for (const [c, { oldValue: u, newValue: l }] of Object.entries(a))
@@ -4064,14 +4064,14 @@ function wc(t, e, n) {
4064
4064
  function bt(t, e) {
4065
4065
  return { [t.table]: e.map((n) => n.entity) };
4066
4066
  }
4067
- function mc(t, e) {
4067
+ function Tc(t, e) {
4068
4068
  var r;
4069
4069
  if (t.orderFieldType)
4070
4070
  return t.orderFieldType;
4071
- const n = t.orderField === "serverCreatedAt" ? "number" : (r = K(e(), t.table, t.orderField)) == null ? void 0 : r["checked-data-type"];
4071
+ const n = t.orderField === "serverCreatedAt" ? "number" : (r = N(e(), t.table, t.orderField)) == null ? void 0 : r["checked-data-type"];
4072
4072
  return t.orderFieldType = n, n;
4073
4073
  }
4074
- function Tc(t, e, n) {
4074
+ function mc(t, e, n) {
4075
4075
  const r = e;
4076
4076
  if (t.orderField === "serverCreatedAt") {
4077
4077
  n.sort(t.orderDirection === "asc" ? function(o, a) {
@@ -4088,10 +4088,10 @@ function Tc(t, e, n) {
4088
4088
  return Ye(a.entity.id, a.entity[s], o.entity.id, o.entity[s], r);
4089
4089
  });
4090
4090
  }
4091
- var me;
4091
+ var Te;
4092
4092
  (function(t) {
4093
4093
  t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error";
4094
- })(me || (me = {}));
4094
+ })(Te || (Te = {}));
4095
4095
  class Sc {
4096
4096
  constructor(e, n, r, s, i, o) {
4097
4097
  p(this, "trySend");
@@ -4103,10 +4103,10 @@ class Sc {
4103
4103
  p(this, "log");
4104
4104
  p(this, "createStore");
4105
4105
  p(this, "getAttrs");
4106
- this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.getAttrs = o, this.subs = new gn({
4106
+ this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.getAttrs = o, this.subs = new _n({
4107
4107
  persister: n,
4108
- merge: gc,
4109
- serialize: _c,
4108
+ merge: _c,
4109
+ serialize: gc,
4110
4110
  parse: (a, c) => bc(c, this.config.useDateObjects),
4111
4111
  objectSize: (a) => {
4112
4112
  var c;
@@ -4143,7 +4143,7 @@ class Sc {
4143
4143
  }
4144
4144
  }
4145
4145
  sendStart(e) {
4146
- this.trySend(L(), {
4146
+ this.trySend(W(), {
4147
4147
  op: "start-sync",
4148
4148
  q: e
4149
4149
  });
@@ -4157,24 +4157,24 @@ class Sc {
4157
4157
  });
4158
4158
  }
4159
4159
  sendRemove(e, n) {
4160
- this.trySend(L(), {
4160
+ this.trySend(W(), {
4161
4161
  op: "remove-sync",
4162
4162
  "subscription-id": e.subscriptionId,
4163
4163
  "keep-subscription": n
4164
4164
  });
4165
4165
  }
4166
4166
  async initSubscription(e, n, r) {
4167
- var u, l, f, d;
4167
+ var u, l, f, h;
4168
4168
  await this.subs.waitForKeyToLoad(n);
4169
4169
  const s = this.subs.currentValue[n];
4170
4170
  if (s && s.state && s.state.txId) {
4171
4171
  this.sendResync(s, s.state, s.state.txId), (u = s.values) != null && u.entities && r && r({
4172
- type: me.LoadFromStorage,
4172
+ type: Te.LoadFromStorage,
4173
4173
  data: bt(s, (l = s.values) == null ? void 0 : l.entities)
4174
4174
  });
4175
4175
  return;
4176
4176
  }
4177
- const i = Object.keys(e)[0], o = ((d = (f = e[i]) == null ? void 0 : f.$) == null ? void 0 : d.order) || { serverCreatedAt: "asc" }, [a, c] = Object.entries(o)[0];
4177
+ const i = Object.keys(e)[0], o = ((h = (f = e[i]) == null ? void 0 : f.$) == null ? void 0 : h.order) || { serverCreatedAt: "asc" }, [a, c] = Object.entries(o)[0];
4178
4178
  this.subs.updateInPlace((y) => {
4179
4179
  y[n] = {
4180
4180
  query: e,
@@ -4232,13 +4232,13 @@ class Sc {
4232
4232
  c.push({
4233
4233
  store: l,
4234
4234
  entity: f,
4235
- serverCreatedAt: Wr(o, l, a.attrsStore, f.id)
4235
+ serverCreatedAt: qr(o, l, a.attrsStore, f.id)
4236
4236
  }), i.push(f);
4237
4237
  }
4238
4238
  this.subs.updateInPlace((u) => {
4239
4239
  u[s] = o, u[s].updatedAt = Date.now();
4240
4240
  }), o.values && this.notifyCbs(s, {
4241
- type: me.InitialSyncBatch,
4241
+ type: Te.InitialSyncBatch,
4242
4242
  data: bt(o, o.values.entities),
4243
4243
  batch: i
4244
4244
  });
@@ -4263,7 +4263,7 @@ class Sc {
4263
4263
  });
4264
4264
  const s = this.subs.currentValue[r];
4265
4265
  s && this.notifyCbs(r, {
4266
- type: me.InitialSyncComplete,
4266
+ type: Te.InitialSyncComplete,
4267
4267
  data: bt(s, ((i = s.values) == null ? void 0 : i.entities) || [])
4268
4268
  });
4269
4269
  }
@@ -4290,58 +4290,58 @@ class Sc {
4290
4290
  i.txId = a["tx-id"];
4291
4291
  const c = [], u = {};
4292
4292
  for (const w of a.changes) {
4293
- const T = u[w.triple[0]] ?? [];
4294
- u[w.triple[0]] = T, T.push(w);
4293
+ const m = u[w.triple[0]] ?? [];
4294
+ u[w.triple[0]] = m, m.push(w);
4295
4295
  }
4296
4296
  const l = s.values ?? {
4297
4297
  entities: [],
4298
4298
  attrsStore: this.getAttrs()
4299
4299
  }, f = l.entities;
4300
4300
  s.values = l;
4301
- const d = [];
4302
- e: for (const [w, T] of Object.entries(u))
4303
- for (let g = 0; g < f.length; g++) {
4304
- const S = f[g];
4301
+ const h = [];
4302
+ e: for (const [w, m] of Object.entries(u))
4303
+ for (let _ = 0; _ < f.length; _++) {
4304
+ const S = f[_];
4305
4305
  if (eo(S.store, w)) {
4306
- qr(S.store, l.attrsStore, T);
4307
- const O = Yt(s, S.store, l.attrsStore), E = wc(S.store, l.attrsStore, T)[w];
4308
- O ? (d.push({
4306
+ Wr(S.store, l.attrsStore, m);
4307
+ const O = Yt(s, S.store, l.attrsStore), E = wc(S.store, l.attrsStore, m)[w];
4308
+ O ? (h.push({
4309
4309
  oldEntity: S.entity,
4310
4310
  newEntity: O,
4311
4311
  changedFields: E || {}
4312
- }), S.entity = O) : c.push(g), delete u[w];
4312
+ }), S.entity = O) : c.push(_), delete u[w];
4313
4313
  continue e;
4314
4314
  }
4315
4315
  }
4316
4316
  const y = [];
4317
- for (const [w, T] of Object.entries(u)) {
4318
- const g = this.createStore([]);
4319
- qr(g, l.attrsStore, T);
4320
- const S = Yt(s, g, l.attrsStore);
4317
+ for (const [w, m] of Object.entries(u)) {
4318
+ const _ = this.createStore([]);
4319
+ Wr(_, l.attrsStore, m);
4320
+ const S = Yt(s, _, l.attrsStore);
4321
4321
  if (!S) {
4322
4322
  this.log.error("No entity found after applying change", {
4323
4323
  sub: s,
4324
- changes: T,
4325
- store: g
4324
+ changes: m,
4325
+ store: _
4326
4326
  });
4327
4327
  continue;
4328
4328
  }
4329
4329
  f.push({
4330
- store: g,
4330
+ store: _,
4331
4331
  entity: S,
4332
- serverCreatedAt: Wr(s, g, l.attrsStore, S.id)
4332
+ serverCreatedAt: qr(s, _, l.attrsStore, S.id)
4333
4333
  }), y.push(S);
4334
4334
  }
4335
4335
  const b = [];
4336
4336
  for (const w of c.sort().reverse())
4337
4337
  b.push(f[w].entity), f.splice(w, 1);
4338
- const _ = mc(s, this.getAttrs);
4339
- Tc(s, _, f), this.notifyCbs(r, {
4340
- type: me.SyncTransaction,
4338
+ const g = Tc(s, this.getAttrs);
4339
+ mc(s, g, f), this.notifyCbs(r, {
4340
+ type: Te.SyncTransaction,
4341
4341
  data: bt(s, (o = s.values) == null ? void 0 : o.entities),
4342
4342
  added: y,
4343
4343
  removed: b,
4344
- updated: d
4344
+ updated: h
4345
4345
  });
4346
4346
  }
4347
4347
  this.subs.updateInPlace((a) => {
@@ -4367,7 +4367,7 @@ class Sc {
4367
4367
  hint: e.hint
4368
4368
  }, s = Object.keys(e["original-event"].q)[0];
4369
4369
  this.notifyCbs(n, {
4370
- type: me.Error,
4370
+ type: Te.Error,
4371
4371
  data: { [s]: [] },
4372
4372
  error: r
4373
4373
  });
@@ -4377,188 +4377,17 @@ class Sc {
4377
4377
  r && this.initSubscription(r.query, r.hash);
4378
4378
  }
4379
4379
  }
4380
- function vc({ WStream: t, opts: e, startStream: n, appendStream: r }) {
4381
- let s = null, i = null, o = 0, a = 0;
4382
- const c = new TextEncoder();
4383
- function u(l) {
4384
- return s || l.error("Stream has not been initialized."), s;
4385
- }
4386
- return new t({
4387
- // We could make this a little more resilient to network interrupts
4388
- // Maybe we should put the segments into storage?
4389
- async start(l) {
4390
- try {
4391
- const { streamId: f, reconnectToken: d } = await n(e);
4392
- s = f, i = d;
4393
- } catch (f) {
4394
- l.error(f.message);
4395
- }
4396
- },
4397
- write(l, f) {
4398
- const d = u(f);
4399
- if (d) {
4400
- const y = c.encode(l).length, b = o + a;
4401
- a += y, r({ streamId: d, chunks: [l], offset: b });
4402
- }
4403
- },
4404
- close() {
4405
- s && r({
4406
- streamId: s,
4407
- chunks: [],
4408
- offset: o + a,
4409
- isDone: !0
4410
- });
4411
- },
4412
- abort(l) {
4413
- console.log("abort", l), s && r({
4414
- streamId: s,
4415
- chunks: [],
4416
- offset: o + a,
4417
- isDone: !0,
4418
- abortReason: l
4419
- });
4420
- }
4421
- });
4422
- }
4423
- class Ec {
4424
- constructor() {
4425
- p(this, "items", []);
4426
- p(this, "resolvers", []);
4427
- p(this, "isClosed", !1);
4428
- }
4429
- push(e) {
4430
- if (this.isClosed)
4431
- return;
4432
- const n = this.resolvers.shift();
4433
- n ? n({ value: e, done: !1 }) : this.items.push(e);
4434
- }
4435
- close() {
4436
- for (this.isClosed = !0; this.resolvers.length > 0; )
4437
- this.resolvers.shift()({ value: void 0, done: !0 });
4438
- }
4439
- async *[Symbol.asyncIterator]() {
4440
- for (; ; )
4441
- if (this.items.length > 0)
4442
- yield this.items.shift();
4443
- else {
4444
- if (this.isClosed)
4445
- return;
4446
- {
4447
- const { value: e, done: n } = await new Promise((r) => {
4448
- this.resolvers.push(r);
4449
- });
4450
- if (n || !e)
4451
- return;
4452
- yield e;
4453
- }
4454
- }
4455
- }
4456
- }
4457
- function Oc({ RStream: t, opts: e, startStream: n }) {
4458
- const r = new TextDecoder("utf-8");
4459
- async function s(i) {
4460
- for await (const o of n(e)) {
4461
- if (o.files)
4462
- for (const a of o.files) {
4463
- const c = await fetch(a.url);
4464
- if (c.body)
4465
- for await (const u of c.body) {
4466
- const l = r.decode(u);
4467
- i.enqueue(l);
4468
- }
4469
- }
4470
- o.content && i.enqueue(o.content);
4471
- }
4472
- i.close();
4473
- }
4474
- return new t({
4475
- start(i) {
4476
- s(i);
4477
- }
4478
- });
4479
- }
4480
- class Ac {
4481
- constructor({ WStream: e, RStream: n, trySend: r, log: s }) {
4482
- p(this, "trySend");
4483
- p(this, "WStream");
4484
- p(this, "RStream");
4485
- p(this, "startStreamCbs", {});
4486
- p(this, "readStreamIterators", {});
4487
- p(this, "log");
4488
- this.WStream = e, this.RStream = n, this.trySend = r, this.log = s;
4489
- }
4490
- createWriteStream(e) {
4491
- return vc({
4492
- WStream: this.WStream,
4493
- startStream: this.startWriteStream.bind(this),
4494
- appendStream: this.appendStream.bind(this),
4495
- opts: e
4496
- });
4497
- }
4498
- createReadStream(e) {
4499
- return Oc({
4500
- RStream: this.RStream,
4501
- opts: e,
4502
- startStream: this.startReadStream.bind(this)
4503
- });
4504
- }
4505
- startWriteStream(e) {
4506
- const n = L();
4507
- let r = null;
4508
- const s = new Promise((o) => {
4509
- r = o;
4510
- });
4511
- this.startStreamCbs[n] = r;
4512
- const i = { op: "create-stream" };
4513
- return e != null && e.clientId && (i["client-id"] = e.clientId), this.trySend(n, i), s;
4514
- }
4515
- appendStream({ streamId: e, chunks: n, isDone: r, offset: s, abortReason: i }) {
4516
- const o = {
4517
- op: "append-stream",
4518
- "stream-id": e,
4519
- chunks: n,
4520
- offset: s,
4521
- done: !!r
4522
- };
4523
- i && (o["abort-reason"] = i), this.trySend(L(), o);
4524
- }
4525
- onCreateStreamOk(e) {
4526
- const n = this.startStreamCbs[e["client-event-id"]];
4527
- if (!n) {
4528
- this.log.info("No stream for start-stream-ok", e);
4529
- return;
4530
- }
4531
- n({ streamId: e["stream-id"], reconnectToken: e["reconnect-token"] });
4532
- }
4533
- // XXX: Need some kind of flow control...
4534
- startReadStream({ clientId: e, streamId: n }) {
4535
- const r = { op: "subscribe-stream" };
4536
- if (!n && !e)
4537
- throw new Error("Must provide one of streamId or clientId to subscribe to the stream.");
4538
- n && (r["stream-id"] = n), e && (r["client-id"] = e);
4539
- const s = new Ec(), i = L();
4540
- return this.readStreamIterators[i] = s, this.trySend(i, r), s;
4541
- }
4542
- onStreamAppend(e) {
4543
- const n = e["client-event-id"], r = this.readStreamIterators[n];
4544
- if (!r) {
4545
- this.log.info("No iterator for read stream", e);
4546
- return;
4547
- }
4548
- e.error || (e.files && r.push({ offset: e.offset, files: e.files }), e.content && r.push({ offset: e.offset, content: e.content }), e.done && r.close());
4549
- }
4550
- }
4551
4380
  const de = {
4552
4381
  CONNECTING: "connecting",
4553
4382
  OPENED: "opened",
4554
4383
  AUTHENTICATED: "authenticated",
4555
4384
  CLOSED: "closed",
4556
4385
  ERRORED: "errored"
4557
- }, kc = 3e4, Cc = 3e4, Ic = 200, Pc = 1e3 * 60, Mc = {
4386
+ }, vc = 3e4, Ec = 3e4, Oc = 200, Ac = 1e3 * 60, kc = {
4558
4387
  apiURI: "https://api.instantdb.com",
4559
4388
  websocketURI: "wss://api.instantdb.com/runtime/session"
4560
4389
  }, Zt = "_instant_oauth_redirect", Ve = "currentUser";
4561
- function Rc({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl: s }) {
4390
+ function Cc({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl: s }) {
4562
4391
  if (!s)
4563
4392
  return new Kr(`${r}?app_id=${e}`);
4564
4393
  switch (t) {
@@ -4570,7 +4399,7 @@ function Rc({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl:
4570
4399
  throw new Error("Unknown transport type " + t);
4571
4400
  }
4572
4401
  }
4573
- function jc() {
4402
+ function Pc() {
4574
4403
  return typeof window < "u" || typeof chrome < "u";
4575
4404
  }
4576
4405
  const zr = {
@@ -4579,7 +4408,7 @@ const zr = {
4579
4408
  "refresh-presence": !0,
4580
4409
  "patch-presence": !0
4581
4410
  };
4582
- function xc(t, e) {
4411
+ function Ic(t, e) {
4583
4412
  var r;
4584
4413
  const n = typeof t == "string" ? JSON.parse(t) : t;
4585
4414
  if ((r = n == null ? void 0 : n.result) != null && r.store) {
@@ -4594,7 +4423,7 @@ function xc(t, e) {
4594
4423
  }
4595
4424
  return n;
4596
4425
  }
4597
- function $c(t, e) {
4426
+ function Mc(t, e) {
4598
4427
  const { result: n, ...r } = e, s = (
4599
4428
  /** @type {import('./reactorTypes.ts').QuerySubInStorage} */
4600
4429
  r
@@ -4609,7 +4438,7 @@ function $c(t, e) {
4609
4438
  }
4610
4439
  return s;
4611
4440
  }
4612
- function Dc(t, e) {
4441
+ function jc(t, e) {
4613
4442
  switch (t) {
4614
4443
  case "pendingMutations":
4615
4444
  return new Map(typeof e == "string" ? JSON.parse(e) : e);
@@ -4617,7 +4446,7 @@ function Dc(t, e) {
4617
4446
  return e;
4618
4447
  }
4619
4448
  }
4620
- function Uc(t, e) {
4449
+ function Rc(t, e) {
4621
4450
  switch (t) {
4622
4451
  case "pendingMutations":
4623
4452
  return [...e.entries()];
@@ -4625,7 +4454,7 @@ function Uc(t, e) {
4625
4454
  return e;
4626
4455
  }
4627
4456
  }
4628
- function Lc(t, e, n) {
4457
+ function xc(t, e, n) {
4629
4458
  const r = e == null ? void 0 : e.result, s = n == null ? void 0 : n.result;
4630
4459
  return r && !s && n && (n.result = r), n || e;
4631
4460
  }
@@ -4635,8 +4464,8 @@ function Xt(t) {
4635
4464
  return a == c ? r < i ? -1 : r > i ? 1 : 0 : a - c;
4636
4465
  });
4637
4466
  }
4638
- class Fc {
4639
- constructor(e, n = Ms, r = Rs, s, i) {
4467
+ class $c {
4468
+ constructor(e, n = Ms, r = js, s, i) {
4640
4469
  /** @type {s.AttrsStore | undefined} */
4641
4470
  p(this, "attrs");
4642
4471
  p(this, "_isOnline", !0);
@@ -4648,8 +4477,6 @@ class Fc {
4648
4477
  p(this, "kv");
4649
4478
  /** @type {SyncTable} */
4650
4479
  p(this, "_syncTable");
4651
- /** @type {InstantStream} */
4652
- p(this, "_instantStream");
4653
4480
  /** @type {Record<string, Array<{ q: any, cb: (data: any) => any }>>} */
4654
4481
  p(this, "queryCbs", {});
4655
4482
  /** @type {Record<string, Array<{ q: any, eventId: string, dfd: Deferred }>>} */
@@ -4718,7 +4545,7 @@ class Fc {
4718
4545
  p(this, "notifyOne", (e) => {
4719
4546
  var i;
4720
4547
  const n = this.queryCbs[e] ?? [], r = (i = this._dataForQueryCache[e]) == null ? void 0 : i.data, s = this.dataForQuery(e);
4721
- s != null && s.data && (this._dataForQueryCache[e] = s, !Tt(s.data, r) && n.forEach((o) => o.cb(s.data)));
4548
+ s != null && s.data && (this._dataForQueryCache[e] = s, !mt(s.data, r) && n.forEach((o) => o.cb(s.data)));
4722
4549
  });
4723
4550
  p(this, "notifyOneQueryOnce", (e) => {
4724
4551
  var s;
@@ -4754,7 +4581,7 @@ class Fc {
4754
4581
  * @returns
4755
4582
  */
4756
4583
  p(this, "pushOps", (e, n) => {
4757
- const r = L(), s = [...this._pendingMutations().values()], i = Math.max(0, ...s.map((c) => c.order || 0)) + 1, o = {
4584
+ const r = W(), s = [...this._pendingMutations().values()], i = Math.max(0, ...s.map((c) => c.order || 0)) + 1, o = {
4758
4585
  op: "transact",
4759
4586
  "tx-steps": e,
4760
4587
  created: Date.now(),
@@ -4775,7 +4602,7 @@ class Fc {
4775
4602
  }
4776
4603
  this._log.info("[socket][open]", this._transport.id), this._setStatus(de.OPENED), this.getCurrentUser().then((r) => {
4777
4604
  var s;
4778
- this._trySend(L(), {
4605
+ this._trySend(W(), {
4779
4606
  op: "init",
4780
4607
  "app-id": this.config.appId,
4781
4608
  "refresh-token": (s = r.user) == null ? void 0 : s.refresh_token,
@@ -4835,7 +4662,7 @@ class Fc {
4835
4662
  }
4836
4663
  this._log.info("[socket][close]", n.id, "schedule reconnect, ms =", this._reconnectTimeoutMs), this._scheduleReconnect();
4837
4664
  });
4838
- if (this._EventSource = i, this.config = { ...Mc, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? Cc, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Ic, this._log = ic(e.verbose || Wn || js, () => this._reactorStats()), this.versions = { ...s || {}, "@instantdb/core": qn }, this.config.schema && (this._linkIndex = Dr(this.config.schema)), !!jc()) {
4665
+ if (this._EventSource = i, this.config = { ...kc, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? Ec, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Oc, this._log = ic(e.verbose || qn || Rs, () => this._reactorStats()), this.versions = { ...s || {}, "@instantdb/core": Wn }, this.config.schema && (this._linkIndex = Dr(this.config.schema)), !!Pc()) {
4839
4666
  if (!e.appId)
4840
4667
  throw new Error("Instant must be initialized with an appId.");
4841
4668
  if (!Le(e.appId))
@@ -4852,19 +4679,12 @@ class Fc {
4852
4679
  }
4853
4680
  })), this._initStorage(n), this._syncTable = new Sc(this._trySendAuthed.bind(this), new n(this.config.appId, "syncSubs"), {
4854
4681
  useDateObjects: this.config.useDateObjects
4855
- }, this._log, (o) => Je(this.ensureAttrs(), o, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._instantStream = new Ac({
4856
- WStream: WritableStream,
4857
- // XXX: needs to be passed in from above
4858
- RStream: ReadableStream,
4859
- // XXX: needs to be passed in from above
4860
- trySend: this._trySendAuthed.bind(this),
4861
- log: this._log
4862
- }), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser().then((o) => {
4682
+ }, this._log, (o) => Je(this.ensureAttrs(), o, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser().then((o) => {
4863
4683
  this.syncUserToEndpoint(o.user);
4864
4684
  }), setInterval(async () => {
4865
4685
  const o = await this.getCurrentUser();
4866
4686
  this.syncUserToEndpoint(o.user);
4867
- }, Pc), r.getIsOnline().then((o) => {
4687
+ }, Ac), r.getIsOnline().then((o) => {
4868
4688
  this._isOnline = o, this._startSocket(), r.listen((a) => {
4869
4689
  a !== this._isOnline && (this._log.info("[network] online =", a), this._isOnline = a, this._isOnline ? this._startSocket() : (this._log.info("Changing status from", this.status, "to", de.CLOSED), this._setStatus(de.CLOSED)));
4870
4690
  });
@@ -4894,11 +4714,11 @@ class Fc {
4894
4714
  this.kv.waitForKeyToLoad("pendingMutations").then(() => this.notifyOne(e));
4895
4715
  }
4896
4716
  _initStorage(e) {
4897
- this.querySubs = new gn({
4717
+ this.querySubs = new _n({
4898
4718
  persister: new e(this.config.appId, "querySubs"),
4899
- merge: Lc,
4900
- serialize: $c,
4901
- parse: (n, r) => xc(r, this.config.useDateObjects),
4719
+ merge: xc,
4720
+ serialize: Mc,
4721
+ parse: (n, r) => Ic(r, this.config.useDateObjects),
4902
4722
  // objectSize
4903
4723
  objectSize: (n) => {
4904
4724
  var r, s, i;
@@ -4914,11 +4734,11 @@ class Fc {
4914
4734
  maxSize: 1e6
4915
4735
  // 1 million triples
4916
4736
  }
4917
- }), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new gn({
4737
+ }), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new _n({
4918
4738
  persister: new e(this.config.appId, "kv"),
4919
4739
  merge: this._onMergeKv,
4920
- serialize: Uc,
4921
- parse: Dc,
4740
+ serialize: Rc,
4741
+ parse: jc,
4922
4742
  objectSize: () => 0,
4923
4743
  logger: this._log,
4924
4744
  saveThrottleMs: 100,
@@ -5000,9 +4820,9 @@ class Fc {
5000
4820
  switch (zr[n.op] || this._log.info("[receive]", e, n.op, n), n.op) {
5001
4821
  case "init-ok": {
5002
4822
  this._setStatus(de.AUTHENTICATED), this._reconnectTimeoutMs = 0, this._setAttrs(n.attrs), this._flushPendingMessages(), this._sessionId = n["session-id"];
5003
- for (const d of Object.keys(this._rooms)) {
5004
- const y = (i = (s = this._presence[d]) == null ? void 0 : s.result) == null ? void 0 : i.user;
5005
- this._tryJoinRoom(d, y);
4823
+ for (const h of Object.keys(this._rooms)) {
4824
+ const y = (i = (s = this._presence[h]) == null ? void 0 : s.result) == null ? void 0 : i.user;
4825
+ this._tryJoinRoom(h, y);
5006
4826
  }
5007
4827
  break;
5008
4828
  }
@@ -5011,19 +4831,19 @@ class Fc {
5011
4831
  break;
5012
4832
  }
5013
4833
  case "add-query-ok": {
5014
- const { q: d, result: y } = n, b = q(d);
4834
+ const { q: h, result: y } = n, b = q(h);
5015
4835
  if (!this._hasQueryListeners() && !this.querySubs.currentValue[b])
5016
4836
  break;
5017
- const _ = (a = (o = y == null ? void 0 : y[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], w = (u = (c = y == null ? void 0 : y[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, T = $r(y), g = this.ensureAttrs(), S = Je(g, T, r, this.config.useDateObjects);
4837
+ const g = (a = (o = y == null ? void 0 : y[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], w = (u = (c = y == null ? void 0 : y[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, m = $r(y), _ = this.ensureAttrs(), S = Je(_, m, r, this.config.useDateObjects);
5018
4838
  this.querySubs.updateInPlace((O) => {
5019
4839
  if (!O[b]) {
5020
- this._log.info("Missing value in querySubs", { hash: b, q: d });
4840
+ this._log.info("Missing value in querySubs", { hash: b, q: h });
5021
4841
  return;
5022
4842
  }
5023
4843
  O[b].result = {
5024
4844
  store: S,
5025
- attrsStore: g,
5026
- pageInfo: _,
4845
+ attrsStore: _,
4846
+ pageInfo: g,
5027
4847
  aggregate: w,
5028
4848
  processedTxId: n["processed-tx-id"]
5029
4849
  };
@@ -5046,105 +4866,97 @@ class Fc {
5046
4866
  this._syncTable.onSyncUpdateTriples(n);
5047
4867
  break;
5048
4868
  }
5049
- case "create-stream-ok": {
5050
- this._instantStream.onCreateStreamOk(n);
5051
- break;
5052
- }
5053
- case "stream-append": {
5054
- this._instantStream.onStreamAppend(n);
5055
- break;
5056
- }
5057
4869
  case "refresh-ok": {
5058
- const { computations: d, attrs: y } = n, b = n["processed-tx-id"];
4870
+ const { computations: h, attrs: y } = n, b = n["processed-tx-id"];
5059
4871
  y && this._setAttrs(y), this._cleanupPendingMutationsTimeout();
5060
- const _ = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations(), b);
5061
- _ !== this._pendingMutations() && this.kv.updateInPlace((g) => {
5062
- g.pendingMutations = _;
4872
+ const g = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations(), b);
4873
+ g !== this._pendingMutations() && this.kv.updateInPlace((_) => {
4874
+ _.pendingMutations = g;
5063
4875
  });
5064
- const w = Xt(_.entries()), T = d.map((g) => {
5065
- var qe, ie, le, be;
5066
- const S = g["instaql-query"], O = g["instaql-result"], E = q(S), R = $r(O), F = this.ensureAttrs(), B = Je(F, R, r, this.config.useDateObjects), { store: We, attrsStore: ut } = this._applyOptimisticUpdates(B, F, w, b), Ut = (ie = (qe = O == null ? void 0 : O[0]) == null ? void 0 : qe.data) == null ? void 0 : ie["page-info"], Lt = (be = (le = O == null ? void 0 : O[0]) == null ? void 0 : le.data) == null ? void 0 : be.aggregate;
4876
+ const w = Xt(g.entries()), m = h.map((_) => {
4877
+ var We, ie, le, be;
4878
+ const S = _["instaql-query"], O = _["instaql-result"], E = q(S), j = $r(O), L = this.ensureAttrs(), B = Je(L, j, r, this.config.useDateObjects), { store: qe, attrsStore: ut } = this._applyOptimisticUpdates(B, L, w, b), Ut = (ie = (We = O == null ? void 0 : O[0]) == null ? void 0 : We.data) == null ? void 0 : ie["page-info"], Lt = (be = (le = O == null ? void 0 : O[0]) == null ? void 0 : le.data) == null ? void 0 : be.aggregate;
5067
4879
  return {
5068
4880
  q: S,
5069
4881
  hash: E,
5070
- store: We,
4882
+ store: qe,
5071
4883
  attrsStore: ut,
5072
4884
  pageInfo: Ut,
5073
4885
  aggregate: Lt
5074
4886
  };
5075
4887
  });
5076
- T.forEach(({ hash: g, q: S, store: O, attrsStore: E, pageInfo: R, aggregate: F }) => {
4888
+ m.forEach(({ hash: _, q: S, store: O, attrsStore: E, pageInfo: j, aggregate: L }) => {
5077
4889
  this.querySubs.updateInPlace((B) => {
5078
- if (!B[g]) {
5079
- this._log.error("Missing value in querySubs", { hash: g, q: S });
4890
+ if (!B[_]) {
4891
+ this._log.error("Missing value in querySubs", { hash: _, q: S });
5080
4892
  return;
5081
4893
  }
5082
- B[g].result = {
4894
+ B[_].result = {
5083
4895
  store: O,
5084
4896
  attrsStore: E,
5085
- pageInfo: R,
5086
- aggregate: F,
4897
+ pageInfo: j,
4898
+ aggregate: L,
5087
4899
  processedTxId: b
5088
4900
  };
5089
4901
  });
5090
- }), this._cleanupPendingMutationsQueries(), T.forEach(({ hash: g }) => {
5091
- this.notifyOne(g);
4902
+ }), this._cleanupPendingMutationsQueries(), m.forEach(({ hash: _ }) => {
4903
+ this.notifyOne(_);
5092
4904
  });
5093
4905
  break;
5094
4906
  }
5095
4907
  case "transact-ok": {
5096
- const { "client-event-id": d, "tx-id": y } = n;
5097
- this._inFlightMutationEventIds.delete(d);
5098
- const _ = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations()).get(d);
5099
- if (!_)
4908
+ const { "client-event-id": h, "tx-id": y } = n;
4909
+ this._inFlightMutationEventIds.delete(h);
4910
+ const g = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations()).get(h);
4911
+ if (!g)
5100
4912
  break;
5101
- this._updatePendingMutations((T) => {
5102
- T.set(d, {
5103
- ...T.get(d),
4913
+ this._updatePendingMutations((m) => {
4914
+ m.set(h, {
4915
+ ...m.get(h),
5104
4916
  "tx-id": y,
5105
4917
  confirmed: Date.now()
5106
4918
  });
5107
4919
  });
5108
4920
  const w = [];
5109
- for (const T of _["tx-steps"])
5110
- if (T[0] === "add-attr") {
5111
- const g = T[1];
5112
- w.push(g);
4921
+ for (const m of g["tx-steps"])
4922
+ if (m[0] === "add-attr") {
4923
+ const _ = m[1];
4924
+ w.push(_);
5113
4925
  }
5114
4926
  if (w.length) {
5115
- const T = Object.values(this.ensureAttrs().attrs);
5116
- this._setAttrs([...T, ...w]);
4927
+ const m = Object.values(this.ensureAttrs().attrs);
4928
+ this._setAttrs([...m, ...w]);
5117
4929
  }
5118
- this._finishTransaction("synced", d), this._cleanupPendingMutationsTimeout();
4930
+ this._finishTransaction("synced", h), this._cleanupPendingMutationsTimeout();
5119
4931
  break;
5120
4932
  }
5121
4933
  case "patch-presence": {
5122
- const d = n["room-id"];
5123
- this._trySetRoomConnected(d, !0), this._patchPresencePeers(d, n.edits), this._notifyPresenceSubs(d);
4934
+ const h = n["room-id"];
4935
+ this._trySetRoomConnected(h, !0), this._patchPresencePeers(h, n.edits), this._notifyPresenceSubs(h);
5124
4936
  break;
5125
4937
  }
5126
4938
  case "refresh-presence": {
5127
- const d = n["room-id"];
5128
- this._trySetRoomConnected(d, !0), this._setPresencePeers(d, n.data), this._notifyPresenceSubs(d);
4939
+ const h = n["room-id"];
4940
+ this._trySetRoomConnected(h, !0), this._setPresencePeers(h, n.data), this._notifyPresenceSubs(h);
5129
4941
  break;
5130
4942
  }
5131
4943
  case "server-broadcast": {
5132
- const d = n["room-id"], y = n.topic;
5133
- this._trySetRoomConnected(d, !0), this._notifyBroadcastSubs(d, y, n);
4944
+ const h = n["room-id"], y = n.topic;
4945
+ this._trySetRoomConnected(h, !0), this._notifyBroadcastSubs(h, y, n);
5134
4946
  break;
5135
4947
  }
5136
4948
  case "join-room-ok": {
5137
- const d = n["room-id"];
5138
- if (!this._rooms[d]) {
5139
- this._roomsPendingLeave[d] && (this._tryLeaveRoom(d), delete this._roomsPendingLeave[d]);
4949
+ const h = n["room-id"];
4950
+ if (!this._rooms[h]) {
4951
+ this._roomsPendingLeave[h] && (this._tryLeaveRoom(h), delete this._roomsPendingLeave[h]);
5140
4952
  break;
5141
4953
  }
5142
- this._trySetRoomConnected(d, !0), this._flushEnqueuedRoomData(d);
4954
+ this._trySetRoomConnected(h, !0), this._flushEnqueuedRoomData(h);
5143
4955
  break;
5144
4956
  }
5145
4957
  case "leave-room-ok": {
5146
- const d = n["room-id"];
5147
- this._trySetRoomConnected(d, !1);
4958
+ const h = n["room-id"];
4959
+ this._trySetRoomConnected(h, !1);
5148
4960
  break;
5149
4961
  }
5150
4962
  case "join-room-error":
@@ -5159,13 +4971,6 @@ class Fc {
5159
4971
  break;
5160
4972
  }
5161
4973
  }
5162
- // XXX: I think we need the clientId?
5163
- createWriteStream(e) {
5164
- return this._instantStream.createWriteStream(e);
5165
- }
5166
- createReadStream(e) {
5167
- return this._instantStream.createReadStream(e);
5168
- }
5169
4974
  _pendingMutations() {
5170
4975
  return this.kv.currentValue.pendingMutations ?? /* @__PURE__ */ new Map();
5171
4976
  }
@@ -5192,7 +4997,7 @@ class Fc {
5192
4997
  }
5193
4998
  }
5194
4999
  _handleReceiveError(e) {
5195
- var a, c, u, l, f, d, y;
5000
+ var a, c, u, l, f, h, y;
5196
5001
  console.log("error", e);
5197
5002
  const n = e["client-event-id"];
5198
5003
  this._inFlightMutationEventIds.delete(n);
@@ -5204,8 +5009,8 @@ class Fc {
5204
5009
  return;
5205
5010
  }
5206
5011
  if ((a = e["original-event"]) != null && a.hasOwnProperty("q") && ((c = e["original-event"]) == null ? void 0 : c.op) === "add-query") {
5207
- const b = (u = e["original-event"]) == null ? void 0 : u.q, _ = q(b);
5208
- this.notifyQueryError(q(b), s), this.notifyQueryOnceError(b, _, n, s);
5012
+ const b = (u = e["original-event"]) == null ? void 0 : u.q, g = q(b);
5013
+ this.notifyQueryError(q(b), s), this.notifyQueryOnceError(b, g, n, s);
5209
5014
  return;
5210
5015
  }
5211
5016
  if (((l = e["original-event"]) == null ? void 0 : l.op) === "init") {
@@ -5216,7 +5021,7 @@ class Fc {
5216
5021
  this._setStatus(de.ERRORED, s), this.notifyAll();
5217
5022
  return;
5218
5023
  }
5219
- if (((d = e["original-event"]) == null ? void 0 : d.op) === "resync-table") {
5024
+ if (((h = e["original-event"]) == null ? void 0 : h.op) === "resync-table") {
5220
5025
  this._syncTable.onResyncError(e);
5221
5026
  return;
5222
5027
  }
@@ -5237,7 +5042,7 @@ class Fc {
5237
5042
  this.attrs = new Ee(e.reduce((n, r) => (n[r.id] = r, n), {}), this._linkIndex), this.notifyAttrsSubs();
5238
5043
  }
5239
5044
  _startQuerySub(e, n) {
5240
- const r = L();
5045
+ const r = W();
5241
5046
  return this.querySubs.updateInPlace((s) => {
5242
5047
  s[n] = s[n] || { q: e, result: null, eventId: r }, s[n].lastAccessed = Date.now();
5243
5048
  }), this._trySendAuthed(r, { op: "add-query", q: e }), r;
@@ -5270,7 +5075,7 @@ class Fc {
5270
5075
  if (!this.querySubs)
5271
5076
  return r.reject(new Error("We can't run `queryOnce` on the backend. Use adminAPI.query instead: https://www.instantdb.com/docs/backend#query")), r.promise;
5272
5077
  const s = q(e), i = this._startQuerySub(e, s);
5273
- return this.queryOnceDfds[s] = this.queryOnceDfds[s] ?? [], this.queryOnceDfds[s].push({ q: e, dfd: r, eventId: i }), setTimeout(() => r.reject(new Error("Query timed out")), kc), r.promise;
5078
+ return this.queryOnceDfds[s] = this.queryOnceDfds[s] ?? [], this.queryOnceDfds[s].push({ q: e, dfd: r, eventId: i }), setTimeout(() => r.reject(new Error("Query timed out")), vc), r.promise;
5274
5079
  }
5275
5080
  _completeQueryOnce(e, n, r) {
5276
5081
  this.queryOnceDfds[n] && (this.queryOnceDfds[n] = this.queryOnceDfds[n].filter((s) => s.dfd !== r), this._cleanupQuery(e, n));
@@ -5283,7 +5088,7 @@ class Fc {
5283
5088
  return !!((n = this.queryCbs[e]) != null && n.length || (r = this.queryOnceDfds[e]) != null && r.length);
5284
5089
  }
5285
5090
  _cleanupQuery(e, n) {
5286
- this._hasQueryListeners(n) || (delete this.queryCbs[n], delete this.queryOnceDfds[n], delete this._dataForQueryCache[n], this.querySubs.unloadKey(n), this._trySendAuthed(L(), { op: "remove-query", q: e }));
5091
+ this._hasQueryListeners(n) || (delete this.queryCbs[n], delete this.queryOnceDfds[n], delete this._dataForQueryCache[n], this.querySubs.unloadKey(n), this._trySendAuthed(W(), { op: "remove-query", q: e }));
5287
5092
  }
5288
5093
  // When we `pushTx`, it's possible that we don't yet have `this.attrs`
5289
5094
  // This means that `tx-steps` in `pendingMutations` will include `add-attr`
@@ -5308,27 +5113,27 @@ class Fc {
5308
5113
  if (!n)
5309
5114
  return /* @__PURE__ */ new Map();
5310
5115
  const s = (l) => {
5311
- const [f, d, y] = l["forward-identity"];
5312
- return K(e, d, y);
5116
+ const [f, h, y] = l["forward-identity"];
5117
+ return N(e, h, y);
5313
5118
  }, i = (l) => {
5314
- const [f, d, y] = l["forward-identity"];
5315
- return Ce(e, d, y);
5119
+ const [f, h, y] = l["forward-identity"];
5120
+ return Ce(e, h, y);
5316
5121
  }, o = { attrIdMap: {}, refSwapAttrIds: /* @__PURE__ */ new Set() };
5317
5122
  let a = !1;
5318
5123
  const c = (l, f) => {
5319
- const d = [];
5124
+ const h = [];
5320
5125
  for (const y of l) {
5321
5126
  const [b] = y;
5322
5127
  if (b === "add-attr") {
5323
- const [w, T] = y, g = s(T);
5324
- if (g && T.id !== g.id) {
5325
- o.attrIdMap[T.id] = g.id, a = !0;
5128
+ const [w, m] = y, _ = s(m);
5129
+ if (_ && m.id !== _.id) {
5130
+ o.attrIdMap[m.id] = _.id, a = !0;
5326
5131
  continue;
5327
5132
  }
5328
- if (T["value-type"] === "ref") {
5329
- const S = i(T);
5133
+ if (m["value-type"] === "ref") {
5134
+ const S = i(m);
5330
5135
  if (S) {
5331
- o.attrIdMap[T.id] = S.id, o.refSwapAttrIds.add(T.id), a = !0;
5136
+ o.attrIdMap[m.id] = S.id, o.refSwapAttrIds.add(m.id), a = !0;
5332
5137
  continue;
5333
5138
  }
5334
5139
  }
@@ -5337,10 +5142,10 @@ class Fc {
5337
5142
  a = !0;
5338
5143
  continue;
5339
5144
  }
5340
- const _ = a ? ha(o, y) : y;
5341
- d.push(_);
5145
+ const g = a ? ha(o, y) : y;
5146
+ h.push(g);
5342
5147
  }
5343
- return a ? d : l;
5148
+ return a ? h : l;
5344
5149
  }, u = /* @__PURE__ */ new Map();
5345
5150
  for (const [l, f] of n.entries())
5346
5151
  u.set(l, {
@@ -5389,13 +5194,13 @@ class Fc {
5389
5194
  const l = this._dataForQueryCache[e];
5390
5195
  if (l && s === l.querySubVersion && o === l.pendingMutationsVersion)
5391
5196
  return l;
5392
- let f = u.store, d = u.attrsStore;
5393
- const { pageInfo: y, aggregate: b, processedTxId: _ } = u, w = this._rewriteMutationsSorted(d, a);
5197
+ let f = u.store, h = u.attrsStore;
5198
+ const { pageInfo: y, aggregate: b, processedTxId: g } = u, w = this._rewriteMutationsSorted(h, a);
5394
5199
  if (n) {
5395
- const g = this._applyOptimisticUpdates(f, d, w, _);
5396
- f = g.store, d = g.attrsStore;
5200
+ const _ = this._applyOptimisticUpdates(f, h, w, g);
5201
+ f = _.store, h = _.attrsStore;
5397
5202
  }
5398
- return { data: Cs({ store: f, attrsStore: d, pageInfo: y, aggregate: b }, c), querySubVersion: s, pendingMutationsVersion: o };
5203
+ return { data: Cs({ store: f, attrsStore: h, pageInfo: y, aggregate: b }, c), querySubVersion: s, pendingMutationsVersion: o };
5399
5204
  }
5400
5205
  _applyOptimisticUpdates(e, n, r, s) {
5401
5206
  for (const [i, o] of r)
@@ -5515,7 +5320,7 @@ class Fc {
5515
5320
  return;
5516
5321
  }
5517
5322
  const e = this._transport;
5518
- this._transport = Rc({
5323
+ this._transport = Cc({
5519
5324
  transportType: this._transportType,
5520
5325
  appId: this.config.appId,
5521
5326
  apiURI: this.config.apiURI,
@@ -5538,7 +5343,7 @@ class Fc {
5538
5343
  const r = await this.kv.waitForKeyToLoad(n);
5539
5344
  if (r)
5540
5345
  return r;
5541
- const s = L();
5346
+ const s = W();
5542
5347
  return this.kv.updateInPlace((i) => {
5543
5348
  i[n] || (i[n] = s);
5544
5349
  }), await this.kv.waitForKeyToLoad(n);
@@ -5585,7 +5390,7 @@ class Fc {
5585
5390
  return null;
5586
5391
  this._replaceUrlAfterOAuth();
5587
5392
  try {
5588
- const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await Rr({
5393
+ const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await jr({
5589
5394
  apiURI: this.config.apiURI,
5590
5395
  appId: this.config.appId,
5591
5396
  code: r,
@@ -5610,7 +5415,7 @@ class Fc {
5610
5415
  n.isLoading || e(this._currentUserCached);
5611
5416
  let r = !1;
5612
5417
  return this.getCurrentUser().then((s) => {
5613
- r || Tt(s, n) || e(s);
5418
+ r || mt(s, n) || e(s);
5614
5419
  }), () => {
5615
5420
  r = !0, this.authCbs = this.authCbs.filter((s) => s !== e);
5616
5421
  };
@@ -5685,7 +5490,7 @@ class Fc {
5685
5490
  async changeCurrentUser(e) {
5686
5491
  var r;
5687
5492
  const { user: n } = await this.getCurrentUser();
5688
- if (!Tt(n, e)) {
5493
+ if (!mt(n, e)) {
5689
5494
  await this.setCurrentUser(e), this.updateUser(e);
5690
5495
  try {
5691
5496
  (r = this._broadcastChannel) == null || r.postMessage({ type: "auth" });
@@ -5795,7 +5600,7 @@ class Fc {
5795
5600
  */
5796
5601
  async exchangeCodeForToken({ code: e, codeVerifier: n }) {
5797
5602
  var o;
5798
- const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await Rr({
5603
+ const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await jr({
5799
5604
  apiURI: this.config.apiURI,
5800
5605
  appId: this.config.appId,
5801
5606
  code: e,
@@ -5875,17 +5680,17 @@ class Fc {
5875
5680
  i.result.user = o, s.isConnected && (this._trySetPresence(n, o), this._notifyPresenceSubs(n));
5876
5681
  }
5877
5682
  _trySetPresence(e, n) {
5878
- this._trySendAuthed(L(), {
5683
+ this._trySendAuthed(W(), {
5879
5684
  op: "set-presence",
5880
5685
  "room-id": e,
5881
5686
  data: n
5882
5687
  });
5883
5688
  }
5884
5689
  _tryJoinRoom(e, n) {
5885
- this._trySendAuthed(L(), { op: "join-room", "room-id": e, data: n }), delete this._roomsPendingLeave[e];
5690
+ this._trySendAuthed(W(), { op: "join-room", "room-id": e, data: n }), delete this._roomsPendingLeave[e];
5886
5691
  }
5887
5692
  _tryLeaveRoom(e) {
5888
- this._trySendAuthed(L(), { op: "leave-room", "room-id": e });
5693
+ this._trySendAuthed(W(), { op: "leave-room", "room-id": e });
5889
5694
  }
5890
5695
  _trySetRoomConnected(e, n) {
5891
5696
  const r = this._rooms[e];
@@ -5921,13 +5726,13 @@ class Fc {
5921
5726
  let s = Object.fromEntries(Object.entries(r).map(([u, l]) => [u, { data: l }]));
5922
5727
  (c = this._presence[e]) == null || c.result;
5923
5728
  const i = Ct(s, (u) => {
5924
- for (let [l, f, d] of n)
5729
+ for (let [l, f, h] of n)
5925
5730
  switch (f) {
5926
5731
  case "+":
5927
- xi(u, l, d);
5732
+ xi(u, l, h);
5928
5733
  break;
5929
5734
  case "r":
5930
- wr(u, l, d);
5735
+ wr(u, l, h);
5931
5736
  break;
5932
5737
  case "-":
5933
5738
  ds(u, l);
@@ -5958,7 +5763,7 @@ class Fc {
5958
5763
  }
5959
5764
  }
5960
5765
  _tryBroadcast(e, n, r, s) {
5961
- this._trySendAuthed(L(), {
5766
+ this._trySendAuthed(W(), {
5962
5767
  op: "client-broadcast",
5963
5768
  "room-id": e,
5964
5769
  roomType: n,
@@ -5975,8 +5780,8 @@ class Fc {
5975
5780
  _notifyBroadcastSubs(e, n, r) {
5976
5781
  var s, i, o;
5977
5782
  (o = (i = (s = this._broadcastSubs) == null ? void 0 : s[e]) == null ? void 0 : i[n]) == null || o.forEach((a) => {
5978
- var l, f, d, y, b, _;
5979
- const c = (l = r.data) == null ? void 0 : l.data, u = r.data["peer-id"] === this._sessionId ? (d = (f = this._presence[e]) == null ? void 0 : f.result) == null ? void 0 : d.user : (_ = (b = (y = this._presence[e]) == null ? void 0 : y.result) == null ? void 0 : b.peers) == null ? void 0 : _[r.data["peer-id"]];
5783
+ var l, f, h, y, b, g;
5784
+ const c = (l = r.data) == null ? void 0 : l.data, u = r.data["peer-id"] === this._sessionId ? (h = (f = this._presence[e]) == null ? void 0 : f.result) == null ? void 0 : h.user : (g = (b = (y = this._presence[e]) == null ? void 0 : y.result) == null ? void 0 : b.peers) == null ? void 0 : g[r.data["peer-id"]];
5980
5785
  return a(c, u);
5981
5786
  });
5982
5787
  }
@@ -6027,9 +5832,9 @@ class Fc {
6027
5832
  });
6028
5833
  }
6029
5834
  }
6030
- function Nc(t, e) {
5835
+ function Dc(t, e) {
6031
5836
  return new Dt(
6032
- Ws(t, e),
5837
+ qs(t, e),
6033
5838
  // (XXX): LinksDef<any> stems from TypeScript’s inability to reconcile the
6034
5839
  // type EntitiesWithLinks<EntitiesWithoutLinks, Links> with
6035
5840
  // EntitiesWithoutLinks. TypeScript is strict about ensuring that types are
@@ -6039,28 +5844,28 @@ function Nc(t, e) {
6039
5844
  void 0
6040
5845
  );
6041
5846
  }
6042
- function Kc(t) {
5847
+ function Uc(t) {
6043
5848
  return new $t(t, {});
6044
5849
  }
6045
- function Wc() {
5850
+ function Lc() {
6046
5851
  return new H("string", !0, !1);
6047
5852
  }
6048
- function qc() {
5853
+ function Fc() {
6049
5854
  return new H("number", !0, !1);
6050
5855
  }
6051
- function zc() {
5856
+ function Nc() {
6052
5857
  return new H("boolean", !0, !1);
6053
5858
  }
6054
- function Vc() {
5859
+ function Kc() {
6055
5860
  return new H("date", !0, !1);
6056
5861
  }
6057
- function Bc() {
5862
+ function qc() {
6058
5863
  return new H("json", !0, !1);
6059
5864
  }
6060
- function Gc() {
5865
+ function Wc() {
6061
5866
  return new H("json", !0, !1);
6062
5867
  }
6063
- function Ws(t, e) {
5868
+ function qs(t, e) {
6064
5869
  var s, i, o, a;
6065
5870
  const n = { fwd: {}, rev: {} };
6066
5871
  for (const c of Object.values(e))
@@ -6079,10 +5884,10 @@ function Ws(t, e) {
6079
5884
  })
6080
5885
  ]));
6081
5886
  }
6082
- function Qc({ entities: t, links: e, rooms: n }) {
5887
+ function zc({ entities: t, links: e, rooms: n }) {
6083
5888
  const r = e ?? {}, s = n ?? {};
6084
5889
  return new Dt(
6085
- Ws(t, r),
5890
+ qs(t, r),
6086
5891
  // (XXX): LinksDef<any> stems from TypeScript's inability to reconcile the
6087
5892
  // type EntitiesWithLinks<EntitiesWithoutLinks, Links> with
6088
5893
  // EntitiesWithoutLinks. TypeScript is strict about ensuring that types are
@@ -6092,30 +5897,30 @@ function Qc({ entities: t, links: e, rooms: n }) {
6092
5897
  s
6093
5898
  );
6094
5899
  }
6095
- const Lu = {
5900
+ const xu = {
6096
5901
  // constructs
6097
- graph: Nc,
6098
- schema: Qc,
6099
- entity: Kc,
5902
+ graph: Dc,
5903
+ schema: zc,
5904
+ entity: Uc,
6100
5905
  // value types
6101
- string: Wc,
6102
- number: qc,
6103
- boolean: zc,
6104
- date: Vc,
6105
- json: Bc,
6106
- any: Gc
5906
+ string: Lc,
5907
+ number: Fc,
5908
+ boolean: Nc,
5909
+ date: Kc,
5910
+ json: qc,
5911
+ any: Wc
6107
5912
  };
6108
- let _t;
6109
- function Hc(t, e) {
6110
- _t == null || _t.dispose();
6111
- const n = tu(e), r = Zc(e, a), s = Yc(Jc(t));
5913
+ let gt;
5914
+ function Vc(t, e) {
5915
+ gt == null || gt.dispose();
5916
+ const n = Yc(e), r = Qc(e, a), s = Gc(Bc(t));
6112
5917
  function i(l) {
6113
5918
  var f;
6114
5919
  l.source === s.element.contentWindow && ((f = l.data) == null ? void 0 : f.type) === "close" && n.isVisible() && a();
6115
5920
  }
6116
5921
  function o(l) {
6117
- const f = l.shiftKey && l.ctrlKey && l.key === "0", d = l.key === "Escape" || l.key === "Esc";
6118
- (f || d && n.isVisible()) && a();
5922
+ const f = l.shiftKey && l.ctrlKey && l.key === "0", h = l.key === "Escape" || l.key === "Esc";
5923
+ (f || h && n.isVisible()) && a();
6119
5924
  }
6120
5925
  function a() {
6121
5926
  n.isVisible() ? n.element.style.display = "none" : (n.element.style.display = "block", n.element.contains(s.element) || n.element.appendChild(s.element));
@@ -6124,16 +5929,16 @@ function Hc(t, e) {
6124
5929
  n.element.remove(), r.element.remove(), removeEventListener("keydown", o), removeEventListener("message", i);
6125
5930
  }
6126
5931
  function u() {
6127
- document.body.appendChild(n.element), document.body.appendChild(r.element), addEventListener("keydown", o), addEventListener("message", i), _t = {
5932
+ document.body.appendChild(n.element), document.body.appendChild(r.element), addEventListener("keydown", o), addEventListener("message", i), gt = {
6128
5933
  dispose: c
6129
5934
  };
6130
5935
  }
6131
5936
  return u();
6132
5937
  }
6133
- function Jc(t) {
6134
- return `${Wn || xs ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
5938
+ function Bc(t) {
5939
+ return `${qn || xs ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
6135
5940
  }
6136
- function Yc(t) {
5941
+ function Gc(t) {
6137
5942
  const e = document.createElement("iframe");
6138
5943
  return e.src = t, e.className = "instant-devtool-iframe", Object.assign(e.style, {
6139
5944
  width: "100%",
@@ -6142,7 +5947,7 @@ function Yc(t) {
6142
5947
  border: "none"
6143
5948
  }), { element: e };
6144
5949
  }
6145
- function Zc(t, e) {
5950
+ function Qc(t, e) {
6146
5951
  const n = `
6147
5952
  <svg width="32" height="32" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
6148
5953
  <rect width="512" height="512" fill="black"/>
@@ -6152,7 +5957,7 @@ function Zc(t, e) {
6152
5957
  return r.innerHTML = n, r.className = "instant-devtool-toggler", Object.assign(r.style, {
6153
5958
  // pos
6154
5959
  position: "fixed",
6155
- ...Xc(t.position),
5960
+ ...Hc(t.position),
6156
5961
  height: "32px",
6157
5962
  width: "32px",
6158
5963
  // layout
@@ -6167,7 +5972,7 @@ function Zc(t, e) {
6167
5972
  cursor: "pointer"
6168
5973
  }), r.addEventListener("click", e), { element: r };
6169
5974
  }
6170
- function Xc(t) {
5975
+ function Hc(t) {
6171
5976
  switch (t) {
6172
5977
  case "bottom-left":
6173
5978
  return { bottom: "24px", left: "24px" };
@@ -6179,7 +5984,7 @@ function Xc(t) {
6179
5984
  return { top: "24px", left: "24px" };
6180
5985
  }
6181
5986
  }
6182
- function eu(t) {
5987
+ function Jc(t) {
6183
5988
  switch (t) {
6184
5989
  case "bottom-left":
6185
5990
  return { bottom: "24px", right: "24px", left: "60px", top: "72px" };
@@ -6191,11 +5996,11 @@ function eu(t) {
6191
5996
  return { top: "24px", right: "24px", left: "60px", bottom: "72px" };
6192
5997
  }
6193
5998
  }
6194
- function tu(t) {
5999
+ function Yc(t) {
6195
6000
  const e = document.createElement("div");
6196
6001
  Object.assign(e.style, {
6197
6002
  position: "fixed",
6198
- ...eu(t.position),
6003
+ ...Jc(t.position),
6199
6004
  display: "block",
6200
6005
  borderRadius: "4px",
6201
6006
  border: "1px #ccc solid",
@@ -6208,7 +6013,7 @@ function tu(t) {
6208
6013
  }
6209
6014
  return { element: e, isVisible: n };
6210
6015
  }
6211
- function nu(t, e) {
6016
+ function Zc(t, e) {
6212
6017
  return e && e.refresh_token ? new Response(JSON.stringify({ ok: !0 }), {
6213
6018
  headers: {
6214
6019
  "Content-Type": "application/json",
@@ -6223,47 +6028,47 @@ function nu(t, e) {
6223
6028
  }
6224
6029
  });
6225
6030
  }
6226
- function gt(t, e) {
6031
+ function _t(t, e) {
6227
6032
  return new Response(JSON.stringify({ ok: !1, error: e }), {
6228
6033
  status: t,
6229
6034
  headers: { "Content-Type": "application/json" }
6230
6035
  });
6231
6036
  }
6232
- const Fu = (t) => ({
6037
+ const $u = (t) => ({
6233
6038
  POST: async (e) => {
6234
6039
  let n;
6235
6040
  try {
6236
6041
  n = await e.json();
6237
6042
  } catch {
6238
- return gt(400, "Invalid JSON body");
6043
+ return _t(400, "Invalid JSON body");
6239
6044
  }
6240
6045
  if (!n.type)
6241
- return gt(400, 'Missing "type" field');
6046
+ return _t(400, 'Missing "type" field');
6242
6047
  if (n.appId !== t.appId)
6243
- return gt(403, "App ID mismatch");
6048
+ return _t(403, "App ID mismatch");
6244
6049
  switch (n.type) {
6245
6050
  case "sync-user":
6246
- return nu(t, n.user ?? null);
6051
+ return Zc(t, n.user ?? null);
6247
6052
  default:
6248
- return gt(400, `Unknown type: ${n.type}`);
6053
+ return _t(400, `Unknown type: ${n.type}`);
6249
6054
  }
6250
6055
  }
6251
- }), ru = {
6056
+ }), Xc = {
6252
6057
  apiURI: "https://api.instantdb.com",
6253
6058
  websocketURI: "wss://api.instantdb.com/runtime/session"
6254
6059
  };
6255
- function su() {
6060
+ function eu() {
6256
6061
  return globalThis.__instantDbSchemaHashStore = globalThis.__instantDbSchemaHashStore ?? /* @__PURE__ */ new WeakMap(), globalThis.__instantDbSchemaHashStore;
6257
6062
  }
6258
- function iu() {
6063
+ function tu() {
6259
6064
  return globalThis.__instantDbStore = globalThis.__instantDbStore ?? {}, globalThis.__instantDbStore;
6260
6065
  }
6261
6066
  function wn(t) {
6262
6067
  const e = t.__adminToken;
6263
6068
  return t.appId + "_" + (t.websocketURI || "default_ws_uri") + "_" + (t.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + t.useDateObjects;
6264
6069
  }
6265
- const mn = iu(), Vr = su();
6266
- class ou {
6070
+ const Tn = tu(), Vr = eu();
6071
+ class nu {
6267
6072
  constructor(e) {
6268
6073
  p(this, "db");
6269
6074
  /**
@@ -6380,7 +6185,7 @@ class ou {
6380
6185
  this.db = e;
6381
6186
  }
6382
6187
  }
6383
- class au {
6188
+ class ru {
6384
6189
  constructor(e) {
6385
6190
  p(this, "db");
6386
6191
  /**
@@ -6429,16 +6234,16 @@ class au {
6429
6234
  this.db = e;
6430
6235
  }
6431
6236
  }
6432
- function cu(t) {
6237
+ function su(t) {
6433
6238
  return JSON.parse(JSON.stringify(t));
6434
6239
  }
6435
- class uu {
6240
+ class iu {
6436
6241
  constructor(e) {
6437
6242
  p(this, "_reactor");
6438
6243
  p(this, "auth");
6439
6244
  p(this, "storage");
6440
6245
  p(this, "tx", Kn());
6441
- this._reactor = e, this.auth = new ou(this._reactor), this.storage = new au(this._reactor);
6246
+ this._reactor = e, this.auth = new nu(this._reactor), this.storage = new ru(this._reactor);
6442
6247
  }
6443
6248
  /**
6444
6249
  * Use this to write data! You can create, update, delete, and link objects
@@ -6579,7 +6384,7 @@ class uu {
6579
6384
  };
6580
6385
  }
6581
6386
  shutdown() {
6582
- delete mn[wn(this._reactor.config)], this._reactor.shutdown();
6387
+ delete Tn[wn(this._reactor.config)], this._reactor.shutdown();
6583
6388
  }
6584
6389
  /**
6585
6390
  * Use this for one-off queries.
@@ -6621,26 +6426,26 @@ function Br(t) {
6621
6426
  const n = q(t);
6622
6427
  return Vr.set(t, n), n;
6623
6428
  }
6624
- function lu(t, e) {
6429
+ function ou(t, e) {
6625
6430
  return Br(t._reactor.config.schema) !== Br(e);
6626
6431
  }
6627
- function fu(t, e, n, r, s) {
6432
+ function au(t, e, n, r, s) {
6628
6433
  var u;
6629
6434
  const i = {
6630
6435
  ...t,
6631
6436
  appId: (u = t.appId) == null ? void 0 : u.trim(),
6632
6437
  useDateObjects: t.useDateObjects ?? !1
6633
- }, o = mn[wn(i)];
6438
+ }, o = Tn[wn(i)];
6634
6439
  if (o)
6635
- return lu(o, i.schema) && o._reactor.updateSchema(i.schema), o;
6636
- const a = new Fc({
6637
- ...ru,
6440
+ return ou(o, i.schema) && o._reactor.updateSchema(i.schema), o;
6441
+ const a = new $c({
6442
+ ...Xc,
6638
6443
  ...i,
6639
6444
  cardinalityInference: !!i.schema
6640
- }, e || Ms, n || Rs, { ...r || {}, "@instantdb/core": qn }, s), c = new uu(a);
6641
- return mn[wn(i)] = c, du(i.appId, i.devtool), c;
6445
+ }, e || Ms, n || js, { ...r || {}, "@instantdb/core": Wn }, s), c = new iu(a);
6446
+ return Tn[wn(i)] = c, cu(i.appId, i.devtool), c;
6642
6447
  }
6643
- function du(t, e) {
6448
+ function cu(t, e) {
6644
6449
  if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
6645
6450
  return;
6646
6451
  const n = {
@@ -6648,9 +6453,9 @@ function du(t, e) {
6648
6453
  allowedHosts: ["localhost"],
6649
6454
  ...typeof e == "object" ? e : {}
6650
6455
  };
6651
- n.allowedHosts.includes(window.location.hostname) && Hc(t, n);
6456
+ n.allowedHosts.includes(window.location.hostname) && Vc(t, n);
6652
6457
  }
6653
- var Tn = { exports: {} }, Be = {};
6458
+ var mn = { exports: {} }, Be = {};
6654
6459
  /**
6655
6460
  * @license React
6656
6461
  * react-jsx-runtime.production.min.js
@@ -6661,21 +6466,21 @@ var Tn = { exports: {} }, Be = {};
6661
6466
  * LICENSE file in the root directory of this source tree.
6662
6467
  */
6663
6468
  var Gr;
6664
- function hu() {
6469
+ function uu() {
6665
6470
  if (Gr) return Be;
6666
6471
  Gr = 1;
6667
6472
  var t = ts, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
6668
6473
  function o(a, c, u) {
6669
- var l, f = {}, d = null, y = null;
6670
- u !== void 0 && (d = "" + u), c.key !== void 0 && (d = "" + c.key), c.ref !== void 0 && (y = c.ref);
6474
+ var l, f = {}, h = null, y = null;
6475
+ u !== void 0 && (h = "" + u), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (y = c.ref);
6671
6476
  for (l in c) r.call(c, l) && !i.hasOwnProperty(l) && (f[l] = c[l]);
6672
6477
  if (a && a.defaultProps) for (l in c = a.defaultProps, c) f[l] === void 0 && (f[l] = c[l]);
6673
- return { $$typeof: e, type: a, key: d, ref: y, props: f, _owner: s.current };
6478
+ return { $$typeof: e, type: a, key: h, ref: y, props: f, _owner: s.current };
6674
6479
  }
6675
6480
  return Be.Fragment = n, Be.jsx = o, Be.jsxs = o, Be;
6676
6481
  }
6677
6482
  var Ge = {}, Qr;
6678
- function pu() {
6483
+ function lu() {
6679
6484
  if (Qr) return Ge;
6680
6485
  Qr = 1;
6681
6486
  var t = {};
@@ -6689,58 +6494,58 @@ function pu() {
6689
6494
  * LICENSE file in the root directory of this source tree.
6690
6495
  */
6691
6496
  return t.NODE_ENV !== "production" && function() {
6692
- var e = ts, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), _ = Symbol.iterator, w = "@@iterator";
6693
- function T(h) {
6694
- if (h === null || typeof h != "object")
6497
+ var e = ts, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), g = Symbol.iterator, w = "@@iterator";
6498
+ function m(d) {
6499
+ if (d === null || typeof d != "object")
6695
6500
  return null;
6696
- var m = _ && h[_] || h[w];
6697
- return typeof m == "function" ? m : null;
6501
+ var T = g && d[g] || d[w];
6502
+ return typeof T == "function" ? T : null;
6698
6503
  }
6699
- var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
6700
- function S(h) {
6504
+ var _ = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
6505
+ function S(d) {
6701
6506
  {
6702
- for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), A = 1; A < m; A++)
6507
+ for (var T = arguments.length, v = new Array(T > 1 ? T - 1 : 0), A = 1; A < T; A++)
6703
6508
  v[A - 1] = arguments[A];
6704
- O("error", h, v);
6509
+ O("error", d, v);
6705
6510
  }
6706
6511
  }
6707
- function O(h, m, v) {
6512
+ function O(d, T, v) {
6708
6513
  {
6709
- var A = g.ReactDebugCurrentFrame, M = A.getStackAddendum();
6710
- M !== "" && (m += "%s", v = v.concat([M]));
6711
- var j = v.map(function(P) {
6712
- return String(P);
6514
+ var A = _.ReactDebugCurrentFrame, M = A.getStackAddendum();
6515
+ M !== "" && (T += "%s", v = v.concat([M]));
6516
+ var R = v.map(function(I) {
6517
+ return String(I);
6713
6518
  });
6714
- j.unshift("Warning: " + m), Function.prototype.apply.call(console[h], console, j);
6519
+ R.unshift("Warning: " + T), Function.prototype.apply.call(console[d], console, R);
6715
6520
  }
6716
6521
  }
6717
- var E = !1, R = !1, F = !1, B = !1, We = !1, ut;
6522
+ var E = !1, j = !1, L = !1, B = !1, qe = !1, ut;
6718
6523
  ut = Symbol.for("react.module.reference");
6719
- function Ut(h) {
6720
- return !!(typeof h == "string" || typeof h == "function" || h === s || h === o || We || h === i || h === l || h === f || B || h === b || E || R || F || typeof h == "object" && h !== null && (h.$$typeof === y || h.$$typeof === d || h.$$typeof === a || h.$$typeof === c || h.$$typeof === u || // This needs to include all possible module reference object
6524
+ function Ut(d) {
6525
+ return !!(typeof d == "string" || typeof d == "function" || d === s || d === o || qe || d === i || d === l || d === f || B || d === b || E || j || L || typeof d == "object" && d !== null && (d.$$typeof === y || d.$$typeof === h || d.$$typeof === a || d.$$typeof === c || d.$$typeof === u || // This needs to include all possible module reference object
6721
6526
  // types supported by any Flight configuration anywhere since
6722
6527
  // we don't know which Flight build this will end up being used
6723
6528
  // with.
6724
- h.$$typeof === ut || h.getModuleId !== void 0));
6529
+ d.$$typeof === ut || d.getModuleId !== void 0));
6725
6530
  }
6726
- function Lt(h, m, v) {
6727
- var A = h.displayName;
6531
+ function Lt(d, T, v) {
6532
+ var A = d.displayName;
6728
6533
  if (A)
6729
6534
  return A;
6730
- var M = m.displayName || m.name || "";
6535
+ var M = T.displayName || T.name || "";
6731
6536
  return M !== "" ? v + "(" + M + ")" : v;
6732
6537
  }
6733
- function qe(h) {
6734
- return h.displayName || "Context";
6538
+ function We(d) {
6539
+ return d.displayName || "Context";
6735
6540
  }
6736
- function ie(h) {
6737
- if (h == null)
6541
+ function ie(d) {
6542
+ if (d == null)
6738
6543
  return null;
6739
- if (typeof h.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof h == "function")
6740
- return h.displayName || h.name || null;
6741
- if (typeof h == "string")
6742
- return h;
6743
- switch (h) {
6544
+ if (typeof d.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof d == "function")
6545
+ return d.displayName || d.name || null;
6546
+ if (typeof d == "string")
6547
+ return d;
6548
+ switch (d) {
6744
6549
  case s:
6745
6550
  return "Fragment";
6746
6551
  case r:
@@ -6754,23 +6559,23 @@ function pu() {
6754
6559
  case f:
6755
6560
  return "SuspenseList";
6756
6561
  }
6757
- if (typeof h == "object")
6758
- switch (h.$$typeof) {
6562
+ if (typeof d == "object")
6563
+ switch (d.$$typeof) {
6759
6564
  case c:
6760
- var m = h;
6761
- return qe(m) + ".Consumer";
6565
+ var T = d;
6566
+ return We(T) + ".Consumer";
6762
6567
  case a:
6763
- var v = h;
6764
- return qe(v._context) + ".Provider";
6568
+ var v = d;
6569
+ return We(v._context) + ".Provider";
6765
6570
  case u:
6766
- return Lt(h, h.render, "ForwardRef");
6767
- case d:
6768
- var A = h.displayName || null;
6769
- return A !== null ? A : ie(h.type) || "Memo";
6571
+ return Lt(d, d.render, "ForwardRef");
6572
+ case h:
6573
+ var A = d.displayName || null;
6574
+ return A !== null ? A : ie(d.type) || "Memo";
6770
6575
  case y: {
6771
- var M = h, j = M._payload, P = M._init;
6576
+ var M = d, R = M._payload, I = M._init;
6772
6577
  try {
6773
- return ie(P(j));
6578
+ return ie(I(R));
6774
6579
  } catch {
6775
6580
  return null;
6776
6581
  }
@@ -6786,20 +6591,20 @@ function pu() {
6786
6591
  {
6787
6592
  if (be === 0) {
6788
6593
  Vn = console.log, Bn = console.info, Gn = console.warn, Qn = console.error, Hn = console.group, Jn = console.groupCollapsed, Yn = console.groupEnd;
6789
- var h = {
6594
+ var d = {
6790
6595
  configurable: !0,
6791
6596
  enumerable: !0,
6792
6597
  value: Zn,
6793
6598
  writable: !0
6794
6599
  };
6795
6600
  Object.defineProperties(console, {
6796
- info: h,
6797
- log: h,
6798
- warn: h,
6799
- error: h,
6800
- group: h,
6801
- groupCollapsed: h,
6802
- groupEnd: h
6601
+ info: d,
6602
+ log: d,
6603
+ warn: d,
6604
+ error: d,
6605
+ group: d,
6606
+ groupCollapsed: d,
6607
+ groupEnd: d
6803
6608
  });
6804
6609
  }
6805
6610
  be++;
@@ -6808,31 +6613,31 @@ function pu() {
6808
6613
  function Bs() {
6809
6614
  {
6810
6615
  if (be--, be === 0) {
6811
- var h = {
6616
+ var d = {
6812
6617
  configurable: !0,
6813
6618
  enumerable: !0,
6814
6619
  writable: !0
6815
6620
  };
6816
6621
  Object.defineProperties(console, {
6817
- log: le({}, h, {
6622
+ log: le({}, d, {
6818
6623
  value: Vn
6819
6624
  }),
6820
- info: le({}, h, {
6625
+ info: le({}, d, {
6821
6626
  value: Bn
6822
6627
  }),
6823
- warn: le({}, h, {
6628
+ warn: le({}, d, {
6824
6629
  value: Gn
6825
6630
  }),
6826
- error: le({}, h, {
6631
+ error: le({}, d, {
6827
6632
  value: Qn
6828
6633
  }),
6829
- group: le({}, h, {
6634
+ group: le({}, d, {
6830
6635
  value: Hn
6831
6636
  }),
6832
- groupCollapsed: le({}, h, {
6637
+ groupCollapsed: le({}, d, {
6833
6638
  value: Jn
6834
6639
  }),
6835
- groupEnd: le({}, h, {
6640
+ groupEnd: le({}, d, {
6836
6641
  value: Yn
6837
6642
  })
6838
6643
  });
@@ -6840,8 +6645,8 @@ function pu() {
6840
6645
  be < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
6841
6646
  }
6842
6647
  }
6843
- var Ft = g.ReactCurrentDispatcher, Nt;
6844
- function lt(h, m, v) {
6648
+ var Ft = _.ReactCurrentDispatcher, Nt;
6649
+ function lt(d, T, v) {
6845
6650
  {
6846
6651
  if (Nt === void 0)
6847
6652
  try {
@@ -6851,7 +6656,7 @@ function pu() {
6851
6656
  Nt = A && A[1] || "";
6852
6657
  }
6853
6658
  return `
6854
- ` + Nt + h;
6659
+ ` + Nt + d;
6855
6660
  }
6856
6661
  }
6857
6662
  var Kt = !1, ft;
@@ -6859,11 +6664,11 @@ function pu() {
6859
6664
  var Gs = typeof WeakMap == "function" ? WeakMap : Map;
6860
6665
  ft = new Gs();
6861
6666
  }
6862
- function Xn(h, m) {
6863
- if (!h || Kt)
6667
+ function Xn(d, T) {
6668
+ if (!d || Kt)
6864
6669
  return "";
6865
6670
  {
6866
- var v = ft.get(h);
6671
+ var v = ft.get(d);
6867
6672
  if (v !== void 0)
6868
6673
  return v;
6869
6674
  }
@@ -6871,31 +6676,31 @@ function pu() {
6871
6676
  Kt = !0;
6872
6677
  var M = Error.prepareStackTrace;
6873
6678
  Error.prepareStackTrace = void 0;
6874
- var j;
6875
- j = Ft.current, Ft.current = null, Vs();
6679
+ var R;
6680
+ R = Ft.current, Ft.current = null, Vs();
6876
6681
  try {
6877
- if (m) {
6878
- var P = function() {
6682
+ if (T) {
6683
+ var I = function() {
6879
6684
  throw Error();
6880
6685
  };
6881
- if (Object.defineProperty(P.prototype, "props", {
6686
+ if (Object.defineProperty(I.prototype, "props", {
6882
6687
  set: function() {
6883
6688
  throw Error();
6884
6689
  }
6885
6690
  }), typeof Reflect == "object" && Reflect.construct) {
6886
6691
  try {
6887
- Reflect.construct(P, []);
6692
+ Reflect.construct(I, []);
6888
6693
  } catch (J) {
6889
6694
  A = J;
6890
6695
  }
6891
- Reflect.construct(h, [], P);
6696
+ Reflect.construct(d, [], I);
6892
6697
  } else {
6893
6698
  try {
6894
- P.call();
6699
+ I.call();
6895
6700
  } catch (J) {
6896
6701
  A = J;
6897
6702
  }
6898
- h.call(P.prototype);
6703
+ d.call(I.prototype);
6899
6704
  }
6900
6705
  } else {
6901
6706
  try {
@@ -6903,178 +6708,178 @@ function pu() {
6903
6708
  } catch (J) {
6904
6709
  A = J;
6905
6710
  }
6906
- h();
6711
+ d();
6907
6712
  }
6908
6713
  } catch (J) {
6909
6714
  if (J && A && typeof J.stack == "string") {
6910
6715
  for (var C = J.stack.split(`
6911
6716
  `), G = A.stack.split(`
6912
- `), D = C.length - 1, N = G.length - 1; D >= 1 && N >= 0 && C[D] !== G[N]; )
6913
- N--;
6914
- for (; D >= 1 && N >= 0; D--, N--)
6915
- if (C[D] !== G[N]) {
6916
- if (D !== 1 || N !== 1)
6717
+ `), D = C.length - 1, F = G.length - 1; D >= 1 && F >= 0 && C[D] !== G[F]; )
6718
+ F--;
6719
+ for (; D >= 1 && F >= 0; D--, F--)
6720
+ if (C[D] !== G[F]) {
6721
+ if (D !== 1 || F !== 1)
6917
6722
  do
6918
- if (D--, N--, N < 0 || C[D] !== G[N]) {
6723
+ if (D--, F--, F < 0 || C[D] !== G[F]) {
6919
6724
  var re = `
6920
6725
  ` + C[D].replace(" at new ", " at ");
6921
- return h.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", h.displayName)), typeof h == "function" && ft.set(h, re), re;
6726
+ return d.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", d.displayName)), typeof d == "function" && ft.set(d, re), re;
6922
6727
  }
6923
- while (D >= 1 && N >= 0);
6728
+ while (D >= 1 && F >= 0);
6924
6729
  break;
6925
6730
  }
6926
6731
  }
6927
6732
  } finally {
6928
- Kt = !1, Ft.current = j, Bs(), Error.prepareStackTrace = M;
6733
+ Kt = !1, Ft.current = R, Bs(), Error.prepareStackTrace = M;
6929
6734
  }
6930
- var Pe = h ? h.displayName || h.name : "", we = Pe ? lt(Pe) : "";
6931
- return typeof h == "function" && ft.set(h, we), we;
6735
+ var Ie = d ? d.displayName || d.name : "", we = Ie ? lt(Ie) : "";
6736
+ return typeof d == "function" && ft.set(d, we), we;
6932
6737
  }
6933
- function Qs(h, m, v) {
6934
- return Xn(h, !1);
6738
+ function Qs(d, T, v) {
6739
+ return Xn(d, !1);
6935
6740
  }
6936
- function Hs(h) {
6937
- var m = h.prototype;
6938
- return !!(m && m.isReactComponent);
6741
+ function Hs(d) {
6742
+ var T = d.prototype;
6743
+ return !!(T && T.isReactComponent);
6939
6744
  }
6940
- function dt(h, m, v) {
6941
- if (h == null)
6745
+ function dt(d, T, v) {
6746
+ if (d == null)
6942
6747
  return "";
6943
- if (typeof h == "function")
6944
- return Xn(h, Hs(h));
6945
- if (typeof h == "string")
6946
- return lt(h);
6947
- switch (h) {
6748
+ if (typeof d == "function")
6749
+ return Xn(d, Hs(d));
6750
+ if (typeof d == "string")
6751
+ return lt(d);
6752
+ switch (d) {
6948
6753
  case l:
6949
6754
  return lt("Suspense");
6950
6755
  case f:
6951
6756
  return lt("SuspenseList");
6952
6757
  }
6953
- if (typeof h == "object")
6954
- switch (h.$$typeof) {
6758
+ if (typeof d == "object")
6759
+ switch (d.$$typeof) {
6955
6760
  case u:
6956
- return Qs(h.render);
6957
- case d:
6958
- return dt(h.type, m, v);
6761
+ return Qs(d.render);
6762
+ case h:
6763
+ return dt(d.type, T, v);
6959
6764
  case y: {
6960
- var A = h, M = A._payload, j = A._init;
6765
+ var A = d, M = A._payload, R = A._init;
6961
6766
  try {
6962
- return dt(j(M), m, v);
6767
+ return dt(R(M), T, v);
6963
6768
  } catch {
6964
6769
  }
6965
6770
  }
6966
6771
  }
6967
6772
  return "";
6968
6773
  }
6969
- var ze = Object.prototype.hasOwnProperty, er = {}, tr = g.ReactDebugCurrentFrame;
6970
- function ht(h) {
6971
- if (h) {
6972
- var m = h._owner, v = dt(h.type, h._source, m ? m.type : null);
6774
+ var ze = Object.prototype.hasOwnProperty, er = {}, tr = _.ReactDebugCurrentFrame;
6775
+ function ht(d) {
6776
+ if (d) {
6777
+ var T = d._owner, v = dt(d.type, d._source, T ? T.type : null);
6973
6778
  tr.setExtraStackFrame(v);
6974
6779
  } else
6975
6780
  tr.setExtraStackFrame(null);
6976
6781
  }
6977
- function Js(h, m, v, A, M) {
6782
+ function Js(d, T, v, A, M) {
6978
6783
  {
6979
- var j = Function.call.bind(ze);
6980
- for (var P in h)
6981
- if (j(h, P)) {
6784
+ var R = Function.call.bind(ze);
6785
+ for (var I in d)
6786
+ if (R(d, I)) {
6982
6787
  var C = void 0;
6983
6788
  try {
6984
- if (typeof h[P] != "function") {
6985
- var G = Error((A || "React class") + ": " + v + " type `" + P + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[P] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
6789
+ if (typeof d[I] != "function") {
6790
+ var G = Error((A || "React class") + ": " + v + " type `" + I + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof d[I] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
6986
6791
  throw G.name = "Invariant Violation", G;
6987
6792
  }
6988
- C = h[P](m, P, A, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
6793
+ C = d[I](T, I, A, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
6989
6794
  } catch (D) {
6990
6795
  C = D;
6991
6796
  }
6992
- C && !(C instanceof Error) && (ht(M), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", A || "React class", v, P, typeof C), ht(null)), C instanceof Error && !(C.message in er) && (er[C.message] = !0, ht(M), S("Failed %s type: %s", v, C.message), ht(null));
6797
+ C && !(C instanceof Error) && (ht(M), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", A || "React class", v, I, typeof C), ht(null)), C instanceof Error && !(C.message in er) && (er[C.message] = !0, ht(M), S("Failed %s type: %s", v, C.message), ht(null));
6993
6798
  }
6994
6799
  }
6995
6800
  }
6996
6801
  var Ys = Array.isArray;
6997
- function Wt(h) {
6998
- return Ys(h);
6802
+ function qt(d) {
6803
+ return Ys(d);
6999
6804
  }
7000
- function Zs(h) {
6805
+ function Zs(d) {
7001
6806
  {
7002
- var m = typeof Symbol == "function" && Symbol.toStringTag, v = m && h[Symbol.toStringTag] || h.constructor.name || "Object";
6807
+ var T = typeof Symbol == "function" && Symbol.toStringTag, v = T && d[Symbol.toStringTag] || d.constructor.name || "Object";
7003
6808
  return v;
7004
6809
  }
7005
6810
  }
7006
- function Xs(h) {
6811
+ function Xs(d) {
7007
6812
  try {
7008
- return nr(h), !1;
6813
+ return nr(d), !1;
7009
6814
  } catch {
7010
6815
  return !0;
7011
6816
  }
7012
6817
  }
7013
- function nr(h) {
7014
- return "" + h;
6818
+ function nr(d) {
6819
+ return "" + d;
7015
6820
  }
7016
- function rr(h) {
7017
- if (Xs(h))
7018
- return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Zs(h)), nr(h);
6821
+ function rr(d) {
6822
+ if (Xs(d))
6823
+ return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Zs(d)), nr(d);
7019
6824
  }
7020
- var sr = g.ReactCurrentOwner, ei = {
6825
+ var sr = _.ReactCurrentOwner, ei = {
7021
6826
  key: !0,
7022
6827
  ref: !0,
7023
6828
  __self: !0,
7024
6829
  __source: !0
7025
6830
  }, ir, or;
7026
- function ti(h) {
7027
- if (ze.call(h, "ref")) {
7028
- var m = Object.getOwnPropertyDescriptor(h, "ref").get;
7029
- if (m && m.isReactWarning)
6831
+ function ti(d) {
6832
+ if (ze.call(d, "ref")) {
6833
+ var T = Object.getOwnPropertyDescriptor(d, "ref").get;
6834
+ if (T && T.isReactWarning)
7030
6835
  return !1;
7031
6836
  }
7032
- return h.ref !== void 0;
6837
+ return d.ref !== void 0;
7033
6838
  }
7034
- function ni(h) {
7035
- if (ze.call(h, "key")) {
7036
- var m = Object.getOwnPropertyDescriptor(h, "key").get;
7037
- if (m && m.isReactWarning)
6839
+ function ni(d) {
6840
+ if (ze.call(d, "key")) {
6841
+ var T = Object.getOwnPropertyDescriptor(d, "key").get;
6842
+ if (T && T.isReactWarning)
7038
6843
  return !1;
7039
6844
  }
7040
- return h.key !== void 0;
6845
+ return d.key !== void 0;
7041
6846
  }
7042
- function ri(h, m) {
7043
- typeof h.ref == "string" && sr.current;
6847
+ function ri(d, T) {
6848
+ typeof d.ref == "string" && sr.current;
7044
6849
  }
7045
- function si(h, m) {
6850
+ function si(d, T) {
7046
6851
  {
7047
6852
  var v = function() {
7048
- ir || (ir = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", m));
6853
+ ir || (ir = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", T));
7049
6854
  };
7050
- v.isReactWarning = !0, Object.defineProperty(h, "key", {
6855
+ v.isReactWarning = !0, Object.defineProperty(d, "key", {
7051
6856
  get: v,
7052
6857
  configurable: !0
7053
6858
  });
7054
6859
  }
7055
6860
  }
7056
- function ii(h, m) {
6861
+ function ii(d, T) {
7057
6862
  {
7058
6863
  var v = function() {
7059
- or || (or = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", m));
6864
+ or || (or = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", T));
7060
6865
  };
7061
- v.isReactWarning = !0, Object.defineProperty(h, "ref", {
6866
+ v.isReactWarning = !0, Object.defineProperty(d, "ref", {
7062
6867
  get: v,
7063
6868
  configurable: !0
7064
6869
  });
7065
6870
  }
7066
6871
  }
7067
- var oi = function(h, m, v, A, M, j, P) {
6872
+ var oi = function(d, T, v, A, M, R, I) {
7068
6873
  var C = {
7069
6874
  // This tag allows us to uniquely identify this as a React Element
7070
6875
  $$typeof: n,
7071
6876
  // Built-in properties that belong on the element
7072
- type: h,
7073
- key: m,
6877
+ type: d,
6878
+ key: T,
7074
6879
  ref: v,
7075
- props: P,
6880
+ props: I,
7076
6881
  // Record the component responsible for creating this element.
7077
- _owner: j
6882
+ _owner: R
7078
6883
  };
7079
6884
  return C._store = {}, Object.defineProperty(C._store, "validated", {
7080
6885
  configurable: !1,
@@ -7093,165 +6898,165 @@ function pu() {
7093
6898
  value: M
7094
6899
  }), Object.freeze && (Object.freeze(C.props), Object.freeze(C)), C;
7095
6900
  };
7096
- function ai(h, m, v, A, M) {
6901
+ function ai(d, T, v, A, M) {
7097
6902
  {
7098
- var j, P = {}, C = null, G = null;
7099
- v !== void 0 && (rr(v), C = "" + v), ni(m) && (rr(m.key), C = "" + m.key), ti(m) && (G = m.ref, ri(m, M));
7100
- for (j in m)
7101
- ze.call(m, j) && !ei.hasOwnProperty(j) && (P[j] = m[j]);
7102
- if (h && h.defaultProps) {
7103
- var D = h.defaultProps;
7104
- for (j in D)
7105
- P[j] === void 0 && (P[j] = D[j]);
6903
+ var R, I = {}, C = null, G = null;
6904
+ v !== void 0 && (rr(v), C = "" + v), ni(T) && (rr(T.key), C = "" + T.key), ti(T) && (G = T.ref, ri(T, M));
6905
+ for (R in T)
6906
+ ze.call(T, R) && !ei.hasOwnProperty(R) && (I[R] = T[R]);
6907
+ if (d && d.defaultProps) {
6908
+ var D = d.defaultProps;
6909
+ for (R in D)
6910
+ I[R] === void 0 && (I[R] = D[R]);
7106
6911
  }
7107
6912
  if (C || G) {
7108
- var N = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
7109
- C && si(P, N), G && ii(P, N);
6913
+ var F = typeof d == "function" ? d.displayName || d.name || "Unknown" : d;
6914
+ C && si(I, F), G && ii(I, F);
7110
6915
  }
7111
- return oi(h, C, G, M, A, sr.current, P);
6916
+ return oi(d, C, G, M, A, sr.current, I);
7112
6917
  }
7113
6918
  }
7114
- var qt = g.ReactCurrentOwner, ar = g.ReactDebugCurrentFrame;
7115
- function Ie(h) {
7116
- if (h) {
7117
- var m = h._owner, v = dt(h.type, h._source, m ? m.type : null);
6919
+ var Wt = _.ReactCurrentOwner, ar = _.ReactDebugCurrentFrame;
6920
+ function Pe(d) {
6921
+ if (d) {
6922
+ var T = d._owner, v = dt(d.type, d._source, T ? T.type : null);
7118
6923
  ar.setExtraStackFrame(v);
7119
6924
  } else
7120
6925
  ar.setExtraStackFrame(null);
7121
6926
  }
7122
6927
  var zt;
7123
6928
  zt = !1;
7124
- function Vt(h) {
7125
- return typeof h == "object" && h !== null && h.$$typeof === n;
6929
+ function Vt(d) {
6930
+ return typeof d == "object" && d !== null && d.$$typeof === n;
7126
6931
  }
7127
6932
  function cr() {
7128
6933
  {
7129
- if (qt.current) {
7130
- var h = ie(qt.current.type);
7131
- if (h)
6934
+ if (Wt.current) {
6935
+ var d = ie(Wt.current.type);
6936
+ if (d)
7132
6937
  return `
7133
6938
 
7134
- Check the render method of \`` + h + "`.";
6939
+ Check the render method of \`` + d + "`.";
7135
6940
  }
7136
6941
  return "";
7137
6942
  }
7138
6943
  }
7139
- function ci(h) {
6944
+ function ci(d) {
7140
6945
  return "";
7141
6946
  }
7142
6947
  var ur = {};
7143
- function ui(h) {
6948
+ function ui(d) {
7144
6949
  {
7145
- var m = cr();
7146
- if (!m) {
7147
- var v = typeof h == "string" ? h : h.displayName || h.name;
7148
- v && (m = `
6950
+ var T = cr();
6951
+ if (!T) {
6952
+ var v = typeof d == "string" ? d : d.displayName || d.name;
6953
+ v && (T = `
7149
6954
 
7150
6955
  Check the top-level render call using <` + v + ">.");
7151
6956
  }
7152
- return m;
6957
+ return T;
7153
6958
  }
7154
6959
  }
7155
- function lr(h, m) {
6960
+ function lr(d, T) {
7156
6961
  {
7157
- if (!h._store || h._store.validated || h.key != null)
6962
+ if (!d._store || d._store.validated || d.key != null)
7158
6963
  return;
7159
- h._store.validated = !0;
7160
- var v = ui(m);
6964
+ d._store.validated = !0;
6965
+ var v = ui(T);
7161
6966
  if (ur[v])
7162
6967
  return;
7163
6968
  ur[v] = !0;
7164
6969
  var A = "";
7165
- h && h._owner && h._owner !== qt.current && (A = " It was passed a child from " + ie(h._owner.type) + "."), Ie(h), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, A), Ie(null);
6970
+ d && d._owner && d._owner !== Wt.current && (A = " It was passed a child from " + ie(d._owner.type) + "."), Pe(d), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, A), Pe(null);
7166
6971
  }
7167
6972
  }
7168
- function fr(h, m) {
6973
+ function fr(d, T) {
7169
6974
  {
7170
- if (typeof h != "object")
6975
+ if (typeof d != "object")
7171
6976
  return;
7172
- if (Wt(h))
7173
- for (var v = 0; v < h.length; v++) {
7174
- var A = h[v];
7175
- Vt(A) && lr(A, m);
6977
+ if (qt(d))
6978
+ for (var v = 0; v < d.length; v++) {
6979
+ var A = d[v];
6980
+ Vt(A) && lr(A, T);
7176
6981
  }
7177
- else if (Vt(h))
7178
- h._store && (h._store.validated = !0);
7179
- else if (h) {
7180
- var M = T(h);
7181
- if (typeof M == "function" && M !== h.entries)
7182
- for (var j = M.call(h), P; !(P = j.next()).done; )
7183
- Vt(P.value) && lr(P.value, m);
6982
+ else if (Vt(d))
6983
+ d._store && (d._store.validated = !0);
6984
+ else if (d) {
6985
+ var M = m(d);
6986
+ if (typeof M == "function" && M !== d.entries)
6987
+ for (var R = M.call(d), I; !(I = R.next()).done; )
6988
+ Vt(I.value) && lr(I.value, T);
7184
6989
  }
7185
6990
  }
7186
6991
  }
7187
- function li(h) {
6992
+ function li(d) {
7188
6993
  {
7189
- var m = h.type;
7190
- if (m == null || typeof m == "string")
6994
+ var T = d.type;
6995
+ if (T == null || typeof T == "string")
7191
6996
  return;
7192
6997
  var v;
7193
- if (typeof m == "function")
7194
- v = m.propTypes;
7195
- else if (typeof m == "object" && (m.$$typeof === u || // Note: Memo only checks outer props here.
6998
+ if (typeof T == "function")
6999
+ v = T.propTypes;
7000
+ else if (typeof T == "object" && (T.$$typeof === u || // Note: Memo only checks outer props here.
7196
7001
  // Inner props are checked in the reconciler.
7197
- m.$$typeof === d))
7198
- v = m.propTypes;
7002
+ T.$$typeof === h))
7003
+ v = T.propTypes;
7199
7004
  else
7200
7005
  return;
7201
7006
  if (v) {
7202
- var A = ie(m);
7203
- Js(v, h.props, "prop", A, h);
7204
- } else if (m.PropTypes !== void 0 && !zt) {
7007
+ var A = ie(T);
7008
+ Js(v, d.props, "prop", A, d);
7009
+ } else if (T.PropTypes !== void 0 && !zt) {
7205
7010
  zt = !0;
7206
- var M = ie(m);
7011
+ var M = ie(T);
7207
7012
  S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
7208
7013
  }
7209
- typeof m.getDefaultProps == "function" && !m.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
7014
+ typeof T.getDefaultProps == "function" && !T.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
7210
7015
  }
7211
7016
  }
7212
- function fi(h) {
7017
+ function fi(d) {
7213
7018
  {
7214
- for (var m = Object.keys(h.props), v = 0; v < m.length; v++) {
7215
- var A = m[v];
7019
+ for (var T = Object.keys(d.props), v = 0; v < T.length; v++) {
7020
+ var A = T[v];
7216
7021
  if (A !== "children" && A !== "key") {
7217
- Ie(h), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", A), Ie(null);
7022
+ Pe(d), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", A), Pe(null);
7218
7023
  break;
7219
7024
  }
7220
7025
  }
7221
- h.ref !== null && (Ie(h), S("Invalid attribute `ref` supplied to `React.Fragment`."), Ie(null));
7026
+ d.ref !== null && (Pe(d), S("Invalid attribute `ref` supplied to `React.Fragment`."), Pe(null));
7222
7027
  }
7223
7028
  }
7224
7029
  var dr = {};
7225
- function hr(h, m, v, A, M, j) {
7030
+ function hr(d, T, v, A, M, R) {
7226
7031
  {
7227
- var P = Ut(h);
7228
- if (!P) {
7032
+ var I = Ut(d);
7033
+ if (!I) {
7229
7034
  var C = "";
7230
- (h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
7035
+ (d === void 0 || typeof d == "object" && d !== null && Object.keys(d).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
7231
7036
  var G = ci();
7232
7037
  G ? C += G : C += cr();
7233
7038
  var D;
7234
- h === null ? D = "null" : Wt(h) ? D = "array" : h !== void 0 && h.$$typeof === n ? (D = "<" + (ie(h.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : D = typeof h, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, C);
7039
+ d === null ? D = "null" : qt(d) ? D = "array" : d !== void 0 && d.$$typeof === n ? (D = "<" + (ie(d.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : D = typeof d, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, C);
7235
7040
  }
7236
- var N = ai(h, m, v, M, j);
7237
- if (N == null)
7238
- return N;
7239
- if (P) {
7240
- var re = m.children;
7041
+ var F = ai(d, T, v, M, R);
7042
+ if (F == null)
7043
+ return F;
7044
+ if (I) {
7045
+ var re = T.children;
7241
7046
  if (re !== void 0)
7242
7047
  if (A)
7243
- if (Wt(re)) {
7244
- for (var Pe = 0; Pe < re.length; Pe++)
7245
- fr(re[Pe], h);
7048
+ if (qt(re)) {
7049
+ for (var Ie = 0; Ie < re.length; Ie++)
7050
+ fr(re[Ie], d);
7246
7051
  Object.freeze && Object.freeze(re);
7247
7052
  } else
7248
7053
  S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
7249
7054
  else
7250
- fr(re, h);
7055
+ fr(re, d);
7251
7056
  }
7252
- if (ze.call(m, "key")) {
7253
- var we = ie(h), J = Object.keys(m).filter(function(_i) {
7254
- return _i !== "key";
7057
+ if (ze.call(T, "key")) {
7058
+ var we = ie(d), J = Object.keys(T).filter(function(gi) {
7059
+ return gi !== "key";
7255
7060
  }), Bt = J.length > 0 ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}";
7256
7061
  if (!dr[we + Bt]) {
7257
7062
  var bi = J.length > 0 ? "{" + J.join(": ..., ") + ": ...}" : "{}";
@@ -7263,23 +7068,23 @@ React keys must be passed directly to JSX without using spread:
7263
7068
  <%s key={someKey} {...props} />`, Bt, we, bi, we), dr[we + Bt] = !0;
7264
7069
  }
7265
7070
  }
7266
- return h === s ? fi(N) : li(N), N;
7071
+ return d === s ? fi(F) : li(F), F;
7267
7072
  }
7268
7073
  }
7269
- function di(h, m, v) {
7270
- return hr(h, m, v, !0);
7074
+ function di(d, T, v) {
7075
+ return hr(d, T, v, !0);
7271
7076
  }
7272
- function hi(h, m, v) {
7273
- return hr(h, m, v, !1);
7077
+ function hi(d, T, v) {
7078
+ return hr(d, T, v, !1);
7274
7079
  }
7275
7080
  var pi = hi, yi = di;
7276
7081
  Ge.Fragment = s, Ge.jsx = pi, Ge.jsxs = yi;
7277
7082
  }(), Ge;
7278
7083
  }
7279
- var yu = {};
7280
- yu.NODE_ENV === "production" ? Tn.exports = hu() : Tn.exports = pu();
7281
- var V = Tn.exports;
7282
- const bu = {
7084
+ var fu = {};
7085
+ fu.NODE_ENV === "production" ? mn.exports = uu() : mn.exports = lu();
7086
+ var V = mn.exports;
7087
+ const du = {
7283
7088
  isLoading: !0,
7284
7089
  data: void 0,
7285
7090
  pageInfo: void 0,
@@ -7294,9 +7099,9 @@ function Hr(t) {
7294
7099
  ...t || {}
7295
7100
  };
7296
7101
  }
7297
- function _u(t, e, n) {
7102
+ function hu(t, e, n) {
7298
7103
  e && n && "ruleParams" in n && (e = { $$ruleParams: n.ruleParams, ...e });
7299
- const r = e ? cu(e) : null, s = q(r), i = it(Hr(t._reactor.getPreviousResult(r))), o = ge(
7104
+ const r = e ? su(e) : null, s = q(r), i = it(Hr(t._reactor.getPreviousResult(r))), o = _e(
7300
7105
  (c) => (i.current = Hr(t._reactor.getPreviousResult(r)), c(), r ? t.subscribeQuery(r, (l) => {
7301
7106
  i.current = {
7302
7107
  isLoading: !l,
@@ -7313,9 +7118,9 @@ function _u(t, e, n) {
7313
7118
  // Build a new subscribe function if the query changes
7314
7119
  [s]
7315
7120
  );
7316
- return { state: tn(o, () => i.current, () => bu), query: r };
7121
+ return { state: tn(o, () => i.current, () => du), query: r };
7317
7122
  }
7318
- function gu() {
7123
+ function pu() {
7319
7124
  const t = it(null);
7320
7125
  Oe(() => {
7321
7126
  n();
@@ -7328,15 +7133,15 @@ function gu() {
7328
7133
  }
7329
7134
  return { set: e, clear: n };
7330
7135
  }
7331
- const wu = 1e3;
7332
- function mu(t, e, n) {
7136
+ const yu = 1e3;
7137
+ function bu(t, e, n) {
7333
7138
  const r = it(n);
7334
7139
  r.current = n, Oe(() => t.core._reactor.subscribeTopic(t.id, e, (i, o) => {
7335
7140
  r.current(i, o);
7336
7141
  }), [t.id, e]);
7337
7142
  }
7338
- function Tu(t, e) {
7339
- return Oe(() => t.core._reactor.joinRoom(t.id), [t.id]), ge((r) => {
7143
+ function gu(t, e) {
7144
+ return Oe(() => t.core._reactor.joinRoom(t.id), [t.id]), _e((r) => {
7340
7145
  t.core._reactor.publishTopic({
7341
7146
  roomType: t.type,
7342
7147
  roomId: t.id,
@@ -7345,7 +7150,7 @@ function Tu(t, e) {
7345
7150
  });
7346
7151
  }, [t.id, e]);
7347
7152
  }
7348
- function Su(t, e = {}) {
7153
+ function _u(t, e = {}) {
7349
7154
  var o, a;
7350
7155
  const [n, r] = ns(() => t.core._reactor.getPresence(t.type, t.id, e) ?? {
7351
7156
  peers: {},
@@ -7354,7 +7159,7 @@ function Su(t, e = {}) {
7354
7159
  Oe(() => t.core._reactor.subscribePresence(t.type, t.id, e, (u) => {
7355
7160
  r(u);
7356
7161
  }), [t.id, e.user, (o = e.peers) == null ? void 0 : o.join(), (a = e.keys) == null ? void 0 : a.join()]);
7357
- const s = ge((c) => {
7162
+ const s = _e((c) => {
7358
7163
  t.core._reactor.publishPresence(t.type, t.id, c);
7359
7164
  }, [t.type, t.id]);
7360
7165
  return nn(() => ({
@@ -7362,27 +7167,27 @@ function Su(t, e = {}) {
7362
7167
  publishPresence: s
7363
7168
  }), [n, s]);
7364
7169
  }
7365
- function vu(t, e, n) {
7170
+ function wu(t, e, n) {
7366
7171
  Oe(() => t.core._reactor.joinRoom(t.id, e), [t.id]), Oe(() => t.core._reactor.publishPresence(t.type, t.id, e), [t.type, t.id, n ?? JSON.stringify(e)]);
7367
7172
  }
7368
- function Eu(t, e, n = {}) {
7369
- const r = gu(), s = Te.usePresence(t, {
7173
+ function Tu(t, e, n = {}) {
7174
+ const r = pu(), s = me.usePresence(t, {
7370
7175
  keys: [e]
7371
7176
  }), i = nn(() => {
7372
7177
  const l = t._core._reactor.getPresence(t.type, t.id);
7373
7178
  return n != null && n.writeOnly ? [] : Object.values((l == null ? void 0 : l.peers) ?? {}).filter((f) => f[e] === !0);
7374
- }, [n == null ? void 0 : n.writeOnly, s]), o = ge((l) => {
7179
+ }, [n == null ? void 0 : n.writeOnly, s]), o = _e((l) => {
7375
7180
  t.core._reactor.publishPresence(t.type, t.id, {
7376
7181
  [e]: l
7377
- }), l && ((n == null ? void 0 : n.timeout) === null || (n == null ? void 0 : n.timeout) === 0 || r.set((n == null ? void 0 : n.timeout) ?? wu, () => {
7182
+ }), l && ((n == null ? void 0 : n.timeout) === null || (n == null ? void 0 : n.timeout) === 0 || r.set((n == null ? void 0 : n.timeout) ?? yu, () => {
7378
7183
  t.core._reactor.publishPresence(t.type, t.id, {
7379
7184
  [e]: null
7380
7185
  });
7381
7186
  }));
7382
- }, [t.type, t.id, e, n == null ? void 0 : n.timeout, r]), a = ge((l) => {
7383
- const d = !((n == null ? void 0 : n.stopOnEnter) && l.key === "Enter");
7384
- o(d);
7385
- }, [n.stopOnEnter, o]), c = ge(() => {
7187
+ }, [t.type, t.id, e, n == null ? void 0 : n.timeout, r]), a = _e((l) => {
7188
+ const h = !((n == null ? void 0 : n.stopOnEnter) && l.key === "Enter");
7189
+ o(h);
7190
+ }, [n.stopOnEnter, o]), c = _e(() => {
7386
7191
  o(!1);
7387
7192
  }, [o]), u = nn(() => ({ onKeyDown: a, onBlur: c }), [a, c]);
7388
7193
  return {
@@ -7391,14 +7196,14 @@ function Eu(t, e, n = {}) {
7391
7196
  inputProps: u
7392
7197
  };
7393
7198
  }
7394
- const Te = {
7395
- useTopicEffect: mu,
7396
- usePublishTopic: Tu,
7397
- usePresence: Su,
7398
- useSyncPresence: vu,
7399
- useTypingIndicator: Eu
7199
+ const me = {
7200
+ useTopicEffect: bu,
7201
+ usePublishTopic: gu,
7202
+ usePresence: _u,
7203
+ useSyncPresence: wu,
7204
+ useTypingIndicator: Tu
7400
7205
  };
7401
- class Ou {
7206
+ class mu {
7402
7207
  constructor(e, n, r) {
7403
7208
  p(this, "core");
7404
7209
  /** @deprecated use `core` instead */
@@ -7420,7 +7225,7 @@ class Ou {
7420
7225
  * db.rooms.useTopicEffect(room, 'emoji', (message, peer) => { });
7421
7226
  */
7422
7227
  p(this, "useTopicEffect", (e, n) => {
7423
- Te.useTopicEffect(this, e, n);
7228
+ me.useTopicEffect(this, e, n);
7424
7229
  });
7425
7230
  /**
7426
7231
  * @deprecated
@@ -7436,7 +7241,7 @@ class Ou {
7436
7241
  * const room = db.room('chat', 'room-id');
7437
7242
  * const publish = db.rooms.usePublishTopic(room, 'emoji');
7438
7243
  */
7439
- p(this, "usePublishTopic", (e) => Te.usePublishTopic(this, e));
7244
+ p(this, "usePublishTopic", (e) => me.usePublishTopic(this, e));
7440
7245
  /**
7441
7246
  * @deprecated
7442
7247
  * `db.room(...).usePresence` is deprecated. You can replace it with `db.rooms.usePresence`.
@@ -7451,7 +7256,7 @@ class Ou {
7451
7256
  * const room = db.room('chat', 'room-id');
7452
7257
  * const { peers } = db.rooms.usePresence(room, { keys: ["name", "avatar"] });
7453
7258
  */
7454
- p(this, "usePresence", (e = {}) => Te.usePresence(this, e));
7259
+ p(this, "usePresence", (e = {}) => me.usePresence(this, e));
7455
7260
  /**
7456
7261
  * @deprecated
7457
7262
  * `db.room(...).useSyncPresence` is deprecated. You can replace it with `db.rooms.useSyncPresence`.
@@ -7466,7 +7271,7 @@ class Ou {
7466
7271
  * const room = db.room('chat', 'room-id');
7467
7272
  * db.rooms.useSyncPresence(room, { nickname });
7468
7273
  */
7469
- p(this, "useSyncPresence", (e, n) => Te.useSyncPresence(this, e, n));
7274
+ p(this, "useSyncPresence", (e, n) => me.useSyncPresence(this, e, n));
7470
7275
  /**
7471
7276
  * @deprecated
7472
7277
  * `db.room(...).useTypingIndicator` is deprecated. You can replace it with `db.rooms.useTypingIndicator`.
@@ -7481,11 +7286,11 @@ class Ou {
7481
7286
  * const room = db.room('chat', 'room-id');
7482
7287
  * const typing = db.rooms.useTypingIndiactor(room, 'chat-input');
7483
7288
  */
7484
- p(this, "useTypingIndicator", (e, n = {}) => Te.useTypingIndicator(this, e, n));
7289
+ p(this, "useTypingIndicator", (e, n = {}) => me.useTypingIndicator(this, e, n));
7485
7290
  this.core = e, this._core = this.core, this.type = n, this.id = r;
7486
7291
  }
7487
7292
  }
7488
- const Au = {
7293
+ const Su = {
7489
7294
  isLoading: !0,
7490
7295
  user: void 0,
7491
7296
  error: void 0
@@ -7539,7 +7344,7 @@ class vt {
7539
7344
  * const publish = db.rooms.usePublishTopic(room, 'emoji');
7540
7345
  * // ...
7541
7346
  */
7542
- p(this, "rooms", Te);
7347
+ p(this, "rooms", me);
7543
7348
  /**
7544
7349
  * Use this to write data! You can create, update, delete, and link objects
7545
7350
  *
@@ -7588,7 +7393,7 @@ class vt {
7588
7393
  * auth.user ? { goals: {} } : null,
7589
7394
  * );
7590
7395
  */
7591
- p(this, "useQuery", (e, n) => _u(this.core, e, n).state);
7396
+ p(this, "useQuery", (e, n) => hu(this.core, e, n).state);
7592
7397
  /**
7593
7398
  * Listen for the logged in state. This is useful
7594
7399
  * for deciding when to show a login screen.
@@ -7661,7 +7466,7 @@ class vt {
7661
7466
  * }
7662
7467
  */
7663
7468
  p(this, "useConnectionStatus", () => {
7664
- const e = it(this.core._reactor.status), n = ge((s) => this.core.subscribeConnectionStatus((o) => {
7469
+ const e = it(this.core._reactor.status), n = _e((s) => this.core.subscribeConnectionStatus((o) => {
7665
7470
  o !== e.current && (e.current = o, s());
7666
7471
  }), []);
7667
7472
  return tn(
@@ -7713,7 +7518,7 @@ class vt {
7713
7518
  const n = this.useAuth();
7714
7519
  return n.isLoading || n.error || n.user ? null : V.jsx(V.Fragment, { children: e });
7715
7520
  });
7716
- this.core = fu(
7521
+ this.core = au(
7717
7522
  e,
7718
7523
  // @ts-expect-error because TS can't resolve subclass statics
7719
7524
  e.Store || this.constructor.Store,
@@ -7737,13 +7542,13 @@ class vt {
7737
7542
  * const { peers } = db.rooms.usePresence(room);
7738
7543
  */
7739
7544
  room(e = "_defaultRoomType", n = "_defaultRoomId") {
7740
- return new Ou(this.core, e, n);
7545
+ return new mu(this.core, e, n);
7741
7546
  }
7742
7547
  _useAuth() {
7743
- const e = it(this.core._reactor._currentUserCached), n = ge((s) => this.core.subscribeAuth((o) => {
7548
+ const e = it(this.core._reactor._currentUserCached), n = _e((s) => this.core.subscribeAuth((o) => {
7744
7549
  e.current = { isLoading: !1, ...o }, s();
7745
7550
  }), []);
7746
- return tn(n, () => e.current, () => Au);
7551
+ return tn(n, () => e.current, () => Su);
7747
7552
  }
7748
7553
  /**
7749
7554
  * One time query for the logged in state. This is useful
@@ -7767,38 +7572,38 @@ class Jr extends Error {
7767
7572
  }
7768
7573
  function en(t) {
7769
7574
  }
7770
- function ku(t) {
7575
+ function vu(t) {
7771
7576
  if (typeof t == "function")
7772
7577
  throw new TypeError(
7773
7578
  "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
7774
7579
  );
7775
7580
  const { onEvent: e = en, onError: n = en, onRetry: r = en, onComment: s } = t;
7776
7581
  let i = "", o = !0, a, c = "", u = "";
7777
- function l(_) {
7778
- const w = o ? _.replace(/^\xEF\xBB\xBF/, "") : _, [T, g] = Cu(`${i}${w}`);
7779
- for (const S of T)
7582
+ function l(g) {
7583
+ const w = o ? g.replace(/^\xEF\xBB\xBF/, "") : g, [m, _] = Eu(`${i}${w}`);
7584
+ for (const S of m)
7780
7585
  f(S);
7781
- i = g, o = !1;
7586
+ i = _, o = !1;
7782
7587
  }
7783
- function f(_) {
7784
- if (_ === "") {
7588
+ function f(g) {
7589
+ if (g === "") {
7785
7590
  y();
7786
7591
  return;
7787
7592
  }
7788
- if (_.startsWith(":")) {
7789
- s && s(_.slice(_.startsWith(": ") ? 2 : 1));
7593
+ if (g.startsWith(":")) {
7594
+ s && s(g.slice(g.startsWith(": ") ? 2 : 1));
7790
7595
  return;
7791
7596
  }
7792
- const w = _.indexOf(":");
7597
+ const w = g.indexOf(":");
7793
7598
  if (w !== -1) {
7794
- const T = _.slice(0, w), g = _[w + 1] === " " ? 2 : 1, S = _.slice(w + g);
7795
- d(T, S, _);
7599
+ const m = g.slice(0, w), _ = g[w + 1] === " " ? 2 : 1, S = g.slice(w + _);
7600
+ h(m, S, g);
7796
7601
  return;
7797
7602
  }
7798
- d(_, "", _);
7603
+ h(g, "", g);
7799
7604
  }
7800
- function d(_, w, T) {
7801
- switch (_) {
7605
+ function h(g, w, m) {
7606
+ switch (g) {
7802
7607
  case "event":
7803
7608
  u = w;
7804
7609
  break;
@@ -7814,15 +7619,15 @@ function ku(t) {
7814
7619
  new Jr(`Invalid \`retry\` value: "${w}"`, {
7815
7620
  type: "invalid-retry",
7816
7621
  value: w,
7817
- line: T
7622
+ line: m
7818
7623
  })
7819
7624
  );
7820
7625
  break;
7821
7626
  default:
7822
7627
  n(
7823
7628
  new Jr(
7824
- `Unknown field "${_.length > 20 ? `${_.slice(0, 20)}…` : _}"`,
7825
- { type: "unknown-field", field: _, value: w, line: T }
7629
+ `Unknown field "${g.length > 20 ? `${g.slice(0, 20)}…` : g}"`,
7630
+ { type: "unknown-field", field: g, value: w, line: m }
7826
7631
  )
7827
7632
  );
7828
7633
  break;
@@ -7838,12 +7643,12 @@ function ku(t) {
7838
7643
  `) ? c.slice(0, -1) : c
7839
7644
  }), a = void 0, c = "", u = "";
7840
7645
  }
7841
- function b(_ = {}) {
7842
- i && _.consume && f(i), o = !0, a = void 0, c = "", u = "", i = "";
7646
+ function b(g = {}) {
7647
+ i && g.consume && f(i), o = !0, a = void 0, c = "", u = "", i = "";
7843
7648
  }
7844
7649
  return { feed: l, reset: b };
7845
7650
  }
7846
- function Cu(t) {
7651
+ function Eu(t) {
7847
7652
  const e = [];
7848
7653
  let n = "", r = 0;
7849
7654
  for (; r < t.length; ) {
@@ -7903,7 +7708,7 @@ class Yr extends Event {
7903
7708
  return e(Zr(this), n);
7904
7709
  }
7905
7710
  }
7906
- function Iu(t) {
7711
+ function Ou(t) {
7907
7712
  const e = globalThis.DOMException;
7908
7713
  return typeof e == "function" ? new e(t, "SyntaxError") : new SyntaxError(t);
7909
7714
  }
@@ -7920,21 +7725,21 @@ function Zr(t) {
7920
7725
  timeStamp: t.timeStamp
7921
7726
  };
7922
7727
  }
7923
- var qs = (t) => {
7728
+ var Ws = (t) => {
7924
7729
  throw TypeError(t);
7925
- }, zn = (t, e, n) => e.has(t) || qs("Cannot " + n), k = (t, e, n) => (zn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), W = (t, e, n) => e.has(t) ? qs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), $ = (t, e, n, r) => (zn(t, e, "write to private field"), e.set(t, n), n), he = (t, e, n) => (zn(t, e, "access private method"), n), Y, Se, Re, Et, Mt, rt, $e, st, _e, je, Ue, xe, Ze, oe, vn, En, On, Xr, An, kn, Xe, Cn, In;
7730
+ }, zn = (t, e, n) => e.has(t) || Ws("Cannot " + n), k = (t, e, n) => (zn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), K = (t, e, n) => e.has(t) ? Ws("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), $ = (t, e, n, r) => (zn(t, e, "write to private field"), e.set(t, n), n), he = (t, e, n) => (zn(t, e, "access private method"), n), Y, Se, je, Et, Mt, rt, $e, st, ge, Re, Ue, xe, Ze, oe, vn, En, On, Xr, An, kn, Xe, Cn, Pn;
7926
7731
  class Ot extends EventTarget {
7927
7732
  constructor(e, n) {
7928
7733
  var r, s;
7929
- super(), W(this, oe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, W(this, Y), W(this, Se), W(this, Re), W(this, Et), W(this, Mt), W(this, rt), W(this, $e), W(this, st, null), W(this, _e), W(this, je), W(this, Ue, null), W(this, xe, null), W(this, Ze, null), W(this, En, async (i) => {
7734
+ super(), K(this, oe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, K(this, Y), K(this, Se), K(this, je), K(this, Et), K(this, Mt), K(this, rt), K(this, $e), K(this, st, null), K(this, ge), K(this, Re), K(this, Ue, null), K(this, xe, null), K(this, Ze, null), K(this, En, async (i) => {
7930
7735
  var o;
7931
- k(this, je).reset();
7736
+ k(this, Re).reset();
7932
7737
  const { body: a, redirected: c, status: u, headers: l } = i;
7933
7738
  if (u === 204) {
7934
7739
  he(this, oe, Xe).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
7935
7740
  return;
7936
7741
  }
7937
- if (c ? $(this, Re, new URL(i.url)) : $(this, Re, void 0), u !== 200) {
7742
+ if (c ? $(this, je, new URL(i.url)) : $(this, je, void 0), u !== 200) {
7938
7743
  he(this, oe, Xe).call(this, `Non-200 status code (${u})`, u);
7939
7744
  return;
7940
7745
  }
@@ -7950,38 +7755,38 @@ class Ot extends EventTarget {
7950
7755
  he(this, oe, Xe).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
7951
7756
  return;
7952
7757
  }
7953
- const d = new TextDecoder(), y = a.getReader();
7758
+ const h = new TextDecoder(), y = a.getReader();
7954
7759
  let b = !0;
7955
7760
  do {
7956
- const { done: _, value: w } = await y.read();
7957
- w && k(this, je).feed(d.decode(w, { stream: !_ })), _ && (b = !1, k(this, je).reset(), he(this, oe, Cn).call(this));
7761
+ const { done: g, value: w } = await y.read();
7762
+ w && k(this, Re).feed(h.decode(w, { stream: !g })), g && (b = !1, k(this, Re).reset(), he(this, oe, Cn).call(this));
7958
7763
  } while (b);
7959
- }), W(this, On, (i) => {
7960
- $(this, _e, void 0), !(i.name === "AbortError" || i.type === "aborted") && he(this, oe, Cn).call(this, Sn(i));
7961
- }), W(this, An, (i) => {
7764
+ }), K(this, On, (i) => {
7765
+ $(this, ge, void 0), !(i.name === "AbortError" || i.type === "aborted") && he(this, oe, Cn).call(this, Sn(i));
7766
+ }), K(this, An, (i) => {
7962
7767
  typeof i.id == "string" && $(this, st, i.id);
7963
7768
  const o = new MessageEvent(i.event || "message", {
7964
7769
  data: i.data,
7965
- origin: k(this, Re) ? k(this, Re).origin : k(this, Se).origin,
7770
+ origin: k(this, je) ? k(this, je).origin : k(this, Se).origin,
7966
7771
  lastEventId: i.id || ""
7967
7772
  });
7968
7773
  k(this, xe) && (!i.event || i.event === "message") && k(this, xe).call(this, o), this.dispatchEvent(o);
7969
- }), W(this, kn, (i) => {
7774
+ }), K(this, kn, (i) => {
7970
7775
  $(this, rt, i);
7971
- }), W(this, In, () => {
7776
+ }), K(this, Pn, () => {
7972
7777
  $(this, $e, void 0), k(this, Y) === this.CONNECTING && he(this, oe, vn).call(this);
7973
7778
  });
7974
7779
  try {
7975
7780
  if (e instanceof URL)
7976
7781
  $(this, Se, e);
7977
7782
  else if (typeof e == "string")
7978
- $(this, Se, new URL(e, Pu()));
7783
+ $(this, Se, new URL(e, Au()));
7979
7784
  else
7980
7785
  throw new Error("Invalid URL");
7981
7786
  } catch {
7982
- throw Iu("An invalid or illegal string was specified");
7787
+ throw Ou("An invalid or illegal string was specified");
7983
7788
  }
7984
- $(this, je, ku({
7789
+ $(this, Re, vu({
7985
7790
  onEvent: k(this, An),
7986
7791
  onRetry: k(this, kn)
7987
7792
  })), $(this, Y, this.CONNECTING), $(this, rt, 3e3), $(this, Mt, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), $(this, Et, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1), he(this, oe, vn).call(this);
@@ -8054,16 +7859,16 @@ class Ot extends EventTarget {
8054
7859
  * @public
8055
7860
  */
8056
7861
  close() {
8057
- k(this, $e) && clearTimeout(k(this, $e)), k(this, Y) !== this.CLOSED && (k(this, _e) && k(this, _e).abort(), $(this, Y, this.CLOSED), $(this, _e, void 0));
7862
+ k(this, $e) && clearTimeout(k(this, $e)), k(this, Y) !== this.CLOSED && (k(this, ge) && k(this, ge).abort(), $(this, Y, this.CLOSED), $(this, ge, void 0));
8058
7863
  }
8059
7864
  }
8060
- Y = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), je = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakSet(), /**
7865
+ Y = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), je = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakSet(), /**
8061
7866
  * Connect to the given URL and start receiving events
8062
7867
  *
8063
7868
  * @internal
8064
7869
  */
8065
7870
  vn = function() {
8066
- $(this, Y, this.CONNECTING), $(this, _e, new AbortController()), k(this, Mt)(k(this, Se), he(this, oe, Xr).call(this)).then(k(this, En)).catch(k(this, On));
7871
+ $(this, Y, this.CONNECTING), $(this, ge, new AbortController()), k(this, Mt)(k(this, Se), he(this, oe, Xr).call(this)).then(k(this, En)).catch(k(this, On));
8067
7872
  }, En = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), /**
8068
7873
  * Get request options for the `fetch()` request
8069
7874
  *
@@ -8079,7 +7884,7 @@ Xr = function() {
8079
7884
  redirect: "follow",
8080
7885
  headers: { Accept: "text/event-stream", ...k(this, st) ? { "Last-Event-ID": k(this, st) } : void 0 },
8081
7886
  cache: "no-store",
8082
- signal: (t = k(this, _e)) == null ? void 0 : t.signal
7887
+ signal: (t = k(this, ge)) == null ? void 0 : t.signal
8083
7888
  };
8084
7889
  return "window" in globalThis && (e.credentials = this.withCredentials ? "include" : "same-origin"), e;
8085
7890
  }, An = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), /**
@@ -8107,8 +7912,8 @@ Cn = function(t, e) {
8107
7912
  return;
8108
7913
  $(this, Y, this.CONNECTING);
8109
7914
  const r = new Yr("error", { code: e, message: t });
8110
- (n = k(this, Ue)) == null || n.call(this, r), this.dispatchEvent(r), $(this, $e, setTimeout(k(this, In), k(this, rt)));
8111
- }, In = /* @__PURE__ */ new WeakMap(), /**
7915
+ (n = k(this, Ue)) == null || n.call(this, r), this.dispatchEvent(r), $(this, $e, setTimeout(k(this, Pn), k(this, rt)));
7916
+ }, Pn = /* @__PURE__ */ new WeakMap(), /**
8112
7917
  * ReadyState representing an EventSource currently trying to connect
8113
7918
  *
8114
7919
  * @public
@@ -8124,24 +7929,24 @@ Ot.OPEN = 1, /**
8124
7929
  * @public
8125
7930
  */
8126
7931
  Ot.CLOSED = 2;
8127
- function Pu() {
7932
+ function Au() {
8128
7933
  const t = "document" in globalThis ? globalThis.document : void 0;
8129
7934
  return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
8130
7935
  }
8131
7936
  class zs extends vt {
8132
7937
  }
8133
7938
  p(zs, "EventSourceImpl", Ot);
8134
- function Mu(t) {
7939
+ function ku(t) {
8135
7940
  const e = {
8136
7941
  ...t,
8137
7942
  useDateObjects: t.useDateObjects ?? !1
8138
7943
  };
8139
7944
  return new zs(e, {
8140
- "@instantdb/react": qn
7945
+ "@instantdb/react": Wn
8141
7946
  });
8142
7947
  }
8143
- const Nu = Mu;
8144
- function Ku({
7948
+ const Du = ku;
7949
+ function Uu({
8145
7950
  as: t = "div",
8146
7951
  spaceId: e,
8147
7952
  room: n,
@@ -8155,51 +7960,51 @@ function Ku({
8155
7960
  }) {
8156
7961
  const l = e || `cursors-space-default--${String(n.type)}-${n.id}`, f = n.usePresence({
8157
7962
  keys: [l]
8158
- }), d = n._core._reactor.getPresence(n.type, n.id);
8159
- function y(g, S) {
8160
- const O = S.clientX, E = S.clientY, R = (O - g.left) / g.width * 100, F = (E - g.top) / g.height * 100;
7963
+ }), h = n._core._reactor.getPresence(n.type, n.id);
7964
+ function y(_, S) {
7965
+ const O = S.clientX, E = S.clientY, j = (O - _.left) / _.width * 100, L = (E - _.top) / _.height * 100;
8161
7966
  f.publishPresence({
8162
7967
  [l]: {
8163
7968
  x: O,
8164
7969
  y: E,
8165
- xPercent: R,
8166
- yPercent: F,
7970
+ xPercent: j,
7971
+ yPercent: L,
8167
7972
  color: i
8168
7973
  }
8169
7974
  });
8170
7975
  }
8171
- function b(g) {
8172
- c || g.stopPropagation();
8173
- const S = g.currentTarget.getBoundingClientRect();
8174
- y(S, g);
7976
+ function b(_) {
7977
+ c || _.stopPropagation();
7978
+ const S = _.currentTarget.getBoundingClientRect();
7979
+ y(S, _);
8175
7980
  }
8176
- function _(g) {
7981
+ function g(_) {
8177
7982
  f.publishPresence({
8178
7983
  [l]: void 0
8179
7984
  });
8180
7985
  }
8181
- function w(g) {
8182
- if (g.touches.length !== 1)
7986
+ function w(_) {
7987
+ if (_.touches.length !== 1)
8183
7988
  return;
8184
- const S = g.touches[0];
7989
+ const S = _.touches[0];
8185
7990
  if (S.target instanceof Element) {
8186
- c || g.stopPropagation();
7991
+ c || _.stopPropagation();
8187
7992
  const O = S.target.getBoundingClientRect();
8188
7993
  y(O, S);
8189
7994
  }
8190
7995
  }
8191
- function T(g) {
7996
+ function m(_) {
8192
7997
  f.publishPresence({
8193
7998
  [l]: void 0
8194
7999
  });
8195
8000
  }
8196
- return mi(
8001
+ return Ti(
8197
8002
  t,
8198
8003
  {
8199
8004
  onMouseMove: b,
8200
- onMouseOut: _,
8005
+ onMouseOut: g,
8201
8006
  onTouchMove: w,
8202
- onTouchEnd: T,
8007
+ onTouchEnd: m,
8203
8008
  className: r,
8204
8009
  style: {
8205
8010
  position: "relative",
@@ -8213,10 +8018,10 @@ function Ku({
8213
8018
  {
8214
8019
  style: {
8215
8020
  ...es,
8216
- ...ju,
8217
- zIndex: u !== void 0 ? u : xu
8021
+ ...Pu,
8022
+ zIndex: u !== void 0 ? u : Iu
8218
8023
  },
8219
- children: Object.entries(f.peers).map(([g, S]) => {
8024
+ children: Object.entries(f.peers).map(([_, S]) => {
8220
8025
  const O = S[l];
8221
8026
  return O ? /* @__PURE__ */ V.jsx(
8222
8027
  "div",
@@ -8229,10 +8034,10 @@ function Ku({
8229
8034
  },
8230
8035
  children: a ? a({
8231
8036
  color: O.color,
8232
- presence: d == null ? void 0 : d.peers[g]
8233
- }) : /* @__PURE__ */ V.jsx(Ru, { ...O })
8037
+ presence: h == null ? void 0 : h.peers[_]
8038
+ }) : /* @__PURE__ */ V.jsx(Cu, { ...O })
8234
8039
  },
8235
- g
8040
+ _
8236
8041
  ) : null;
8237
8042
  })
8238
8043
  },
@@ -8241,7 +8046,7 @@ function Ku({
8241
8046
  ]
8242
8047
  );
8243
8048
  }
8244
- function Ru({ color: t }) {
8049
+ function Cu({ color: t }) {
8245
8050
  const n = t || "black";
8246
8051
  return /* @__PURE__ */ V.jsxs(
8247
8052
  "svg",
@@ -8294,23 +8099,23 @@ const es = {
8294
8099
  left: 0,
8295
8100
  bottom: 0,
8296
8101
  right: 0
8297
- }, ju = {
8102
+ }, Pu = {
8298
8103
  overflow: "hidden",
8299
8104
  pointerEvents: "none",
8300
8105
  userSelect: "none"
8301
- }, xu = 99999;
8106
+ }, Iu = 99999;
8302
8107
  export {
8303
- Ku as Cursors,
8108
+ Uu as Cursors,
8304
8109
  xt as InstantAPIError,
8305
8110
  vt as InstantReactAbstractDatabase,
8306
8111
  zs as InstantReactWebDatabase,
8307
8112
  Fa as StoreInterface,
8308
- me as SyncTableCallbackEventType,
8309
- Fu as createInstantRouteHandler,
8310
- Lu as i,
8311
- L as id,
8312
- Mu as init,
8313
- Nu as init_experimental,
8113
+ Te as SyncTableCallbackEventType,
8114
+ $u as createInstantRouteHandler,
8115
+ xu as i,
8116
+ W as id,
8117
+ ku as init,
8118
+ Du as init_experimental,
8314
8119
  la as lookup,
8315
- Uu as tx
8120
+ Ru as tx
8316
8121
  };