@instantdb/core 0.22.87-experimental.drewh-explorer-component.20181589271.1 → 0.22.87-experimental.drewh-entity-caching.20182780212.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,6 +1,6 @@
1
- var Bn = Object.defineProperty;
2
- var Hn = (t, e, n) => e in t ? Bn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var w = (t, e, n) => Hn(t, typeof e != "symbol" ? e + "" : e, n);
1
+ var Hn = Object.defineProperty;
2
+ var Jn = (t, e, n) => e in t ? Hn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var w = (t, e, n) => Jn(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  function P(t) {
5
5
  if (typeof t == "number")
6
6
  return (Math.abs(t * 2654435761) >>> 0).toString(16);
@@ -40,14 +40,14 @@ const A = {
40
40
  Remove: "remove",
41
41
  Replace: "replace",
42
42
  Add: "add"
43
- }, nn = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Jn = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Te = Symbol.iterator, L = {
43
+ }, rn = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Yn = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Te = Symbol.iterator, L = {
44
44
  mutable: "mutable",
45
45
  immutable: "immutable"
46
- }, it = {};
46
+ }, ot = {};
47
47
  function ue(t, e) {
48
48
  return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
49
49
  }
50
- function St(t, e) {
50
+ function Ot(t, e) {
51
51
  if (e in t) {
52
52
  let n = Reflect.getPrototypeOf(t);
53
53
  for (; n; ) {
@@ -58,10 +58,10 @@ function St(t, e) {
58
58
  }
59
59
  }
60
60
  }
61
- function ot(t) {
61
+ function at(t) {
62
62
  return Object.getPrototypeOf(t) === Set.prototype;
63
63
  }
64
- function at(t) {
64
+ function ct(t) {
65
65
  return Object.getPrototypeOf(t) === Map.prototype;
66
66
  }
67
67
  function U(t) {
@@ -72,9 +72,9 @@ function Y(t) {
72
72
  return !!S(t);
73
73
  }
74
74
  function S(t) {
75
- return typeof t != "object" ? null : t == null ? void 0 : t[nn];
75
+ return typeof t != "object" ? null : t == null ? void 0 : t[rn];
76
76
  }
77
- function ct(t) {
77
+ function ut(t) {
78
78
  var e;
79
79
  const n = S(t);
80
80
  return n ? (e = n.copy) !== null && e !== void 0 ? e : n.original : t;
@@ -85,7 +85,7 @@ function K(t, e) {
85
85
  let n;
86
86
  return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((n = e.mark(t, L)) === L.immutable || typeof n == "function");
87
87
  }
88
- function rn(t, e = []) {
88
+ function sn(t, e = []) {
89
89
  if (Object.hasOwnProperty.call(t, "key")) {
90
90
  const n = t.parent.copy, r = S(Q(n, t.key));
91
91
  if (r !== null && (r == null ? void 0 : r.original) !== t.original)
@@ -96,10 +96,10 @@ function rn(t, e = []) {
96
96
  e.push(i);
97
97
  }
98
98
  if (t.parent)
99
- return rn(t.parent, e);
99
+ return sn(t.parent, e);
100
100
  e.reverse();
101
101
  try {
102
- Yn(t.copy, e);
102
+ Zn(t.copy, e);
103
103
  } catch {
104
104
  return null;
105
105
  }
@@ -114,14 +114,14 @@ function Q(t, e) {
114
114
  function pe(t, e, n) {
115
115
  Z(t) === 2 ? t.set(e, n) : t[e] = n;
116
116
  }
117
- function xe(t, e) {
117
+ function Re(t, e) {
118
118
  const n = S(t);
119
119
  return (n ? U(n) : t)[e];
120
120
  }
121
121
  function W(t, e) {
122
122
  return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
123
123
  }
124
- function Ke(t) {
124
+ function qe(t) {
125
125
  if (t)
126
126
  for (; t.finalities.revoke.length > 0; )
127
127
  t.finalities.revoke.pop()();
@@ -132,7 +132,7 @@ function H(t, e) {
132
132
  return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
133
133
  }).join("/");
134
134
  }
135
- function Yn(t, e) {
135
+ function Zn(t, e) {
136
136
  for (let n = 0; n < e.length - 1; n += 1) {
137
137
  const r = e[n];
138
138
  if (t = Q(Z(t) === 3 ? Array.from(t) : t, r), typeof t != "object")
@@ -140,7 +140,7 @@ function Yn(t, e) {
140
140
  }
141
141
  return t;
142
142
  }
143
- function Zn(t) {
143
+ function Xn(t) {
144
144
  const e = Object.create(Object.getPrototypeOf(t));
145
145
  return Reflect.ownKeys(t).forEach((n) => {
146
146
  let r = Reflect.getOwnPropertyDescriptor(t, n);
@@ -156,26 +156,26 @@ function Zn(t) {
156
156
  }), Reflect.defineProperty(e, n, r);
157
157
  }), e;
158
158
  }
159
- const Xn = Object.prototype.propertyIsEnumerable;
160
- function sn(t, e) {
159
+ const er = Object.prototype.propertyIsEnumerable;
160
+ function on(t, e) {
161
161
  let n;
162
162
  if (Array.isArray(t))
163
163
  return Array.prototype.concat.call(t);
164
164
  if (t instanceof Set) {
165
- if (!ot(t)) {
165
+ if (!at(t)) {
166
166
  const r = Object.getPrototypeOf(t).constructor;
167
167
  return new r(t.values());
168
168
  }
169
169
  return Set.prototype.difference ? Set.prototype.difference.call(t, /* @__PURE__ */ new Set()) : new Set(t.values());
170
170
  } else if (t instanceof Map) {
171
- if (!at(t)) {
171
+ if (!ct(t)) {
172
172
  const r = Object.getPrototypeOf(t).constructor;
173
173
  return new r(t);
174
174
  }
175
175
  return new Map(t);
176
176
  } else if (e != null && e.mark && (n = e.mark(t, L), n !== void 0) && n !== L.mutable) {
177
177
  if (n === L.immutable)
178
- return Zn(t);
178
+ return Xn(t);
179
179
  if (typeof n == "function") {
180
180
  if (e.enablePatches || e.enableAutoFreeze)
181
181
  throw new Error("You can't use mark and patches or auto freeze together.");
@@ -187,17 +187,17 @@ function sn(t, e) {
187
187
  return Object.keys(t).forEach((s) => {
188
188
  r[s] = t[s];
189
189
  }), Object.getOwnPropertySymbols(t).forEach((s) => {
190
- Xn.call(t, s) && (r[s] = t[s]);
190
+ er.call(t, s) && (r[s] = t[s]);
191
191
  }), r;
192
192
  } else
193
193
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
194
194
  }
195
195
  function j(t) {
196
- t.copy || (t.copy = sn(t.original, t.options));
196
+ t.copy || (t.copy = on(t.original, t.options));
197
197
  }
198
198
  function oe(t) {
199
199
  if (!K(t))
200
- return ct(t);
200
+ return ut(t);
201
201
  if (Array.isArray(t))
202
202
  return t.map(oe);
203
203
  if (t instanceof Map) {
@@ -205,7 +205,7 @@ function oe(t) {
205
205
  r,
206
206
  oe(s)
207
207
  ]);
208
- if (!at(t)) {
208
+ if (!ct(t)) {
209
209
  const r = Object.getPrototypeOf(t).constructor;
210
210
  return new r(n);
211
211
  }
@@ -213,7 +213,7 @@ function oe(t) {
213
213
  }
214
214
  if (t instanceof Set) {
215
215
  const n = Array.from(t).map(oe);
216
- if (!ot(t)) {
216
+ if (!at(t)) {
217
217
  const r = Object.getPrototypeOf(t).constructor;
218
218
  return new r(n);
219
219
  }
@@ -231,7 +231,7 @@ function z(t) {
231
231
  var e;
232
232
  t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && z(t.parent));
233
233
  }
234
- function Ot() {
234
+ function vt() {
235
235
  throw new Error("Cannot modify frozen object");
236
236
  }
237
237
  function X(t, e, n, r, s) {
@@ -259,12 +259,12 @@ function X(t, e, n, r, s) {
259
259
  case 2:
260
260
  for (const [a, c] of t)
261
261
  X(a, a, n, r, s), X(c, a, n, r, s);
262
- t.set = t.clear = t.delete = Ot;
262
+ t.set = t.clear = t.delete = vt;
263
263
  break;
264
264
  case 3:
265
265
  for (const a of t)
266
266
  X(a, a, n, r, s);
267
- t.add = t.clear = t.delete = Ot;
267
+ t.add = t.clear = t.delete = vt;
268
268
  break;
269
269
  case 1:
270
270
  Object.freeze(t);
@@ -280,7 +280,7 @@ function X(t, e, n, r, s) {
280
280
  }
281
281
  r.pop(), s.pop();
282
282
  }
283
- function ut(t, e) {
283
+ function lt(t, e) {
284
284
  const n = Z(t);
285
285
  if (n === 0)
286
286
  Reflect.ownKeys(t).forEach((r) => {
@@ -293,11 +293,11 @@ function ut(t, e) {
293
293
  } else
294
294
  t.forEach((r, s) => e(s, r, t));
295
295
  }
296
- function on(t, e, n) {
296
+ function an(t, e, n) {
297
297
  if (Y(t) || !K(t, n) || e.has(t) || Object.isFrozen(t))
298
298
  return;
299
299
  const r = t instanceof Set, s = r ? /* @__PURE__ */ new Map() : void 0;
300
- if (e.add(t), ut(t, (i, o) => {
300
+ if (e.add(t), lt(t, (i, o) => {
301
301
  var a;
302
302
  if (Y(o)) {
303
303
  const c = S(o);
@@ -305,7 +305,7 @@ function on(t, e, n) {
305
305
  const u = !((a = c.assignedMap) === null || a === void 0) && a.size || c.operated ? c.copy : c.original;
306
306
  pe(r ? s : t, i, u);
307
307
  } else
308
- on(o, e, n);
308
+ an(o, e, n);
309
309
  }), s) {
310
310
  const i = t, o = Array.from(i);
311
311
  i.clear(), o.forEach((a) => {
@@ -313,39 +313,39 @@ function on(t, e, n) {
313
313
  });
314
314
  }
315
315
  }
316
- function er(t, e) {
316
+ function tr(t, e) {
317
317
  const n = t.type === 3 ? t.setMap : t.copy;
318
- t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && on(Q(n, e), t.finalities.handledSet, t.options);
318
+ t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && an(Q(n, e), t.finalities.handledSet, t.options);
319
319
  }
320
- function qe(t) {
320
+ function ze(t) {
321
321
  t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
322
- t.copy.add(ct(e));
322
+ t.copy.add(ut(e));
323
323
  }));
324
324
  }
325
- function ze(t, e, n, r) {
325
+ function Ve(t, e, n, r) {
326
326
  if (t.operated && t.assignedMap && t.assignedMap.size > 0 && !t.finalized) {
327
327
  if (n && r) {
328
- const i = rn(t);
328
+ const i = sn(t);
329
329
  i && e(t, i, n, r);
330
330
  }
331
331
  t.finalized = !0;
332
332
  }
333
333
  }
334
- function lt(t, e, n, r) {
334
+ function ft(t, e, n, r) {
335
335
  const s = S(n);
336
336
  s && (s.callbacks || (s.callbacks = []), s.callbacks.push((i, o) => {
337
337
  var a;
338
338
  const c = t.type === 3 ? t.setMap : t.copy;
339
339
  if (W(Q(c, e), n)) {
340
340
  let u = s.original;
341
- s.copy && (u = s.copy), qe(t), ze(t, r, i, o), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(u, s.original)), pe(c, e, u);
341
+ s.copy && (u = s.copy), ze(t), Ve(t, r, i, o), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(u, s.original)), pe(c, e, u);
342
342
  }
343
343
  }), t.options.enableAutoFreeze && s.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), K(n, t.options) && t.finalities.draft.push(() => {
344
344
  const i = t.type === 3 ? t.setMap : t.copy;
345
- W(Q(i, e), n) && er(t, e);
345
+ W(Q(i, e), n) && tr(t, e);
346
346
  });
347
347
  }
348
- function tr(t, e, n, r, s) {
348
+ function nr(t, e, n, r, s) {
349
349
  let { original: i, assignedMap: o, options: a } = t, c = t.copy;
350
350
  c.length < i.length && ([i, c] = [c, i], [n, r] = [r, n]);
351
351
  for (let u = 0; u < i.length; u += 1)
@@ -391,7 +391,7 @@ function tr(t, e, n, r, s) {
391
391
  }
392
392
  }
393
393
  }
394
- function nr({ original: t, copy: e, assignedMap: n }, r, s, i, o) {
394
+ function rr({ original: t, copy: e, assignedMap: n }, r, s, i, o) {
395
395
  n.forEach((a, c) => {
396
396
  const u = Q(t, c), l = me(Q(e, c)), f = a ? ue(t, c) ? A.Replace : A.Add : A.Remove;
397
397
  if (W(u, l) && f === A.Replace)
@@ -400,7 +400,7 @@ function nr({ original: t, copy: e, assignedMap: n }, r, s, i, o) {
400
400
  s.push(f === A.Remove ? { op: f, path: h } : { op: f, path: h, value: l }), i.push(f === A.Add ? { op: A.Remove, path: h } : f === A.Remove ? { op: A.Add, path: h, value: u } : { op: A.Replace, path: h, value: u });
401
401
  });
402
402
  }
403
- function rr({ original: t, copy: e }, n, r, s, i) {
403
+ function sr({ original: t, copy: e }, n, r, s, i) {
404
404
  let o = 0;
405
405
  t.forEach((a) => {
406
406
  if (!e.has(a)) {
@@ -437,17 +437,17 @@ function de(t, e, n, r) {
437
437
  switch (t.type) {
438
438
  case 0:
439
439
  case 2:
440
- return nr(t, e, n, r, s);
440
+ return rr(t, e, n, r, s);
441
441
  case 1:
442
- return tr(t, e, n, r, s);
442
+ return nr(t, e, n, r, s);
443
443
  case 3:
444
- return rr(t, e, n, r, s);
444
+ return sr(t, e, n, r, s);
445
445
  }
446
446
  }
447
447
  const ve = (t, e, n = !1) => {
448
448
  if (typeof t == "object" && t !== null && (!K(t, e) || n))
449
449
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
450
- }, Ve = {
450
+ }, We = {
451
451
  get size() {
452
452
  return U(S(this)).size;
453
453
  },
@@ -456,7 +456,7 @@ const ve = (t, e, n = !1) => {
456
456
  },
457
457
  set(t, e) {
458
458
  const n = S(this), r = U(n);
459
- return (!r.has(t) || !W(r.get(t), e)) && (j(n), z(n), n.assignedMap.set(t, !0), n.copy.set(t, e), lt(n, t, e, de)), this;
459
+ return (!r.has(t) || !W(r.get(t), e)) && (j(n), z(n), n.assignedMap.set(t, !0), n.copy.set(t, e), ft(n, t, e, de)), this;
460
460
  },
461
461
  delete(t) {
462
462
  if (!this.has(t))
@@ -484,7 +484,7 @@ const ve = (t, e, n = !1) => {
484
484
  const r = S(this), s = U(r).get(t), i = ((n = (e = r.options).mark) === null || n === void 0 ? void 0 : n.call(e, s, L)) === L.mutable;
485
485
  if (r.options.strict && ve(s, r.options, i), i || r.finalized || !K(s, r.options) || s !== r.original.get(t))
486
486
  return s;
487
- const o = it.createDraft({
487
+ const o = ot.createDraft({
488
488
  original: s,
489
489
  parentDraft: r,
490
490
  key: t,
@@ -528,7 +528,7 @@ const ve = (t, e, n = !1) => {
528
528
  [Te]() {
529
529
  return this.entries();
530
530
  }
531
- }, sr = Reflect.ownKeys(Ve), vt = (t, e, { isValuesIterator: n }) => () => {
531
+ }, ir = Reflect.ownKeys(We), At = (t, e, { isValuesIterator: n }) => () => {
532
532
  var r, s;
533
533
  const i = e.next();
534
534
  if (i.done)
@@ -537,7 +537,7 @@ const ve = (t, e, n = !1) => {
537
537
  let a = t.setMap.get(o);
538
538
  const c = S(a), u = ((s = (r = t.options).mark) === null || s === void 0 ? void 0 : s.call(r, a, L)) === L.mutable;
539
539
  if (t.options.strict && ve(o, t.options, u), !u && !c && K(o, t.options) && !t.finalized && t.original.has(o)) {
540
- const l = it.createDraft({
540
+ const l = ot.createDraft({
541
541
  original: o,
542
542
  parentDraft: t,
543
543
  key: o,
@@ -564,7 +564,7 @@ const ve = (t, e, n = !1) => {
564
564
  },
565
565
  add(t) {
566
566
  const e = S(this);
567
- return this.has(t) || (j(e), z(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), lt(e, t, t, de)), this;
567
+ return this.has(t) || (j(e), z(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), ft(e, t, t, de)), this;
568
568
  },
569
569
  delete(t) {
570
570
  if (!this.has(t))
@@ -589,7 +589,7 @@ const ve = (t, e, n = !1) => {
589
589
  const e = t.setMap.keys();
590
590
  return {
591
591
  [Symbol.iterator]: () => this.values(),
592
- next: vt(t, e, { isValuesIterator: !0 })
592
+ next: At(t, e, { isValuesIterator: !0 })
593
593
  };
594
594
  },
595
595
  entries() {
@@ -598,7 +598,7 @@ const ve = (t, e, n = !1) => {
598
598
  const e = t.setMap.keys();
599
599
  return {
600
600
  [Symbol.iterator]: () => this.entries(),
601
- next: vt(t, e, {
601
+ next: At(t, e, {
602
602
  isValuesIterator: !1
603
603
  })
604
604
  };
@@ -639,13 +639,13 @@ Set.prototype.difference && Object.assign(Ae, {
639
639
  return Set.prototype.isDisjointFrom.call(new Set(this.values()), t);
640
640
  }
641
641
  });
642
- const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
642
+ const or = Reflect.ownKeys(Ae), cn = /* @__PURE__ */ new WeakSet(), un = {
643
643
  get(t, e, n) {
644
644
  var r, s;
645
645
  const i = (r = t.copy) === null || r === void 0 ? void 0 : r[e];
646
- if (i && an.has(i))
646
+ if (i && cn.has(i))
647
647
  return i;
648
- if (e === nn)
648
+ if (e === rn)
649
649
  return t;
650
650
  let o;
651
651
  if (t.options.mark) {
@@ -654,14 +654,14 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
654
654
  return t.options.strict && ve(u, t.options, !0), u;
655
655
  }
656
656
  const a = U(t);
657
- if (a instanceof Map && sr.includes(e)) {
657
+ if (a instanceof Map && ir.includes(e)) {
658
658
  if (e === "size")
659
- return Object.getOwnPropertyDescriptor(Ve, "size").get.call(t.proxy);
660
- const u = Ve[e];
659
+ return Object.getOwnPropertyDescriptor(We, "size").get.call(t.proxy);
660
+ const u = We[e];
661
661
  if (u)
662
662
  return u.bind(t.proxy);
663
663
  }
664
- if (a instanceof Set && ir.includes(e)) {
664
+ if (a instanceof Set && or.includes(e)) {
665
665
  if (e === "size")
666
666
  return Object.getOwnPropertyDescriptor(Ae, "size").get.call(t.proxy);
667
667
  const u = Ae[e];
@@ -669,7 +669,7 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
669
669
  return u.bind(t.proxy);
670
670
  }
671
671
  if (!ue(a, e)) {
672
- const u = St(a, e);
672
+ const u = Ot(a, e);
673
673
  return u ? "value" in u ? u.value : (
674
674
  // !case: support for getter
675
675
  (s = u.get) === null || s === void 0 ? void 0 : s.call(t.proxy)
@@ -678,8 +678,8 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
678
678
  const c = a[e];
679
679
  if (t.options.strict && ve(c, t.options), t.finalized || !K(c, t.options))
680
680
  return c;
681
- if (c === xe(t.original, e)) {
682
- if (j(t), t.copy[e] = ft({
681
+ if (c === Re(t.original, e)) {
682
+ if (j(t), t.copy[e] = dt({
683
683
  original: t.original[e],
684
684
  parentDraft: t,
685
685
  key: t.type === 1 ? Number(e) : e,
@@ -700,11 +700,11 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
700
700
  let s;
701
701
  if (t.type === 1 && e !== "length" && !(Number.isInteger(s = Number(e)) && s >= 0 && (e === 0 || s === 0 || String(s) === String(e))))
702
702
  throw new Error("Only supports setting array indices and the 'length' property.");
703
- const i = St(U(t), e);
703
+ const i = Ot(U(t), e);
704
704
  if (i != null && i.set)
705
705
  return i.set.call(t.proxy, n), !0;
706
- const o = xe(U(t), e), a = S(o);
707
- return a && W(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) : (W(n, o) && (n !== void 0 || ue(t.original, e)) || (j(t), z(t), ue(t.original, e) && W(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, lt(t, e, n, de)), !0);
706
+ const o = Re(U(t), e), a = S(o);
707
+ return a && W(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) : (W(n, o) && (n !== void 0 || ue(t.original, e)) || (j(t), z(t), ue(t.original, e) && W(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, ft(t, e, n, de)), !0);
708
708
  },
709
709
  has(t, e) {
710
710
  return e in U(t);
@@ -732,10 +732,10 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
732
732
  },
733
733
  deleteProperty(t, e) {
734
734
  var n;
735
- return t.type === 1 ? cn.set.call(this, t, e, void 0, t.proxy) : (xe(t.original, e) !== void 0 || e in t.original ? (j(t), z(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
735
+ return t.type === 1 ? un.set.call(this, t, e, void 0, t.proxy) : (Re(t.original, e) !== void 0 || e in t.original ? (j(t), z(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
736
736
  }
737
737
  };
738
- function ft(t) {
738
+ function dt(t) {
739
739
  const { original: e, parentDraft: n, key: r, finalities: s, options: i } = t, o = Z(e), a = {
740
740
  type: o,
741
741
  finalized: !1,
@@ -749,8 +749,8 @@ function ft(t) {
749
749
  setMap: o === 3 ? new Map(e.entries()) : void 0
750
750
  };
751
751
  (r || "key" in t) && (a.key = r);
752
- const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a, cn);
753
- if (s.revoke.push(u), an.add(c), a.proxy = c, n) {
752
+ const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a, un);
753
+ if (s.revoke.push(u), cn.add(c), a.proxy = c, n) {
754
754
  const l = n;
755
755
  l.finalities.draft.push((f, d) => {
756
756
  var h, p;
@@ -759,7 +759,7 @@ function ft(t) {
759
759
  const y = Q(_, r), g = S(y);
760
760
  if (g) {
761
761
  let T = g.original;
762
- g.operated && (T = ct(y)), qe(g), ze(g, de, f, d), l.options.enableAutoFreeze && (l.options.updatedValues = (h = l.options.updatedValues) !== null && h !== void 0 ? h : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(T, g.original)), pe(_, r, T);
762
+ g.operated && (T = ut(y)), ze(g), Ve(g, de, f, d), l.options.enableAutoFreeze && (l.options.updatedValues = (h = l.options.updatedValues) !== null && h !== void 0 ? h : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(T, g.original)), pe(_, r, T);
763
763
  }
764
764
  (p = b.callbacks) === null || p === void 0 || p.forEach((T) => {
765
765
  T(f, d);
@@ -768,26 +768,26 @@ function ft(t) {
768
768
  } else {
769
769
  const l = S(c);
770
770
  l.finalities.draft.push((f, d) => {
771
- qe(l), ze(l, de, f, d);
771
+ ze(l), Ve(l, de, f, d);
772
772
  });
773
773
  }
774
774
  return c;
775
775
  }
776
- it.createDraft = ft;
777
- function or(t, e, n, r, s) {
776
+ ot.createDraft = dt;
777
+ function ar(t, e, n, r, s) {
778
778
  var i;
779
779
  const o = S(t), a = (i = o == null ? void 0 : o.original) !== null && i !== void 0 ? i : t, c = !!e.length;
780
780
  if (o != null && o.operated)
781
781
  for (; o.finalities.draft.length > 0; )
782
782
  o.finalities.draft.pop()(n, r);
783
783
  const u = c ? e[0] : o ? o.operated ? o.copy : o.original : t;
784
- return o && Ke(o), s && X(u, u, o == null ? void 0 : o.options.updatedValues), [
784
+ return o && qe(o), s && X(u, u, o == null ? void 0 : o.options.updatedValues), [
785
785
  u,
786
786
  n && c ? [{ op: A.Replace, path: [], value: e[0] }] : n,
787
787
  r && c ? [{ op: A.Replace, path: [], value: a }] : r
788
788
  ];
789
789
  }
790
- function ar(t, e) {
790
+ function cr(t, e) {
791
791
  var n;
792
792
  const r = {
793
793
  draft: [],
@@ -796,7 +796,7 @@ function ar(t, e) {
796
796
  };
797
797
  let s, i;
798
798
  e.enablePatches && (s = [], i = []);
799
- const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, L)) === L.mutable || !K(t, e) ? t : ft({
799
+ const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, L)) === L.mutable || !K(t, e) ? t : dt({
800
800
  original: t,
801
801
  parentDraft: null,
802
802
  finalities: r,
@@ -805,14 +805,14 @@ function ar(t, e) {
805
805
  return [
806
806
  a,
807
807
  (c = []) => {
808
- const [u, l, f] = or(a, c, s, i, e.enableAutoFreeze);
808
+ const [u, l, f] = ar(a, c, s, i, e.enableAutoFreeze);
809
809
  return e.enablePatches ? [u, l, f] : u;
810
810
  }
811
811
  ];
812
812
  }
813
- function We(t) {
813
+ function Qe(t) {
814
814
  const { rootDraft: e, value: n, useRawReturn: r = !1, isRoot: s = !0 } = t;
815
- ut(n, (i, o, a) => {
815
+ lt(n, (i, o, a) => {
816
816
  const c = S(o);
817
817
  if (c && e && c.finalities === e.finalities) {
818
818
  t.isContainDraft = !0;
@@ -822,10 +822,10 @@ function We(t) {
822
822
  a.clear(), l.forEach((f) => a.add(i === f ? u : f));
823
823
  } else
824
824
  pe(a, i, u);
825
- } else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1, We(t));
825
+ } else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1, Qe(t));
826
826
  }), s && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
827
827
  }
828
- function un(t) {
828
+ function ln(t) {
829
829
  var e;
830
830
  const n = S(t);
831
831
  if (!K(t, n == null ? void 0 : n.options))
@@ -835,7 +835,7 @@ function un(t) {
835
835
  return n.original;
836
836
  let s;
837
837
  function i() {
838
- s = r === 2 ? at(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : sn(t, n == null ? void 0 : n.options);
838
+ s = r === 2 ? ct(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : on(t, n == null ? void 0 : n.options);
839
839
  }
840
840
  if (n) {
841
841
  n.finalized = !0;
@@ -846,23 +846,23 @@ function un(t) {
846
846
  }
847
847
  } else
848
848
  s = t;
849
- if (ut(s, (o, a) => {
849
+ if (lt(s, (o, a) => {
850
850
  if (n && W(Q(n.original, o), a))
851
851
  return;
852
- const c = un(a);
852
+ const c = ln(a);
853
853
  c !== a && (s === t && i(), pe(s, o, c));
854
854
  }), r === 3) {
855
855
  const o = (e = n == null ? void 0 : n.original) !== null && e !== void 0 ? e : s;
856
- return ot(o) ? new Set(s) : new (Object.getPrototypeOf(o)).constructor(s);
856
+ return at(o) ? new Set(s) : new (Object.getPrototypeOf(o)).constructor(s);
857
857
  }
858
858
  return s;
859
859
  }
860
- function At(t) {
860
+ function kt(t) {
861
861
  if (!Y(t))
862
862
  throw new Error(`current() is only used for Draft, parameter: ${t}`);
863
- return un(t);
863
+ return ln(t);
864
864
  }
865
- const cr = (t) => function e(n, r, s) {
865
+ const ur = (t) => function e(n, r, s) {
866
866
  var i, o, a;
867
867
  if (typeof n == "function" && typeof r != "function")
868
868
  return function(m, ...M) {
@@ -873,7 +873,7 @@ const cr = (t) => function e(n, r, s) {
873
873
  if (typeof r != "function" && (l = r), l !== void 0 && Object.prototype.toString.call(l) !== "[object Object]")
874
874
  throw new Error(`Invalid options: ${l}, 'options' should be an object.`);
875
875
  l = Object.assign(Object.assign({}, t), l);
876
- const f = Y(c) ? At(c) : c, d = Array.isArray(l.mark) ? (m, M) => {
876
+ const f = Y(c) ? kt(c) : c, d = Array.isArray(l.mark) ? (m, M) => {
877
877
  for (const I of l.mark) {
878
878
  if (typeof I != "function")
879
879
  throw new Error(`Invalid mark: ${I}, 'mark' should be a function.`);
@@ -889,7 +889,7 @@ const cr = (t) => function e(n, r, s) {
889
889
  };
890
890
  if (!K(f, _) && typeof f == "object" && f !== null)
891
891
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
892
- const [y, g] = ar(f, _);
892
+ const [y, g] = cr(f, _);
893
893
  if (typeof r != "function") {
894
894
  if (!K(f, _))
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.");
@@ -899,24 +899,24 @@ const cr = (t) => function e(n, r, s) {
899
899
  try {
900
900
  T = u(y);
901
901
  } catch (m) {
902
- throw Ke(S(y)), m;
902
+ throw qe(S(y)), m;
903
903
  }
904
904
  const v = (m) => {
905
905
  const M = S(y);
906
906
  if (!Y(m)) {
907
907
  if (m !== void 0 && !W(m, y) && (M != null && M.operated))
908
908
  throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
909
- const B = m == null ? void 0 : m[Jn];
909
+ const B = m == null ? void 0 : m[Yn];
910
910
  if (B) {
911
911
  const De = B[0];
912
- return _.strict && typeof m == "object" && m !== null && We({
912
+ return _.strict && typeof m == "object" && m !== null && Qe({
913
913
  rootDraft: M,
914
914
  value: m,
915
915
  useRawReturn: !0
916
916
  }), g([De]);
917
917
  }
918
918
  if (m !== void 0)
919
- return typeof m == "object" && m !== null && We({ rootDraft: M, value: m }), g([m]);
919
+ return typeof m == "object" && m !== null && Qe({ rootDraft: M, value: m }), g([m]);
920
920
  }
921
921
  if (m === y || m === void 0)
922
922
  return g([]);
@@ -924,30 +924,30 @@ const cr = (t) => function e(n, r, s) {
924
924
  if (_ === I.options) {
925
925
  if (I.operated)
926
926
  throw new Error("Cannot return a modified child draft.");
927
- return g([At(m)]);
927
+ return g([kt(m)]);
928
928
  }
929
929
  return g([m]);
930
930
  };
931
931
  return T instanceof Promise ? T.then(v, (m) => {
932
- throw Ke(S(y)), m;
932
+ throw qe(S(y)), m;
933
933
  }) : v(T);
934
- }, ke = cr();
934
+ }, ke = ur();
935
935
  Object.prototype.constructor.toString();
936
- function ln(t, e) {
936
+ function fn(t, e) {
937
937
  const n = Object.keys(t), r = Object.keys(e);
938
938
  return n.length === r.length && Object.keys(t).every((s) => e.hasOwnProperty(s));
939
939
  }
940
- function kt(t, e) {
940
+ function Et(t, e) {
941
941
  return Object.keys(t).length === Object.keys(e).length && Object.keys(t).every(
942
942
  (n) => e.hasOwnProperty(n) && t[n] === e[n]
943
943
  );
944
944
  }
945
945
  function Se(t, e) {
946
- return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : ln(t, e) ? Object.keys(t).every(
946
+ return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : fn(t, e) ? Object.keys(t).every(
947
947
  (n) => Se(t[n], e[n])
948
948
  ) : !1;
949
949
  }
950
- function dt(t) {
950
+ function ht(t) {
951
951
  if (!ae(t))
952
952
  return t;
953
953
  const e = {};
@@ -955,7 +955,7 @@ function dt(t) {
955
955
  r !== void 0 && (e[n] = r);
956
956
  return e;
957
957
  }
958
- function fn(t, e) {
958
+ function dn(t, e) {
959
959
  if (!ae(t) || !ae(e))
960
960
  return e;
961
961
  const n = { ...t };
@@ -966,14 +966,14 @@ function fn(t, e) {
966
966
  continue;
967
967
  }
968
968
  const s = ae(t[r]) && ae(e[r]);
969
- n[r] = s ? fn(t[r], e[r]) : e[r];
969
+ n[r] = s ? dn(t[r], e[r]) : e[r];
970
970
  }
971
971
  return n;
972
972
  }
973
973
  function ae(t) {
974
974
  return typeof t == "object" && t !== null && !Array.isArray(t);
975
975
  }
976
- function ur(t, e, n) {
976
+ function lr(t, e, n) {
977
977
  if (!t || e.length === 0)
978
978
  return;
979
979
  let r = t || {};
@@ -984,7 +984,7 @@ function ur(t, e, n) {
984
984
  const s = e[e.length - 1];
985
985
  Array.isArray(r) && typeof s == "number" ? r.splice(s, 0, n) : r[s] = n;
986
986
  }
987
- function Et(t, e, n) {
987
+ function Ct(t, e, n) {
988
988
  if (!t || e.length === 0)
989
989
  return;
990
990
  let r = t || {};
@@ -994,7 +994,7 @@ function Et(t, e, n) {
994
994
  }
995
995
  r[e[e.length - 1]] = n;
996
996
  }
997
- function dn(t, e) {
997
+ function hn(t, e) {
998
998
  if (!t || e.length === 0)
999
999
  return;
1000
1000
  const [n, ...r] = e;
@@ -1003,13 +1003,13 @@ function dn(t, e) {
1003
1003
  Array.isArray(t) ? t.splice(n, 1) : delete t[n];
1004
1004
  return;
1005
1005
  }
1006
- dn(t[n], r), lr(t[n]) && delete t[n];
1006
+ hn(t[n], r), fr(t[n]) && delete t[n];
1007
1007
  }
1008
1008
  }
1009
- function lr(t) {
1009
+ function fr(t) {
1010
1010
  return t && Object.keys(t).length === 0;
1011
1011
  }
1012
- const Ct = /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$/, fr = {
1012
+ const Mt = /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$/, dr = {
1013
1013
  ZULU: 0,
1014
1014
  YEKT: 18e3,
1015
1015
  YEKST: 21600,
@@ -1205,32 +1205,32 @@ const Ct = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|
1205
1205
  ACSST: 37800,
1206
1206
  ACDT: 37800
1207
1207
  };
1208
- function dr(t) {
1208
+ function hr(t) {
1209
1209
  return new Date(t);
1210
1210
  }
1211
- function hr(t) {
1211
+ function pr(t) {
1212
1212
  return /* @__PURE__ */ new Date(t + "Z");
1213
1213
  }
1214
- const pr = /^(\d+)[\./-](\d+)[\./-](\d+)$/;
1215
- function yr(t) {
1216
- const e = t.match(pr);
1214
+ const yr = /^(\d+)[\./-](\d+)[\./-](\d+)$/;
1215
+ function br(t) {
1216
+ const e = t.match(yr);
1217
1217
  if (!e)
1218
1218
  return null;
1219
1219
  const [n, r, s, i] = e;
1220
1220
  return r <= 0 || s <= 0 || i <= 0 ? null : r > 999 ? new Date(Date.UTC(r, s - 1, i, 0, 0, 0, 0)) : new Date(Date.UTC(i, r - 1, s, 0, 0, 0, 0));
1221
1221
  }
1222
- function br(t) {
1222
+ function _r(t) {
1223
1223
  const [e, n] = t.split(" ");
1224
1224
  return /* @__PURE__ */ new Date(e + "T" + n + "Z");
1225
1225
  }
1226
- function _r(t) {
1226
+ function gr(t) {
1227
1227
  const [e, n] = t.split(" ");
1228
1228
  return /* @__PURE__ */ new Date(e + "T" + n + "Z");
1229
1229
  }
1230
- function gr(t) {
1230
+ function wr(t) {
1231
1231
  return new Date(t);
1232
1232
  }
1233
- function wr(t) {
1233
+ function Tr(t) {
1234
1234
  const e = /^(\w{3}) (\w{3}) (\d{2}) (\d{4})$/;
1235
1235
  if (!t.match(e))
1236
1236
  throw new Error(`Unable to parse \`${t}\` as a date.`);
@@ -1247,7 +1247,7 @@ function wr(t) {
1247
1247
  )
1248
1248
  );
1249
1249
  }
1250
- function Tr(t) {
1250
+ function mr(t) {
1251
1251
  const e = /^(.+T.+)([+-])(\d{2})$/, n = t.match(e);
1252
1252
  if (n) {
1253
1253
  const [, r, s, i] = n, o = `${r}${s}${i}:00`;
@@ -1255,7 +1255,7 @@ function Tr(t) {
1255
1255
  }
1256
1256
  return null;
1257
1257
  }
1258
- function mr(t) {
1258
+ function Sr(t) {
1259
1259
  const e = /^(\d+)-(\d{1,2})-(\d{1,2})([ T])(.+)$/, n = t.match(e);
1260
1260
  if (n) {
1261
1261
  const [, r, s, i, o, a] = n, c = s.padStart(2, "0"), u = i.padStart(2, "0"), l = `${r}-${c}-${u}T${a}`;
@@ -1263,14 +1263,14 @@ function mr(t) {
1263
1263
  }
1264
1264
  return null;
1265
1265
  }
1266
- function Sr(t) {
1266
+ function Or(t) {
1267
1267
  const [e, n] = t.split(", "), [r, s, i] = e.split("/").map(Number), o = n.match(/(\d{1,2}):(\d{2}):(\d{2}) (AM|PM)/);
1268
1268
  if (!o)
1269
1269
  throw new Error(`Unable to parse time from: ${t}`);
1270
1270
  let [, a, c, u, l] = o;
1271
1271
  return a = Number(a), c = Number(c), u = Number(u), l === "PM" && a !== 12 ? a += 12 : l === "AM" && a === 12 && (a = 0), new Date(Date.UTC(i, r - 1, s, a, c, u));
1272
1272
  }
1273
- function Or(t) {
1273
+ function vr(t) {
1274
1274
  switch (t) {
1275
1275
  case "epoch":
1276
1276
  return /* @__PURE__ */ new Date(0);
@@ -1282,28 +1282,28 @@ function Or(t) {
1282
1282
  return null;
1283
1283
  }
1284
1284
  }
1285
- function vr(t) {
1286
- const e = t.match(Ct);
1285
+ function Ar(t) {
1286
+ const e = t.match(Mt);
1287
1287
  if (!e)
1288
1288
  return null;
1289
- const [n] = e, r = fr[n], s = new Date(t.replace(Ct, "Z"));
1289
+ const [n] = e, r = dr[n], s = new Date(t.replace(Mt, "Z"));
1290
1290
  return new Date(s.getTime() - r * 1e3);
1291
1291
  }
1292
- const Ar = [
1293
- yr,
1294
- _r,
1295
- wr,
1296
- Sr,
1292
+ const kr = [
1293
+ br,
1297
1294
  gr,
1298
- hr,
1299
1295
  Tr,
1300
- br,
1301
- dr,
1302
1296
  Or,
1297
+ wr,
1298
+ pr,
1299
+ mr,
1300
+ _r,
1301
+ hr,
1303
1302
  vr,
1304
- mr
1303
+ Ar,
1304
+ Sr
1305
1305
  ];
1306
- function kr(t, e) {
1306
+ function Er(t, e) {
1307
1307
  try {
1308
1308
  const n = t(e);
1309
1309
  return n instanceof Date && !isNaN(n.getTime()) ? n : null;
@@ -1311,18 +1311,18 @@ function kr(t, e) {
1311
1311
  return null;
1312
1312
  }
1313
1313
  }
1314
- function Qe(t) {
1315
- for (const e of Ar) {
1316
- const n = kr(e, t);
1314
+ function Ge(t) {
1315
+ for (const e of kr) {
1316
+ const n = Er(e, t);
1317
1317
  if (n)
1318
1318
  return n;
1319
1319
  }
1320
1320
  return null;
1321
1321
  }
1322
- function Er(t) {
1322
+ function Cr(t) {
1323
1323
  try {
1324
1324
  const e = JSON.parse(t);
1325
- return typeof e == "string" ? Qe(e) : null;
1325
+ return typeof e == "string" ? Ge(e) : null;
1326
1326
  } catch {
1327
1327
  return null;
1328
1328
  }
@@ -1334,7 +1334,7 @@ function Me(t) {
1334
1334
  if (t instanceof Date)
1335
1335
  return t;
1336
1336
  if (typeof t == "string") {
1337
- const e = Qe(t) || Er(t) || Qe(t.trim());
1337
+ const e = Ge(t) || Cr(t) || Ge(t.trim());
1338
1338
  if (!e)
1339
1339
  throw new Error(`Unable to parse \`${t}\` as a date.`);
1340
1340
  return e;
@@ -1345,13 +1345,13 @@ function Me(t) {
1345
1345
  );
1346
1346
  }
1347
1347
  }
1348
- function Cr(t) {
1348
+ function Mr(t) {
1349
1349
  return t.cardinality === "one";
1350
1350
  }
1351
- function ht(t) {
1351
+ function pt(t) {
1352
1352
  return t["value-type"] === "ref";
1353
1353
  }
1354
- function pt(t) {
1354
+ function yt(t) {
1355
1355
  return t["value-type"] === "blob";
1356
1356
  }
1357
1357
  function re(t, e) {
@@ -1379,7 +1379,7 @@ function D(t, e, n) {
1379
1379
  let i = t.get(r);
1380
1380
  i || (i = /* @__PURE__ */ new Map(), t.set(r, i)), D(i, s, n);
1381
1381
  }
1382
- function hn(t, e, n) {
1382
+ function pn(t, e, n) {
1383
1383
  const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1384
1384
  for (const o of e) {
1385
1385
  let [a, c, u, l] = o;
@@ -1388,32 +1388,32 @@ function hn(t, e, n) {
1388
1388
  console.warn("no such attr", a, t);
1389
1389
  continue;
1390
1390
  }
1391
- f["checked-data-type"] === "date" && n && (u = Me(u), o[2] = u), ht(f) && D(i, [u, c, a], o), D(r, [a, c, u], o), D(s, [c, a, u], o);
1391
+ f["checked-data-type"] === "date" && n && (u = Me(u), o[2] = u), pt(f) && D(i, [u, c, a], o), D(r, [a, c, u], o), D(s, [c, a, u], o);
1392
1392
  }
1393
1393
  return { eav: r, aev: s, vae: i };
1394
1394
  }
1395
- function pn(t) {
1395
+ function yn(t) {
1396
1396
  const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1397
1397
  for (const i of Object.values(t)) {
1398
1398
  const o = i["forward-identity"], [a, c, u] = o, l = i["reverse-identity"];
1399
- if (D(r, [c, u], i), pt(i) && D(e, [c, u], i), i["primary?"] && D(n, [c], i), l) {
1399
+ if (D(r, [c, u], i), yt(i) && D(e, [c, u], i), i["primary?"] && D(n, [c], i), l) {
1400
1400
  const [f, d, h] = l;
1401
1401
  D(s, [d, h], i);
1402
1402
  }
1403
1403
  }
1404
1404
  return { blobAttrs: e, primaryKeys: n, forwardIdents: r, revIdents: s };
1405
1405
  }
1406
- function yn(t) {
1406
+ function bn(t) {
1407
1407
  return {
1408
1408
  __type: t.__type,
1409
1409
  attrs: t.attrs,
1410
- triples: x(t.eav, 3),
1410
+ triples: R(t.eav, 3),
1411
1411
  cardinalityInference: t.cardinalityInference,
1412
1412
  linkIndex: t.linkIndex,
1413
1413
  useDateObjects: t.useDateObjects
1414
1414
  };
1415
1415
  }
1416
- function bn(t) {
1416
+ function _n(t) {
1417
1417
  return Oe(
1418
1418
  t.attrs,
1419
1419
  t.triples,
@@ -1422,19 +1422,19 @@ function bn(t) {
1422
1422
  t.useDateObjects
1423
1423
  );
1424
1424
  }
1425
- function Mr(t, e) {
1425
+ function Ir(t, e) {
1426
1426
  return se(t.eav, [e]) !== void 0;
1427
1427
  }
1428
- function yt(t) {
1429
- t.attrIndexes = pn(t.attrs);
1428
+ function bt(t) {
1429
+ t.attrIndexes = yn(t.attrs);
1430
1430
  }
1431
1431
  function Oe(t, e, n, r, s) {
1432
- const i = hn(
1432
+ const i = pn(
1433
1433
  t,
1434
1434
  e,
1435
1435
  s
1436
1436
  );
1437
- return i.useDateObjects = s, i.attrs = t, i.attrIndexes = pn(t), i.cardinalityInference = n, i.linkIndex = r, i.__type = "store", i;
1437
+ return i.useDateObjects = s, i.attrs = t, i.attrIndexes = yn(t), i.cardinalityInference = n, i.linkIndex = r, i.__type = "store", i;
1438
1438
  }
1439
1439
  function ye(t, e) {
1440
1440
  var s, i;
@@ -1443,7 +1443,7 @@ function ye(t, e) {
1443
1443
  const [o, a] = e[0], c = t.aev.get(o);
1444
1444
  if (!c)
1445
1445
  return null;
1446
- n = (s = x(c, 2).find((l) => l[2] === a)) == null ? void 0 : s[0];
1446
+ n = (s = R(c, 2).find((l) => l[2] === a)) == null ? void 0 : s[0];
1447
1447
  } else
1448
1448
  n = e[0];
1449
1449
  if (!n)
@@ -1453,7 +1453,7 @@ function ye(t, e) {
1453
1453
  const [o, a] = r, c = t.aev.get(o);
1454
1454
  if (!c)
1455
1455
  return null;
1456
- const l = (i = x(c, 2).find((b) => b[2] === a)) == null ? void 0 : i[0];
1456
+ const l = (i = R(c, 2).find((b) => b[2] === a)) == null ? void 0 : i[0];
1457
1457
  if (!l)
1458
1458
  return null;
1459
1459
  const [f, d, h, ...p] = e;
@@ -1463,21 +1463,21 @@ function ye(t, e) {
1463
1463
  return [n, ...a];
1464
1464
  }
1465
1465
  }
1466
- function _n(t, e) {
1466
+ function gn(t, e) {
1467
1467
  const n = ye(t, e);
1468
1468
  if (!n)
1469
1469
  return;
1470
1470
  const [r, s, i] = n, o = re(t.attrs, s);
1471
- o && (N(t.eav, [r, s, i]), N(t.aev, [s, r, i]), ht(o) && N(t.vae, [i, s, r]));
1471
+ o && (N(t.eav, [r, s, i]), N(t.aev, [s, r, i]), pt(o) && N(t.vae, [i, s, r]));
1472
1472
  }
1473
- let Ir = 0;
1474
- function gn(t, e, n) {
1473
+ let Pr = 0;
1474
+ function wn(t, e, n) {
1475
1475
  const [r, s, i] = n;
1476
1476
  let o;
1477
1477
  const a = se(t.eav, [r, s, i]);
1478
- return a && (o = a[3]), o || Date.now() * 10 + Ir++;
1478
+ return a && (o = a[3]), o || Date.now() * 10 + Pr++;
1479
1479
  }
1480
- function wn(t, e) {
1480
+ function Tn(t, e) {
1481
1481
  const n = ye(t, e);
1482
1482
  if (!n)
1483
1483
  return;
@@ -1486,31 +1486,31 @@ function wn(t, e) {
1486
1486
  if (!o)
1487
1487
  return;
1488
1488
  o["checked-data-type"] === "date" && t.useDateObjects && (i = Me(i));
1489
- const a = se(t.eav, [r, s, i]), c = (a == null ? void 0 : a[3]) ?? gn(t, o, n), u = [r, s, i, c];
1490
- Cr(o) ? (D(t.eav, [r, s], /* @__PURE__ */ new Map([[i, u]])), D(t.aev, [s, r], /* @__PURE__ */ new Map([[i, u]]))) : (D(t.eav, [r, s, i], u), D(t.aev, [s, r, i], u)), ht(o) && D(t.vae, [i, s, r], u);
1489
+ const a = se(t.eav, [r, s, i]), c = (a == null ? void 0 : a[3]) ?? wn(t, o, n), u = [r, s, i, c];
1490
+ Mr(o) ? (D(t.eav, [r, s], /* @__PURE__ */ new Map([[i, u]])), D(t.aev, [s, r], /* @__PURE__ */ new Map([[i, u]]))) : (D(t.eav, [r, s, i], u), D(t.aev, [s, r, i], u)), pt(o) && D(t.vae, [i, s, r], u);
1491
1491
  }
1492
- function Pr(t, e) {
1492
+ function jr(t, e) {
1493
1493
  var d;
1494
1494
  const n = ye(t, e);
1495
1495
  if (!n)
1496
1496
  return;
1497
1497
  const [r, s, i] = n, o = re(t.attrs, s);
1498
1498
  if (!o) return;
1499
- if (!pt(o))
1499
+ if (!yt(o))
1500
1500
  throw new Error("merge operation is not supported for links");
1501
1501
  const a = se(t.eav, [r, s]);
1502
1502
  if (!a) return;
1503
1503
  const c = (d = a.values().next()) == null ? void 0 : d.value;
1504
1504
  if (!c) return;
1505
- const u = c[2], l = fn(u, i), f = [
1505
+ const u = c[2], l = dn(u, i), f = [
1506
1506
  r,
1507
1507
  s,
1508
1508
  l,
1509
- gn(t, o, c)
1509
+ wn(t, o, c)
1510
1510
  ];
1511
1511
  D(t.eav, [r, s], /* @__PURE__ */ new Map([[l, f]]));
1512
1512
  }
1513
- function Ge(t, e) {
1513
+ function Be(t, e) {
1514
1514
  var c, u;
1515
1515
  const [n, r] = e, s = ye(t, [n]);
1516
1516
  if (!s)
@@ -1519,10 +1519,10 @@ function Ge(t, e) {
1519
1519
  if (o) {
1520
1520
  for (const l of o.keys()) {
1521
1521
  const f = t.attrs[l];
1522
- f && f["on-delete-reverse"] === "cascade" && x(o.get(l), 1).forEach(
1522
+ f && f["on-delete-reverse"] === "cascade" && R(o.get(l), 1).forEach(
1523
1523
  ([d, h, p]) => {
1524
1524
  var b;
1525
- return Ge(t, [p, (b = f["reverse-identity"]) == null ? void 0 : b[1]]);
1525
+ return Be(t, [p, (b = f["reverse-identity"]) == null ? void 0 : b[1]]);
1526
1526
  }
1527
1527
  ), // Fall back to deleting everything if we've rehydrated tx-steps from
1528
1528
  // the store that didn't set `etype` in deleteEntity
@@ -1532,15 +1532,15 @@ function Ge(t, e) {
1532
1532
  }
1533
1533
  o.size === 0 && N(t.eav, [i]);
1534
1534
  }
1535
- const a = t.vae.get(i) && x(t.vae.get(i), 2);
1535
+ const a = t.vae.get(i) && R(t.vae.get(i), 2);
1536
1536
  a && a.forEach((l) => {
1537
1537
  var b, _, y;
1538
1538
  const [f, d, h] = l, p = t.attrs[d];
1539
- (!r || !p || ((b = p["reverse-identity"]) == null ? void 0 : b[1]) === r) && (N(t.eav, [f, d, h]), N(t.aev, [d, f, h]), N(t.vae, [h, d, f])), p && p["on-delete"] === "cascade" && ((_ = p["reverse-identity"]) == null ? void 0 : _[1]) === r && Ge(t, [f, (y = p["forward-identity"]) == null ? void 0 : y[1]]);
1539
+ (!r || !p || ((b = p["reverse-identity"]) == null ? void 0 : b[1]) === r) && (N(t.eav, [f, d, h]), N(t.aev, [d, f, h]), N(t.vae, [h, d, f])), p && p["on-delete"] === "cascade" && ((_ = p["reverse-identity"]) == null ? void 0 : _[1]) === r && Be(t, [f, (y = p["forward-identity"]) == null ? void 0 : y[1]]);
1540
1540
  }), ((u = t.vae.get(i)) == null ? void 0 : u.size) === 0 && N(t.vae, [i]);
1541
1541
  }
1542
- function Tn(t, e) {
1543
- const n = hn(
1542
+ function mn(t, e) {
1543
+ const n = pn(
1544
1544
  t.attrs,
1545
1545
  e,
1546
1546
  t.useDateObjects
@@ -1549,44 +1549,44 @@ function Tn(t, e) {
1549
1549
  t[r] = n[r];
1550
1550
  });
1551
1551
  }
1552
- function jr(t, [e]) {
1553
- t.attrs[e.id] = e, yt(t);
1552
+ function $r(t, [e]) {
1553
+ t.attrs[e.id] = e, bt(t);
1554
1554
  }
1555
- function mn(t) {
1556
- return x(t.eav, 3);
1555
+ function Sn(t) {
1556
+ return R(t.eav, 3);
1557
1557
  }
1558
- function $r(t, [e]) {
1558
+ function Dr(t, [e]) {
1559
1559
  if (!t.attrs[e]) return;
1560
- const n = mn(t).filter(([r, s]) => s !== e);
1561
- delete t.attrs[e], yt(t), Tn(t, n);
1560
+ const n = Sn(t).filter(([r, s]) => s !== e);
1561
+ delete t.attrs[e], bt(t), mn(t, n);
1562
1562
  }
1563
- function Dr(t, [e]) {
1563
+ function Rr(t, [e]) {
1564
1564
  const n = t.attrs[e.id];
1565
- n && (t.attrs[e.id] = { ...n, ...e }, yt(t), Tn(t, mn(t)));
1565
+ n && (t.attrs[e.id] = { ...n, ...e }, bt(t), mn(t, Sn(t)));
1566
1566
  }
1567
1567
  function xr(t, e) {
1568
1568
  const [n, ...r] = e;
1569
1569
  switch (n) {
1570
1570
  case "add-triple":
1571
- wn(t, r);
1571
+ Tn(t, r);
1572
1572
  break;
1573
1573
  case "deep-merge-triple":
1574
- Pr(t, r);
1574
+ jr(t, r);
1575
1575
  break;
1576
1576
  case "retract-triple":
1577
- _n(t, r);
1577
+ gn(t, r);
1578
1578
  break;
1579
1579
  case "delete-entity":
1580
- Ge(t, r);
1580
+ Be(t, r);
1581
1581
  break;
1582
1582
  case "add-attr":
1583
- jr(t, r);
1583
+ $r(t, r);
1584
1584
  break;
1585
1585
  case "delete-attr":
1586
- $r(t, r);
1586
+ Dr(t, r);
1587
1587
  break;
1588
1588
  case "update-attr":
1589
- Dr(t, r);
1589
+ Rr(t, r);
1590
1590
  break;
1591
1591
  case "restore-attr":
1592
1592
  break;
@@ -1596,7 +1596,7 @@ function xr(t, e) {
1596
1596
  throw new Error(`unhandled transaction action: ${n}`);
1597
1597
  }
1598
1598
  }
1599
- function x(t, e, n = []) {
1599
+ function R(t, e, n = []) {
1600
1600
  if (!t || e === 0)
1601
1601
  return n;
1602
1602
  if (e === 1) {
@@ -1605,7 +1605,7 @@ function x(t, e, n = []) {
1605
1605
  return n;
1606
1606
  }
1607
1607
  for (const r of t.values())
1608
- x(r, e - 1, n);
1608
+ R(r, e - 1, n);
1609
1609
  return n;
1610
1610
  }
1611
1611
  function be(t, e, n) {
@@ -1633,7 +1633,7 @@ function be(t, e, n) {
1633
1633
  return r;
1634
1634
  }
1635
1635
  if (n != null && n.$comparator)
1636
- return x(e, 1).filter(n.$op);
1636
+ return R(e, 1).filter(n.$op);
1637
1637
  const s = n.in || n.$in || [n];
1638
1638
  for (const o of s) {
1639
1639
  const a = e.get(o);
@@ -1641,20 +1641,20 @@ function be(t, e, n) {
1641
1641
  }
1642
1642
  return r;
1643
1643
  }
1644
- function Rr(t, e, n) {
1644
+ function Ur(t, e, n) {
1645
1645
  let r = "";
1646
1646
  return t !== void 0 && (r += "e"), e !== void 0 && (r += "a"), n !== void 0 && (r += "v"), r;
1647
1647
  }
1648
- function Ur(t, [e, n, r]) {
1648
+ function Lr(t, [e, n, r]) {
1649
1649
  var i, o;
1650
- switch (Rr(e, n, r)) {
1650
+ switch (Ur(e, n, r)) {
1651
1651
  case "e": {
1652
1652
  const a = t.eav.get(e);
1653
- return x(a, 2);
1653
+ return R(a, 2);
1654
1654
  }
1655
1655
  case "ea": {
1656
1656
  const a = (i = t.eav.get(e)) == null ? void 0 : i.get(n);
1657
- return x(a, 1);
1657
+ return R(a, 1);
1658
1658
  }
1659
1659
  case "eav": {
1660
1660
  const a = (o = t.eav.get(e)) == null ? void 0 : o.get(n);
@@ -1671,7 +1671,7 @@ function Ur(t, [e, n, r]) {
1671
1671
  }
1672
1672
  case "a": {
1673
1673
  const a = t.aev.get(n);
1674
- return x(a, 2);
1674
+ return R(a, 2);
1675
1675
  }
1676
1676
  case "av": {
1677
1677
  const a = t.aev.get(n);
@@ -1690,38 +1690,41 @@ function Ur(t, [e, n, r]) {
1690
1690
  return a;
1691
1691
  }
1692
1692
  default:
1693
- return x(t.eav, 3);
1693
+ return R(t.eav, 3);
1694
1694
  }
1695
1695
  }
1696
- function Lr(t, e, n) {
1696
+ const xe = {};
1697
+ function Fr(t, e, n) {
1697
1698
  var s;
1699
+ if (xe[n])
1700
+ return xe[n];
1698
1701
  const r = {};
1699
1702
  if (!e)
1700
1703
  return r;
1701
1704
  for (const [i, o] of e.entries()) {
1702
- const a = (s = t.eav.get(n)) == null ? void 0 : s.get(o.id), c = x(a, 1);
1705
+ const a = (s = t.eav.get(n)) == null ? void 0 : s.get(o.id), c = R(a, 1);
1703
1706
  for (const u of c)
1704
1707
  r[i] = u[2];
1705
1708
  }
1706
- return r;
1709
+ return xe[n] = r, r;
1707
1710
  }
1708
1711
  function G(t, e, n) {
1709
1712
  var r;
1710
1713
  return (r = t.attrIndexes.forwardIdents.get(e)) == null ? void 0 : r.get(n);
1711
1714
  }
1712
- function Sn(t, e, n) {
1715
+ function On(t, e, n) {
1713
1716
  var r;
1714
1717
  return (r = t.attrIndexes.revIdents.get(e)) == null ? void 0 : r.get(n);
1715
1718
  }
1716
- function Fr(t, e) {
1719
+ function Nr(t, e) {
1717
1720
  return t.attrIndexes.blobAttrs.get(e);
1718
1721
  }
1719
- function On(t, e) {
1722
+ function vn(t, e) {
1720
1723
  var r;
1721
1724
  const n = t.attrIndexes.primaryKeys.get(e);
1722
1725
  return n || ((r = t.attrIndexes.forwardIdents.get(e)) == null ? void 0 : r.get("id"));
1723
1726
  }
1724
- function Nr(t, e) {
1727
+ function Kr(t, e) {
1725
1728
  const n = ye(t, e);
1726
1729
  if (!n)
1727
1730
  return;
@@ -1729,7 +1732,7 @@ function Nr(t, e) {
1729
1732
  if (re(t.attrs, s))
1730
1733
  return se(t.eav, [r, s]);
1731
1734
  }
1732
- function Kr(t, e) {
1735
+ function qr(t, e) {
1733
1736
  const n = e.filter(
1734
1737
  ([r, s, i, o, a]) => {
1735
1738
  if (r !== "add-triple" && r !== "deep-merge-triple")
@@ -1740,8 +1743,8 @@ function Kr(t, e) {
1740
1743
  let u = !1;
1741
1744
  const l = re(t.attrs, i);
1742
1745
  if (l) {
1743
- const f = On(t, l["forward-identity"][1]);
1744
- u = !!Nr(t, [
1746
+ const f = vn(t, l["forward-identity"][1]);
1747
+ u = !!Kr(t, [
1745
1748
  s,
1746
1749
  f == null ? void 0 : f.id,
1747
1750
  s
@@ -1756,28 +1759,28 @@ function Kr(t, e) {
1756
1759
  });
1757
1760
  });
1758
1761
  }
1759
- function qr(t) {
1762
+ function zr(t) {
1760
1763
  return typeof t == "string" && t.startsWith("?");
1761
1764
  }
1762
- function zr(t, e, n) {
1765
+ function Vr(t, e, n) {
1763
1766
  if (n.hasOwnProperty(t)) {
1764
1767
  const r = n[t];
1765
- return vn(r, e, n);
1768
+ return An(r, e, n);
1766
1769
  }
1767
1770
  return { ...n, [t]: e };
1768
1771
  }
1769
- function Mt(t, e, n) {
1772
+ function It(t, e, n) {
1770
1773
  return t === e ? n : null;
1771
1774
  }
1772
- function Vr(t) {
1775
+ function Wr(t) {
1773
1776
  switch (typeof t) {
1774
1777
  case "string":
1775
- return t.startsWith("?") ? zr : Mt;
1778
+ return t.startsWith("?") ? Vr : It;
1776
1779
  default:
1777
- return Mt;
1780
+ return It;
1778
1781
  }
1779
1782
  }
1780
- const Wr = [
1783
+ const Qr = [
1781
1784
  "in",
1782
1785
  "$in",
1783
1786
  "$not",
@@ -1785,94 +1788,94 @@ const Wr = [
1785
1788
  "$comparator"
1786
1789
  // covers all of $gt, $lt, etc.
1787
1790
  ];
1788
- function Qr(t) {
1789
- for (const e of Wr)
1791
+ function Gr(t) {
1792
+ for (const e of Qr)
1790
1793
  if (t.hasOwnProperty(e))
1791
1794
  return !0;
1792
1795
  return !1;
1793
1796
  }
1794
- function vn(t, e, n) {
1795
- return n ? typeof t == "object" ? Qr(t) ? n : null : Vr(t)(t, e, n) : null;
1797
+ function An(t, e, n) {
1798
+ return n ? typeof t == "object" ? Gr(t) ? n : null : Wr(t)(t, e, n) : null;
1796
1799
  }
1797
- function Gr(t, e, n) {
1800
+ function Br(t, e, n) {
1798
1801
  return t.reduce((r, s, i) => {
1799
1802
  const o = e[i];
1800
- return vn(s, o, r);
1803
+ return An(s, o, r);
1801
1804
  }, n);
1802
1805
  }
1803
- function Br(t, e, n) {
1804
- return Yr(t, e, n).map((r) => Gr(e, r, n)).filter((r) => r);
1805
- }
1806
1806
  function Hr(t, e, n) {
1807
- return e.or ? e.or.patterns.flatMap((r) => Be(t, r, n)) : e.and ? e.and.patterns.reduce((r, s) => Be(t, s, r), n) : n.flatMap((r) => Br(t, e, r));
1807
+ return Zr(t, e, n).map((r) => Br(e, r, n)).filter((r) => r);
1808
+ }
1809
+ function Jr(t, e, n) {
1810
+ return e.or ? e.or.patterns.flatMap((r) => He(t, r, n)) : e.and ? e.and.patterns.reduce((r, s) => He(t, s, r), n) : n.flatMap((r) => Hr(t, e, r));
1808
1811
  }
1809
- function Be(t, e, n = [{}]) {
1810
- return e.reduce((r, s) => Hr(t, s, r), n);
1812
+ function He(t, e, n = [{}]) {
1813
+ return e.reduce((r, s) => Jr(t, s, r), n);
1811
1814
  }
1812
- function bt(t, e) {
1813
- return Array.isArray(e) ? e.map((n) => bt(t, n)) : qr(e) ? t[e] : e;
1815
+ function _t(t, e) {
1816
+ return Array.isArray(e) ? e.map((n) => _t(t, n)) : zr(e) ? t[e] : e;
1814
1817
  }
1815
- function Jr(t, { find: e, where: n }) {
1816
- return Be(t, n).map((s) => bt(s, e));
1818
+ function Yr(t, { find: e, where: n }) {
1819
+ return He(t, n).map((s) => _t(s, e));
1817
1820
  }
1818
- function Yr(t, e, n) {
1819
- return Ur(t, bt(n, e));
1821
+ function Zr(t, e, n) {
1822
+ return Lr(t, _t(n, e));
1820
1823
  }
1821
- const Zr = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
1824
+ const Xr = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
1822
1825
  function te(t) {
1823
- return typeof t == "string" && Zr.test(t);
1826
+ return typeof t == "string" && Xr.test(t);
1824
1827
  }
1825
1828
  const E = [];
1826
1829
  for (let t = 0; t < 256; ++t)
1827
1830
  E.push((t + 256).toString(16).slice(1));
1828
- function Xr(t, e = 0) {
1831
+ function es(t, e = 0) {
1829
1832
  return (E[t[e + 0]] + E[t[e + 1]] + E[t[e + 2]] + E[t[e + 3]] + "-" + E[t[e + 4]] + E[t[e + 5]] + "-" + E[t[e + 6]] + E[t[e + 7]] + "-" + E[t[e + 8]] + E[t[e + 9]] + "-" + E[t[e + 10]] + E[t[e + 11]] + E[t[e + 12]] + E[t[e + 13]] + E[t[e + 14]] + E[t[e + 15]]).toLowerCase();
1830
1833
  }
1831
- let Re;
1832
- const es = new Uint8Array(16);
1833
- function ts() {
1834
- if (!Re) {
1834
+ let Ue;
1835
+ const ts = new Uint8Array(16);
1836
+ function ns() {
1837
+ if (!Ue) {
1835
1838
  if (typeof crypto > "u" || !crypto.getRandomValues)
1836
1839
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1837
- Re = crypto.getRandomValues.bind(crypto);
1840
+ Ue = crypto.getRandomValues.bind(crypto);
1838
1841
  }
1839
- return Re(es);
1842
+ return Ue(ts);
1840
1843
  }
1841
- const ns = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), It = { randomUUID: ns };
1842
- function rs(t, e, n) {
1844
+ const rs = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Pt = { randomUUID: rs };
1845
+ function ss(t, e, n) {
1843
1846
  var s;
1844
- if (It.randomUUID && !t)
1845
- return It.randomUUID();
1847
+ if (Pt.randomUUID && !t)
1848
+ return Pt.randomUUID();
1846
1849
  t = t || {};
1847
- const r = t.random ?? ((s = t.rng) == null ? void 0 : s.call(t)) ?? ts();
1850
+ const r = t.random ?? ((s = t.rng) == null ? void 0 : s.call(t)) ?? ns();
1848
1851
  if (r.length < 16)
1849
1852
  throw new Error("Random bytes length must be >= 16");
1850
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Xr(r);
1853
+ return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, es(r);
1851
1854
  }
1852
- function Pt(t) {
1855
+ function jt(t) {
1853
1856
  const e = t.replace(/-/g, ""), n = [];
1854
1857
  for (let r = 0; r < e.length; r += 2)
1855
1858
  n.push(parseInt(e.substring(r, r + 2), 16));
1856
1859
  return n;
1857
1860
  }
1858
- function ss(t, e) {
1861
+ function is(t, e) {
1859
1862
  for (let n = 0; n < t.length; n++) {
1860
1863
  if (t[n] < e[n]) return -1;
1861
1864
  if (t[n] > e[n]) return 1;
1862
1865
  }
1863
1866
  return 0;
1864
1867
  }
1865
- function is(t, e) {
1866
- return ss(Pt(t), Pt(e));
1868
+ function os(t, e) {
1869
+ return is(jt(t), jt(e));
1867
1870
  }
1868
1871
  function k() {
1869
- return rs();
1872
+ return ss();
1870
1873
  }
1871
- function os(t, e) {
1874
+ function as(t, e) {
1872
1875
  return t.localeCompare(e);
1873
1876
  }
1874
- function as() {
1875
- let t = os;
1877
+ function cs() {
1878
+ let t = as;
1876
1879
  if (typeof Intl == "object" && Intl.hasOwnProperty("Collator"))
1877
1880
  try {
1878
1881
  t = Intl.Collator("en-US").compare;
@@ -1880,10 +1883,10 @@ function as() {
1880
1883
  }
1881
1884
  return t;
1882
1885
  }
1883
- const cs = as();
1884
- let us = 0;
1886
+ const us = cs();
1887
+ let ls = 0;
1885
1888
  function le(t) {
1886
- return Ie(`_${t}`, us++);
1889
+ return Ie(`_${t}`, ls++);
1887
1890
  }
1888
1891
  function Ie(t, e) {
1889
1892
  return `?${t}-${e}`;
@@ -1893,28 +1896,28 @@ class ne extends Error {
1893
1896
  super(e), this.name = "AttrNotFoundError";
1894
1897
  }
1895
1898
  }
1896
- function ls(t, e) {
1897
- const n = On(t, e);
1899
+ function fs(t, e) {
1900
+ const n = vn(t, e);
1898
1901
  if (!n)
1899
1902
  throw new ne(`Could not find id attr for ${e}`);
1900
1903
  return n;
1901
1904
  }
1902
- function jt(t, e, n, r) {
1903
- return [fs(t, e, n, r)];
1905
+ function $t(t, e, n, r) {
1906
+ return [ds(t, e, n, r)];
1904
1907
  }
1905
- function fs(t, e, n, r) {
1908
+ function ds(t, e, n, r) {
1906
1909
  return [
1907
1910
  t(n, r),
1908
- ls(e, n).id,
1911
+ fs(e, n).id,
1909
1912
  t(n, r),
1910
1913
  t("time", r)
1911
1914
  ];
1912
1915
  }
1913
- function ds(t, e, n) {
1916
+ function hs(t, e, n) {
1914
1917
  return t.map((r) => r === e ? n : r);
1915
1918
  }
1916
- function An(t, e, n, r, s) {
1917
- const i = G(e, n, s), o = Sn(e, n, s), a = i || o;
1919
+ function kn(t, e, n, r, s) {
1920
+ const i = G(e, n, s), o = On(e, n, s), a = i || o;
1918
1921
  if (!a)
1919
1922
  throw new ne(`Could not find attr for ${[n, s]}`);
1920
1923
  if (a["value-type"] !== "ref")
@@ -1932,7 +1935,7 @@ function An(t, e, n, r, s) {
1932
1935
  ];
1933
1936
  return [i ? f : u, d, h, a, !!i];
1934
1937
  }
1935
- function $t(t, e) {
1938
+ function Dt(t, e) {
1936
1939
  if (typeof e != "string")
1937
1940
  return function(o) {
1938
1941
  return !1;
@@ -1945,7 +1948,7 @@ function $t(t, e) {
1945
1948
  return typeof o != "string" ? !1 : s.test(o);
1946
1949
  };
1947
1950
  }
1948
- function hs(t, e) {
1951
+ function ps(t, e) {
1949
1952
  if (typeof e != "object" || e.hasOwnProperty("$in") || e.hasOwnProperty("in"))
1950
1953
  return e;
1951
1954
  const n = t["checked-data-type"] === "date";
@@ -1986,7 +1989,7 @@ function hs(t, e) {
1986
1989
  }
1987
1990
  };
1988
1991
  if (e.hasOwnProperty("$like")) {
1989
- const r = $t(!0, e.$like);
1992
+ const r = Dt(!0, e.$like);
1990
1993
  return {
1991
1994
  $comparator: !0,
1992
1995
  $op: function(i) {
@@ -1995,7 +1998,7 @@ function hs(t, e) {
1995
1998
  };
1996
1999
  }
1997
2000
  if (e.hasOwnProperty("$ilike")) {
1998
- const r = $t(!1, e.$ilike);
2001
+ const r = Dt(!1, e.$ilike);
1999
2002
  return {
2000
2003
  $comparator: !0,
2001
2004
  $op: function(i) {
@@ -2005,8 +2008,8 @@ function hs(t, e) {
2005
2008
  }
2006
2009
  return e;
2007
2010
  }
2008
- function ps(t, e, n, r, s, i) {
2009
- const o = G(e, n, s), a = Sn(e, n, s), c = o || a;
2011
+ function ys(t, e, n, r, s, i) {
2012
+ const o = G(e, n, s), a = On(e, n, s), c = o || a;
2010
2013
  if (!c)
2011
2014
  throw new ne(
2012
2015
  `No attr for etype = ${n} label = ${s}`
@@ -2027,14 +2030,14 @@ function ps(t, e, n, r, s, i) {
2027
2030
  return o ? [
2028
2031
  t(n, r),
2029
2032
  c.id,
2030
- hs(c, i),
2033
+ ps(c, i),
2031
2034
  le("time")
2032
2035
  ] : [i, c.id, t(n, r), le("time")];
2033
2036
  }
2034
- function ys(t, e, n, r, s) {
2037
+ function bs(t, e, n, r, s) {
2035
2038
  const [i, o, a] = s.reduce(
2036
2039
  (c, u) => {
2037
- const [l, f, d] = c, [h, p, b] = An(
2040
+ const [l, f, d] = c, [h, p, b] = kn(
2038
2041
  t,
2039
2042
  e,
2040
2043
  l,
@@ -2047,14 +2050,14 @@ function ys(t, e, n, r, s) {
2047
2050
  );
2048
2051
  return [i, o, a];
2049
2052
  }
2050
- function He(t, e, n, r, s, i) {
2051
- const o = s.slice(0, s.length - 1), a = s[s.length - 1], [c, u, l] = ys(
2053
+ function Je(t, e, n, r, s, i) {
2054
+ const o = s.slice(0, s.length - 1), a = s[s.length - 1], [c, u, l] = bs(
2052
2055
  t,
2053
2056
  e,
2054
2057
  n,
2055
2058
  r,
2056
2059
  o
2057
- ), f = ps(
2060
+ ), f = ys(
2058
2061
  t,
2059
2062
  e,
2060
2063
  c,
@@ -2064,50 +2067,50 @@ function He(t, e, n, r, s, i) {
2064
2067
  );
2065
2068
  return l.concat([f]);
2066
2069
  }
2067
- function bs(t, e) {
2070
+ function _s(t, e) {
2068
2071
  return e ? [e].concat(t) : t;
2069
2072
  }
2070
- function _s([t, e]) {
2073
+ function gs([t, e]) {
2071
2074
  return t === "or" && Array.isArray(e);
2072
2075
  }
2073
- function gs([t, e]) {
2076
+ function ws([t, e]) {
2074
2077
  return t === "and" && Array.isArray(e);
2075
2078
  }
2076
- function ws(t, e, n) {
2079
+ function Ts(t, e, n) {
2077
2080
  return (r, s) => {
2078
2081
  const i = t(r, s);
2079
2082
  return e == i ? i : `${i}-${n}`;
2080
2083
  };
2081
2084
  }
2082
- function Dt(t, e, n, r, s, i) {
2085
+ function Rt(t, e, n, r, s, i) {
2083
2086
  const o = t(r, s), a = i.map((c, u) => {
2084
- const l = ws(t, o, u);
2085
- return kn(l, n, r, s, c);
2087
+ const l = Ts(t, o, u);
2088
+ return En(l, n, r, s, c);
2086
2089
  });
2087
2090
  return { [e]: { patterns: a, joinSym: o } };
2088
2091
  }
2089
- function Ts(t) {
2092
+ function ms(t) {
2090
2093
  const e = [];
2091
2094
  for (let n = 1; n <= t.length; n++)
2092
2095
  e.push(t.slice(0, n));
2093
2096
  return e;
2094
2097
  }
2095
2098
  function xt(t, e, n, r, s) {
2096
- return Ts(s).map(
2097
- (i) => He(t, e, n, r, i, { $isNull: !0 })
2099
+ return ms(s).map(
2100
+ (i) => Je(t, e, n, r, i, { $isNull: !0 })
2098
2101
  );
2099
2102
  }
2100
- function kn(t, e, n, r, s) {
2103
+ function En(t, e, n, r, s) {
2101
2104
  return Object.entries(s).flatMap(([i, o]) => {
2102
- if (_s([i, o]))
2103
- return Dt(t, "or", e, n, r, o);
2104
2105
  if (gs([i, o]))
2105
- return Dt(t, "and", e, n, r, o);
2106
+ return Rt(t, "or", e, n, r, o);
2107
+ if (ws([i, o]))
2108
+ return Rt(t, "and", e, n, r, o);
2106
2109
  if (i === "$entityIdStartsWith")
2107
2110
  return [];
2108
2111
  const a = i.split(".");
2109
2112
  if (o != null && o.hasOwnProperty("$ne") && (o = { ...o, $not: o.$ne }, delete o.$ne), o != null && o.hasOwnProperty("$not")) {
2110
- const c = He(t, e, n, r, a, o), u = xt(
2113
+ const c = Je(t, e, n, r, a, o), u = xt(
2111
2114
  t,
2112
2115
  e,
2113
2116
  n,
@@ -2136,41 +2139,41 @@ function kn(t, e, n, r, s) {
2136
2139
  joinSym: t(n, r)
2137
2140
  }
2138
2141
  }
2139
- ] : He(t, e, n, r, a, o);
2142
+ ] : Je(t, e, n, r, a, o);
2140
2143
  });
2141
2144
  }
2142
- function ms(t, e, n, r) {
2145
+ function Ss(t, e, n, r) {
2143
2146
  const s = Ie;
2144
- return r ? kn(s, t, e, n, r).concat(jt(s, t, e, n)) : jt(s, t, e, n);
2147
+ return r ? En(s, t, e, n, r).concat($t(s, t, e, n)) : $t(s, t, e, n);
2145
2148
  }
2146
- function Ss(t, e, n) {
2149
+ function Os(t, e, n) {
2147
2150
  return [t(e, n), t("time", n)];
2148
2151
  }
2149
- function Os(t, e, n, r, s, i) {
2150
- const [o, a, c, u, l] = An(
2152
+ function vs(t, e, n, r, s, i) {
2153
+ const [o, a, c, u, l] = kn(
2151
2154
  t,
2152
2155
  e,
2153
2156
  n,
2154
2157
  r,
2155
2158
  s
2156
- ), f = ds(c, t(n, r), i);
2159
+ ), f = hs(c, t(n, r), i);
2157
2160
  return [o, a, f, u, l];
2158
2161
  }
2159
- function vs(t, e, { etype: n, level: r, form: s }, i) {
2162
+ function As(t, e, { etype: n, level: r, form: s }, i) {
2160
2163
  const o = Object.keys(s).filter((a) => a !== "$");
2161
2164
  return o.length ? Object.entries(i).map(function([c, u]) {
2162
2165
  return o.map(function(d) {
2163
2166
  var p, b, _;
2164
2167
  const h = !!(e.cardinalityInference && ((_ = (b = (p = e.linkIndex) == null ? void 0 : p[n]) == null ? void 0 : b[d]) != null && _.isSingular));
2165
2168
  try {
2166
- const [y, g, T] = Os(
2169
+ const [y, g, T] = vs(
2167
2170
  t,
2168
2171
  e,
2169
2172
  n,
2170
2173
  r,
2171
2174
  d,
2172
2175
  c
2173
- ), v = Cn(e, {
2176
+ ), v = Mn(e, {
2174
2177
  etype: y,
2175
2178
  level: g,
2176
2179
  form: s[d],
@@ -2187,48 +2190,48 @@ function vs(t, e, { etype: n, level: r, form: s }, i) {
2187
2190
  }, u);
2188
2191
  }) : Object.values(i);
2189
2192
  }
2190
- function As(t, e, n) {
2191
- return n === "string" ? cs(t, e) : t > e ? 1 : -1;
2193
+ function ks(t, e, n) {
2194
+ return n === "string" ? us(t, e) : t > e ? 1 : -1;
2192
2195
  }
2193
2196
  function ce(t, e, n, r, s) {
2194
- return e === r || e == null && r == null ? is(t, n) : r == null ? 1 : e == null ? -1 : As(e, r, s);
2197
+ return e === r || e == null && r == null ? os(t, n) : r == null ? 1 : e == null ? -1 : ks(e, r, s);
2195
2198
  }
2196
2199
  function Ee([t, e], [n, r], s) {
2197
2200
  return ce(t, e, n, r, s);
2198
2201
  }
2199
- function Je(t) {
2202
+ function Ye(t) {
2200
2203
  return t == null ? t : new Date(t).getTime();
2201
2204
  }
2202
- function ks(t, e, n, r) {
2205
+ function Es(t, e, n, r) {
2203
2206
  var p;
2204
2207
  const [s, i, o, a] = t, c = n === "desc" ? 1 : -1;
2205
2208
  if (((p = e["forward-identity"]) == null ? void 0 : p[2]) === "id")
2206
2209
  return Ee(r, [s, a], null) === c;
2207
- const [u, l] = r, f = e["checked-data-type"], d = f === "date" ? Je(l) : l, h = f === "date" ? Je(o) : o;
2210
+ const [u, l] = r, f = e["checked-data-type"], d = f === "date" ? Ye(l) : l, h = f === "date" ? Ye(o) : o;
2208
2211
  return Ee([u, d], [s, h], f) === c;
2209
2212
  }
2210
- function Es(t, e) {
2213
+ function Cs(t, e) {
2211
2214
  const n = e[1];
2212
2215
  return t.attrs[n];
2213
2216
  }
2214
- function Cs(t, e, n) {
2217
+ function Ms(t, e, n) {
2215
2218
  const r = Object.keys(n)[0];
2216
2219
  return G(t, e, r);
2217
2220
  }
2218
- function Ms(t, e, n, r) {
2221
+ function Is(t, e, n, r) {
2219
2222
  if (n)
2220
- return Es(t, n);
2223
+ return Cs(t, n);
2221
2224
  if (r)
2222
- return Cs(t, e, r);
2225
+ return Ms(t, e, r);
2223
2226
  }
2224
- function Is(t, e, n) {
2227
+ function Ps(t, e, n) {
2225
2228
  var s, i;
2226
2229
  if (!Array.isArray(n.fields))
2227
- return Fr(t, e);
2230
+ return Nr(t, e);
2228
2231
  const r = /* @__PURE__ */ new Map();
2229
2232
  for (const o of n.fields) {
2230
2233
  const a = G(t, e, o), c = (s = a == null ? void 0 : a["forward-identity"]) == null ? void 0 : s[2];
2231
- c && pt(a) && r.set(c, a);
2234
+ c && yt(a) && r.set(c, a);
2232
2235
  }
2233
2236
  if (!r.has("id")) {
2234
2237
  const o = G(t, e, "id"), a = (i = o == null ? void 0 : o["forward-identity"]) == null ? void 0 : i[2];
@@ -2236,17 +2239,17 @@ function Is(t, e, n) {
2236
2239
  }
2237
2240
  return r;
2238
2241
  }
2239
- function Ps(t, { etype: e, pageInfo: n, dq: r, form: s }) {
2242
+ function js(t, { etype: e, pageInfo: n, dq: r, form: s }) {
2240
2243
  var h, p;
2241
- const i = (h = s == null ? void 0 : s.$) == null ? void 0 : h.order, o = En(s), a = js(s);
2242
- let c = Jr(t, r);
2243
- const u = n == null ? void 0 : n["start-cursor"], l = Ms(t, e, u, i);
2244
+ const i = (h = s == null ? void 0 : s.$) == null ? void 0 : h.order, o = Cn(s), a = $s(s);
2245
+ let c = Yr(t, r);
2246
+ const u = n == null ? void 0 : n["start-cursor"], l = Is(t, e, u, i);
2244
2247
  if (l && ((p = l == null ? void 0 : l["forward-identity"]) == null ? void 0 : p[2]) !== "id") {
2245
2248
  const b = l["checked-data-type"] === "date", _ = l.id;
2246
2249
  c = c.map(([y]) => {
2247
2250
  var T, v, m, M, I;
2248
2251
  let g = (I = (M = (m = (v = (T = t.eav.get(y)) == null ? void 0 : T.get(_)) == null ? void 0 : v.values()) == null ? void 0 : m.next()) == null ? void 0 : M.value) == null ? void 0 : I[2];
2249
- return b && (g = Je(g)), [y, g];
2252
+ return b && (g = Ye(g)), [y, g];
2250
2253
  });
2251
2254
  }
2252
2255
  c.sort(
@@ -2257,31 +2260,31 @@ function Ps(t, { etype: e, pageInfo: n, dq: r, form: s }) {
2257
2260
  }
2258
2261
  );
2259
2262
  let f = {};
2260
- const d = Is(t, e, r);
2263
+ const d = Ps(t, e, r);
2261
2264
  for (const b of c) {
2262
2265
  const [_] = b;
2263
- if (f[_] || !o && u && l && ks(u, l, a, b))
2266
+ if (f[_] || !o && u && l && Es(u, l, a, b))
2264
2267
  continue;
2265
- const y = Lr(t, d, _);
2268
+ const y = Fr(t, d, _);
2266
2269
  y && (f[_] = y);
2267
2270
  }
2268
2271
  return f;
2269
2272
  }
2270
- function js(t) {
2273
+ function $s(t) {
2271
2274
  var n;
2272
2275
  const e = (n = t.$) == null ? void 0 : n.order;
2273
2276
  return e && e[Object.keys(e)[0]] || "asc";
2274
2277
  }
2275
- function En(t) {
2278
+ function Cn(t) {
2276
2279
  var s, i, o;
2277
2280
  const e = (s = t.$) == null ? void 0 : s.offset, n = (i = t.$) == null ? void 0 : i.before, r = (o = t.$) == null ? void 0 : o.after;
2278
2281
  return !e && !n && !r;
2279
2282
  }
2280
- function $s(t, { etype: e, level: n, form: r, join: s, pageInfo: i }) {
2283
+ function Ds(t, { etype: e, level: n, form: r, join: s, pageInfo: i }) {
2281
2284
  var f, d, h, p, b;
2282
- if (!En(r) && (!i || !i["start-cursor"]))
2285
+ if (!Cn(r) && (!i || !i["start-cursor"]))
2283
2286
  return [];
2284
- const o = bs(ms(t, e, n, (f = r.$) == null ? void 0 : f.where), s), a = Ss(Ie, e, n), c = (d = r.$) == null ? void 0 : d.fields, u = Ps(t, {
2287
+ const o = _s(Ss(t, e, n, (f = r.$) == null ? void 0 : f.where), s), a = Os(Ie, e, n), c = (d = r.$) == null ? void 0 : d.fields, u = js(t, {
2285
2288
  etype: e,
2286
2289
  pageInfo: i,
2287
2290
  form: r,
@@ -2296,18 +2299,18 @@ function $s(t, { etype: e, level: n, form: r, join: s, pageInfo: i }) {
2296
2299
  }
2297
2300
  return u;
2298
2301
  }
2299
- function Ds(t, e) {
2302
+ function Rs(t, e) {
2300
2303
  try {
2301
- return $s(t, e);
2304
+ return Ds(t, e);
2302
2305
  } catch (n) {
2303
2306
  if (n instanceof ne)
2304
2307
  return {};
2305
2308
  throw n;
2306
2309
  }
2307
2310
  }
2308
- function Cn(t, e) {
2309
- const n = Ds(t, e);
2310
- return vs(Ie, t, e, n);
2311
+ function Mn(t, e) {
2312
+ const n = Rs(t, e);
2313
+ return As(Ie, t, e, n);
2311
2314
  }
2312
2315
  function xs(t) {
2313
2316
  const e = {};
@@ -2320,13 +2323,13 @@ function xs(t) {
2320
2323
  };
2321
2324
  return e;
2322
2325
  }
2323
- function Mn({
2326
+ function In({
2324
2327
  store: t,
2325
2328
  pageInfo: e,
2326
2329
  aggregate: n
2327
2330
  }, r) {
2328
2331
  const i = { data: Object.keys(r).reduce(function(a, c) {
2329
- return n != null && n[c] || c === "$$ruleParams" || (a[c] = Cn(t, {
2332
+ return n != null && n[c] || c === "$$ruleParams" || (a[c] = Mn(t, {
2330
2333
  etype: c,
2331
2334
  form: r[c],
2332
2335
  level: 0,
@@ -2335,7 +2338,7 @@ function Mn({
2335
2338
  }, {}) };
2336
2339
  return e && (i.pageInfo = xs(e)), n && (i.aggregate = n), i;
2337
2340
  }
2338
- function Rs() {
2341
+ function Us() {
2339
2342
  const e = {
2340
2343
  __etype: 1,
2341
2344
  __ops: 1,
@@ -2349,8 +2352,8 @@ function Rs() {
2349
2352
  };
2350
2353
  return new Set(Object.keys(e));
2351
2354
  }
2352
- const Us = Rs();
2353
- function Ye(t, e, n) {
2355
+ const Ls = Us();
2356
+ function Ze(t, e, n) {
2354
2357
  const r = {
2355
2358
  __etype: t,
2356
2359
  __ops: n
@@ -2359,8 +2362,8 @@ function Ye(t, e, n) {
2359
2362
  get: (s, i) => {
2360
2363
  if (i === "__ops") return n;
2361
2364
  if (i === "__etype") return t;
2362
- if (Us.has(i))
2363
- return (o, a) => Ye(t, e, [
2365
+ if (Ls.has(i))
2366
+ return (o, a) => Ze(t, e, [
2364
2367
  ...n,
2365
2368
  a ? [i, t, e, o, a] : [i, t, e, o]
2366
2369
  ]);
@@ -2373,11 +2376,11 @@ function xo(t, e) {
2373
2376
  function Ce(t) {
2374
2377
  return t.startsWith("lookup__");
2375
2378
  }
2376
- function In(t) {
2379
+ function Pn(t) {
2377
2380
  const [e, n, ...r] = t.split("__");
2378
2381
  return [n, JSON.parse(r.join("__"))];
2379
2382
  }
2380
- function Ls(t) {
2383
+ function Fs(t) {
2381
2384
  return new Proxy(
2382
2385
  {
2383
2386
  __etype: t
@@ -2386,26 +2389,26 @@ function Ls(t) {
2386
2389
  get(e, n) {
2387
2390
  if (n === "__etype") return t;
2388
2391
  const r = n;
2389
- return Ce(r) ? Ye(t, In(r), []) : Ye(t, r, []);
2392
+ return Ce(r) ? Ze(t, Pn(r), []) : Ze(t, r, []);
2390
2393
  }
2391
2394
  }
2392
2395
  );
2393
2396
  }
2394
- function Pn() {
2397
+ function jn() {
2395
2398
  return new Proxy(
2396
2399
  {},
2397
2400
  {
2398
2401
  get(t, e) {
2399
- return Ls(e);
2402
+ return Fs(e);
2400
2403
  }
2401
2404
  }
2402
2405
  );
2403
2406
  }
2404
- const Ro = Pn();
2405
- function Fs(t) {
2407
+ const Uo = jn();
2408
+ function Ns(t) {
2406
2409
  return t.__ops;
2407
2410
  }
2408
- function Ns(t, e) {
2411
+ function Ks(t, e) {
2409
2412
  const { attrIdMap: n, refSwapAttrIds: r } = t, s = [];
2410
2413
  for (const o of e) {
2411
2414
  const a = n[o];
@@ -2438,7 +2441,7 @@ function J(t, e, n) {
2438
2441
  return o === e && a === n;
2439
2442
  });
2440
2443
  }
2441
- function Ks(t) {
2444
+ function qs(t) {
2442
2445
  if (Array.isArray(t))
2443
2446
  return t;
2444
2447
  const e = Object.entries(t);
@@ -2448,39 +2451,39 @@ function Ks(t) {
2448
2451
  );
2449
2452
  return e[0];
2450
2453
  }
2451
- function Ze(t, e, n) {
2454
+ function Xe(t, e, n) {
2452
2455
  return n.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
2453
2456
  // before assuming it's a ref lookup.
2454
2457
  !C(t, e, n);
2455
2458
  }
2456
- function Xe(t) {
2459
+ function et(t) {
2457
2460
  const [e, n, ...r] = t.split(".");
2458
2461
  if (r.length > 0 || n !== "id")
2459
2462
  throw new Error(`${t} is not a valid lookup attribute.`);
2460
2463
  return e;
2461
2464
  }
2462
- function qs(t, e, n) {
2463
- if (!Ze(t, e, n))
2465
+ function zs(t, e, n) {
2466
+ if (!Xe(t, e, n))
2464
2467
  return C(t, e, n);
2465
- const r = Xe(n), s = C(t, e, r) || J(t, e, r);
2468
+ const r = et(n), s = C(t, e, r) || J(t, e, r);
2466
2469
  if (s && s["value-type"] !== "ref")
2467
2470
  throw new Error(`${n} does not reference a valid link attribute.`);
2468
2471
  return s;
2469
2472
  }
2470
- function et(t) {
2471
- return typeof t == "string" && !Ce(t) ? null : typeof t == "string" && Ce(t) ? In(t) : Ks(t);
2473
+ function tt(t) {
2474
+ return typeof t == "string" && !Ce(t) ? null : typeof t == "string" && Ce(t) ? Pn(t) : qs(t);
2472
2475
  }
2473
- function R(t, e, n) {
2474
- const r = et(n);
2476
+ function x(t, e, n) {
2477
+ const r = tt(n);
2475
2478
  if (r === null)
2476
2479
  return n;
2477
- const [s, i] = r, o = qs(t, e, s);
2480
+ const [s, i] = r, o = zs(t, e, s);
2478
2481
  if (!o || !o["unique?"])
2479
2482
  throw new Error(`${s} is not a unique attribute.`);
2480
2483
  return [o.id, i];
2481
2484
  }
2482
- function jn(t, e, n, r) {
2483
- const s = R(t, e, n);
2485
+ function $n(t, e, n, r) {
2486
+ const s = x(t, e, n);
2484
2487
  return Array.isArray(s) ? [[
2485
2488
  "add-triple",
2486
2489
  s,
@@ -2488,47 +2491,47 @@ function jn(t, e, n, r) {
2488
2491
  s
2489
2492
  ]].concat(r) : r;
2490
2493
  }
2491
- function zs({ attrs: t }, [e, n, r]) {
2494
+ function Vs({ attrs: t }, [e, n, r]) {
2492
2495
  const s = Object.entries(r).flatMap(([i, o]) => {
2493
2496
  const a = Array.isArray(o) ? o : [o], c = C(t, e, i), u = J(t, e, i);
2494
2497
  return a.map((l) => c ? [
2495
2498
  "add-triple",
2496
- R(t, e, n),
2499
+ x(t, e, n),
2497
2500
  c.id,
2498
- R(t, c["reverse-identity"][1], l)
2501
+ x(t, c["reverse-identity"][1], l)
2499
2502
  ] : [
2500
2503
  "add-triple",
2501
- R(t, u["forward-identity"][1], l),
2504
+ x(t, u["forward-identity"][1], l),
2502
2505
  u.id,
2503
- R(t, e, n)
2506
+ x(t, e, n)
2504
2507
  ]);
2505
2508
  });
2506
- return jn(t, e, n, s);
2509
+ return $n(t, e, n, s);
2507
2510
  }
2508
- function Vs({ attrs: t }, [e, n, r]) {
2511
+ function Ws({ attrs: t }, [e, n, r]) {
2509
2512
  const s = Object.entries(r).flatMap(([i, o]) => {
2510
2513
  const a = Array.isArray(o) ? o : [o], c = C(t, e, i), u = J(t, e, i);
2511
2514
  return a.map((l) => c ? [
2512
2515
  "retract-triple",
2513
- R(t, e, n),
2516
+ x(t, e, n),
2514
2517
  c.id,
2515
- R(t, c["reverse-identity"][1], l)
2518
+ x(t, c["reverse-identity"][1], l)
2516
2519
  ] : [
2517
2520
  "retract-triple",
2518
- R(t, u["forward-identity"][1], l),
2521
+ x(t, u["forward-identity"][1], l),
2519
2522
  u.id,
2520
- R(t, e, n)
2523
+ x(t, e, n)
2521
2524
  ]);
2522
2525
  });
2523
- return jn(t, e, n, s);
2526
+ return $n(t, e, n, s);
2524
2527
  }
2525
- function Ws(t, e, n) {
2528
+ function Qs(t, e, n) {
2526
2529
  if (Array.isArray(n)) {
2527
2530
  const [r, s] = n;
2528
2531
  for (const i of t || []) {
2529
2532
  const o = i == null ? void 0 : i.aev.get(r);
2530
2533
  if (o) {
2531
- for (const [a, c, u] of x(o, 2))
2534
+ for (const [a, c, u] of R(o, 2))
2532
2535
  if (u === s)
2533
2536
  return !0;
2534
2537
  }
@@ -2544,18 +2547,18 @@ function Ws(t, e, n) {
2544
2547
  }
2545
2548
  return !1;
2546
2549
  }
2547
- function $n({ stores: t, attrs: e }, [n, r, s, i]) {
2548
- return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null : Ws(t, n, r) ? { mode: "update" } : null;
2550
+ function Dn({ stores: t, attrs: e }, [n, r, s, i]) {
2551
+ return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null : Qs(t, n, r) ? { mode: "update" } : null;
2549
2552
  }
2550
- function Qs(t, e) {
2551
- const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c = R(n, r, s);
2553
+ function Gs(t, e) {
2554
+ const { attrs: n } = t, [r, s, i, o] = e, a = ht(i), c = x(n, r, s);
2552
2555
  return [["id", c]].concat(Object.entries(a)).map(([l, f]) => {
2553
2556
  const d = C(n, r, l);
2554
2557
  return d["checked-data-type"] === "date" && t.useDateObjects && (f = Me(f)), ["add-triple", c, d.id, f, { mode: "create" }];
2555
2558
  });
2556
2559
  }
2557
- function Gs(t, e) {
2558
- const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c = R(n, r, s), u = $n(t, [r, c, i, o]);
2560
+ function Bs(t, e) {
2561
+ const { attrs: n } = t, [r, s, i, o] = e, a = ht(i), c = x(n, r, s), u = Dn(t, [r, c, i, o]);
2559
2562
  return [["id", c]].concat(Object.entries(a)).map(([f, d]) => {
2560
2563
  const h = C(n, r, f);
2561
2564
  return h["checked-data-type"] === "date" && t.useDateObjects && (d = Me(d)), [
@@ -2567,11 +2570,11 @@ function Gs(t, e) {
2567
2570
  ];
2568
2571
  });
2569
2572
  }
2570
- function Bs({ attrs: t }, [e, n]) {
2571
- return [["delete-entity", R(t, e, n), e]];
2573
+ function Hs({ attrs: t }, [e, n]) {
2574
+ return [["delete-entity", x(t, e, n), e]];
2572
2575
  }
2573
- function Hs(t, e) {
2574
- const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c = R(n, r, s), u = $n(t, [r, c, i, o]), l = Object.entries(a).map(([d, h]) => {
2576
+ function Js(t, e) {
2577
+ const { attrs: n } = t, [r, s, i, o] = e, a = ht(i), c = x(n, r, s), u = Dn(t, [r, c, i, o]), l = Object.entries(a).map(([d, h]) => {
2575
2578
  const p = C(n, r, d);
2576
2579
  return [
2577
2580
  "deep-merge-triple",
@@ -2589,38 +2592,38 @@ function Hs(t, e) {
2589
2592
  ...u ? [u] : []
2590
2593
  ]].concat(l);
2591
2594
  }
2592
- function Js({ attrs: t }, [e, n, r]) {
2593
- return [["rule-params", R(t, e, n), e, r]];
2595
+ function Ys({ attrs: t }, [e, n, r]) {
2596
+ return [["rule-params", x(t, e, n), e, r]];
2594
2597
  }
2595
- function Ys(t) {
2598
+ function Zs(t) {
2596
2599
  const [e, n, r, s, i] = t;
2597
2600
  if (!s)
2598
2601
  return t;
2599
2602
  const o = { ...s };
2600
2603
  return delete o.id, [e, n, r, o, ...i ? [i] : []];
2601
2604
  }
2602
- function Zs(t, e) {
2603
- const [n, ...r] = Ys(e);
2605
+ function Xs(t, e) {
2606
+ const [n, ...r] = Zs(e);
2604
2607
  switch (n) {
2605
2608
  case "merge":
2606
- return Hs(t, r);
2609
+ return Js(t, r);
2607
2610
  case "create":
2608
- return Qs(t, r);
2609
- case "update":
2610
2611
  return Gs(t, r);
2612
+ case "update":
2613
+ return Bs(t, r);
2611
2614
  case "link":
2612
- return zs(t, r);
2613
- case "unlink":
2614
2615
  return Vs(t, r);
2616
+ case "unlink":
2617
+ return Ws(t, r);
2615
2618
  case "delete":
2616
- return Bs(t, r);
2619
+ return Hs(t, r);
2617
2620
  case "ruleParams":
2618
- return Js(t, r);
2621
+ return Ys(t, r);
2619
2622
  default:
2620
2623
  throw new Error(`unsupported action ${n}`);
2621
2624
  }
2622
2625
  }
2623
- function Xs(t) {
2626
+ function ei(t) {
2624
2627
  switch (t) {
2625
2628
  case "string":
2626
2629
  case "date":
@@ -2631,13 +2634,13 @@ function Xs(t) {
2631
2634
  return;
2632
2635
  }
2633
2636
  }
2634
- function ei(t, e, n) {
2637
+ function ti(t, e, n) {
2635
2638
  var a, c;
2636
2639
  const r = (c = (a = t.entities[e]) == null ? void 0 : a.attrs) == null ? void 0 : c[n];
2637
2640
  if (n === "id") return null;
2638
2641
  if (!r)
2639
2642
  throw new Error(`${e}.${n} does not exist in your schema`);
2640
- const { unique: s, indexed: i } = r == null ? void 0 : r.config, o = Xs(r == null ? void 0 : r.valueType);
2643
+ const { unique: s, indexed: i } = r == null ? void 0 : r.config, o = ei(r == null ? void 0 : r.valueType);
2641
2644
  return {
2642
2645
  "index?": i,
2643
2646
  "unique?": s,
@@ -2645,7 +2648,7 @@ function ei(t, e, n) {
2645
2648
  };
2646
2649
  }
2647
2650
  function _e(t, e, n, r) {
2648
- const s = t ? ei(t, e, n) : null, i = k(), a = [k(), e, n];
2651
+ const s = t ? ti(t, e, n) : null, i = k(), a = [k(), e, n];
2649
2652
  return {
2650
2653
  id: i,
2651
2654
  "forward-identity": a,
@@ -2658,11 +2661,11 @@ function _e(t, e, n, r) {
2658
2661
  ...r || {}
2659
2662
  };
2660
2663
  }
2661
- function ti(t, e, n) {
2664
+ function ni(t, e, n) {
2662
2665
  return Object.values(t.links).find((s) => s.forward.on === e && s.forward.label === n || s.reverse.on === e && s.reverse.label === n);
2663
2666
  }
2664
- function ni(t, e, n) {
2665
- const r = ti(t, e, n);
2667
+ function ri(t, e, n) {
2668
+ const r = ni(t, e, n);
2666
2669
  if (!r)
2667
2670
  throw new Error(`Couldn't find the link ${e}.${n} in your schema`);
2668
2671
  const { forward: s, reverse: i } = r;
@@ -2675,8 +2678,8 @@ function ni(t, e, n) {
2675
2678
  "on-delete-reverse": i.onDelete
2676
2679
  };
2677
2680
  }
2678
- function Rt(t, e, n, r) {
2679
- const s = t ? ni(t, e, n) : null, i = k(), o = [k(), e, n], a = [k(), n, e];
2681
+ function Ut(t, e, n, r) {
2682
+ const s = t ? ri(t, e, n) : null, i = k(), o = [k(), e, n], a = [k(), n, e];
2680
2683
  return {
2681
2684
  id: i,
2682
2685
  "forward-identity": o,
@@ -2690,7 +2693,7 @@ function Rt(t, e, n, r) {
2690
2693
  ...r || {}
2691
2694
  };
2692
2695
  }
2693
- const ri = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink"]), si = /* @__PURE__ */ new Set(["link", "unlink"]), ii = /* @__PURE__ */ new Set(["create", "update", "merge"]), oi = /* @__PURE__ */ new Set([
2696
+ const si = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink"]), ii = /* @__PURE__ */ new Set(["link", "unlink"]), oi = /* @__PURE__ */ new Set(["create", "update", "merge"]), ai = /* @__PURE__ */ new Set([
2694
2697
  "link",
2695
2698
  "unlink",
2696
2699
  "create",
@@ -2698,17 +2701,17 @@ const ri = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink
2698
2701
  "merge",
2699
2702
  "delete",
2700
2703
  "ruleParams"
2701
- ]), tt = { "unique?": !0, "index?": !0 }, ai = { ...tt, cardinality: "one" };
2702
- function ci(t) {
2704
+ ]), nt = { "unique?": !0, "index?": !0 }, ci = { ...nt, cardinality: "one" };
2705
+ function ui(t) {
2703
2706
  const e = [], [n, r, s, i] = t;
2704
- if (!oi.has(n))
2707
+ if (!ai.has(n))
2705
2708
  return e;
2706
- const o = et(s);
2709
+ const o = tt(s);
2707
2710
  if (o && e.push({ etype: r, lookupPair: o }), n === "link")
2708
2711
  for (const [a, c] of Object.entries(i)) {
2709
2712
  const u = Array.isArray(c) ? c : [c];
2710
2713
  for (const l of u) {
2711
- const f = et(l);
2714
+ const f = tt(l);
2712
2715
  f && e.push({
2713
2716
  etype: r,
2714
2717
  lookupPair: f,
@@ -2718,7 +2721,7 @@ function ci(t) {
2718
2721
  }
2719
2722
  return e;
2720
2723
  }
2721
- function ui({ attrs: t, schema: e }, n) {
2724
+ function li({ attrs: t, schema: e }, n) {
2722
2725
  var u, l;
2723
2726
  const [r, s, i] = [/* @__PURE__ */ new Set(), { ...t }, []];
2724
2727
  function o(f) {
@@ -2729,67 +2732,67 @@ function ui({ attrs: t, schema: e }, n) {
2729
2732
  }
2730
2733
  function c(f, d) {
2731
2734
  const h = C(s, f, d), p = J(s, f, d);
2732
- a(h), a(p), !h && !p && o(Rt(e, f, d, ai));
2735
+ a(h), a(p), !h && !p && o(Ut(e, f, d, ci));
2733
2736
  }
2734
2737
  for (const f of n)
2735
- for (const { etype: d, lookupPair: h, linkLabel: p } of ci(f)) {
2738
+ for (const { etype: d, lookupPair: h, linkLabel: p } of ui(f)) {
2736
2739
  const b = h[0];
2737
2740
  if (p) {
2738
2741
  c(d, p);
2739
2742
  const _ = C(s, d, p), y = J(s, d, p);
2740
2743
  a(_), a(y);
2741
2744
  const g = ((u = _ == null ? void 0 : _["reverse-identity"]) == null ? void 0 : u[1]) || ((l = y == null ? void 0 : y["forward-identity"]) == null ? void 0 : l[1]) || p;
2742
- if (Ze(s, g, b))
2743
- c(g, Xe(b));
2745
+ if (Xe(s, g, b))
2746
+ c(g, et(b));
2744
2747
  else {
2745
2748
  const T = C(s, g, b);
2746
2749
  T || o(
2747
- _e(e, g, b, tt)
2750
+ _e(e, g, b, nt)
2748
2751
  ), a(T);
2749
2752
  }
2750
- } else if (Ze(s, d, b))
2751
- c(d, Xe(b));
2753
+ } else if (Xe(s, d, b))
2754
+ c(d, et(b));
2752
2755
  else {
2753
2756
  const _ = C(s, d, b);
2754
- _ || o(_e(e, d, b, tt)), a(_);
2757
+ _ || o(_e(e, d, b, nt)), a(_);
2755
2758
  }
2756
2759
  }
2757
2760
  for (const f of n) {
2758
2761
  const [d, h, p, b] = f;
2759
- if (ri.has(d)) {
2762
+ if (si.has(d)) {
2760
2763
  const _ = C(s, h, "id");
2761
2764
  a(_), _ || o(_e(e, h, "id", { "unique?": !0 }));
2762
2765
  for (const y of Object.keys(b)) {
2763
2766
  const g = C(s, h, y);
2764
- if (a(g), ii.has(d) && (g || o(
2767
+ if (a(g), oi.has(d) && (g || o(
2765
2768
  _e(
2766
2769
  e,
2767
2770
  h,
2768
2771
  y,
2769
2772
  y === "id" ? { "unique?": !0 } : null
2770
2773
  )
2771
- )), si.has(d)) {
2774
+ )), ii.has(d)) {
2772
2775
  const T = J(s, h, y);
2773
- !g && !T && o(Rt(e, h, y)), a(T);
2776
+ !g && !T && o(Ut(e, h, y)), a(T);
2774
2777
  }
2775
2778
  }
2776
2779
  }
2777
2780
  }
2778
2781
  return [s, i];
2779
2782
  }
2780
- function li(t, e) {
2781
- const r = (Array.isArray(e) ? e : [e]).flatMap((c) => Fs(c)), [s, i] = ui(t, r), o = { ...t, attrs: s }, a = r.flatMap((c) => Zs(o, c));
2783
+ function fi(t, e) {
2784
+ const r = (Array.isArray(e) ? e : [e]).flatMap((c) => Ns(c)), [s, i] = li(t, r), o = { ...t, attrs: s }, a = r.flatMap((c) => Xs(o, c));
2782
2785
  return [...i, ...a];
2783
2786
  }
2784
- function Ut(t, e) {
2787
+ function Lt(t, e) {
2785
2788
  typeof requestIdleCallback > "u" ? t() : requestIdleCallback(t, { timeout: e });
2786
2789
  }
2787
2790
  const fe = "__meta";
2788
- class fi {
2791
+ class di {
2789
2792
  constructor(e, n) {
2790
2793
  }
2791
2794
  }
2792
- class nt {
2795
+ class rt {
2793
2796
  constructor(e) {
2794
2797
  this._subs = [], this._nextSave = null, this._nextGc = null, this._pendingSaveKeys = /* @__PURE__ */ new Set(), this._loadedKeys = /* @__PURE__ */ new Set(), this._version = 0, this._meta = {
2795
2798
  isLoading: !0,
@@ -2971,7 +2974,7 @@ class nt {
2971
2974
  gc() {
2972
2975
  this._nextGc || (this._nextGc = setTimeout(
2973
2976
  () => {
2974
- Ut(() => {
2977
+ Lt(() => {
2975
2978
  this._nextGc = null, this._gc();
2976
2979
  }, 30 * 1e3);
2977
2980
  },
@@ -2986,7 +2989,7 @@ class nt {
2986
2989
  return;
2987
2990
  }
2988
2991
  this._nextSave = setTimeout(() => {
2989
- Ut(() => {
2992
+ Lt(() => {
2990
2993
  this._nextSave = null, this._writeToStorage(e).then(n).catch(r);
2991
2994
  }, this._idleCallbackMaxWaitMs);
2992
2995
  }, this._saveThrottleMs);
@@ -3018,13 +3021,13 @@ class nt {
3018
3021
  };
3019
3022
  }
3020
3023
  }
3021
- const di = 6, hi = ["kv", "querySubs", "syncSubs"];
3022
- function pi(t) {
3024
+ const hi = 6, pi = ["kv", "querySubs", "syncSubs"];
3025
+ function yi(t) {
3023
3026
  return function(n) {
3024
3027
  console.error("Error in IndexedDB event", { source: t, event: n });
3025
3028
  };
3026
3029
  }
3027
- async function yi(t) {
3030
+ async function bi(t) {
3028
3031
  return new Promise((e) => {
3029
3032
  const n = indexedDB.open(t);
3030
3033
  n.onerror = (r) => {
@@ -3038,7 +3041,7 @@ async function yi(t) {
3038
3041
  };
3039
3042
  });
3040
3043
  }
3041
- async function bi(t, e, n) {
3044
+ async function _i(t, e, n) {
3042
3045
  const r = (
3043
3046
  // Backwards compatibility for older versions where we JSON.stringified before storing
3044
3047
  typeof e == "string" ? JSON.parse(e) : e
@@ -3072,14 +3075,14 @@ async function bi(t, e, n) {
3072
3075
  };
3073
3076
  });
3074
3077
  }
3075
- async function Lt(t, e, n) {
3078
+ async function Ft(t, e, n) {
3076
3079
  const r = n.put(e, t);
3077
3080
  return new Promise((s, i) => {
3078
3081
  r.onsuccess = () => s(), r.onerror = (o) => i(o);
3079
3082
  });
3080
3083
  }
3081
- async function _i(t, e) {
3082
- const n = await yi(`instant_${t}_5`);
3084
+ async function gi(t, e) {
3085
+ const n = await bi(`instant_${t}_5`);
3083
3086
  if (!n)
3084
3087
  return;
3085
3088
  const r = await new Promise((l, f) => {
@@ -3102,12 +3105,12 @@ async function _i(t, e) {
3102
3105
  for (const [l, f] of r)
3103
3106
  switch (l) {
3104
3107
  case "querySubs": {
3105
- const d = bi(l, f, o);
3108
+ const d = _i(l, f, o);
3106
3109
  a.push(d);
3107
3110
  break;
3108
3111
  }
3109
3112
  default: {
3110
- const d = Lt(l, f, i);
3113
+ const d = Ft(l, f, i);
3111
3114
  a.push(d);
3112
3115
  const h = {
3113
3116
  createdAt: Date.now(),
@@ -3118,15 +3121,15 @@ async function _i(t, e) {
3118
3121
  break;
3119
3122
  }
3120
3123
  }
3121
- const u = Lt(fe, c, i);
3124
+ const u = Ft(fe, c, i);
3122
3125
  a.push(u), await Promise.all(a), await new Promise((l, f) => {
3123
3126
  s.oncomplete = (d) => l(d), s.onerror = (d) => f(d), s.onabort = (d) => f(d);
3124
3127
  });
3125
3128
  }
3126
- const Ft = /* @__PURE__ */ new Map();
3127
- class Dn extends fi {
3129
+ const Nt = /* @__PURE__ */ new Map();
3130
+ class Rn extends di {
3128
3131
  constructor(e, n) {
3129
- super(e, n), this.dbName = `instant_${e}_${di}`, this._storeName = n, this._appId = e, this._dbPromise = this._init();
3132
+ super(e, n), this.dbName = `instant_${e}_${hi}`, this._storeName = n, this._appId = e, this._dbPromise = this._init();
3130
3133
  }
3131
3134
  _init() {
3132
3135
  return new Promise((e, n) => {
@@ -3137,12 +3140,12 @@ class Dn extends fi {
3137
3140
  }, s.onsuccess = (i) => {
3138
3141
  const a = i.target.result;
3139
3142
  if (r) {
3140
- const c = _i(this._appId, a).catch((u) => {
3141
- pi("Error upgrading store from version 5 to 6.")(u);
3143
+ const c = gi(this._appId, a).catch((u) => {
3144
+ yi("Error upgrading store from version 5 to 6.")(u);
3142
3145
  });
3143
- Ft.set(this.dbName, c), c.then(() => e(a)).catch(() => e(a));
3146
+ Nt.set(this.dbName, c), c.then(() => e(a)).catch(() => e(a));
3144
3147
  } else {
3145
- const c = Ft.get(this.dbName);
3148
+ const c = Nt.get(this.dbName);
3146
3149
  c ? c.then(() => e(a)).catch(() => e(a)) : e(a);
3147
3150
  }
3148
3151
  }, s.onupgradeneeded = (i) => {
@@ -3152,7 +3155,7 @@ class Dn extends fi {
3152
3155
  }
3153
3156
  _upgradeStore(e) {
3154
3157
  const r = e.target.result;
3155
- for (const s of hi)
3158
+ for (const s of pi)
3156
3159
  r.objectStoreNames.contains(s) || r.createObjectStore(s);
3157
3160
  }
3158
3161
  async getItem(e) {
@@ -3258,7 +3261,7 @@ async function q(t, e) {
3258
3261
  const n = await fetch(t, e), r = await n.json();
3259
3262
  return n.status === 200 ? Promise.resolve(r) : Promise.reject(new Pe({ status: n.status, body: r }));
3260
3263
  }
3261
- function gi({
3264
+ function wi({
3262
3265
  apiURI: t,
3263
3266
  appId: e,
3264
3267
  email: n
@@ -3269,7 +3272,7 @@ function gi({
3269
3272
  body: JSON.stringify({ "app-id": e, email: n })
3270
3273
  });
3271
3274
  }
3272
- async function wi({
3275
+ async function Ti({
3273
3276
  apiURI: t,
3274
3277
  appId: e,
3275
3278
  email: n,
@@ -3287,7 +3290,7 @@ async function wi({
3287
3290
  })
3288
3291
  });
3289
3292
  }
3290
- async function Ti({
3293
+ async function mi({
3291
3294
  apiURI: t,
3292
3295
  appId: e,
3293
3296
  refreshToken: n
@@ -3301,7 +3304,7 @@ async function Ti({
3301
3304
  })
3302
3305
  });
3303
3306
  }
3304
- async function mi({
3307
+ async function Si({
3305
3308
  apiURI: t,
3306
3309
  appId: e
3307
3310
  }) {
@@ -3313,7 +3316,7 @@ async function mi({
3313
3316
  })
3314
3317
  });
3315
3318
  }
3316
- async function Nt({
3319
+ async function Kt({
3317
3320
  apiURI: t,
3318
3321
  appId: e,
3319
3322
  code: n,
@@ -3331,7 +3334,7 @@ async function Nt({
3331
3334
  })
3332
3335
  });
3333
3336
  }
3334
- async function Si({
3337
+ async function Oi({
3335
3338
  apiURI: t,
3336
3339
  appId: e,
3337
3340
  nonce: n,
@@ -3351,7 +3354,7 @@ async function Si({
3351
3354
  })
3352
3355
  });
3353
3356
  }
3354
- async function Oi({
3357
+ async function vi({
3355
3358
  apiURI: t,
3356
3359
  appId: e,
3357
3360
  refreshToken: n
@@ -3367,7 +3370,7 @@ async function Oi({
3367
3370
  })
3368
3371
  });
3369
3372
  }
3370
- async function vi({
3373
+ async function Ai({
3371
3374
  apiURI: t,
3372
3375
  appId: e,
3373
3376
  path: n,
@@ -3388,7 +3391,7 @@ async function vi({
3388
3391
  body: r
3389
3392
  });
3390
3393
  }
3391
- async function Ai({
3394
+ async function ki({
3392
3395
  apiURI: t,
3393
3396
  appId: e,
3394
3397
  path: n,
@@ -3406,7 +3409,7 @@ async function Ai({
3406
3409
  );
3407
3410
  return s;
3408
3411
  }
3409
- async function ki({
3412
+ async function Ei({
3410
3413
  apiURI: t,
3411
3414
  appId: e,
3412
3415
  fileName: n,
@@ -3426,7 +3429,7 @@ async function ki({
3426
3429
  });
3427
3430
  return i;
3428
3431
  }
3429
- async function Ei(t, e) {
3432
+ async function Ci(t, e) {
3430
3433
  return (await fetch(t, {
3431
3434
  method: "PUT",
3432
3435
  body: e,
@@ -3435,7 +3438,7 @@ async function Ei(t, e) {
3435
3438
  }
3436
3439
  })).ok;
3437
3440
  }
3438
- async function Ci({
3441
+ async function Mi({
3439
3442
  apiURI: t,
3440
3443
  appId: e,
3441
3444
  path: n,
@@ -3455,39 +3458,39 @@ async function Ci({
3455
3458
  );
3456
3459
  return s;
3457
3460
  }
3458
- let _t = !1, Rn = !1, Un = !1;
3459
- typeof window < "u" && typeof window.localStorage < "u" && (_t = !!window.localStorage.getItem("devBackend"), Rn = !!window.localStorage.getItem("__instantLogging"), Un = !!window.localStorage.getItem("__devtoolLocalDash"));
3460
- function Kt(t, e) {
3461
+ let gt = !1, Un = !1, Ln = !1;
3462
+ typeof window < "u" && typeof window.localStorage < "u" && (gt = !!window.localStorage.getItem("devBackend"), Un = !!window.localStorage.getItem("__instantLogging"), Ln = !!window.localStorage.getItem("__devtoolLocalDash"));
3463
+ function qt(t, e) {
3461
3464
  if (!e) return t;
3462
3465
  const n = {};
3463
3466
  return e.forEach((r) => {
3464
3467
  n[r] = t[r];
3465
3468
  }), n;
3466
3469
  }
3467
- function Mi(t, e, n) {
3470
+ function Ii(t, e, n) {
3468
3471
  const r = {
3469
3472
  peers: {}
3470
3473
  };
3471
3474
  if (e && "user" in e ? e.user : !0) {
3472
- const i = Kt(t.user ?? {}, e == null ? void 0 : e.keys);
3475
+ const i = qt(t.user ?? {}, e == null ? void 0 : e.keys);
3473
3476
  r.user = { ...i, peerId: n };
3474
3477
  }
3475
3478
  for (const i of Object.keys(t.peers ?? {})) {
3476
3479
  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));
3477
3480
  if (o || a) {
3478
- const c = Kt(t.peers[i], e == null ? void 0 : e.keys);
3481
+ const c = qt(t.peers[i], e == null ? void 0 : e.keys);
3479
3482
  r.peers[i] = { ...c, peerId: i };
3480
3483
  }
3481
3484
  }
3482
3485
  return r;
3483
3486
  }
3484
- function Ii(t, e) {
3485
- if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !kt(t.user, e.user)) || !ln(t.peers, e.peers)) return !0;
3487
+ function Pi(t, e) {
3488
+ if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !Et(t.user, e.user)) || !fn(t.peers, e.peers)) return !0;
3486
3489
  for (const r of Object.keys(t.peers))
3487
- if (!kt(t.peers[r], e.peers[r])) return !0;
3490
+ if (!Et(t.peers[r], e.peers[r])) return !0;
3488
3491
  return !1;
3489
3492
  }
3490
- class qt {
3493
+ class zt {
3491
3494
  constructor() {
3492
3495
  w(this, "promise");
3493
3496
  w(this, "_resolve");
@@ -3503,20 +3506,20 @@ class qt {
3503
3506
  this._reject(e);
3504
3507
  }
3505
3508
  }
3506
- function Ln(t, e = []) {
3509
+ function Fn(t, e = []) {
3507
3510
  t.forEach((n) => {
3508
3511
  const { data: r } = n, { "datalog-result": s } = r, { "join-rows": i } = s;
3509
3512
  for (const o of i)
3510
3513
  for (const a of o)
3511
3514
  e.push(a);
3512
- Ln(n["child-nodes"], e);
3515
+ Fn(n["child-nodes"], e);
3513
3516
  });
3514
3517
  }
3515
- function zt(t) {
3518
+ function Vt(t) {
3516
3519
  const e = [];
3517
- return Ln(t, e), e;
3520
+ return Fn(t, e), e;
3518
3521
  }
3519
- function Vt(t) {
3522
+ function Wt(t) {
3520
3523
  return Object.values(t.links).reduce((e, n) => {
3521
3524
  var r, s;
3522
3525
  return e[r = n.forward.on] ?? (e[r] = {}), e[n.forward.on][n.forward.label] = {
@@ -3530,8 +3533,8 @@ function Vt(t) {
3530
3533
  }, e;
3531
3534
  }, {});
3532
3535
  }
3533
- const Fn = "v0.22.87-experimental.drewh-explorer-component.20181589271.1";
3534
- function Pi(t, e) {
3536
+ const Nn = "v0.22.87-experimental.drewh-entity-caching.20182780212.1";
3537
+ function ji(t, e) {
3535
3538
  return {
3536
3539
  info: t ? (...n) => console.info(...n, e()) : () => {
3537
3540
  },
@@ -3640,7 +3643,7 @@ class O extends Error {
3640
3643
  super(r), this.name = "QueryValidationError";
3641
3644
  }
3642
3645
  }
3643
- const Wt = [
3646
+ const Qt = [
3644
3647
  "where",
3645
3648
  "order",
3646
3649
  "limit",
@@ -3651,7 +3654,7 @@ const Wt = [
3651
3654
  "before",
3652
3655
  "fields",
3653
3656
  "aggregate"
3654
- ], ji = (t) => t.valueType || "unknown", Nn = (t, e, n = !1) => {
3657
+ ], $i = (t) => t.valueType || "unknown", Kn = (t, e, n = !1) => {
3655
3658
  if (n || t == null) return !0;
3656
3659
  switch (e) {
3657
3660
  case "string":
@@ -3665,9 +3668,9 @@ const Wt = [
3665
3668
  default:
3666
3669
  return !0;
3667
3670
  }
3668
- }, $i = (t, e, n, r, s, i, o) => {
3671
+ }, Di = (t, e, n, r, s, i, o) => {
3669
3672
  const a = i.valueType === "json", c = (u, l, f) => {
3670
- if (!Nn(f, l, a))
3673
+ if (!Kn(f, l, a))
3671
3674
  throw new O(
3672
3675
  `Invalid value for operator '${u}' on attribute '${r}' in entity '${s}'. Expected ${l}, but received: ${typeof f}`,
3673
3676
  o
@@ -3710,13 +3713,13 @@ const Wt = [
3710
3713
  );
3711
3714
  }
3712
3715
  }, ee = (t, e, n, r, s) => {
3713
- const i = ji(n), o = n.valueType === "json";
3716
+ const i = $i(n), o = n.valueType === "json";
3714
3717
  if (typeof t == "object" && t !== null && !Array.isArray(t)) {
3715
3718
  if (o)
3716
3719
  return;
3717
3720
  const c = t;
3718
3721
  for (const [u, l] of Object.entries(c))
3719
- $i(
3722
+ Di(
3720
3723
  u,
3721
3724
  l,
3722
3725
  i,
@@ -3725,12 +3728,12 @@ const Wt = [
3725
3728
  n,
3726
3729
  `${s}.${u}`
3727
3730
  );
3728
- } else if (!Nn(t, i, o))
3731
+ } else if (!Kn(t, i, o))
3729
3732
  throw new O(
3730
3733
  `Invalid value for attribute '${e}' in entity '${r}'. Expected ${i}, but received: ${typeof t}`,
3731
3734
  s
3732
3735
  );
3733
- }, Di = (t, e, n, r, s) => {
3736
+ }, Ri = (t, e, n, r, s) => {
3734
3737
  const i = t.split(".");
3735
3738
  if (i.length < 2)
3736
3739
  throw new O(
@@ -3800,12 +3803,12 @@ const Wt = [
3800
3803
  );
3801
3804
  }
3802
3805
  ee(e, t, u, n, s);
3803
- }, Kn = (t, e, n, r) => {
3806
+ }, qn = (t, e, n, r) => {
3804
3807
  for (const [s, i] of Object.entries(t)) {
3805
3808
  if (s === "or" || s === "and") {
3806
3809
  if (Array.isArray(i))
3807
3810
  for (const u of i)
3808
- typeof u == "object" && u !== null && Kn(
3811
+ typeof u == "object" && u !== null && qn(
3809
3812
  u,
3810
3813
  e,
3811
3814
  n,
@@ -3824,7 +3827,7 @@ const Wt = [
3824
3827
  continue;
3825
3828
  }
3826
3829
  if (s.includes(".")) {
3827
- Di(
3830
+ Ri(
3828
3831
  s,
3829
3832
  i,
3830
3833
  e,
@@ -3869,9 +3872,9 @@ const Wt = [
3869
3872
  }
3870
3873
  }, xi = (t, e, n, r, s = 0) => {
3871
3874
  for (const o of Object.keys(t))
3872
- if (!Wt.includes(o))
3875
+ if (!Qt.includes(o))
3873
3876
  throw new O(
3874
- `Invalid query parameter '${o}' in $ object. Valid parameters are: ${Wt.join(", ")}. Found: ${o}`,
3877
+ `Invalid query parameter '${o}' in $ object. Valid parameters are: ${Qt.join(", ")}. Found: ${o}`,
3875
3878
  r
3876
3879
  );
3877
3880
  const i = [
@@ -3894,14 +3897,14 @@ const Wt = [
3894
3897
  `'where' clause must be an object in entity '${e}', but received: ${typeof t.where}`,
3895
3898
  r ? `${r}.where` : void 0
3896
3899
  );
3897
- Kn(
3900
+ qn(
3898
3901
  t.where,
3899
3902
  e,
3900
3903
  n,
3901
3904
  r ? `${r}.where` : "where"
3902
3905
  );
3903
3906
  }
3904
- }, qn = (t, e, n, r, s = 0) => {
3907
+ }, zn = (t, e, n, r, s = 0) => {
3905
3908
  var i;
3906
3909
  if (!t || typeof t != "object")
3907
3910
  throw new O(
@@ -3920,7 +3923,7 @@ const Wt = [
3920
3923
  const a = t[o];
3921
3924
  if (typeof a == "object" && a !== null) {
3922
3925
  const c = (i = n == null ? void 0 : n.entities[e].links[o]) == null ? void 0 : i.entityName;
3923
- c && qn(
3926
+ c && zn(
3924
3927
  a,
3925
3928
  c,
3926
3929
  n,
@@ -3943,7 +3946,7 @@ const Wt = [
3943
3946
  s
3944
3947
  );
3945
3948
  }
3946
- }, Qt = (t, e) => {
3949
+ }, Gt = (t, e) => {
3947
3950
  if (typeof t != "object" || t === null)
3948
3951
  throw new O(
3949
3952
  `Query must be an object, but received: ${typeof t}${t === null ? " (null)" : ""}`
@@ -3972,7 +3975,7 @@ const Wt = [
3972
3975
  r
3973
3976
  );
3974
3977
  }
3975
- qn(
3978
+ zn(
3976
3979
  n[r],
3977
3980
  r,
3978
3981
  e,
@@ -3982,30 +3985,30 @@ const Wt = [
3982
3985
  );
3983
3986
  }
3984
3987
  }
3985
- }, Gt = (t) => typeof t != "string" ? !1 : Ce(t) ? !0 : te(t);
3988
+ }, Bt = (t) => typeof t != "string" ? !1 : Ce(t) ? !0 : te(t);
3986
3989
  class F extends Error {
3987
3990
  constructor(e) {
3988
3991
  super(e), this.name = "TransactionValidationError";
3989
3992
  }
3990
3993
  }
3991
- const zn = (t) => t.length > 0 ? t.join(", ") : "none", Ri = (t, e) => new F(
3992
- `Entity '${t}' does not exist in schema. Available entities: ${zn(e)}`
3993
- ), Ue = {
3994
+ const Vn = (t) => t.length > 0 ? t.join(", ") : "none", Ui = (t, e) => new F(
3995
+ `Entity '${t}' does not exist in schema. Available entities: ${Vn(e)}`
3996
+ ), Le = {
3994
3997
  string: (t) => typeof t == "string",
3995
3998
  number: (t) => typeof t == "number" && !isNaN(t),
3996
3999
  boolean: (t) => typeof t == "boolean",
3997
4000
  date: (t) => t instanceof Date || typeof t == "string" || typeof t == "number",
3998
4001
  json: () => !0
3999
- }, Ui = (t, e) => {
4002
+ }, Li = (t, e) => {
4000
4003
  var n;
4001
- return t == null ? !0 : ((n = Ue[e.valueType]) == null ? void 0 : n.call(Ue, t)) ?? !1;
4002
- }, Vn = (t, e) => {
4004
+ return t == null ? !0 : ((n = Le[e.valueType]) == null ? void 0 : n.call(Le, t)) ?? !1;
4005
+ }, Wn = (t, e) => {
4003
4006
  const n = e.entities[t];
4004
4007
  if (!n)
4005
- throw Ri(t, Object.keys(e.entities));
4008
+ throw Ui(t, Object.keys(e.entities));
4006
4009
  return n;
4007
- }, Le = (t, e, n) => {
4008
- const r = Vn(t, n);
4010
+ }, Fe = (t, e, n) => {
4011
+ const r = Wn(t, n);
4009
4012
  if (typeof e != "object" || e === null)
4010
4013
  throw new F(
4011
4014
  `Arguments for data operation on entity '${t}' must be an object, but received: ${typeof e}`
@@ -4013,13 +4016,13 @@ const zn = (t) => t.length > 0 ? t.join(", ") : "none", Ri = (t, e) => new F(
4013
4016
  for (const [s, i] of Object.entries(e)) {
4014
4017
  if (s === "id") continue;
4015
4018
  const o = r.attrs[s];
4016
- if (o && !Ui(i, o))
4019
+ if (o && !Li(i, o))
4017
4020
  throw new F(
4018
4021
  `Invalid value for attribute '${s}' in entity '${t}'. Expected ${o.valueType}, but received: ${typeof i}`
4019
4022
  );
4020
4023
  }
4021
- }, Bt = (t, e, n) => {
4022
- const r = Vn(t, n);
4024
+ }, Ht = (t, e, n) => {
4025
+ const r = Wn(t, n);
4023
4026
  if (typeof e != "object" || e === null)
4024
4027
  throw new F(
4025
4028
  `Arguments for link operation on entity '${t}' must be an object, but received: ${typeof e}`
@@ -4028,31 +4031,31 @@ const zn = (t) => t.length > 0 ? t.join(", ") : "none", Ri = (t, e) => new F(
4028
4031
  if (!r.links[s]) {
4029
4032
  const a = Object.keys(r.links);
4030
4033
  throw new F(
4031
- `Link '${s}' does not exist on entity '${t}'. Available links: ${zn(a)}`
4034
+ `Link '${s}' does not exist on entity '${t}'. Available links: ${Vn(a)}`
4032
4035
  );
4033
4036
  }
4034
4037
  if (i != null) {
4035
4038
  if (Array.isArray(i)) {
4036
4039
  for (const a of i)
4037
- if (!Gt(a))
4040
+ if (!Bt(a))
4038
4041
  throw new F(
4039
4042
  `Invalid entity ID in link '${s}' for entity '${t}'. Expected a UUID or a lookup, but received: ${a}`
4040
4043
  );
4041
- } else if (!Gt(i))
4044
+ } else if (!Bt(i))
4042
4045
  throw new F(
4043
4046
  `Invalid UUID in link '${s}' for entity '${t}'. Expected a UUID, but received: ${i}`
4044
4047
  );
4045
4048
  }
4046
4049
  }
4047
- }, Li = {
4048
- create: Le,
4049
- update: Le,
4050
- merge: Le,
4051
- link: Bt,
4052
- unlink: Bt,
4050
+ }, Fi = {
4051
+ create: Fe,
4052
+ update: Fe,
4053
+ merge: Fe,
4054
+ link: Ht,
4055
+ unlink: Ht,
4053
4056
  delete: () => {
4054
4057
  }
4055
- }, Fi = (t, e) => {
4058
+ }, Ni = (t, e) => {
4056
4059
  if (!e) return;
4057
4060
  const [n, r, s, i] = t;
4058
4061
  if (!Array.isArray(s) && !te(s))
@@ -4063,9 +4066,9 @@ const zn = (t) => t.length > 0 ? t.join(", ") : "none", Ri = (t, e) => new F(
4063
4066
  throw new F(
4064
4067
  `Entity name must be a string, but received: ${typeof r}`
4065
4068
  );
4066
- const o = Li[n];
4069
+ const o = Fi[n];
4067
4070
  o && i !== void 0 && o(r, i, e);
4068
- }, Ni = (t, e) => {
4071
+ }, Ki = (t, e) => {
4069
4072
  const n = Array.isArray(t) ? t : [t];
4070
4073
  for (const r of n) {
4071
4074
  if (!r || typeof r != "object")
@@ -4081,14 +4084,14 @@ const zn = (t) => t.length > 0 ? t.join(", ") : "none", Ri = (t, e) => new F(
4081
4084
  throw new F(
4082
4085
  `Transaction operation must be an array, but received: ${typeof s}`
4083
4086
  );
4084
- Fi(s, e);
4087
+ Ni(s, e);
4085
4088
  }
4086
4089
  }
4087
4090
  };
4088
- let Wn = 0;
4089
- class Ht {
4091
+ let Qn = 0;
4092
+ class Jt {
4090
4093
  constructor(e) {
4091
- this.type = "ws", this.id = `${this.type}_${Wn++}`, this.conn = new WebSocket(e), this.conn.onopen = (n) => {
4094
+ this.type = "ws", this.id = `${this.type}_${Qn++}`, this.conn = new WebSocket(e), this.conn.onopen = (n) => {
4092
4095
  this.onopen && this.onopen({ target: this });
4093
4096
  }, this.conn.onmessage = (n) => {
4094
4097
  this.onmessage && this.onmessage({
@@ -4114,9 +4117,9 @@ class Ht {
4114
4117
  return this.conn.send(JSON.stringify(e));
4115
4118
  }
4116
4119
  }
4117
- class Ki {
4120
+ class qi {
4118
4121
  constructor(e, n) {
4119
- this.type = "sse", this.initParams = null, this.sendQueue = [], this.closeFired = !1, this.sseInitTimeout = void 0, this.id = `${this.type}_${Wn++}`, this.url = n, this.ES = e, this.conn = new e(n), this.sseInitTimeout = setTimeout(() => {
4122
+ this.type = "sse", this.initParams = null, this.sendQueue = [], this.closeFired = !1, this.sseInitTimeout = void 0, this.id = `${this.type}_${Qn++}`, this.url = n, this.ES = e, this.conn = new e(n), this.sseInitTimeout = setTimeout(() => {
4120
4123
  this.initParams || this.handleError();
4121
4124
  }, 1e4), this.conn.onmessage = (r) => {
4122
4125
  const s = JSON.parse(r.data);
@@ -4197,34 +4200,34 @@ class Ki {
4197
4200
  this.handleClose();
4198
4201
  }
4199
4202
  }
4200
- function qi(t, e) {
4203
+ function zi(t, e) {
4201
4204
  const n = t.values;
4202
4205
  if (n)
4203
4206
  for (const r of n.entities || [])
4204
- r.store.useDateObjects = e, r.store.attrs = n.attrs, r.store = bn(r.store);
4207
+ r.store.useDateObjects = e, r.store.attrs = n.attrs, r.store = _n(r.store);
4205
4208
  return t;
4206
4209
  }
4207
- function zi(t, e) {
4210
+ function Vi(t, e) {
4208
4211
  var n, r;
4209
4212
  if ((n = e.values) != null && n.entities) {
4210
4213
  const s = [];
4211
4214
  for (const i of (r = e.values) == null ? void 0 : r.entities) {
4212
- const o = yn(i.store);
4215
+ const o = bn(i.store);
4213
4216
  delete o.attrs, s.push({ ...i, store: o });
4214
4217
  }
4215
4218
  return { ...e, values: { ...e.values, entities: s } };
4216
4219
  } else
4217
4220
  return e;
4218
4221
  }
4219
- function Vi(t, e, n) {
4222
+ function Wi(t, e, n) {
4220
4223
  var i, o;
4221
4224
  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;
4222
4225
  return r && (!s || r > s) ? e : s && (!r || s > r) ? n : e || n;
4223
4226
  }
4224
- function Fe(t, e) {
4225
- return Mn({ store: e, pageInfo: null, aggregate: null }, t.query).data[t.table][0];
4227
+ function Ne(t, e) {
4228
+ return In({ store: e, pageInfo: null, aggregate: null }, t.query).data[t.table][0];
4226
4229
  }
4227
- function Jt(t, e, n) {
4230
+ function Yt(t, e, n) {
4228
4231
  var i;
4229
4232
  const r = (i = G(e, t.table, "id")) == null ? void 0 : i.id;
4230
4233
  if (!r)
@@ -4232,18 +4235,18 @@ function Jt(t, e, n) {
4232
4235
  const s = se(e.eav, [n, r, n]);
4233
4236
  return s ? s[3] : -1;
4234
4237
  }
4235
- function Yt(t, e) {
4238
+ function Zt(t, e) {
4236
4239
  for (const { action: n, triple: r } of e)
4237
4240
  switch (n) {
4238
4241
  case "added":
4239
- wn(t, r);
4242
+ Tn(t, r);
4240
4243
  break;
4241
4244
  case "removed":
4242
- _n(t, r);
4245
+ gn(t, r);
4243
4246
  break;
4244
4247
  }
4245
4248
  }
4246
- function Wi(t, e) {
4249
+ function Qi(t, e) {
4247
4250
  var r, s;
4248
4251
  const n = {};
4249
4252
  for (const { action: i, triple: o } of e) {
@@ -4270,14 +4273,14 @@ function Wi(t, e) {
4270
4273
  function ge(t, e) {
4271
4274
  return { [t.table]: e.map((n) => n.entity) };
4272
4275
  }
4273
- function Qi(t, e) {
4276
+ function Gi(t, e) {
4274
4277
  var r;
4275
4278
  if (t.orderFieldType)
4276
4279
  return t.orderFieldType;
4277
4280
  const n = t.orderField === "serverCreatedAt" ? "number" : (r = G(e([]), t.table, t.orderField)) == null ? void 0 : r["checked-data-type"];
4278
4281
  return t.orderFieldType = n, n;
4279
4282
  }
4280
- function Gi(t, e, n) {
4283
+ function Bi(t, e, n) {
4281
4284
  const r = e;
4282
4285
  if (t.orderField === "serverCreatedAt") {
4283
4286
  n.sort(
@@ -4322,14 +4325,14 @@ function Gi(t, e, n) {
4322
4325
  }
4323
4326
  );
4324
4327
  }
4325
- var Bi = /* @__PURE__ */ ((t) => (t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error", t))(Bi || {});
4326
- class Hi {
4328
+ var Hi = /* @__PURE__ */ ((t) => (t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error", t))(Hi || {});
4329
+ class Ji {
4327
4330
  constructor(e, n, r, s, i) {
4328
- this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.subs = new nt({
4331
+ this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.subs = new rt({
4329
4332
  persister: n,
4330
- merge: Vi,
4331
- serialize: zi,
4332
- parse: (o, a) => qi(a, this.config.useDateObjects),
4333
+ merge: Wi,
4334
+ serialize: Vi,
4335
+ parse: (o, a) => zi(a, this.config.useDateObjects),
4333
4336
  objectSize: (o) => {
4334
4337
  var a;
4335
4338
  return ((a = o.values) == null ? void 0 : a.entities.length) || 0;
@@ -4462,11 +4465,11 @@ class Hi {
4462
4465
  for (const u of r) {
4463
4466
  const l = this.createStore(u);
4464
4467
  a.attrs = l.attrs;
4465
- const f = Fe(o, l);
4468
+ const f = Ne(o, l);
4466
4469
  c.push({
4467
4470
  store: l,
4468
4471
  entity: f,
4469
- serverCreatedAt: Jt(o, l, f.id)
4472
+ serverCreatedAt: Yt(o, l, f.id)
4470
4473
  }), i.push(f);
4471
4474
  }
4472
4475
  this.subs.updateInPlace((u) => {
@@ -4536,9 +4539,9 @@ class Hi {
4536
4539
  e: for (const [_, y] of Object.entries(u))
4537
4540
  for (let g = 0; g < f.length; g++) {
4538
4541
  const T = f[g];
4539
- if (Mr(T.store, _)) {
4540
- Yt(T.store, y);
4541
- const v = Fe(s, T.store), m = Wi(T.store, y)[_];
4542
+ if (Ir(T.store, _)) {
4543
+ Zt(T.store, y);
4544
+ const v = Ne(s, T.store), m = Qi(T.store, y)[_];
4542
4545
  v ? (d.push({
4543
4546
  oldEntity: T.entity,
4544
4547
  newEntity: v,
@@ -4550,8 +4553,8 @@ class Hi {
4550
4553
  const h = [];
4551
4554
  for (const [_, y] of Object.entries(u)) {
4552
4555
  const g = this.createStore([]);
4553
- l.attrs = g.attrs, Yt(g, y);
4554
- const T = Fe(s, g);
4556
+ l.attrs = g.attrs, Zt(g, y);
4557
+ const T = Ne(s, g);
4555
4558
  if (!T) {
4556
4559
  this.log.error("No entity found after applying change", {
4557
4560
  sub: s,
@@ -4563,14 +4566,14 @@ class Hi {
4563
4566
  f.push({
4564
4567
  store: g,
4565
4568
  entity: T,
4566
- serverCreatedAt: Jt(s, g, T.id)
4569
+ serverCreatedAt: Yt(s, g, T.id)
4567
4570
  }), h.push(T);
4568
4571
  }
4569
4572
  const p = [];
4570
4573
  for (const _ of c.sort().reverse())
4571
4574
  p.push(f[_].entity), f.splice(_, 1);
4572
- const b = Qi(s, this.createStore);
4573
- Gi(s, b, f), this.notifyCbs(r, {
4575
+ const b = Gi(s, this.createStore);
4576
+ Bi(s, b, f), this.notifyCbs(r, {
4574
4577
  type: "SyncTransaction",
4575
4578
  data: ge(s, (o = s.values) == null ? void 0 : o.entities),
4576
4579
  added: h,
@@ -4617,11 +4620,11 @@ const V = {
4617
4620
  AUTHENTICATED: "authenticated",
4618
4621
  CLOSED: "closed",
4619
4622
  ERRORED: "errored"
4620
- }, Ji = 3e4, Yi = 3e4, Zi = 200, Xi = {
4623
+ }, Yi = 3e4, Zi = 3e4, Xi = 200, eo = {
4621
4624
  apiURI: "https://api.instantdb.com",
4622
4625
  websocketURI: "wss://api.instantdb.com/runtime/session"
4623
- }, Ne = "_instant_oauth_redirect", ie = "currentUser";
4624
- function eo({
4626
+ }, Ke = "_instant_oauth_redirect", ie = "currentUser";
4627
+ function to({
4625
4628
  transportType: t,
4626
4629
  appId: e,
4627
4630
  apiURI: n,
@@ -4629,12 +4632,12 @@ function eo({
4629
4632
  EventSourceImpl: s
4630
4633
  }) {
4631
4634
  if (!s)
4632
- return new Ht(`${r}?app_id=${e}`);
4635
+ return new Jt(`${r}?app_id=${e}`);
4633
4636
  switch (t) {
4634
4637
  case "ws":
4635
- return new Ht(`${r}?app_id=${e}`);
4638
+ return new Jt(`${r}?app_id=${e}`);
4636
4639
  case "sse":
4637
- return new Ki(
4640
+ return new qi(
4638
4641
  s,
4639
4642
  `${n}/runtime/sse?app_id=${e}`
4640
4643
  );
@@ -4642,36 +4645,36 @@ function eo({
4642
4645
  throw new Error("Unknown transport type " + t);
4643
4646
  }
4644
4647
  }
4645
- function to() {
4648
+ function no() {
4646
4649
  return typeof window < "u" || typeof chrome < "u";
4647
4650
  }
4648
- const Zt = {
4651
+ const Xt = {
4649
4652
  "set-presence": !0,
4650
4653
  "set-presence-ok": !0,
4651
4654
  "refresh-presence": !0,
4652
4655
  "patch-presence": !0
4653
4656
  };
4654
- function no(t, e) {
4657
+ function ro(t, e) {
4655
4658
  var r;
4656
4659
  const n = typeof t == "string" ? JSON.parse(t) : t;
4657
4660
  if ((r = n == null ? void 0 : n.result) != null && r.store) {
4658
4661
  const s = n.result.store;
4659
- n.result.store = bn({
4662
+ n.result.store = _n({
4660
4663
  ...s,
4661
4664
  useDateObjects: e
4662
4665
  });
4663
4666
  }
4664
4667
  return n;
4665
4668
  }
4666
- function ro(t, e) {
4669
+ function so(t, e) {
4667
4670
  var r;
4668
4671
  const n = { ...e };
4669
4672
  return (r = e.result) != null && r.store && (n.result = {
4670
4673
  ...e.result,
4671
- store: yn(e.result.store)
4674
+ store: bn(e.result.store)
4672
4675
  }), n;
4673
4676
  }
4674
- function so(t, e) {
4677
+ function io(t, e) {
4675
4678
  switch (t) {
4676
4679
  case "pendingMutations":
4677
4680
  return new Map(typeof e == "string" ? JSON.parse(e) : e);
@@ -4679,7 +4682,7 @@ function so(t, e) {
4679
4682
  return e;
4680
4683
  }
4681
4684
  }
4682
- function io(t, e) {
4685
+ function oo(t, e) {
4683
4686
  switch (t) {
4684
4687
  case "pendingMutations":
4685
4688
  return [...e.entries()];
@@ -4687,18 +4690,18 @@ function io(t, e) {
4687
4690
  return e;
4688
4691
  }
4689
4692
  }
4690
- function oo(t, e, n) {
4693
+ function ao(t, e, n) {
4691
4694
  const r = e == null ? void 0 : e.result, s = n == null ? void 0 : n.result;
4692
4695
  return r && !s && n && (n.result = r), n || e;
4693
4696
  }
4694
- function Xt(t) {
4697
+ function en(t) {
4695
4698
  return [...t].sort((e, n) => {
4696
4699
  const [r, s] = e, [i, o] = n, a = s.order || 0, c = o.order || 0;
4697
4700
  return a == c ? r < i ? -1 : r > i ? 1 : 0 : a - c;
4698
4701
  });
4699
4702
  }
4700
- class ao {
4701
- constructor(e, n = Dn, r = xn, s, i) {
4703
+ class co {
4704
+ constructor(e, n = Rn, r = xn, s, i) {
4702
4705
  w(this, "attrs");
4703
4706
  w(this, "_isOnline", !0);
4704
4707
  w(this, "_isShutdown", !1);
@@ -4791,9 +4794,9 @@ class ao {
4791
4794
  });
4792
4795
  /** Applies transactions locally and sends transact message to server */
4793
4796
  w(this, "pushTx", (e) => {
4794
- this.config.disableValidation || Ni(e, this.config.schema);
4797
+ this.config.disableValidation || Ki(e, this.config.schema);
4795
4798
  try {
4796
- const n = li(
4799
+ const n = fi(
4797
4800
  {
4798
4801
  attrs: this.optimisticAttrs(),
4799
4802
  schema: this.config.schema,
@@ -4828,7 +4831,7 @@ class ao {
4828
4831
  this._updatePendingMutations((c) => {
4829
4832
  c.set(r, o);
4830
4833
  });
4831
- const a = new qt();
4834
+ const a = new zt();
4832
4835
  return this.mutationDeferredStore.set(r, a), this._sendMutation(r, o), this.notifyAll(), a.promise;
4833
4836
  });
4834
4837
  w(this, "_transportOnOpen", (e) => {
@@ -4932,10 +4935,10 @@ class ao {
4932
4935
  this._reconnectTimeoutMs
4933
4936
  ), this._scheduleReconnect();
4934
4937
  });
4935
- if (this._EventSource = i, this.config = { ...Xi, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? Yi, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Zi, this._log = Pi(
4936
- e.verbose || _t || Rn,
4938
+ if (this._EventSource = i, this.config = { ...eo, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? Zi, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Xi, this._log = ji(
4939
+ e.verbose || gt || Un,
4937
4940
  () => this._reactorStats()
4938
- ), this.versions = { ...s || {}, "@instantdb/core": Fn }, this.config.schema && (this._linkIndex = Vt(this.config.schema)), !!to()) {
4941
+ ), this.versions = { ...s || {}, "@instantdb/core": Nn }, this.config.schema && (this._linkIndex = Wt(this.config.schema)), !!no()) {
4939
4942
  if (!e.appId)
4940
4943
  throw new Error("Instant must be initialized with an appId.");
4941
4944
  if (!te(e.appId))
@@ -4952,7 +4955,7 @@ class ao {
4952
4955
  } catch (c) {
4953
4956
  this._log.error("[error] handle broadcast channel", c);
4954
4957
  }
4955
- })), this._initStorage(n), this._syncTable = new Hi(
4958
+ })), this._initStorage(n), this._syncTable = new Ji(
4956
4959
  this._trySendAuthed.bind(this),
4957
4960
  new n(this.config.appId, "syncSubs"),
4958
4961
  {
@@ -4983,7 +4986,7 @@ class ao {
4983
4986
  ...this.config,
4984
4987
  schema: e,
4985
4988
  cardinalityInference: !!e
4986
- }, this._linkIndex = e ? Vt(this.config.schema) : null;
4989
+ }, this._linkIndex = e ? Wt(this.config.schema) : null;
4987
4990
  }
4988
4991
  _reactorStats() {
4989
4992
  return {
@@ -4996,11 +4999,11 @@ class ao {
4996
4999
  this.kv.waitForKeyToLoad("pendingMutations").then(() => this.notifyOne(e));
4997
5000
  }
4998
5001
  _initStorage(e) {
4999
- this.querySubs = new nt({
5002
+ this.querySubs = new rt({
5000
5003
  persister: new e(this.config.appId, "querySubs"),
5001
- merge: oo,
5002
- serialize: ro,
5003
- parse: (n, r) => no(r, this.config.useDateObjects),
5004
+ merge: ao,
5005
+ serialize: so,
5006
+ parse: (n, r) => ro(r, this.config.useDateObjects),
5004
5007
  // objectSize
5005
5008
  objectSize: (n) => {
5006
5009
  var r, s, i;
@@ -5016,11 +5019,11 @@ class ao {
5016
5019
  maxSize: 1e6
5017
5020
  // 1 million triples
5018
5021
  }
5019
- }), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new nt({
5022
+ }), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new rt({
5020
5023
  persister: new e(this.config.appId, "kv"),
5021
5024
  merge: this._onMergeKv,
5022
- serialize: io,
5023
- parse: so,
5025
+ serialize: oo,
5026
+ parse: io,
5024
5027
  objectSize: () => 0,
5025
5028
  logger: this._log,
5026
5029
  saveThrottleMs: 100,
@@ -5082,7 +5085,7 @@ class ao {
5082
5085
  _handleReceive(e, n) {
5083
5086
  var s, i, o, a, c, u;
5084
5087
  const r = !!this.config.schema && ("cardinalityInference" in this.config ? !!this.config.cardinalityInference : !0);
5085
- switch (Zt[n.op] || this._log.info("[receive]", e, n.op, n), n.op) {
5088
+ switch (Xt[n.op] || this._log.info("[receive]", e, n.op, n), n.op) {
5086
5089
  case "init-ok": {
5087
5090
  this._setStatus(V.AUTHENTICATED), this._reconnectTimeoutMs = 0, this._setAttrs(n.attrs), this._flushPendingMessages(), this._sessionId = n["session-id"];
5088
5091
  for (const d of Object.keys(this._rooms)) {
@@ -5099,7 +5102,7 @@ class ao {
5099
5102
  const { q: d, result: h } = n, p = P(d);
5100
5103
  if (!this._hasQueryListeners() && !this.querySubs.currentValue[p])
5101
5104
  break;
5102
- const b = (a = (o = h == null ? void 0 : h[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], _ = (u = (c = h == null ? void 0 : h[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, y = zt(h), g = Oe(
5105
+ const b = (a = (o = h == null ? void 0 : h[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], _ = (u = (c = h == null ? void 0 : h[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, y = Vt(h), g = Oe(
5103
5106
  this.attrs,
5104
5107
  y,
5105
5108
  r,
@@ -5147,9 +5150,9 @@ class ao {
5147
5150
  b !== this._pendingMutations() && this.kv.updateInPlace((g) => {
5148
5151
  g.pendingMutations = b;
5149
5152
  });
5150
- const _ = Xt(b.entries()), y = d.map((g) => {
5151
- var gt, wt, Tt, mt;
5152
- const T = g["instaql-query"], v = g["instaql-result"], m = P(T), M = zt(v), I = Oe(
5153
+ const _ = en(b.entries()), y = d.map((g) => {
5154
+ var wt, Tt, mt, St;
5155
+ const T = g["instaql-query"], v = g["instaql-result"], m = P(T), M = Vt(v), I = Oe(
5153
5156
  this.attrs,
5154
5157
  M,
5155
5158
  r,
@@ -5159,8 +5162,8 @@ class ao {
5159
5162
  I,
5160
5163
  _,
5161
5164
  p
5162
- ), De = (wt = (gt = v == null ? void 0 : v[0]) == null ? void 0 : gt.data) == null ? void 0 : wt["page-info"], Gn = (mt = (Tt = v == null ? void 0 : v[0]) == null ? void 0 : Tt.data) == null ? void 0 : mt.aggregate;
5163
- return { q: T, hash: m, store: B, pageInfo: De, aggregate: Gn };
5165
+ ), De = (Tt = (wt = v == null ? void 0 : v[0]) == null ? void 0 : wt.data) == null ? void 0 : Tt["page-info"], Bn = (St = (mt = v == null ? void 0 : v[0]) == null ? void 0 : mt.data) == null ? void 0 : St.aggregate;
5166
+ return { q: T, hash: m, store: B, pageInfo: De, aggregate: Bn };
5164
5167
  });
5165
5168
  y.forEach(({ hash: g, q: T, store: v, pageInfo: m, aggregate: M }) => {
5166
5169
  this.querySubs.updateInPlace((I) => {
@@ -5329,15 +5332,15 @@ class ao {
5329
5332
  * Returns an unsubscribe function
5330
5333
  */
5331
5334
  subscribeQuery(e, n, r) {
5332
- this.config.disableValidation || Qt(e, this.config.schema), r && "ruleParams" in r && (e = { $$ruleParams: r.ruleParams, ...e });
5335
+ this.config.disableValidation || Gt(e, this.config.schema), r && "ruleParams" in r && (e = { $$ruleParams: r.ruleParams, ...e });
5333
5336
  const s = P(e), i = this.getPreviousResult(e);
5334
5337
  return i && n(i), this.queryCbs[s] = this.queryCbs[s] ?? [], this.queryCbs[s].push({ q: e, cb: n }), this._startQuerySub(e, s), () => {
5335
5338
  this._unsubQuery(e, s, n);
5336
5339
  };
5337
5340
  }
5338
5341
  queryOnce(e, n) {
5339
- this.config.disableValidation || Qt(e, this.config.schema), n && "ruleParams" in n && (e = { $$ruleParams: n.ruleParams, ...e });
5340
- const r = new qt();
5342
+ this.config.disableValidation || Gt(e, this.config.schema), n && "ruleParams" in n && (e = { $$ruleParams: n.ruleParams, ...e });
5343
+ const r = new zt();
5341
5344
  if (!this._isOnline)
5342
5345
  return r.reject(
5343
5346
  new Error("We can't run `queryOnce`, because the device is offline.")
@@ -5351,7 +5354,7 @@ class ao {
5351
5354
  const s = P(e), i = this._startQuerySub(e, s);
5352
5355
  return this.queryOnceDfds[s] = this.queryOnceDfds[s] ?? [], this.queryOnceDfds[s].push({ q: e, dfd: r, eventId: i }), setTimeout(
5353
5356
  () => r.reject(new Error("Query timed out")),
5354
- Ji
5357
+ Yi
5355
5358
  ), r.promise;
5356
5359
  }
5357
5360
  _completeQueryOnce(e, n, r) {
@@ -5413,7 +5416,7 @@ class ao {
5413
5416
  a = !0;
5414
5417
  continue;
5415
5418
  }
5416
- const b = a ? Ns(o, h) : h;
5419
+ const b = a ? Ks(o, h) : h;
5417
5420
  d.push(b);
5418
5421
  }
5419
5422
  return a ? d : l;
@@ -5426,7 +5429,7 @@ class ao {
5426
5429
  return a ? u : n;
5427
5430
  }
5428
5431
  _rewriteMutationsSorted(e, n) {
5429
- return Xt(this._rewriteMutations(e, n).entries());
5432
+ return en(this._rewriteMutations(e, n).entries());
5430
5433
  }
5431
5434
  // ---------------------------
5432
5435
  // Transact
@@ -5469,11 +5472,11 @@ class ao {
5469
5472
  p,
5470
5473
  h
5471
5474
  );
5472
- return { data: Mn({ store: b, pageInfo: f, aggregate: d }, a), querySubVersion: r, pendingMutationsVersion: i };
5475
+ return { data: In({ store: b, pageInfo: f, aggregate: d }, a), querySubVersion: r, pendingMutationsVersion: i };
5473
5476
  }
5474
5477
  _applyOptimisticUpdates(e, n, r) {
5475
5478
  for (const [s, i] of n)
5476
- (!i["tx-id"] || r && i["tx-id"] > r) && (e = Kr(e, i["tx-steps"]));
5479
+ (!i["tx-id"] || r && i["tx-id"] > r) && (e = qr(e, i["tx-steps"]));
5477
5480
  return e;
5478
5481
  }
5479
5482
  /** Re-compute all subscriptions */
@@ -5567,7 +5570,7 @@ class ao {
5567
5570
  }
5568
5571
  _trySend(e, n, r) {
5569
5572
  if (this._transport.isOpen()) {
5570
- switch (Zt[n.op] || this._log.info("[send]", this._transport.id, n.op, n), n.op) {
5573
+ switch (Xt[n.op] || this._log.info("[send]", this._transport.id, n.op, n), n.op) {
5571
5574
  case "transact": {
5572
5575
  this._inFlightMutationEventIds.add(e);
5573
5576
  break;
@@ -5596,7 +5599,7 @@ class ao {
5596
5599
  return;
5597
5600
  }
5598
5601
  const e = this._transport;
5599
- this._transport = eo({
5602
+ this._transport = to({
5600
5603
  transportType: this._transportType,
5601
5604
  appId: this.config.appId,
5602
5605
  apiURI: this.config.apiURI,
@@ -5635,9 +5638,9 @@ class ao {
5635
5638
  if (typeof URL > "u")
5636
5639
  return;
5637
5640
  const e = new URL(window.location.href);
5638
- if (e.searchParams.get(Ne)) {
5641
+ if (e.searchParams.get(Ke)) {
5639
5642
  const n = e.toString();
5640
- e.searchParams.delete(Ne), e.searchParams.delete("code"), e.searchParams.delete("error");
5643
+ e.searchParams.delete(Ke), e.searchParams.delete("code"), e.searchParams.delete("error");
5641
5644
  const r = e.pathname + (e.searchParams.size ? "?" + e.searchParams : "") + e.hash;
5642
5645
  if (history.replaceState(history.state, "", r), // @ts-ignore (waiting for ts support)
5643
5646
  typeof navigation == "object" && // @ts-ignore (waiting for ts support)
@@ -5661,7 +5664,7 @@ class ao {
5661
5664
  if (typeof window > "u" || typeof window.location > "u" || typeof URLSearchParams > "u")
5662
5665
  return null;
5663
5666
  const e = new URLSearchParams(window.location.search);
5664
- if (!e.get(Ne))
5667
+ if (!e.get(Ke))
5665
5668
  return null;
5666
5669
  const n = e.get("error");
5667
5670
  if (n)
@@ -5671,7 +5674,7 @@ class ao {
5671
5674
  return null;
5672
5675
  this._replaceUrlAfterOAuth();
5673
5676
  try {
5674
- const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await Nt({
5677
+ const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await Kt({
5675
5678
  apiURI: this.config.apiURI,
5676
5679
  appId: this.config.appId,
5677
5680
  code: r,
@@ -5790,7 +5793,7 @@ class ao {
5790
5793
  }), this._reconnectTimeoutMs = 0, this._transport.close(), this._oauthCallbackResponse = null, this.notifyAuthSubs(n);
5791
5794
  }
5792
5795
  sendMagicCode({ email: e }) {
5793
- return gi({
5796
+ return wi({
5794
5797
  apiURI: this.config.apiURI,
5795
5798
  appId: this.config.appId,
5796
5799
  email: e
@@ -5798,7 +5801,7 @@ class ao {
5798
5801
  }
5799
5802
  async signInWithMagicCode({ email: e, code: n }) {
5800
5803
  var o;
5801
- const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await wi({
5804
+ const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await Ti({
5802
5805
  apiURI: this.config.apiURI,
5803
5806
  appId: this.config.appId,
5804
5807
  email: e,
@@ -5808,7 +5811,7 @@ class ao {
5808
5811
  return await this.changeCurrentUser(i.user), i;
5809
5812
  }
5810
5813
  async signInWithCustomToken(e) {
5811
- const n = await Ti({
5814
+ const n = await mi({
5812
5815
  apiURI: this.config.apiURI,
5813
5816
  appId: this.config.appId,
5814
5817
  refreshToken: e
@@ -5816,7 +5819,7 @@ class ao {
5816
5819
  return await this.changeCurrentUser(n.user), n;
5817
5820
  }
5818
5821
  async signInAsGuest() {
5819
- const e = await mi({
5822
+ const e = await Si({
5820
5823
  apiURI: this.config.apiURI,
5821
5824
  appId: this.config.appId
5822
5825
  });
@@ -5831,7 +5834,7 @@ class ao {
5831
5834
  this._log.info("[auth-invalidate] skipped invalidateToken");
5832
5835
  return;
5833
5836
  }
5834
- Oi({
5837
+ vi({
5835
5838
  apiURI: this.config.apiURI,
5836
5839
  appId: this.config.appId,
5837
5840
  refreshToken: r
@@ -5863,7 +5866,7 @@ class ao {
5863
5866
  */
5864
5867
  async exchangeCodeForToken({ code: e, codeVerifier: n }) {
5865
5868
  var o;
5866
- const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await Nt({
5869
+ const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await Kt({
5867
5870
  apiURI: this.config.apiURI,
5868
5871
  appId: this.config.appId,
5869
5872
  code: e,
@@ -5884,7 +5887,7 @@ class ao {
5884
5887
  */
5885
5888
  async signInWithIdToken({ idToken: e, clientName: n, nonce: r }) {
5886
5889
  var a;
5887
- const s = await this.getCurrentUser(), i = (a = s == null ? void 0 : s.user) == null ? void 0 : a.refresh_token, o = await Si({
5890
+ const s = await this.getCurrentUser(), i = (a = s == null ? void 0 : s.user) == null ? void 0 : a.refresh_token, o = await Oi({
5888
5891
  apiURI: this.config.apiURI,
5889
5892
  appId: this.config.appId,
5890
5893
  idToken: e,
@@ -5925,7 +5928,7 @@ class ao {
5925
5928
  getPresence(e, n, r = {}) {
5926
5929
  const s = this._rooms[n], i = this._presence[n];
5927
5930
  return !s || !i || !i.result ? null : {
5928
- ...Mi(i.result, r, this._sessionId),
5931
+ ...Ii(i.result, r, this._sessionId),
5929
5932
  isLoading: !s.isConnected,
5930
5933
  error: s.error
5931
5934
  };
@@ -5981,7 +5984,7 @@ class ao {
5981
5984
  }
5982
5985
  _notifyPresenceSub(e, n) {
5983
5986
  const r = this.getPresence("", e, n);
5984
- r && (n.prev && !Ii(r, n.prev) || (n.prev = r, n.cb(r)));
5987
+ r && (n.prev && !Pi(r, n.prev) || (n.prev = r, n.cb(r)));
5985
5988
  }
5986
5989
  _patchPresencePeers(e, n) {
5987
5990
  var o, a, c;
@@ -5994,13 +5997,13 @@ class ao {
5994
5997
  for (let [l, f, d] of n)
5995
5998
  switch (f) {
5996
5999
  case "+":
5997
- ur(u, l, d);
6000
+ lr(u, l, d);
5998
6001
  break;
5999
6002
  case "r":
6000
- Et(u, l, d);
6003
+ Ct(u, l, d);
6001
6004
  break;
6002
6005
  case "-":
6003
- dn(u, l);
6006
+ hn(u, l);
6004
6007
  break;
6005
6008
  }
6006
6009
  delete u[this._sessionId];
@@ -6014,7 +6017,7 @@ class ao {
6014
6017
  Object.entries(r).map(([i, o]) => [i, o.data])
6015
6018
  );
6016
6019
  this._presence = ke(this._presence, (i) => {
6017
- Et(i, [e, "result", "peers"], s);
6020
+ Ct(i, [e, "result", "peers"], s);
6018
6021
  });
6019
6022
  }
6020
6023
  // --------
@@ -6057,7 +6060,7 @@ class ao {
6057
6060
  async uploadFile(e, n, r) {
6058
6061
  var o;
6059
6062
  const s = await this.getCurrentUser(), i = (o = s == null ? void 0 : s.user) == null ? void 0 : o.refresh_token;
6060
- return vi({
6063
+ return Ai({
6061
6064
  ...r,
6062
6065
  apiURI: this.config.apiURI,
6063
6066
  appId: this.config.appId,
@@ -6069,7 +6072,7 @@ class ao {
6069
6072
  async deleteFile(e) {
6070
6073
  var i;
6071
6074
  const n = await this.getCurrentUser(), r = (i = n == null ? void 0 : n.user) == null ? void 0 : i.refresh_token;
6072
- return await Ai({
6075
+ return await ki({
6073
6076
  apiURI: this.config.apiURI,
6074
6077
  appId: this.config.appId,
6075
6078
  path: e,
@@ -6080,18 +6083,18 @@ class ao {
6080
6083
  // ---------------------------------
6081
6084
  async upload(e, n) {
6082
6085
  var c;
6083
- const r = await this.getCurrentUser(), s = (c = r == null ? void 0 : r.user) == null ? void 0 : c.refresh_token, i = e || n.name, o = await ki({
6086
+ const r = await this.getCurrentUser(), s = (c = r == null ? void 0 : r.user) == null ? void 0 : c.refresh_token, i = e || n.name, o = await Ei({
6084
6087
  apiURI: this.config.apiURI,
6085
6088
  appId: this.config.appId,
6086
6089
  fileName: i,
6087
6090
  refreshToken: s
6088
6091
  });
6089
- return await Ei(o, n);
6092
+ return await Ci(o, n);
6090
6093
  }
6091
6094
  async getDownloadUrl(e) {
6092
6095
  var i;
6093
6096
  const n = await this.getCurrentUser(), r = (i = n == null ? void 0 : n.user) == null ? void 0 : i.refresh_token;
6094
- return await Ci({
6097
+ return await Mi({
6095
6098
  apiURI: this.config.apiURI,
6096
6099
  appId: this.config.appId,
6097
6100
  path: e,
@@ -6099,9 +6102,9 @@ class ao {
6099
6102
  });
6100
6103
  }
6101
6104
  }
6102
- function co(t, e) {
6105
+ function uo(t, e) {
6103
6106
  return new $e(
6104
- Qn(t, e),
6107
+ Gn(t, e),
6105
6108
  // (XXX): LinksDef<any> stems from TypeScript’s inability to reconcile the
6106
6109
  // type EntitiesWithLinks<EntitiesWithoutLinks, Links> with
6107
6110
  // EntitiesWithoutLinks. TypeScript is strict about ensuring that types are
@@ -6111,28 +6114,28 @@ function co(t, e) {
6111
6114
  void 0
6112
6115
  );
6113
6116
  }
6114
- function uo(t) {
6117
+ function lo(t) {
6115
6118
  return new je(t, {});
6116
6119
  }
6117
- function lo() {
6120
+ function fo() {
6118
6121
  return new $("string", !0, !1);
6119
6122
  }
6120
- function fo() {
6123
+ function ho() {
6121
6124
  return new $("number", !0, !1);
6122
6125
  }
6123
- function ho() {
6126
+ function po() {
6124
6127
  return new $("boolean", !0, !1);
6125
6128
  }
6126
- function po() {
6129
+ function yo() {
6127
6130
  return new $("date", !0, !1);
6128
6131
  }
6129
- function yo() {
6132
+ function bo() {
6130
6133
  return new $("json", !0, !1);
6131
6134
  }
6132
- function bo() {
6135
+ function _o() {
6133
6136
  return new $("json", !0, !1);
6134
6137
  }
6135
- function Qn(t, e) {
6138
+ function Gn(t, e) {
6136
6139
  var s, i, o, a;
6137
6140
  const n = { fwd: {}, rev: {} };
6138
6141
  for (const c of Object.values(e))
@@ -6153,14 +6156,14 @@ function Qn(t, e) {
6153
6156
  ])
6154
6157
  );
6155
6158
  }
6156
- function _o({
6159
+ function go({
6157
6160
  entities: t,
6158
6161
  links: e,
6159
6162
  rooms: n
6160
6163
  }) {
6161
6164
  const r = e ?? {}, s = n ?? {};
6162
6165
  return new $e(
6163
- Qn(t, r),
6166
+ Gn(t, r),
6164
6167
  // (XXX): LinksDef<any> stems from TypeScript's inability to reconcile the
6165
6168
  // type EntitiesWithLinks<EntitiesWithoutLinks, Links> with
6166
6169
  // EntitiesWithoutLinks. TypeScript is strict about ensuring that types are
@@ -6170,23 +6173,23 @@ function _o({
6170
6173
  s
6171
6174
  );
6172
6175
  }
6173
- const Uo = {
6176
+ const Lo = {
6174
6177
  // constructs
6175
- graph: co,
6176
- schema: _o,
6177
- entity: uo,
6178
+ graph: uo,
6179
+ schema: go,
6180
+ entity: lo,
6178
6181
  // value types
6179
- string: lo,
6180
- number: fo,
6181
- boolean: ho,
6182
- date: po,
6183
- json: yo,
6184
- any: bo
6182
+ string: fo,
6183
+ number: ho,
6184
+ boolean: po,
6185
+ date: yo,
6186
+ json: bo,
6187
+ any: _o
6185
6188
  };
6186
6189
  let we;
6187
- function go(t, e) {
6190
+ function wo(t, e) {
6188
6191
  we == null || we.dispose();
6189
- const n = vo(e), r = mo(e, a), s = To(wo(t));
6192
+ const n = Ao(e), r = So(e, a), s = mo(To(t));
6190
6193
  function i(l) {
6191
6194
  var f;
6192
6195
  l.source === s.element.contentWindow && ((f = l.data) == null ? void 0 : f.type) === "close" && n.isVisible() && a();
@@ -6208,10 +6211,10 @@ function go(t, e) {
6208
6211
  }
6209
6212
  return u();
6210
6213
  }
6211
- function wo(t) {
6212
- return `${_t || Un ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
6213
- }
6214
6214
  function To(t) {
6215
+ return `${gt || Ln ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
6216
+ }
6217
+ function mo(t) {
6215
6218
  const e = document.createElement("iframe");
6216
6219
  return e.src = t, e.className = "instant-devtool-iframe", Object.assign(e.style, {
6217
6220
  width: "100%",
@@ -6220,7 +6223,7 @@ function To(t) {
6220
6223
  border: "none"
6221
6224
  }), { element: e };
6222
6225
  }
6223
- function mo(t, e) {
6226
+ function So(t, e) {
6224
6227
  const n = `
6225
6228
  <svg width="32" height="32" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
6226
6229
  <rect width="512" height="512" fill="black"/>
@@ -6230,7 +6233,7 @@ function mo(t, e) {
6230
6233
  return r.innerHTML = n, r.className = "instant-devtool-toggler", Object.assign(r.style, {
6231
6234
  // pos
6232
6235
  position: "fixed",
6233
- ...So(t.position),
6236
+ ...Oo(t.position),
6234
6237
  height: "32px",
6235
6238
  width: "32px",
6236
6239
  // layout
@@ -6245,7 +6248,7 @@ function mo(t, e) {
6245
6248
  cursor: "pointer"
6246
6249
  }), r.addEventListener("click", e), { element: r };
6247
6250
  }
6248
- function So(t) {
6251
+ function Oo(t) {
6249
6252
  switch (t) {
6250
6253
  case "bottom-left":
6251
6254
  return { bottom: "24px", left: "24px" };
@@ -6257,7 +6260,7 @@ function So(t) {
6257
6260
  return { top: "24px", left: "24px" };
6258
6261
  }
6259
6262
  }
6260
- function Oo(t) {
6263
+ function vo(t) {
6261
6264
  switch (t) {
6262
6265
  case "bottom-left":
6263
6266
  return { bottom: "24px", right: "24px", left: "60px", top: "72px" };
@@ -6269,11 +6272,11 @@ function Oo(t) {
6269
6272
  return { top: "24px", right: "24px", left: "60px", bottom: "72px" };
6270
6273
  }
6271
6274
  }
6272
- function vo(t) {
6275
+ function Ao(t) {
6273
6276
  const e = document.createElement("div");
6274
6277
  Object.assign(e.style, {
6275
6278
  position: "fixed",
6276
- ...Oo(t.position),
6279
+ ...vo(t.position),
6277
6280
  display: "block",
6278
6281
  borderRadius: "4px",
6279
6282
  border: "1px #ccc solid",
@@ -6286,37 +6289,37 @@ function vo(t) {
6286
6289
  }
6287
6290
  return { element: e, isVisible: n };
6288
6291
  }
6289
- const Ao = {
6292
+ const ko = {
6290
6293
  apiURI: "https://api.instantdb.com",
6291
6294
  websocketURI: "wss://api.instantdb.com/runtime/session"
6292
6295
  };
6293
- function ko() {
6296
+ function Eo() {
6294
6297
  return globalThis.__instantDbSchemaHashStore = globalThis.__instantDbSchemaHashStore ?? /* @__PURE__ */ new WeakMap(), globalThis.__instantDbSchemaHashStore;
6295
6298
  }
6296
- function Eo() {
6299
+ function Co() {
6297
6300
  return globalThis.__instantDbStore = globalThis.__instantDbStore ?? {}, globalThis.__instantDbStore;
6298
6301
  }
6299
- function rt(t) {
6302
+ function st(t) {
6300
6303
  const e = t.__adminToken;
6301
6304
  return t.appId + "_" + (t.websocketURI || "default_ws_uri") + "_" + (t.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + t.useDateObjects;
6302
6305
  }
6303
- const st = Eo(), en = ko();
6304
- class Co {
6306
+ const it = Co(), tn = Eo();
6307
+ class Mo {
6305
6308
  constructor(e) {
6306
6309
  this.db = e, this.sendMagicCode = (n) => this.db.sendMagicCode(n), this.signInWithMagicCode = (n) => this.db.signInWithMagicCode(n), this.signInWithToken = (n) => this.db.signInWithCustomToken(n), this.signInAsGuest = () => this.db.signInAsGuest(), this.createAuthorizationURL = (n) => this.db.createAuthorizationURL(n), this.signInWithIdToken = (n) => this.db.signInWithIdToken(n), this.exchangeOAuthCode = (n) => this.db.exchangeCodeForToken(n), this.issuerURI = () => this.db.issuerURI(), this.signOut = (n = { invalidateToken: !0 }) => this.db.signOut(n);
6307
6310
  }
6308
6311
  }
6309
- class Mo {
6312
+ class Io {
6310
6313
  constructor(e) {
6311
6314
  this.db = e, this.uploadFile = (n, r, s = {}) => this.db.uploadFile(n, r, s), this.delete = (n) => this.db.deleteFile(n), this.upload = (n, r) => this.db.upload(n, r), this.put = this.upload, this.getDownloadUrl = (n) => this.db.getDownloadUrl(n);
6312
6315
  }
6313
6316
  }
6314
- function Lo(t) {
6317
+ function Fo(t) {
6315
6318
  return JSON.parse(JSON.stringify(t));
6316
6319
  }
6317
- class Io {
6320
+ class Po {
6318
6321
  constructor(e) {
6319
- this.tx = Pn(), this._reactor = e, this.auth = new Co(this._reactor), this.storage = new Mo(this._reactor);
6322
+ this.tx = jn(), this._reactor = e, this.auth = new Mo(this._reactor), this.storage = new Io(this._reactor);
6320
6323
  }
6321
6324
  /**
6322
6325
  * Use this to write data! You can create, update, delete, and link objects
@@ -6457,7 +6460,7 @@ class Io {
6457
6460
  };
6458
6461
  }
6459
6462
  shutdown() {
6460
- delete st[rt(this._reactor.config)], this._reactor.shutdown();
6463
+ delete it[st(this._reactor.config)], this._reactor.shutdown();
6461
6464
  }
6462
6465
  /**
6463
6466
  * Use this for one-off queries.
@@ -6490,39 +6493,39 @@ class Io {
6490
6493
  return this._reactor.subscribeTable(e, n);
6491
6494
  }
6492
6495
  }
6493
- function tn(t) {
6496
+ function nn(t) {
6494
6497
  if (!t)
6495
6498
  return "0";
6496
- const e = en.get(t);
6499
+ const e = tn.get(t);
6497
6500
  if (e)
6498
6501
  return e;
6499
6502
  const n = P(t);
6500
- return en.set(t, n), n;
6503
+ return tn.set(t, n), n;
6501
6504
  }
6502
- function Po(t, e) {
6503
- return tn(t._reactor.config.schema) !== tn(e);
6505
+ function jo(t, e) {
6506
+ return nn(t._reactor.config.schema) !== nn(e);
6504
6507
  }
6505
- function jo(t, e, n, r, s) {
6508
+ function $o(t, e, n, r, s) {
6506
6509
  const i = {
6507
6510
  ...t,
6508
6511
  useDateObjects: t.useDateObjects ?? !1
6509
- }, o = st[rt(i)];
6512
+ }, o = it[st(i)];
6510
6513
  if (o)
6511
- return Po(o, i.schema) && o._reactor.updateSchema(i.schema), o;
6512
- const a = new ao(
6514
+ return jo(o, i.schema) && o._reactor.updateSchema(i.schema), o;
6515
+ const a = new co(
6513
6516
  {
6514
- ...Ao,
6517
+ ...ko,
6515
6518
  ...i,
6516
6519
  cardinalityInference: !!i.schema
6517
6520
  },
6518
- e || Dn,
6521
+ e || Rn,
6519
6522
  n || xn,
6520
- { ...r || {}, "@instantdb/core": Fn },
6523
+ { ...r || {}, "@instantdb/core": Nn },
6521
6524
  s
6522
- ), c = new Io(a);
6523
- return st[rt(i)] = c, $o(i.appId, i.devtool), c;
6525
+ ), c = new Po(a);
6526
+ return it[st(i)] = c, Do(i.appId, i.devtool), c;
6524
6527
  }
6525
- function $o(t, e) {
6528
+ function Do(t, e) {
6526
6529
  if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
6527
6530
  return;
6528
6531
  const n = {
@@ -6530,33 +6533,33 @@ function $o(t, e) {
6530
6533
  allowedHosts: ["localhost"],
6531
6534
  ...typeof e == "object" ? e : {}
6532
6535
  };
6533
- n.allowedHosts.includes(window.location.hostname) && go(t, n);
6536
+ n.allowedHosts.includes(window.location.hostname) && wo(t, n);
6534
6537
  }
6535
- const Fo = jo;
6538
+ const No = $o;
6536
6539
  export {
6537
- Co as Auth,
6538
- Dn as IndexedDBStorage,
6540
+ Mo as Auth,
6541
+ Rn as IndexedDBStorage,
6539
6542
  Pe as InstantAPIError,
6540
- Io as InstantCoreDatabase,
6543
+ Po as InstantCoreDatabase,
6541
6544
  he as InstantError,
6542
6545
  O as QueryValidationError,
6543
- Mo as Storage,
6544
- fi as StorageInterface,
6545
- Bi as SyncTableCallbackEventType,
6546
+ Io as Storage,
6547
+ di as StorageInterface,
6548
+ Hi as SyncTableCallbackEventType,
6546
6549
  F as TransactionValidationError,
6547
6550
  xn as WindowNetworkListener,
6548
- Lo as coerceQuery,
6551
+ Fo as coerceQuery,
6549
6552
  Me as coerceToDate,
6550
- Fs as getOps,
6551
- Uo as i,
6553
+ Ns as getOps,
6554
+ Lo as i,
6552
6555
  k as id,
6553
- jo as init,
6554
- Fo as init_experimental,
6556
+ $o as init,
6557
+ No as init_experimental,
6555
6558
  xo as lookup,
6556
- Ro as tx,
6557
- Pn as txInit,
6558
- Qt as validateQuery,
6559
- Ni as validateTransactions,
6560
- Fn as version,
6559
+ Uo as tx,
6560
+ jn as txInit,
6561
+ Gt as validateQuery,
6562
+ Ki as validateTransactions,
6563
+ Nn as version,
6561
6564
  P as weakHash
6562
6565
  };