@instantdb/react 0.22.61-experimental.delay-looking-at-store.19555739599.1 → 0.22.61
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.
- package/dist/standalone/index.js +604 -611
- package/dist/standalone/index.umd.cjs +12 -12
- package/package.json +4 -4
package/dist/standalone/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ci, { useRef as
|
|
1
|
+
import ci, { useRef as at, useCallback as ge, useSyncExternalStore as nn, useEffect as je, useMemo as rn, useState as di, createElement as ks } from "react";
|
|
2
2
|
function V(t) {
|
|
3
3
|
if (typeof t == "number")
|
|
4
4
|
return (Math.abs(t * 2654435761) >>> 0).toString(16);
|
|
@@ -45,10 +45,10 @@ const U = {
|
|
|
45
45
|
mutable: "mutable",
|
|
46
46
|
immutable: "immutable"
|
|
47
47
|
}, Rn = {};
|
|
48
|
-
function
|
|
48
|
+
function nt(t, e) {
|
|
49
49
|
return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function wr(t, e) {
|
|
52
52
|
if (e in t) {
|
|
53
53
|
let n = Reflect.getPrototypeOf(t);
|
|
54
54
|
for (; n; ) {
|
|
@@ -92,7 +92,7 @@ function li(t, e = []) {
|
|
|
92
92
|
if (r !== null && (r == null ? void 0 : r.original) !== t.original)
|
|
93
93
|
return null;
|
|
94
94
|
const i = t.parent.type === 3, s = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
|
|
95
|
-
if (!(i && n.size > s ||
|
|
95
|
+
if (!(i && n.size > s || nt(n, s)))
|
|
96
96
|
return null;
|
|
97
97
|
e.push(s);
|
|
98
98
|
}
|
|
@@ -112,7 +112,7 @@ function Pe(t) {
|
|
|
112
112
|
function be(t, e) {
|
|
113
113
|
return Pe(t) === 2 ? t.get(e) : t[e];
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ct(t, e, n) {
|
|
116
116
|
Pe(t) === 2 ? t.set(e, n) : t[e] = n;
|
|
117
117
|
}
|
|
118
118
|
function Ht(t, e) {
|
|
@@ -196,15 +196,15 @@ function hi(t, e) {
|
|
|
196
196
|
function Q(t) {
|
|
197
197
|
t.copy || (t.copy = hi(t.original, t.options));
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Je(t) {
|
|
200
200
|
if (!ae(t))
|
|
201
201
|
return Dn(t);
|
|
202
202
|
if (Array.isArray(t))
|
|
203
|
-
return t.map(
|
|
203
|
+
return t.map(Je);
|
|
204
204
|
if (t instanceof Map) {
|
|
205
205
|
const n = Array.from(t.entries()).map(([r, i]) => [
|
|
206
206
|
r,
|
|
207
|
-
|
|
207
|
+
Je(i)
|
|
208
208
|
]);
|
|
209
209
|
if (!$n(t)) {
|
|
210
210
|
const r = Object.getPrototypeOf(t).constructor;
|
|
@@ -213,7 +213,7 @@ function Ze(t) {
|
|
|
213
213
|
return new Map(n);
|
|
214
214
|
}
|
|
215
215
|
if (t instanceof Set) {
|
|
216
|
-
const n = Array.from(t).map(
|
|
216
|
+
const n = Array.from(t).map(Je);
|
|
217
217
|
if (!xn(t)) {
|
|
218
218
|
const r = Object.getPrototypeOf(t).constructor;
|
|
219
219
|
return new r(n);
|
|
@@ -222,20 +222,20 @@ function Ze(t) {
|
|
|
222
222
|
}
|
|
223
223
|
const e = Object.create(Object.getPrototypeOf(t));
|
|
224
224
|
for (const n in t)
|
|
225
|
-
e[n] =
|
|
225
|
+
e[n] = Je(t[n]);
|
|
226
226
|
return e;
|
|
227
227
|
}
|
|
228
228
|
function St(t) {
|
|
229
|
-
return Ce(t) ?
|
|
229
|
+
return Ce(t) ? Je(t) : t;
|
|
230
230
|
}
|
|
231
231
|
function fe(t) {
|
|
232
232
|
var e;
|
|
233
233
|
t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && fe(t.parent));
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Tr() {
|
|
236
236
|
throw new Error("Cannot modify frozen object");
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Re(t, e, n, r, i) {
|
|
239
239
|
{
|
|
240
240
|
n = n ?? /* @__PURE__ */ new WeakMap(), r = r ?? [], i = i ?? [];
|
|
241
241
|
const o = n.has(t) ? n.get(t) : t;
|
|
@@ -259,24 +259,24 @@ function xe(t, e, n, r, i) {
|
|
|
259
259
|
switch (Pe(t)) {
|
|
260
260
|
case 2:
|
|
261
261
|
for (const [a, u] of t)
|
|
262
|
-
|
|
263
|
-
t.set = t.clear = t.delete =
|
|
262
|
+
Re(a, a, n, r, i), Re(u, a, n, r, i);
|
|
263
|
+
t.set = t.clear = t.delete = Tr;
|
|
264
264
|
break;
|
|
265
265
|
case 3:
|
|
266
266
|
for (const a of t)
|
|
267
|
-
|
|
268
|
-
t.add = t.clear = t.delete =
|
|
267
|
+
Re(a, a, n, r, i);
|
|
268
|
+
t.add = t.clear = t.delete = Tr;
|
|
269
269
|
break;
|
|
270
270
|
case 1:
|
|
271
271
|
Object.freeze(t);
|
|
272
272
|
let o = 0;
|
|
273
273
|
for (const a of t)
|
|
274
|
-
|
|
274
|
+
Re(a, o, n, r, i), o += 1;
|
|
275
275
|
break;
|
|
276
276
|
default:
|
|
277
277
|
Object.freeze(t), Object.keys(t).forEach((a) => {
|
|
278
278
|
const u = t[a];
|
|
279
|
-
|
|
279
|
+
Re(u, a, n, r, i);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
r.pop(), i.pop();
|
|
@@ -304,7 +304,7 @@ function pi(t, e, n) {
|
|
|
304
304
|
const u = j(o);
|
|
305
305
|
Q(u);
|
|
306
306
|
const d = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
|
|
307
|
-
|
|
307
|
+
ct(r ? i : t, s, d);
|
|
308
308
|
} else
|
|
309
309
|
pi(o, e, n);
|
|
310
310
|
}), i) {
|
|
@@ -339,7 +339,7 @@ function Ln(t, e, n, r) {
|
|
|
339
339
|
const u = t.type === 3 ? t.setMap : t.copy;
|
|
340
340
|
if (ye(be(u, e), n)) {
|
|
341
341
|
let d = i.original;
|
|
342
|
-
i.copy && (d = i.copy), on(t), an(t, r, s, o), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(d, i.original)),
|
|
342
|
+
i.copy && (d = i.copy), on(t), an(t, r, s, o), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(d, i.original)), ct(u, e, d);
|
|
343
343
|
}
|
|
344
344
|
}), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), ae(n, t.options) && t.finalities.draft.push(() => {
|
|
345
345
|
const s = t.type === 3 ? t.setMap : t.copy;
|
|
@@ -394,7 +394,7 @@ function Rs(t, e, n, r, i) {
|
|
|
394
394
|
}
|
|
395
395
|
function xs({ original: t, copy: e, assignedMap: n }, r, i, s, o) {
|
|
396
396
|
n.forEach((a, u) => {
|
|
397
|
-
const d = be(t, u), c = St(be(e, u)), f = a ?
|
|
397
|
+
const d = be(t, u), c = St(be(e, u)), f = a ? nt(t, u) ? U.Replace : U.Add : U.Remove;
|
|
398
398
|
if (ye(d, c) && f === U.Replace)
|
|
399
399
|
return;
|
|
400
400
|
const l = r.concat(u), p = Ae(l, o);
|
|
@@ -433,7 +433,7 @@ function $s({ original: t, copy: e }, n, r, i, s) {
|
|
|
433
433
|
o += 1;
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function ut(t, e, n, r) {
|
|
437
437
|
const { pathAsArray: i = !0 } = t.options.enablePatches;
|
|
438
438
|
switch (t.type) {
|
|
439
439
|
case 0:
|
|
@@ -457,7 +457,7 @@ const jt = (t, e, n = !1) => {
|
|
|
457
457
|
},
|
|
458
458
|
set(t, e) {
|
|
459
459
|
const n = j(this), r = te(n);
|
|
460
|
-
return (!r.has(t) || !ye(r.get(t), e)) && (Q(n), fe(n), n.assignedMap.set(t, !0), n.copy.set(t, e), Ln(n, t, e,
|
|
460
|
+
return (!r.has(t) || !ye(r.get(t), e)) && (Q(n), fe(n), n.assignedMap.set(t, !0), n.copy.set(t, e), Ln(n, t, e, ut)), this;
|
|
461
461
|
},
|
|
462
462
|
delete(t) {
|
|
463
463
|
if (!this.has(t))
|
|
@@ -565,7 +565,7 @@ const jt = (t, e, n = !1) => {
|
|
|
565
565
|
},
|
|
566
566
|
add(t) {
|
|
567
567
|
const e = j(this);
|
|
568
|
-
return this.has(t) || (Q(e), fe(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), Ln(e, t, t,
|
|
568
|
+
return this.has(t) || (Q(e), fe(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), Ln(e, t, t, ut)), this;
|
|
569
569
|
},
|
|
570
570
|
delete(t) {
|
|
571
571
|
if (!this.has(t))
|
|
@@ -669,8 +669,8 @@ const Us = Reflect.ownKeys(Ct), yi = /* @__PURE__ */ new WeakSet(), bi = {
|
|
|
669
669
|
if (d)
|
|
670
670
|
return d.bind(t.proxy);
|
|
671
671
|
}
|
|
672
|
-
if (!
|
|
673
|
-
const d =
|
|
672
|
+
if (!nt(a, e)) {
|
|
673
|
+
const d = wr(a, e);
|
|
674
674
|
return d ? "value" in d ? d.value : (
|
|
675
675
|
// !case: support for getter
|
|
676
676
|
(i = d.get) === null || i === void 0 ? void 0 : i.call(t.proxy)
|
|
@@ -701,11 +701,11 @@ const Us = Reflect.ownKeys(Ct), yi = /* @__PURE__ */ new WeakSet(), bi = {
|
|
|
701
701
|
let i;
|
|
702
702
|
if (t.type === 1 && e !== "length" && !(Number.isInteger(i = Number(e)) && i >= 0 && (e === 0 || i === 0 || String(i) === String(e))))
|
|
703
703
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
704
|
-
const s =
|
|
704
|
+
const s = wr(te(t), e);
|
|
705
705
|
if (s != null && s.set)
|
|
706
706
|
return s.set.call(t.proxy, n), !0;
|
|
707
707
|
const o = Ht(te(t), e), a = j(o);
|
|
708
|
-
return a && ye(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) : (ye(n, o) && (n !== void 0 ||
|
|
708
|
+
return a && ye(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) : (ye(n, o) && (n !== void 0 || nt(t.original, e)) || (Q(t), fe(t), nt(t.original, e) && ye(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, Ln(t, e, n, ut)), !0);
|
|
709
709
|
},
|
|
710
710
|
has(t, e) {
|
|
711
711
|
return e in te(t);
|
|
@@ -757,10 +757,10 @@ function Fn(t) {
|
|
|
757
757
|
var p, y;
|
|
758
758
|
const b = j(u);
|
|
759
759
|
let _ = c.type === 3 ? c.setMap : c.copy;
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
let m =
|
|
763
|
-
|
|
760
|
+
const T = be(_, r), w = j(T);
|
|
761
|
+
if (w) {
|
|
762
|
+
let m = w.original;
|
|
763
|
+
w.operated && (m = Dn(T)), on(w), an(w, ut, f, l), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(m, w.original)), ct(_, r, m);
|
|
764
764
|
}
|
|
765
765
|
(y = b.callbacks) === null || y === void 0 || y.forEach((m) => {
|
|
766
766
|
m(f, l);
|
|
@@ -769,7 +769,7 @@ function Fn(t) {
|
|
|
769
769
|
} else {
|
|
770
770
|
const c = j(u);
|
|
771
771
|
c.finalities.draft.push((f, l) => {
|
|
772
|
-
on(c), an(c,
|
|
772
|
+
on(c), an(c, ut, f, l);
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
775
|
return u;
|
|
@@ -782,7 +782,7 @@ function Ls(t, e, n, r, i) {
|
|
|
782
782
|
for (; o.finalities.draft.length > 0; )
|
|
783
783
|
o.finalities.draft.pop()(n, r);
|
|
784
784
|
const d = u ? e[0] : o ? o.operated ? o.copy : o.original : t;
|
|
785
|
-
return o && sn(o), i &&
|
|
785
|
+
return o && sn(o), i && Re(d, d, o == null ? void 0 : o.options.updatedValues), [
|
|
786
786
|
d,
|
|
787
787
|
n && u ? [{ op: U.Replace, path: [], value: e[0] }] : n,
|
|
788
788
|
r && u ? [{ op: U.Replace, path: [], value: a }] : r
|
|
@@ -822,7 +822,7 @@ function cn(t) {
|
|
|
822
822
|
const c = Array.from(a);
|
|
823
823
|
a.clear(), c.forEach((f) => a.add(s === f ? d : f));
|
|
824
824
|
} else
|
|
825
|
-
|
|
825
|
+
ct(a, s, d);
|
|
826
826
|
} else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1, cn(t));
|
|
827
827
|
}), i && (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."));
|
|
828
828
|
}
|
|
@@ -851,7 +851,7 @@ function _i(t) {
|
|
|
851
851
|
if (n && ye(be(n.original, o), a))
|
|
852
852
|
return;
|
|
853
853
|
const u = _i(a);
|
|
854
|
-
u !== a && (i === t && s(),
|
|
854
|
+
u !== a && (i === t && s(), ct(i, o, u));
|
|
855
855
|
}), r === 3) {
|
|
856
856
|
const o = (e = n == null ? void 0 : n.original) !== null && e !== void 0 ? e : i;
|
|
857
857
|
return xn(o) ? new Set(i) : new (Object.getPrototypeOf(o)).constructor(i);
|
|
@@ -867,7 +867,7 @@ const Ns = (t) => function e(n, r, i) {
|
|
|
867
867
|
var s, o, a;
|
|
868
868
|
if (typeof n == "function" && typeof r != "function")
|
|
869
869
|
return function(S, ...I) {
|
|
870
|
-
return e(S, (
|
|
870
|
+
return e(S, (x) => n.call(this, x, ...I), r);
|
|
871
871
|
};
|
|
872
872
|
const u = n, d = r;
|
|
873
873
|
let c = i;
|
|
@@ -875,10 +875,10 @@ const Ns = (t) => function e(n, r, i) {
|
|
|
875
875
|
throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
|
|
876
876
|
c = Object.assign(Object.assign({}, t), c);
|
|
877
877
|
const f = Ce(u) ? vr(u) : u, l = Array.isArray(c.mark) ? (S, I) => {
|
|
878
|
-
for (const
|
|
879
|
-
if (typeof
|
|
880
|
-
throw new Error(`Invalid mark: ${
|
|
881
|
-
const q =
|
|
878
|
+
for (const x of c.mark) {
|
|
879
|
+
if (typeof x != "function")
|
|
880
|
+
throw new Error(`Invalid mark: ${x}, 'mark' should be a function.`);
|
|
881
|
+
const q = x(S, I);
|
|
882
882
|
if (q)
|
|
883
883
|
return q;
|
|
884
884
|
}
|
|
@@ -890,47 +890,47 @@ const Ns = (t) => function e(n, r, i) {
|
|
|
890
890
|
};
|
|
891
891
|
if (!ae(f, _) && typeof f == "object" && f !== null)
|
|
892
892
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
893
|
-
const [
|
|
893
|
+
const [T, w] = Fs(f, _);
|
|
894
894
|
if (typeof r != "function") {
|
|
895
895
|
if (!ae(f, _))
|
|
896
896
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
897
|
-
return [
|
|
897
|
+
return [T, w];
|
|
898
898
|
}
|
|
899
899
|
let m;
|
|
900
900
|
try {
|
|
901
|
-
m = d(
|
|
901
|
+
m = d(T);
|
|
902
902
|
} catch (S) {
|
|
903
|
-
throw sn(j(
|
|
903
|
+
throw sn(j(T)), S;
|
|
904
904
|
}
|
|
905
905
|
const E = (S) => {
|
|
906
|
-
const I = j(
|
|
906
|
+
const I = j(T);
|
|
907
907
|
if (!Ce(S)) {
|
|
908
|
-
if (S !== void 0 && !ye(S,
|
|
908
|
+
if (S !== void 0 && !ye(S, T) && (I != null && I.operated))
|
|
909
909
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
910
910
|
const q = S == null ? void 0 : S[js];
|
|
911
911
|
if (q) {
|
|
912
|
-
const
|
|
912
|
+
const Te = q[0];
|
|
913
913
|
return _.strict && typeof S == "object" && S !== null && cn({
|
|
914
914
|
rootDraft: I,
|
|
915
915
|
value: S,
|
|
916
916
|
useRawReturn: !0
|
|
917
|
-
}),
|
|
917
|
+
}), w([Te]);
|
|
918
918
|
}
|
|
919
919
|
if (S !== void 0)
|
|
920
|
-
return typeof S == "object" && S !== null && cn({ rootDraft: I, value: S }),
|
|
920
|
+
return typeof S == "object" && S !== null && cn({ rootDraft: I, value: S }), w([S]);
|
|
921
921
|
}
|
|
922
|
-
if (S ===
|
|
923
|
-
return
|
|
924
|
-
const
|
|
925
|
-
if (_ ===
|
|
926
|
-
if (
|
|
922
|
+
if (S === T || S === void 0)
|
|
923
|
+
return w([]);
|
|
924
|
+
const x = j(S);
|
|
925
|
+
if (_ === x.options) {
|
|
926
|
+
if (x.operated)
|
|
927
927
|
throw new Error("Cannot return a modified child draft.");
|
|
928
|
-
return
|
|
928
|
+
return w([vr(S)]);
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return w([S]);
|
|
931
931
|
};
|
|
932
932
|
return m instanceof Promise ? m.then(E, (S) => {
|
|
933
|
-
throw sn(j(
|
|
933
|
+
throw sn(j(T)), S;
|
|
934
934
|
}) : E(m);
|
|
935
935
|
}, Pt = Ns();
|
|
936
936
|
Object.prototype.constructor.toString();
|
|
@@ -945,15 +945,15 @@ function Ot(t, e) {
|
|
|
945
945
|
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : gi(t, e) ? Object.keys(t).every((n) => Ot(t[n], e[n])) : !1;
|
|
946
946
|
}
|
|
947
947
|
function Nn(t) {
|
|
948
|
-
if (!
|
|
948
|
+
if (!Ze(t))
|
|
949
949
|
return t;
|
|
950
950
|
const e = {};
|
|
951
951
|
for (const [n, r] of Object.entries(t))
|
|
952
952
|
r !== void 0 && (e[n] = r);
|
|
953
953
|
return e;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
if (!
|
|
955
|
+
function wi(t, e) {
|
|
956
|
+
if (!Ze(t) || !Ze(e))
|
|
957
957
|
return e;
|
|
958
958
|
const n = Object.assign({}, t);
|
|
959
959
|
for (const r of Object.keys(e)) {
|
|
@@ -963,12 +963,12 @@ function Ti(t, e) {
|
|
|
963
963
|
delete n[r];
|
|
964
964
|
continue;
|
|
965
965
|
}
|
|
966
|
-
const i =
|
|
967
|
-
n[r] = i ?
|
|
966
|
+
const i = Ze(t[r]) && Ze(e[r]);
|
|
967
|
+
n[r] = i ? wi(t[r], e[r]) : e[r];
|
|
968
968
|
}
|
|
969
969
|
return n;
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function Ze(t) {
|
|
972
972
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
973
973
|
}
|
|
974
974
|
function Ks(t, e, n) {
|
|
@@ -992,7 +992,7 @@ function Or(t, e, n) {
|
|
|
992
992
|
}
|
|
993
993
|
r[e[e.length - 1]] = n;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Ti(t, e) {
|
|
996
996
|
if (!t || e.length === 0)
|
|
997
997
|
return;
|
|
998
998
|
const [n, ...r] = e;
|
|
@@ -1001,7 +1001,7 @@ function wi(t, e) {
|
|
|
1001
1001
|
Array.isArray(t) ? t.splice(n, 1) : delete t[n];
|
|
1002
1002
|
return;
|
|
1003
1003
|
}
|
|
1004
|
-
|
|
1004
|
+
Ti(t[n], r), qs(t[n]) && delete t[n];
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
1007
|
function qs(t) {
|
|
@@ -1331,10 +1331,10 @@ function Kn(t) {
|
|
|
1331
1331
|
function qn(t) {
|
|
1332
1332
|
return t["value-type"] === "blob";
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function We(t, e) {
|
|
1335
1335
|
return t[e];
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function ze(t, e) {
|
|
1338
1338
|
return e.reduce((n, r) => n && n.get(r), t);
|
|
1339
1339
|
}
|
|
1340
1340
|
function oe(t, e) {
|
|
@@ -1362,7 +1362,7 @@ function mi(t, e, n) {
|
|
|
1362
1362
|
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1363
1363
|
for (const o of e) {
|
|
1364
1364
|
let [a, u, d, c] = o;
|
|
1365
|
-
const f =
|
|
1365
|
+
const f = We(t, u);
|
|
1366
1366
|
if (!f) {
|
|
1367
1367
|
console.warn("no such attr", a, t);
|
|
1368
1368
|
continue;
|
|
@@ -1396,7 +1396,7 @@ function Oi(t) {
|
|
|
1396
1396
|
return Et(t.attrs, t.triples, t.cardinalityInference, t.linkIndex, t.useDateObjects);
|
|
1397
1397
|
}
|
|
1398
1398
|
function oo(t, e) {
|
|
1399
|
-
return
|
|
1399
|
+
return ze(t.eav, [e]) !== void 0;
|
|
1400
1400
|
}
|
|
1401
1401
|
function Wn(t) {
|
|
1402
1402
|
t.attrIndexes = vi(t.attrs);
|
|
@@ -1405,7 +1405,7 @@ function Et(t, e, n, r, i) {
|
|
|
1405
1405
|
const s = mi(t, e, i);
|
|
1406
1406
|
return s.useDateObjects = i, s.attrs = t, s.attrIndexes = vi(t), s.cardinalityInference = n, s.linkIndex = r, s.__type = "store", s;
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function dt(t, e) {
|
|
1409
1409
|
var n, r;
|
|
1410
1410
|
let i;
|
|
1411
1411
|
if (Array.isArray(e[0])) {
|
|
@@ -1433,49 +1433,49 @@ function ft(t, e) {
|
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
1435
|
function Ei(t, e) {
|
|
1436
|
-
const n =
|
|
1436
|
+
const n = dt(t, e);
|
|
1437
1437
|
if (!n)
|
|
1438
1438
|
return;
|
|
1439
|
-
const [r, i, s] = n, o =
|
|
1439
|
+
const [r, i, s] = n, o = We(t.attrs, i);
|
|
1440
1440
|
o && (oe(t.eav, [r, i, s]), oe(t.aev, [i, r, s]), Kn(o) && oe(t.vae, [s, i, r]));
|
|
1441
1441
|
}
|
|
1442
1442
|
let ao = 0;
|
|
1443
1443
|
function Ai(t, e, n) {
|
|
1444
1444
|
const [r, i, s] = n;
|
|
1445
1445
|
let o;
|
|
1446
|
-
const a =
|
|
1446
|
+
const a = ze(t.ea, [r, i, s]);
|
|
1447
1447
|
return a && (o = a[3]), o || Date.now() * 10 + ao++;
|
|
1448
1448
|
}
|
|
1449
1449
|
function ki(t, e) {
|
|
1450
1450
|
var n;
|
|
1451
|
-
const r =
|
|
1451
|
+
const r = dt(t, e);
|
|
1452
1452
|
if (!r)
|
|
1453
1453
|
return;
|
|
1454
1454
|
let [i, s, o] = r;
|
|
1455
|
-
const a =
|
|
1455
|
+
const a = We(t.attrs, s);
|
|
1456
1456
|
if (!a)
|
|
1457
1457
|
return;
|
|
1458
1458
|
a["checked-data-type"] === "date" && t.useDateObjects && (o = xt(o));
|
|
1459
|
-
const u =
|
|
1459
|
+
const u = ze(t.eav, [i, s, o]), d = (n = u == null ? void 0 : u[3]) !== null && n !== void 0 ? n : Ai(t, a, r), c = [i, s, o, d];
|
|
1460
1460
|
so(a) ? (Z(t.eav, [i, s], /* @__PURE__ */ new Map([[o, c]])), Z(t.aev, [s, i], /* @__PURE__ */ new Map([[o, c]]))) : (Z(t.eav, [i, s, o], c), Z(t.aev, [s, i, o], c)), Kn(a) && Z(t.vae, [o, s, i], c);
|
|
1461
1461
|
}
|
|
1462
1462
|
function uo(t, e) {
|
|
1463
1463
|
var n;
|
|
1464
|
-
const r =
|
|
1464
|
+
const r = dt(t, e);
|
|
1465
1465
|
if (!r)
|
|
1466
1466
|
return;
|
|
1467
|
-
const [i, s, o] = r, a =
|
|
1467
|
+
const [i, s, o] = r, a = We(t.attrs, s);
|
|
1468
1468
|
if (!a)
|
|
1469
1469
|
return;
|
|
1470
1470
|
if (!qn(a))
|
|
1471
1471
|
throw new Error("merge operation is not supported for links");
|
|
1472
|
-
const u =
|
|
1472
|
+
const u = ze(t.eav, [i, s]);
|
|
1473
1473
|
if (!u)
|
|
1474
1474
|
return;
|
|
1475
1475
|
const d = (n = u.values().next()) === null || n === void 0 ? void 0 : n.value;
|
|
1476
1476
|
if (!d)
|
|
1477
1477
|
return;
|
|
1478
|
-
const c = d[2], f =
|
|
1478
|
+
const c = d[2], f = wi(c, o), l = [
|
|
1479
1479
|
i,
|
|
1480
1480
|
s,
|
|
1481
1481
|
f,
|
|
@@ -1485,7 +1485,7 @@ function uo(t, e) {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
function fn(t, e) {
|
|
1487
1487
|
var n, r;
|
|
1488
|
-
const [i, s] = e, o =
|
|
1488
|
+
const [i, s] = e, o = dt(t, [i]);
|
|
1489
1489
|
if (!o)
|
|
1490
1490
|
return;
|
|
1491
1491
|
const [a] = o, u = t.eav.get(a);
|
|
@@ -1506,8 +1506,8 @@ function fn(t, e) {
|
|
|
1506
1506
|
const d = t.vae.get(a) && X(t.vae.get(a), 2);
|
|
1507
1507
|
d && d.forEach((c) => {
|
|
1508
1508
|
var f, l, p;
|
|
1509
|
-
const [y, b, _] = c,
|
|
1510
|
-
(!s || !
|
|
1509
|
+
const [y, b, _] = c, T = t.attrs[b];
|
|
1510
|
+
(!s || !T || ((f = T["reverse-identity"]) === null || f === void 0 ? void 0 : f[1]) === s) && (oe(t.eav, [y, b, _]), oe(t.aev, [b, y, _]), oe(t.vae, [_, b, y])), T && T["on-delete"] === "cascade" && ((l = T["reverse-identity"]) === null || l === void 0 ? void 0 : l[1]) === s && fn(t, [y, (p = T["forward-identity"]) === null || p === void 0 ? void 0 : p[1]]);
|
|
1511
1511
|
}), ((r = t.vae.get(a)) === null || r === void 0 ? void 0 : r.size) === 0 && oe(t.vae, [a]);
|
|
1512
1512
|
}
|
|
1513
1513
|
function ji(t, e) {
|
|
@@ -1671,7 +1671,7 @@ function bo(t, e, n) {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
return i;
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function we(t, e, n) {
|
|
1675
1675
|
var r;
|
|
1676
1676
|
return (r = t.attrIndexes.forwardIdents.get(e)) === null || r === void 0 ? void 0 : r.get(n);
|
|
1677
1677
|
}
|
|
@@ -1688,14 +1688,14 @@ function Ii(t, e) {
|
|
|
1688
1688
|
return r || ((n = t.attrIndexes.forwardIdents.get(e)) === null || n === void 0 ? void 0 : n.get("id"));
|
|
1689
1689
|
}
|
|
1690
1690
|
function go(t, e) {
|
|
1691
|
-
const n =
|
|
1691
|
+
const n = dt(t, e);
|
|
1692
1692
|
if (!n)
|
|
1693
1693
|
return;
|
|
1694
1694
|
const [r, i, s] = n;
|
|
1695
|
-
if (
|
|
1696
|
-
return
|
|
1695
|
+
if (We(t.attrs, i))
|
|
1696
|
+
return ze(t.eav, [r, i]);
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1698
|
+
function wo(t, e) {
|
|
1699
1699
|
const n = e.filter(([r, i, s, o, a]) => {
|
|
1700
1700
|
if (r !== "add-triple" && r !== "deep-merge-triple")
|
|
1701
1701
|
return !0;
|
|
@@ -1703,7 +1703,7 @@ function To(t, e) {
|
|
|
1703
1703
|
if (u !== "create" && u !== "update")
|
|
1704
1704
|
return !0;
|
|
1705
1705
|
let d = !1;
|
|
1706
|
-
const c =
|
|
1706
|
+
const c = We(t.attrs, s);
|
|
1707
1707
|
if (c) {
|
|
1708
1708
|
const f = Ii(t, c["forward-identity"][1]);
|
|
1709
1709
|
d = !!go(t, [i, f.id, i]);
|
|
@@ -1716,7 +1716,7 @@ function To(t, e) {
|
|
|
1716
1716
|
});
|
|
1717
1717
|
});
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1719
|
+
function To(t) {
|
|
1720
1720
|
return typeof t == "string" && t.startsWith("?");
|
|
1721
1721
|
}
|
|
1722
1722
|
function mo(t, e, n) {
|
|
@@ -1770,7 +1770,7 @@ function ln(t, e, n = [{}]) {
|
|
|
1770
1770
|
return e.reduce((r, i) => ko(t, i, r), n);
|
|
1771
1771
|
}
|
|
1772
1772
|
function zn(t, e) {
|
|
1773
|
-
return Array.isArray(e) ? e.map((n) => zn(t, n)) :
|
|
1773
|
+
return Array.isArray(e) ? e.map((n) => zn(t, n)) : To(e) ? t[e] : e;
|
|
1774
1774
|
}
|
|
1775
1775
|
function jo(t, { find: e, where: n }) {
|
|
1776
1776
|
return ln(t, n).map((i) => zn(i, e));
|
|
@@ -1779,7 +1779,7 @@ function Co(t, e, n) {
|
|
|
1779
1779
|
return yo(t, zn(n, e));
|
|
1780
1780
|
}
|
|
1781
1781
|
const Po = /^(?:[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;
|
|
1782
|
-
function
|
|
1782
|
+
function Ne(t) {
|
|
1783
1783
|
return typeof t == "string" && Po.test(t);
|
|
1784
1784
|
}
|
|
1785
1785
|
const W = [];
|
|
@@ -1844,13 +1844,13 @@ function Fo() {
|
|
|
1844
1844
|
}
|
|
1845
1845
|
const No = Fo();
|
|
1846
1846
|
let Ko = 0;
|
|
1847
|
-
function
|
|
1847
|
+
function rt(t) {
|
|
1848
1848
|
return $t(`_${t}`, Ko++);
|
|
1849
1849
|
}
|
|
1850
1850
|
function $t(t, e) {
|
|
1851
1851
|
return `?${t}-${e}`;
|
|
1852
1852
|
}
|
|
1853
|
-
class
|
|
1853
|
+
class Ke extends Error {
|
|
1854
1854
|
constructor(e) {
|
|
1855
1855
|
super(e), this.name = "AttrNotFoundError";
|
|
1856
1856
|
}
|
|
@@ -1858,7 +1858,7 @@ class qe extends Error {
|
|
|
1858
1858
|
function qo(t, e) {
|
|
1859
1859
|
const n = Ii(t, e);
|
|
1860
1860
|
if (!n)
|
|
1861
|
-
throw new
|
|
1861
|
+
throw new Ke(`Could not find id attr for ${e}`);
|
|
1862
1862
|
return n;
|
|
1863
1863
|
}
|
|
1864
1864
|
function Cr(t, e, n, r) {
|
|
@@ -1876,21 +1876,21 @@ function zo(t, e, n) {
|
|
|
1876
1876
|
return t.map((r) => r === e ? n : r);
|
|
1877
1877
|
}
|
|
1878
1878
|
function Ri(t, e, n, r, i) {
|
|
1879
|
-
const s =
|
|
1879
|
+
const s = we(e, n, i), o = Pi(e, n, i), a = s || o;
|
|
1880
1880
|
if (!a)
|
|
1881
|
-
throw new
|
|
1881
|
+
throw new Ke(`Could not find attr for ${[n, i]}`);
|
|
1882
1882
|
if (a["value-type"] !== "ref")
|
|
1883
1883
|
throw new Error(`Attr ${a.id} is not a ref`);
|
|
1884
1884
|
const [u, d] = a["forward-identity"], [c, f] = a["reverse-identity"], l = r + 1, p = s ? [
|
|
1885
1885
|
t(d, r),
|
|
1886
1886
|
a.id,
|
|
1887
1887
|
t(f, l),
|
|
1888
|
-
|
|
1888
|
+
rt("time")
|
|
1889
1889
|
] : [
|
|
1890
1890
|
t(d, l),
|
|
1891
1891
|
a.id,
|
|
1892
1892
|
t(f, r),
|
|
1893
|
-
|
|
1893
|
+
rt("time")
|
|
1894
1894
|
];
|
|
1895
1895
|
return [s ? f : d, l, p, a, !!s];
|
|
1896
1896
|
}
|
|
@@ -1965,26 +1965,26 @@ function Vo(t, e) {
|
|
|
1965
1965
|
return e;
|
|
1966
1966
|
}
|
|
1967
1967
|
function Bo(t, e, n, r, i, s) {
|
|
1968
|
-
const o =
|
|
1968
|
+
const o = we(e, n, i), a = Pi(e, n, i), u = o || a;
|
|
1969
1969
|
if (!u)
|
|
1970
|
-
throw new
|
|
1970
|
+
throw new Ke(`No attr for etype = ${n} label = ${i}`);
|
|
1971
1971
|
if (s != null && s.hasOwnProperty("$isNull")) {
|
|
1972
|
-
const d =
|
|
1972
|
+
const d = we(e, n, "id");
|
|
1973
1973
|
if (!d)
|
|
1974
|
-
throw new
|
|
1974
|
+
throw new Ke(`No attr for etype = ${n} label = id`);
|
|
1975
1975
|
return [
|
|
1976
1976
|
t(n, r),
|
|
1977
1977
|
d.id,
|
|
1978
1978
|
{ $isNull: { attrId: u.id, isNull: s.$isNull, reverse: !o } },
|
|
1979
|
-
|
|
1979
|
+
rt("time")
|
|
1980
1980
|
];
|
|
1981
1981
|
}
|
|
1982
1982
|
return o ? [
|
|
1983
1983
|
t(n, r),
|
|
1984
1984
|
u.id,
|
|
1985
1985
|
Vo(u, s),
|
|
1986
|
-
|
|
1987
|
-
] : [s, u.id, t(n, r),
|
|
1986
|
+
rt("time")
|
|
1987
|
+
] : [s, u.id, t(n, r), rt("time")];
|
|
1988
1988
|
}
|
|
1989
1989
|
function Go(t, e, n, r, i) {
|
|
1990
1990
|
const [s, o, a] = i.reduce((u, d) => {
|
|
@@ -2076,17 +2076,17 @@ function na(t, e, { etype: n, level: r, form: i }, s) {
|
|
|
2076
2076
|
var p, y, b;
|
|
2077
2077
|
const _ = !!(e.cardinalityInference && (!((b = (y = (p = e.linkIndex) === null || p === void 0 ? void 0 : p[n]) === null || y === void 0 ? void 0 : y[l]) === null || b === void 0) && b.isSingular));
|
|
2078
2078
|
try {
|
|
2079
|
-
const [
|
|
2080
|
-
etype:
|
|
2081
|
-
level:
|
|
2079
|
+
const [T, w, m] = ta(t, e, n, r, l, u), E = Di(e, {
|
|
2080
|
+
etype: T,
|
|
2081
|
+
level: w,
|
|
2082
2082
|
form: i[l],
|
|
2083
2083
|
join: m
|
|
2084
2084
|
}), S = _ ? E[0] : E;
|
|
2085
2085
|
return { [l]: S };
|
|
2086
|
-
} catch (
|
|
2087
|
-
if (
|
|
2086
|
+
} catch (T) {
|
|
2087
|
+
if (T instanceof Ke)
|
|
2088
2088
|
return { [l]: _ ? void 0 : [] };
|
|
2089
|
-
throw
|
|
2089
|
+
throw T;
|
|
2090
2090
|
}
|
|
2091
2091
|
}).reduce(function(l, p) {
|
|
2092
2092
|
return Object.assign(Object.assign({}, l), p);
|
|
@@ -2096,11 +2096,11 @@ function na(t, e, { etype: n, level: r, form: i }, s) {
|
|
|
2096
2096
|
function ra(t, e, n) {
|
|
2097
2097
|
return n === "string" ? No(t, e) : t > e ? 1 : -1;
|
|
2098
2098
|
}
|
|
2099
|
-
function
|
|
2099
|
+
function Xe(t, e, n, r, i) {
|
|
2100
2100
|
return e === r || e == null && r == null ? Uo(t, n) : r == null ? 1 : e == null ? -1 : ra(e, r, i);
|
|
2101
2101
|
}
|
|
2102
2102
|
function It([t, e], [n, r], i) {
|
|
2103
|
-
return
|
|
2103
|
+
return Xe(t, e, n, r, i);
|
|
2104
2104
|
}
|
|
2105
2105
|
function pn(t) {
|
|
2106
2106
|
return t == null ? t : new Date(t).getTime();
|
|
@@ -2119,7 +2119,7 @@ function sa(t, e) {
|
|
|
2119
2119
|
}
|
|
2120
2120
|
function oa(t, e, n) {
|
|
2121
2121
|
const r = Object.keys(n)[0];
|
|
2122
|
-
return
|
|
2122
|
+
return we(t, e, r);
|
|
2123
2123
|
}
|
|
2124
2124
|
function aa(t, e, n, r) {
|
|
2125
2125
|
if (n)
|
|
@@ -2133,11 +2133,11 @@ function ua(t, e, n) {
|
|
|
2133
2133
|
return _o(t, e);
|
|
2134
2134
|
const s = /* @__PURE__ */ new Map();
|
|
2135
2135
|
for (const o of n.fields) {
|
|
2136
|
-
const a =
|
|
2136
|
+
const a = we(t, e, o), u = (r = a == null ? void 0 : a["forward-identity"]) === null || r === void 0 ? void 0 : r[2];
|
|
2137
2137
|
u && qn(a) && s.set(u, a);
|
|
2138
2138
|
}
|
|
2139
2139
|
if (!s.has("id")) {
|
|
2140
|
-
const o =
|
|
2140
|
+
const o = we(t, e, "id"), a = (i = o == null ? void 0 : o["forward-identity"]) === null || i === void 0 ? void 0 : i[2];
|
|
2141
2141
|
a && s.set(a, o);
|
|
2142
2142
|
}
|
|
2143
2143
|
return s;
|
|
@@ -2149,16 +2149,16 @@ function ca(t, { etype: e, pageInfo: n, dq: r, form: i }) {
|
|
|
2149
2149
|
const f = n == null ? void 0 : n["start-cursor"], l = aa(t, e, f, a);
|
|
2150
2150
|
if (l && ((o = l == null ? void 0 : l["forward-identity"]) === null || o === void 0 ? void 0 : o[2]) !== "id") {
|
|
2151
2151
|
const b = l["checked-data-type"] === "date", _ = l.id;
|
|
2152
|
-
c = c.map(([
|
|
2153
|
-
var
|
|
2154
|
-
let
|
|
2155
|
-
return b && (
|
|
2152
|
+
c = c.map(([T]) => {
|
|
2153
|
+
var w, m, E, S, I;
|
|
2154
|
+
let x = (I = (S = (E = (m = (w = t.eav.get(T)) === null || w === void 0 ? void 0 : w.get(_)) === null || m === void 0 ? void 0 : m.values()) === null || E === void 0 ? void 0 : E.next()) === null || S === void 0 ? void 0 : S.value) === null || I === void 0 ? void 0 : I[2];
|
|
2155
|
+
return b && (x = pn(x)), [T, x];
|
|
2156
2156
|
});
|
|
2157
2157
|
}
|
|
2158
|
-
c.sort(d === "asc" ? function(_,
|
|
2159
|
-
return It(_,
|
|
2160
|
-
} : function(_,
|
|
2161
|
-
return It(
|
|
2158
|
+
c.sort(d === "asc" ? function(_, T) {
|
|
2159
|
+
return It(_, T, l == null ? void 0 : l["checked-data-type"]);
|
|
2160
|
+
} : function(_, T) {
|
|
2161
|
+
return It(T, _, l == null ? void 0 : l["checked-data-type"]);
|
|
2162
2162
|
});
|
|
2163
2163
|
let p = {};
|
|
2164
2164
|
const y = ua(t, e, r);
|
|
@@ -2166,8 +2166,8 @@ function ca(t, { etype: e, pageInfo: n, dq: r, form: i }) {
|
|
|
2166
2166
|
const [_] = b;
|
|
2167
2167
|
if (p[_] || !u && f && l && ia(f, l, d, b))
|
|
2168
2168
|
continue;
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2169
|
+
const T = bo(t, y, _);
|
|
2170
|
+
T && (p[_] = T);
|
|
2171
2171
|
}
|
|
2172
2172
|
return p;
|
|
2173
2173
|
}
|
|
@@ -2202,7 +2202,7 @@ function la(t, e) {
|
|
|
2202
2202
|
try {
|
|
2203
2203
|
return fa(t, e);
|
|
2204
2204
|
} catch (n) {
|
|
2205
|
-
if (n instanceof
|
|
2205
|
+
if (n instanceof Ke)
|
|
2206
2206
|
return {};
|
|
2207
2207
|
throw n;
|
|
2208
2208
|
}
|
|
@@ -2267,7 +2267,7 @@ function yn(t, e, n) {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
});
|
|
2269
2269
|
}
|
|
2270
|
-
function
|
|
2270
|
+
function Lc(t, e) {
|
|
2271
2271
|
return `lookup__${t}__${JSON.stringify(e)}`;
|
|
2272
2272
|
}
|
|
2273
2273
|
function Mt(t) {
|
|
@@ -2296,7 +2296,7 @@ function Vn() {
|
|
|
2296
2296
|
}
|
|
2297
2297
|
});
|
|
2298
2298
|
}
|
|
2299
|
-
const
|
|
2299
|
+
const Fc = Vn();
|
|
2300
2300
|
function _a(t) {
|
|
2301
2301
|
return t.__ops;
|
|
2302
2302
|
}
|
|
@@ -2334,7 +2334,7 @@ function ke(t, e, n) {
|
|
|
2334
2334
|
return o === e && a === n;
|
|
2335
2335
|
});
|
|
2336
2336
|
}
|
|
2337
|
-
function
|
|
2337
|
+
function wa(t) {
|
|
2338
2338
|
if (Array.isArray(t))
|
|
2339
2339
|
return t;
|
|
2340
2340
|
const e = Object.entries(t);
|
|
@@ -2353,7 +2353,7 @@ function _n(t) {
|
|
|
2353
2353
|
throw new Error(`${t} is not a valid lookup attribute.`);
|
|
2354
2354
|
return e;
|
|
2355
2355
|
}
|
|
2356
|
-
function
|
|
2356
|
+
function Ta(t, e, n) {
|
|
2357
2357
|
if (!bn(t, e, n))
|
|
2358
2358
|
return B(t, e, n);
|
|
2359
2359
|
const r = _n(n), i = B(t, e, r) || ke(t, e, r);
|
|
@@ -2362,13 +2362,13 @@ function wa(t, e, n) {
|
|
|
2362
2362
|
return i;
|
|
2363
2363
|
}
|
|
2364
2364
|
function gn(t) {
|
|
2365
|
-
return typeof t == "string" && !Mt(t) ? null : typeof t == "string" && Mt(t) ? Li(t) :
|
|
2365
|
+
return typeof t == "string" && !Mt(t) ? null : typeof t == "string" && Mt(t) ? Li(t) : wa(t);
|
|
2366
2366
|
}
|
|
2367
2367
|
function ee(t, e, n) {
|
|
2368
2368
|
const r = gn(n);
|
|
2369
2369
|
if (r === null)
|
|
2370
2370
|
return n;
|
|
2371
|
-
const [i, s] = r, o =
|
|
2371
|
+
const [i, s] = r, o = Ta(t, e, i);
|
|
2372
2372
|
if (!o || !o["unique?"])
|
|
2373
2373
|
throw new Error(`${i} is not a unique attribute.`);
|
|
2374
2374
|
return [o.id, s];
|
|
@@ -2539,7 +2539,7 @@ function Ma(t, e, n) {
|
|
|
2539
2539
|
"checked-data-type": u
|
|
2540
2540
|
};
|
|
2541
2541
|
}
|
|
2542
|
-
function
|
|
2542
|
+
function wt(t, e, n, r) {
|
|
2543
2543
|
const i = t ? Ma(t, e, n) : null, s = K(), a = [K(), e, n];
|
|
2544
2544
|
return Object.assign(Object.assign({ id: s, "forward-identity": a, "value-type": "blob", cardinality: "one", "unique?": !1, "index?": !1, isUnsynced: !0 }, i || {}), r || {});
|
|
2545
2545
|
}
|
|
@@ -2572,7 +2572,7 @@ const $a = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink
|
|
|
2572
2572
|
"merge",
|
|
2573
2573
|
"delete",
|
|
2574
2574
|
"ruleParams"
|
|
2575
|
-
]),
|
|
2575
|
+
]), wn = { "unique?": !0, "index?": !0 }, Fa = Object.assign(Object.assign({}, wn), { cardinality: "one" });
|
|
2576
2576
|
function Na(t) {
|
|
2577
2577
|
const e = [], [n, r, i, s] = t;
|
|
2578
2578
|
if (!La.has(n))
|
|
@@ -2610,32 +2610,32 @@ function Ka({ attrs: t, schema: e }, n) {
|
|
|
2610
2610
|
const b = p[0];
|
|
2611
2611
|
if (y) {
|
|
2612
2612
|
c(l, y);
|
|
2613
|
-
const _ = B(o, l, y),
|
|
2614
|
-
d(_), d(
|
|
2615
|
-
const
|
|
2616
|
-
if (bn(o,
|
|
2617
|
-
c(
|
|
2613
|
+
const _ = B(o, l, y), T = ke(o, l, y);
|
|
2614
|
+
d(_), d(T);
|
|
2615
|
+
const w = ((r = _ == null ? void 0 : _["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = T == null ? void 0 : T["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) || y;
|
|
2616
|
+
if (bn(o, w, b))
|
|
2617
|
+
c(w, _n(b));
|
|
2618
2618
|
else {
|
|
2619
|
-
const m = B(o,
|
|
2620
|
-
m || u(
|
|
2619
|
+
const m = B(o, w, b);
|
|
2620
|
+
m || u(wt(e, w, b, wn)), d(m);
|
|
2621
2621
|
}
|
|
2622
2622
|
} else if (bn(o, l, b))
|
|
2623
2623
|
c(l, _n(b));
|
|
2624
2624
|
else {
|
|
2625
2625
|
const _ = B(o, l, b);
|
|
2626
|
-
_ || u(
|
|
2626
|
+
_ || u(wt(e, l, b, wn)), d(_);
|
|
2627
2627
|
}
|
|
2628
2628
|
}
|
|
2629
2629
|
for (const f of n) {
|
|
2630
2630
|
const [l, p, y, b] = f;
|
|
2631
2631
|
if ($a.has(l)) {
|
|
2632
2632
|
const _ = B(o, p, "id");
|
|
2633
|
-
d(_), _ || u(
|
|
2634
|
-
for (const
|
|
2635
|
-
const
|
|
2636
|
-
if (d(
|
|
2637
|
-
const m = ke(o, p,
|
|
2638
|
-
!
|
|
2633
|
+
d(_), _ || u(wt(e, p, "id", { "unique?": !0 }));
|
|
2634
|
+
for (const T of Object.keys(b)) {
|
|
2635
|
+
const w = B(o, p, T);
|
|
2636
|
+
if (d(w), Ua.has(l) && (w || u(wt(e, p, T, T === "id" ? { "unique?": !0 } : null))), Da.has(l)) {
|
|
2637
|
+
const m = ke(o, p, T);
|
|
2638
|
+
!w && !m && u(Rr(e, p, T)), d(m);
|
|
2639
2639
|
}
|
|
2640
2640
|
}
|
|
2641
2641
|
}
|
|
@@ -2676,12 +2676,12 @@ var de = function(t, e, n, r) {
|
|
|
2676
2676
|
function xr(t, e) {
|
|
2677
2677
|
typeof requestIdleCallback > "u" ? t() : requestIdleCallback(t, { timeout: e });
|
|
2678
2678
|
}
|
|
2679
|
-
const
|
|
2679
|
+
const it = "__meta";
|
|
2680
2680
|
class Wa {
|
|
2681
2681
|
constructor(e, n) {
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
class
|
|
2684
|
+
class Tn {
|
|
2685
2685
|
constructor(e) {
|
|
2686
2686
|
var n, r;
|
|
2687
2687
|
this._subs = [], this._nextSave = null, this._nextGc = null, this._pendingSaveKeys = /* @__PURE__ */ new Set(), this._loadedKeys = /* @__PURE__ */ new Set(), this._version = 0, this._meta = {
|
|
@@ -2697,7 +2697,7 @@ class wn {
|
|
|
2697
2697
|
var e, n, r;
|
|
2698
2698
|
this._meta.loadingPromise && (yield this._meta.loadingPromise);
|
|
2699
2699
|
try {
|
|
2700
|
-
const i = this._persister.getItem(
|
|
2700
|
+
const i = this._persister.getItem(it);
|
|
2701
2701
|
this._meta.loadingPromise = i;
|
|
2702
2702
|
const s = yield i;
|
|
2703
2703
|
this._meta.isLoading = !1, this._meta.error = null, this._meta.loadingPromise = null, this._meta.attempts = 0;
|
|
@@ -2790,7 +2790,7 @@ class wn {
|
|
|
2790
2790
|
const y = this._persister.removeItem(p);
|
|
2791
2791
|
i.push(y.then(() => 1)), this._loadedKeys.delete(p), this._pendingSaveKeys.delete(p);
|
|
2792
2792
|
}
|
|
2793
|
-
const d = [], c = [[
|
|
2793
|
+
const d = [], c = [[it, o]], f = (n = o.objects) !== null && n !== void 0 ? n : {};
|
|
2794
2794
|
o.objects = f;
|
|
2795
2795
|
for (const p of u)
|
|
2796
2796
|
if (this._loadedKeys.has(p)) {
|
|
@@ -2822,7 +2822,7 @@ class wn {
|
|
|
2822
2822
|
if (!this._gcOpts)
|
|
2823
2823
|
return;
|
|
2824
2824
|
const e = new Set(yield this._persister.getAllKeys());
|
|
2825
|
-
e.delete(
|
|
2825
|
+
e.delete(it);
|
|
2826
2826
|
const n = new Set(Object.keys(this.currentValue));
|
|
2827
2827
|
for (const l of Object.keys(this._loadingKeys))
|
|
2828
2828
|
n.add(l);
|
|
@@ -2985,17 +2985,17 @@ function Qa(t, e, n) {
|
|
|
2985
2985
|
for (const [y, b] of Object.entries(r)) {
|
|
2986
2986
|
const _ = typeof b == "string" ? JSON.parse(b) : b;
|
|
2987
2987
|
if (_.lastAccessed) {
|
|
2988
|
-
const
|
|
2988
|
+
const w = {
|
|
2989
2989
|
createdAt: _.lastAccessed,
|
|
2990
2990
|
updatedAt: _.lastAccessed,
|
|
2991
2991
|
size: (c = (d = (u = (a = _.result) === null || a === void 0 ? void 0 : a.store) === null || u === void 0 ? void 0 : u.triples) === null || d === void 0 ? void 0 : d.length) !== null && c !== void 0 ? c : 0
|
|
2992
2992
|
};
|
|
2993
|
-
f[y] =
|
|
2993
|
+
f[y] = w;
|
|
2994
2994
|
}
|
|
2995
|
-
const
|
|
2996
|
-
i.add(
|
|
2995
|
+
const T = n.put(_, y);
|
|
2996
|
+
i.add(T);
|
|
2997
2997
|
}
|
|
2998
|
-
const l = { objects: f }, p = n.put(l,
|
|
2998
|
+
const l = { objects: f }, p = n.put(l, it);
|
|
2999
2999
|
i.add(p);
|
|
3000
3000
|
for (const y of i)
|
|
3001
3001
|
y.onsuccess = () => {
|
|
@@ -3028,8 +3028,8 @@ function Ha(t, e) {
|
|
|
3028
3028
|
y.onsuccess = () => {
|
|
3029
3029
|
const _ = y.result;
|
|
3030
3030
|
if (_) {
|
|
3031
|
-
const
|
|
3032
|
-
b.push([
|
|
3031
|
+
const T = _.key, w = _.value;
|
|
3032
|
+
b.push([T, w]), _.continue();
|
|
3033
3033
|
} else
|
|
3034
3034
|
c(b);
|
|
3035
3035
|
}, y.onerror = (_) => {
|
|
@@ -3055,7 +3055,7 @@ function Ha(t, e) {
|
|
|
3055
3055
|
break;
|
|
3056
3056
|
}
|
|
3057
3057
|
}
|
|
3058
|
-
const d = $r(
|
|
3058
|
+
const d = $r(it, u, s);
|
|
3059
3059
|
a.push(d), yield Promise.all(a), yield new Promise((c, f) => {
|
|
3060
3060
|
i.oncomplete = (l) => c(l), i.onerror = (l) => f(l), i.onabort = (l) => f(l);
|
|
3061
3061
|
});
|
|
@@ -3209,11 +3209,11 @@ class qi {
|
|
|
3209
3209
|
};
|
|
3210
3210
|
}
|
|
3211
3211
|
}
|
|
3212
|
-
class
|
|
3212
|
+
class qe extends Error {
|
|
3213
3213
|
constructor(e, n) {
|
|
3214
3214
|
super(e), this.hint = n;
|
|
3215
3215
|
const r = new.target.prototype;
|
|
3216
|
-
Object.setPrototypeOf && Object.setPrototypeOf(this, r), Error.captureStackTrace && Error.captureStackTrace(this,
|
|
3216
|
+
Object.setPrototypeOf && Object.setPrototypeOf(this, r), Error.captureStackTrace && Error.captureStackTrace(this, qe), this.name = "InstantError";
|
|
3217
3217
|
}
|
|
3218
3218
|
get [Symbol.toStringTag]() {
|
|
3219
3219
|
return "InstantError";
|
|
@@ -3246,7 +3246,7 @@ var Ja = function(t, e, n, r) {
|
|
|
3246
3246
|
d((r = r.apply(t, e || [])).next());
|
|
3247
3247
|
});
|
|
3248
3248
|
};
|
|
3249
|
-
class Dt extends
|
|
3249
|
+
class Dt extends qe {
|
|
3250
3250
|
constructor(e) {
|
|
3251
3251
|
var n;
|
|
3252
3252
|
const r = ((n = e.body) === null || n === void 0 ? void 0 : n.message) || `API Error (${e.status})`;
|
|
@@ -3264,7 +3264,7 @@ function ue(t, e) {
|
|
|
3264
3264
|
return n.status === 200 ? Promise.resolve(r) : Promise.reject(new Dt({ status: n.status, body: r }));
|
|
3265
3265
|
});
|
|
3266
3266
|
}
|
|
3267
|
-
var
|
|
3267
|
+
var Ve = function(t, e, n, r) {
|
|
3268
3268
|
function i(s) {
|
|
3269
3269
|
return s instanceof n ? s : new n(function(o) {
|
|
3270
3270
|
o(s);
|
|
@@ -3299,7 +3299,7 @@ function Za({ apiURI: t, appId: e, email: n }) {
|
|
|
3299
3299
|
});
|
|
3300
3300
|
}
|
|
3301
3301
|
function Xa(t) {
|
|
3302
|
-
return
|
|
3302
|
+
return Ve(this, arguments, void 0, function* ({ apiURI: e, appId: n, email: r, code: i, refreshToken: s }) {
|
|
3303
3303
|
return yield ue(`${e}/runtime/auth/verify_magic_code`, {
|
|
3304
3304
|
method: "POST",
|
|
3305
3305
|
headers: { "content-type": "application/json" },
|
|
@@ -3312,7 +3312,7 @@ function Xa(t) {
|
|
|
3312
3312
|
});
|
|
3313
3313
|
}
|
|
3314
3314
|
function eu(t) {
|
|
3315
|
-
return
|
|
3315
|
+
return Ve(this, arguments, void 0, function* ({ apiURI: e, appId: n, refreshToken: r }) {
|
|
3316
3316
|
return yield ue(`${e}/runtime/auth/verify_refresh_token`, {
|
|
3317
3317
|
method: "POST",
|
|
3318
3318
|
headers: { "content-type": "application/json" },
|
|
@@ -3324,7 +3324,7 @@ function eu(t) {
|
|
|
3324
3324
|
});
|
|
3325
3325
|
}
|
|
3326
3326
|
function tu(t) {
|
|
3327
|
-
return
|
|
3327
|
+
return Ve(this, arguments, void 0, function* ({ apiURI: e, appId: n }) {
|
|
3328
3328
|
return yield ue(`${e}/runtime/auth/sign_in_guest`, {
|
|
3329
3329
|
method: "POST",
|
|
3330
3330
|
headers: { "content-type": "application/json" },
|
|
@@ -3335,7 +3335,7 @@ function tu(t) {
|
|
|
3335
3335
|
});
|
|
3336
3336
|
}
|
|
3337
3337
|
function Ur(t) {
|
|
3338
|
-
return
|
|
3338
|
+
return Ve(this, arguments, void 0, function* ({ apiURI: e, appId: n, code: r, codeVerifier: i, refreshToken: s }) {
|
|
3339
3339
|
return yield ue(`${e}/runtime/oauth/token`, {
|
|
3340
3340
|
method: "POST",
|
|
3341
3341
|
headers: { "content-type": "application/json" },
|
|
@@ -3349,7 +3349,7 @@ function Ur(t) {
|
|
|
3349
3349
|
});
|
|
3350
3350
|
}
|
|
3351
3351
|
function nu(t) {
|
|
3352
|
-
return
|
|
3352
|
+
return Ve(this, arguments, void 0, function* ({ apiURI: e, appId: n, nonce: r, idToken: i, clientName: s, refreshToken: o }) {
|
|
3353
3353
|
return yield ue(`${e}/runtime/oauth/id_token`, {
|
|
3354
3354
|
method: "POST",
|
|
3355
3355
|
headers: { "content-type": "application/json" },
|
|
@@ -3364,7 +3364,7 @@ function nu(t) {
|
|
|
3364
3364
|
});
|
|
3365
3365
|
}
|
|
3366
3366
|
function ru(t) {
|
|
3367
|
-
return
|
|
3367
|
+
return Ve(this, arguments, void 0, function* ({ apiURI: e, appId: n, refreshToken: r }) {
|
|
3368
3368
|
return yield ue(`${e}/runtime/signout`, {
|
|
3369
3369
|
method: "POST",
|
|
3370
3370
|
headers: {
|
|
@@ -3377,7 +3377,7 @@ function ru(t) {
|
|
|
3377
3377
|
});
|
|
3378
3378
|
});
|
|
3379
3379
|
}
|
|
3380
|
-
var
|
|
3380
|
+
var ft = function(t, e, n, r) {
|
|
3381
3381
|
function i(s) {
|
|
3382
3382
|
return s instanceof n ? s : new n(function(o) {
|
|
3383
3383
|
o(s);
|
|
@@ -3405,7 +3405,7 @@ var lt = function(t, e, n, r) {
|
|
|
3405
3405
|
});
|
|
3406
3406
|
};
|
|
3407
3407
|
function iu(t) {
|
|
3408
|
-
return
|
|
3408
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, path: r, file: i, refreshToken: s, contentType: o, contentDisposition: a }) {
|
|
3409
3409
|
const u = {
|
|
3410
3410
|
app_id: n,
|
|
3411
3411
|
path: r,
|
|
@@ -3420,7 +3420,7 @@ function iu(t) {
|
|
|
3420
3420
|
});
|
|
3421
3421
|
}
|
|
3422
3422
|
function su(t) {
|
|
3423
|
-
return
|
|
3423
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, path: r, refreshToken: i }) {
|
|
3424
3424
|
const { data: s } = yield ue(`${e}/storage/files?app_id=${n}&filename=${encodeURIComponent(r)}`, {
|
|
3425
3425
|
method: "DELETE",
|
|
3426
3426
|
headers: {
|
|
@@ -3432,7 +3432,7 @@ function su(t) {
|
|
|
3432
3432
|
});
|
|
3433
3433
|
}
|
|
3434
3434
|
function ou(t) {
|
|
3435
|
-
return
|
|
3435
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, fileName: r, refreshToken: i, metadata: s = {} }) {
|
|
3436
3436
|
const { data: o } = yield ue(`${e}/storage/signed-upload-url`, {
|
|
3437
3437
|
method: "POST",
|
|
3438
3438
|
headers: {
|
|
@@ -3448,7 +3448,7 @@ function ou(t) {
|
|
|
3448
3448
|
});
|
|
3449
3449
|
}
|
|
3450
3450
|
function au(t, e) {
|
|
3451
|
-
return
|
|
3451
|
+
return ft(this, void 0, void 0, function* () {
|
|
3452
3452
|
return (yield fetch(t, {
|
|
3453
3453
|
method: "PUT",
|
|
3454
3454
|
body: e,
|
|
@@ -3459,7 +3459,7 @@ function au(t, e) {
|
|
|
3459
3459
|
});
|
|
3460
3460
|
}
|
|
3461
3461
|
function uu(t) {
|
|
3462
|
-
return
|
|
3462
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, path: r, refreshToken: i }) {
|
|
3463
3463
|
const { data: s } = yield ue(`${e}/storage/signed-download-url?app_id=${n}&filename=${encodeURIComponent(r)}`, {
|
|
3464
3464
|
method: "GET",
|
|
3465
3465
|
headers: {
|
|
@@ -3546,7 +3546,7 @@ function Kr(t) {
|
|
|
3546
3546
|
}, e;
|
|
3547
3547
|
}, {});
|
|
3548
3548
|
}
|
|
3549
|
-
const Gn = "v0.22.61
|
|
3549
|
+
const Gn = "v0.22.61";
|
|
3550
3550
|
function fu(t, e) {
|
|
3551
3551
|
return {
|
|
3552
3552
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -3614,7 +3614,7 @@ class Lt {
|
|
|
3614
3614
|
return new Lt(this.entities, this.links, {});
|
|
3615
3615
|
}
|
|
3616
3616
|
}
|
|
3617
|
-
class
|
|
3617
|
+
class R extends Error {
|
|
3618
3618
|
constructor(e, n) {
|
|
3619
3619
|
const r = n ? `At path '${n}': ${e}` : e;
|
|
3620
3620
|
super(r), this.name = "QueryValidationError";
|
|
@@ -3649,13 +3649,13 @@ const qr = [
|
|
|
3649
3649
|
}, hu = (t, e, n, r, i, s, o) => {
|
|
3650
3650
|
const a = s.valueType === "json", u = (d, c, f) => {
|
|
3651
3651
|
if (!Bi(f, c, a))
|
|
3652
|
-
throw new
|
|
3652
|
+
throw new R(`Invalid value for operator '${d}' on attribute '${r}' in entity '${i}'. Expected ${c}, but received: ${typeof f}`, o);
|
|
3653
3653
|
};
|
|
3654
3654
|
switch (t) {
|
|
3655
3655
|
case "in":
|
|
3656
3656
|
case "$in":
|
|
3657
3657
|
if (!Array.isArray(e))
|
|
3658
|
-
throw new
|
|
3658
|
+
throw new R(`Operator '${t}' for attribute '${r}' in entity '${i}' must be an array, but received: ${typeof e}`, o);
|
|
3659
3659
|
for (const d of e)
|
|
3660
3660
|
u(t, n, d);
|
|
3661
3661
|
break;
|
|
@@ -3670,15 +3670,15 @@ const qr = [
|
|
|
3670
3670
|
case "$like":
|
|
3671
3671
|
case "$ilike":
|
|
3672
3672
|
if (u(t, "string", e), t === "$ilike" && !s.isIndexed)
|
|
3673
|
-
throw new
|
|
3673
|
+
throw new R(`Operator '${t}' can only be used with indexed attributes, but '${r}' in entity '${i}' is not indexed`, o);
|
|
3674
3674
|
break;
|
|
3675
3675
|
case "$isNull":
|
|
3676
3676
|
u(t, "boolean", e);
|
|
3677
3677
|
break;
|
|
3678
3678
|
default:
|
|
3679
|
-
throw new
|
|
3679
|
+
throw new R(`Unknown operator '${t}' for attribute '${r}' in entity '${i}'`, o);
|
|
3680
3680
|
}
|
|
3681
|
-
},
|
|
3681
|
+
}, Le = (t, e, n, r, i) => {
|
|
3682
3682
|
const s = lu(n), o = n.valueType === "json";
|
|
3683
3683
|
if (typeof t == "object" && t !== null && !Array.isArray(t)) {
|
|
3684
3684
|
if (o)
|
|
@@ -3687,44 +3687,44 @@ const qr = [
|
|
|
3687
3687
|
for (const [d, c] of Object.entries(u))
|
|
3688
3688
|
hu(d, c, s, e, r, n, `${i}.${d}`);
|
|
3689
3689
|
} else if (!Bi(t, s, o))
|
|
3690
|
-
throw new
|
|
3690
|
+
throw new R(`Invalid value for attribute '${e}' in entity '${r}'. Expected ${s}, but received: ${typeof t}`, i);
|
|
3691
3691
|
}, pu = (t, e, n, r, i) => {
|
|
3692
3692
|
const s = t.split(".");
|
|
3693
3693
|
if (s.length < 2)
|
|
3694
|
-
throw new
|
|
3694
|
+
throw new R(`Invalid dot notation path '${t}'. Must contain at least one dot.`, i);
|
|
3695
3695
|
let o = n;
|
|
3696
3696
|
for (let c = 0; c < s.length - 1; c++) {
|
|
3697
3697
|
const f = s[c], l = r.entities[o];
|
|
3698
3698
|
if (!l)
|
|
3699
|
-
throw new
|
|
3699
|
+
throw new R(`Entity '${o}' does not exist in schema while traversing dot notation path '${t}'.`, i);
|
|
3700
3700
|
const p = l.links[f];
|
|
3701
3701
|
if (!p) {
|
|
3702
3702
|
const y = Object.keys(l.links);
|
|
3703
|
-
throw new
|
|
3703
|
+
throw new R(`Link '${f}' does not exist on entity '${o}' in dot notation path '${t}'. Available links: ${y.length > 0 ? y.join(", ") : "none"}`, i);
|
|
3704
3704
|
}
|
|
3705
3705
|
o = p.entityName;
|
|
3706
3706
|
}
|
|
3707
3707
|
const a = s[s.length - 1], u = r.entities[o];
|
|
3708
3708
|
if (!u)
|
|
3709
|
-
throw new
|
|
3709
|
+
throw new R(`Target entity '${o}' does not exist in schema for dot notation path '${t}'.`, i);
|
|
3710
3710
|
if (a === "id") {
|
|
3711
|
-
if (typeof e == "string" && !
|
|
3712
|
-
throw new
|
|
3713
|
-
|
|
3711
|
+
if (typeof e == "string" && !Ne(e))
|
|
3712
|
+
throw new R(`Invalid value for id field in entity '${o}'. Expected a UUID, but received: ${e}`, i);
|
|
3713
|
+
Le(e, t, new H("string", !1, !0), n, i);
|
|
3714
3714
|
return;
|
|
3715
3715
|
}
|
|
3716
3716
|
const d = u.attrs[a];
|
|
3717
3717
|
if (Object.keys(u.links).includes(a)) {
|
|
3718
|
-
if (typeof e == "string" && !
|
|
3719
|
-
throw new
|
|
3720
|
-
|
|
3718
|
+
if (typeof e == "string" && !Ne(e))
|
|
3719
|
+
throw new R(`Invalid value for link '${a}' in entity '${o}'. Expected a UUID, but received: ${e}`, i);
|
|
3720
|
+
Le(e, t, new H("string", !1, !0), n, i);
|
|
3721
3721
|
return;
|
|
3722
3722
|
}
|
|
3723
3723
|
if (!d) {
|
|
3724
3724
|
const c = Object.keys(u.attrs);
|
|
3725
|
-
throw new
|
|
3725
|
+
throw new R(`Attribute '${a}' does not exist on entity '${o}' in dot notation path '${t}'. Available attributes: ${c.length > 0 ? c.join(", ") + ", id" : "id"}`, i);
|
|
3726
3726
|
}
|
|
3727
|
-
|
|
3727
|
+
Le(e, t, d, n, i);
|
|
3728
3728
|
}, Gi = (t, e, n, r) => {
|
|
3729
3729
|
for (const [i, s] of Object.entries(t)) {
|
|
3730
3730
|
if (i === "or" || i === "and") {
|
|
@@ -3734,7 +3734,7 @@ const qr = [
|
|
|
3734
3734
|
continue;
|
|
3735
3735
|
}
|
|
3736
3736
|
if (i === "id") {
|
|
3737
|
-
|
|
3737
|
+
Le(s, "id", new H("string", !1, !0), e, `${r}.id`);
|
|
3738
3738
|
continue;
|
|
3739
3739
|
}
|
|
3740
3740
|
if (i.includes(".")) {
|
|
@@ -3747,21 +3747,21 @@ const qr = [
|
|
|
3747
3747
|
const a = o.attrs[i], u = o.links[i];
|
|
3748
3748
|
if (!a && !u) {
|
|
3749
3749
|
const d = Object.keys(o.attrs), c = Object.keys(o.links);
|
|
3750
|
-
throw new
|
|
3750
|
+
throw new R(`Attribute or link '${i}' does not exist on entity '${e}'. Available attributes: ${d.length > 0 ? d.join(", ") : "none"}. Available links: ${c.length > 0 ? c.join(", ") : "none"}`, `${r}.${i}`);
|
|
3751
3751
|
}
|
|
3752
3752
|
if (a)
|
|
3753
|
-
|
|
3753
|
+
Le(s, i, a, e, `${r}.${i}`);
|
|
3754
3754
|
else if (u) {
|
|
3755
|
-
if (typeof s == "string" && !
|
|
3756
|
-
throw new
|
|
3755
|
+
if (typeof s == "string" && !Ne(s))
|
|
3756
|
+
throw new R(`Invalid value for link '${i}' in entity '${e}'. Expected a UUID, but received: ${s}`, `${r}.${i}`);
|
|
3757
3757
|
const d = new H("string", !1, !0);
|
|
3758
|
-
|
|
3758
|
+
Le(s, i, d, e, `${r}.${i}`);
|
|
3759
3759
|
}
|
|
3760
3760
|
}
|
|
3761
3761
|
}, yu = (t, e, n, r, i = 0) => {
|
|
3762
3762
|
for (const o of Object.keys(t))
|
|
3763
3763
|
if (!qr.includes(o))
|
|
3764
|
-
throw new
|
|
3764
|
+
throw new R(`Invalid query parameter '${o}' in $ object. Valid parameters are: ${qr.join(", ")}. Found: ${o}`, r);
|
|
3765
3765
|
const s = [
|
|
3766
3766
|
// 'limit', // only supported client side
|
|
3767
3767
|
"offset",
|
|
@@ -3772,21 +3772,21 @@ const qr = [
|
|
|
3772
3772
|
];
|
|
3773
3773
|
for (const o of s)
|
|
3774
3774
|
if (t[o] !== void 0 && i > 0)
|
|
3775
|
-
throw new
|
|
3775
|
+
throw new R(`'${o}' can only be used on top-level namespaces. It cannot be used in nested queries.`, r);
|
|
3776
3776
|
if (t.where && n) {
|
|
3777
3777
|
if (typeof t.where != "object" || t.where === null)
|
|
3778
|
-
throw new
|
|
3778
|
+
throw new R(`'where' clause must be an object in entity '${e}', but received: ${typeof t.where}`, r ? `${r}.where` : void 0);
|
|
3779
3779
|
Gi(t.where, e, n, r ? `${r}.where` : "where");
|
|
3780
3780
|
}
|
|
3781
3781
|
}, Qi = (t, e, n, r, i = 0) => {
|
|
3782
3782
|
var s;
|
|
3783
3783
|
if (!t || typeof t != "object")
|
|
3784
|
-
throw new
|
|
3784
|
+
throw new R(`Query part for entity '${e}' must be an object, but received: ${typeof t}`, r);
|
|
3785
3785
|
for (const o of Object.keys(t))
|
|
3786
3786
|
if (o !== "$") {
|
|
3787
3787
|
if (n && !(o in n.entities[e].links)) {
|
|
3788
3788
|
const u = Object.keys(n.entities[e].links);
|
|
3789
|
-
throw new
|
|
3789
|
+
throw new R(`Link '${o}' does not exist on entity '${e}'. Available links: ${u.length > 0 ? u.join(", ") : "none"}`, `${r}.${o}`);
|
|
3790
3790
|
}
|
|
3791
3791
|
const a = t[o];
|
|
3792
3792
|
if (typeof a == "object" && a !== null) {
|
|
@@ -3796,29 +3796,29 @@ const qr = [
|
|
|
3796
3796
|
} else {
|
|
3797
3797
|
const a = t[o];
|
|
3798
3798
|
if (typeof a != "object" || a === null)
|
|
3799
|
-
throw new
|
|
3799
|
+
throw new R(`Query parameter '$' must be an object in entity '${e}', but received: ${typeof a}`, `${r}.$`);
|
|
3800
3800
|
yu(a, e, n, `${r}.$`, i);
|
|
3801
3801
|
}
|
|
3802
3802
|
}, Wr = (t, e) => {
|
|
3803
3803
|
if (typeof t != "object" || t === null)
|
|
3804
|
-
throw new
|
|
3804
|
+
throw new R(`Query must be an object, but received: ${typeof t}${t === null ? " (null)" : ""}`);
|
|
3805
3805
|
if (Array.isArray(t))
|
|
3806
|
-
throw new
|
|
3806
|
+
throw new R(`Query must be an object, but received: ${typeof t}`);
|
|
3807
3807
|
const n = t;
|
|
3808
3808
|
for (const r of Object.keys(n)) {
|
|
3809
3809
|
if (Array.isArray(t[r]))
|
|
3810
|
-
throw new
|
|
3810
|
+
throw new R(`Query keys must be strings, but found key of type: ${typeof r}`, r);
|
|
3811
3811
|
if (typeof r != "string")
|
|
3812
|
-
throw new
|
|
3812
|
+
throw new R(`Query keys must be strings, but found key of type: ${typeof r}`, r);
|
|
3813
3813
|
if (r !== "$$ruleParams") {
|
|
3814
3814
|
if (e && !e.entities[r]) {
|
|
3815
3815
|
const i = Object.keys(e.entities);
|
|
3816
|
-
throw new
|
|
3816
|
+
throw new R(`Entity '${r}' does not exist in schema. Available entities: ${i.length > 0 ? i.join(", ") : "none"}`, r);
|
|
3817
3817
|
}
|
|
3818
3818
|
Qi(n[r], r, e, r, 0);
|
|
3819
3819
|
}
|
|
3820
3820
|
}
|
|
3821
|
-
}, zr = (t) => typeof t != "string" ? !1 : Mt(t) ? !0 :
|
|
3821
|
+
}, zr = (t) => typeof t != "string" ? !1 : Mt(t) ? !0 : Ne(t);
|
|
3822
3822
|
class ie extends Error {
|
|
3823
3823
|
constructor(e) {
|
|
3824
3824
|
super(e), this.name = "TransactionValidationError";
|
|
@@ -3875,17 +3875,17 @@ const Hi = (t) => t.length > 0 ? t.join(", ") : "none", bu = (t, e) => new ie(`E
|
|
|
3875
3875
|
unlink: Br,
|
|
3876
3876
|
delete: () => {
|
|
3877
3877
|
}
|
|
3878
|
-
},
|
|
3878
|
+
}, wu = (t, e) => {
|
|
3879
3879
|
if (!e)
|
|
3880
3880
|
return;
|
|
3881
3881
|
const [n, r, i, s] = t;
|
|
3882
|
-
if (!Array.isArray(i) && !
|
|
3882
|
+
if (!Array.isArray(i) && !Ne(i))
|
|
3883
3883
|
throw new ie(`Invalid id for entity '${r}'. Expected a UUID, but received: ${i}`);
|
|
3884
3884
|
if (typeof r != "string")
|
|
3885
3885
|
throw new ie(`Entity name must be a string, but received: ${typeof r}`);
|
|
3886
3886
|
const o = gu[n];
|
|
3887
3887
|
o && s !== void 0 && o(r, s, e);
|
|
3888
|
-
},
|
|
3888
|
+
}, Tu = (t, e) => {
|
|
3889
3889
|
const n = Array.isArray(t) ? t : [t];
|
|
3890
3890
|
for (const r of n) {
|
|
3891
3891
|
if (!r || typeof r != "object")
|
|
@@ -3895,7 +3895,7 @@ const Hi = (t) => t.length > 0 ? t.join(", ") : "none", bu = (t, e) => new ie(`E
|
|
|
3895
3895
|
for (const i of r.__ops) {
|
|
3896
3896
|
if (!Array.isArray(i))
|
|
3897
3897
|
throw new ie(`Transaction operation must be an array, but received: ${typeof i}`);
|
|
3898
|
-
|
|
3898
|
+
wu(i, e);
|
|
3899
3899
|
}
|
|
3900
3900
|
}
|
|
3901
3901
|
};
|
|
@@ -4090,10 +4090,10 @@ function Zt(t, e) {
|
|
|
4090
4090
|
}
|
|
4091
4091
|
function Yr(t, e, n) {
|
|
4092
4092
|
var r;
|
|
4093
|
-
const i = (r =
|
|
4093
|
+
const i = (r = we(e, t.table, "id")) === null || r === void 0 ? void 0 : r.id;
|
|
4094
4094
|
if (!i)
|
|
4095
4095
|
return -1;
|
|
4096
|
-
const s =
|
|
4096
|
+
const s = ze(e.eav, [n, i, n]);
|
|
4097
4097
|
return s ? s[3] : -1;
|
|
4098
4098
|
}
|
|
4099
4099
|
function Jr(t, e) {
|
|
@@ -4128,40 +4128,33 @@ function Eu(t, e) {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
return o;
|
|
4130
4130
|
}
|
|
4131
|
-
function
|
|
4131
|
+
function Tt(t, e) {
|
|
4132
4132
|
return { [t.table]: e.map((n) => n.entity) };
|
|
4133
4133
|
}
|
|
4134
4134
|
function Au(t, e) {
|
|
4135
|
-
|
|
4136
|
-
if (t.orderFieldType)
|
|
4137
|
-
return t.orderFieldType;
|
|
4138
|
-
const r = t.orderField === "serverCreatedAt" ? "number" : (n = Te(e([]), t.table, t.orderField)) === null || n === void 0 ? void 0 : n["checked-data-type"];
|
|
4139
|
-
return t.orderFieldType = r, r;
|
|
4140
|
-
}
|
|
4141
|
-
function ku(t, e, n) {
|
|
4142
|
-
const r = e;
|
|
4135
|
+
const n = t.orderFieldType;
|
|
4143
4136
|
if (t.orderField === "serverCreatedAt") {
|
|
4144
|
-
|
|
4145
|
-
return
|
|
4146
|
-
} : function(
|
|
4147
|
-
return
|
|
4137
|
+
e.sort(t.orderDirection === "asc" ? function(s, o) {
|
|
4138
|
+
return Xe(s.entity.id, s.serverCreatedAt, o.entity.id, o.serverCreatedAt, n);
|
|
4139
|
+
} : function(s, o) {
|
|
4140
|
+
return Xe(o.entity.id, o.serverCreatedAt, s.entity.id, s.serverCreatedAt, n);
|
|
4148
4141
|
});
|
|
4149
4142
|
return;
|
|
4150
4143
|
}
|
|
4151
|
-
const
|
|
4152
|
-
|
|
4153
|
-
return
|
|
4154
|
-
} : function(
|
|
4155
|
-
return
|
|
4144
|
+
const r = t.orderField;
|
|
4145
|
+
e.sort(t.orderDirection === "asc" ? function(s, o) {
|
|
4146
|
+
return Xe(s.entity.id, s.entity[r], o.entity.id, o.entity[r], n);
|
|
4147
|
+
} : function(s, o) {
|
|
4148
|
+
return Xe(o.entity.id, o.entity[r], s.entity.id, s.entity[r], n);
|
|
4156
4149
|
});
|
|
4157
4150
|
}
|
|
4158
4151
|
var Se;
|
|
4159
4152
|
(function(t) {
|
|
4160
4153
|
t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error";
|
|
4161
4154
|
})(Se || (Se = {}));
|
|
4162
|
-
class
|
|
4155
|
+
class ku {
|
|
4163
4156
|
constructor(e, n, r, i, s) {
|
|
4164
|
-
this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = i, this.createStore = s, this.subs = new
|
|
4157
|
+
this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = i, this.createStore = s, this.subs = new Tn({
|
|
4165
4158
|
persister: n,
|
|
4166
4159
|
merge: Ou,
|
|
4167
4160
|
serialize: Su,
|
|
@@ -4223,24 +4216,25 @@ class ju {
|
|
|
4223
4216
|
}
|
|
4224
4217
|
initSubscription(e, n, r) {
|
|
4225
4218
|
return Hr(this, void 0, void 0, function* () {
|
|
4226
|
-
var i, s, o, a;
|
|
4219
|
+
var i, s, o, a, u;
|
|
4227
4220
|
yield this.subs.waitForKeyToLoad(n);
|
|
4228
|
-
const
|
|
4229
|
-
if (
|
|
4230
|
-
this.sendResync(
|
|
4221
|
+
const d = this.subs.currentValue[n];
|
|
4222
|
+
if (d && d.state && d.state.txId) {
|
|
4223
|
+
this.sendResync(d, d.state), !((i = d.values) === null || i === void 0) && i.entities && r && (Object.keys(e)[0], r({
|
|
4231
4224
|
type: Se.LoadFromStorage,
|
|
4232
|
-
data:
|
|
4225
|
+
data: Tt(d, (s = d.values) === null || s === void 0 ? void 0 : s.entities)
|
|
4233
4226
|
}));
|
|
4234
4227
|
return;
|
|
4235
4228
|
}
|
|
4236
|
-
const
|
|
4237
|
-
this.subs.updateInPlace((
|
|
4238
|
-
|
|
4229
|
+
const c = Object.keys(e)[0], f = ((a = (o = e[c]) === null || o === void 0 ? void 0 : o.$) === null || a === void 0 ? void 0 : a.order) || { serverCreatedAt: "asc" }, [l, p] = Object.entries(f)[0], y = l === "serverCreatedAt" ? "number" : (u = we(this.createStore([]), c, l)) === null || u === void 0 ? void 0 : u["checked-data-type"];
|
|
4230
|
+
this.subs.updateInPlace((b) => {
|
|
4231
|
+
b[n] = {
|
|
4239
4232
|
query: e,
|
|
4240
4233
|
hash: n,
|
|
4241
|
-
table:
|
|
4242
|
-
orderDirection:
|
|
4243
|
-
orderField:
|
|
4234
|
+
table: c,
|
|
4235
|
+
orderDirection: p,
|
|
4236
|
+
orderField: l,
|
|
4237
|
+
orderFieldType: y,
|
|
4244
4238
|
createdAt: Date.now(),
|
|
4245
4239
|
updatedAt: Date.now()
|
|
4246
4240
|
};
|
|
@@ -4304,7 +4298,7 @@ class ju {
|
|
|
4304
4298
|
c[s] = a, c[s].updatedAt = Date.now();
|
|
4305
4299
|
}), a.values && this.notifyCbs(s, {
|
|
4306
4300
|
type: Se.InitialSyncBatch,
|
|
4307
|
-
data:
|
|
4301
|
+
data: Tt(a, a.values.entities),
|
|
4308
4302
|
batch: o
|
|
4309
4303
|
});
|
|
4310
4304
|
}
|
|
@@ -4329,7 +4323,7 @@ class ju {
|
|
|
4329
4323
|
const s = this.subs.currentValue[i];
|
|
4330
4324
|
s && this.notifyCbs(i, {
|
|
4331
4325
|
type: Se.InitialSyncComplete,
|
|
4332
|
-
data:
|
|
4326
|
+
data: Tt(s, ((n = s.values) === null || n === void 0 ? void 0 : n.entities) || [])
|
|
4333
4327
|
});
|
|
4334
4328
|
}
|
|
4335
4329
|
onSyncUpdateTriples(e) {
|
|
@@ -4354,9 +4348,9 @@ class ju {
|
|
|
4354
4348
|
continue;
|
|
4355
4349
|
u.txId = d["tx-id"];
|
|
4356
4350
|
const c = [], f = {};
|
|
4357
|
-
for (const
|
|
4358
|
-
const
|
|
4359
|
-
f[
|
|
4351
|
+
for (const T of d.changes) {
|
|
4352
|
+
const w = (n = f[T.triple[0]]) !== null && n !== void 0 ? n : [];
|
|
4353
|
+
f[T.triple[0]] = w, w.push(T);
|
|
4360
4354
|
}
|
|
4361
4355
|
const l = (r = a.values) !== null && r !== void 0 ? r : {
|
|
4362
4356
|
entities: [],
|
|
@@ -4364,46 +4358,45 @@ class ju {
|
|
|
4364
4358
|
}, p = l.entities;
|
|
4365
4359
|
a.values = l;
|
|
4366
4360
|
const y = [];
|
|
4367
|
-
e: for (const [
|
|
4368
|
-
for (const [
|
|
4369
|
-
if (oo(
|
|
4370
|
-
Jr(
|
|
4371
|
-
const
|
|
4372
|
-
for (const [
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
oldEntity:
|
|
4376
|
-
newEntity:
|
|
4377
|
-
changedFields:
|
|
4378
|
-
}),
|
|
4361
|
+
e: for (const [T, w] of Object.entries(f))
|
|
4362
|
+
for (const [m, E] of Object.entries(p))
|
|
4363
|
+
if (oo(E.store, T)) {
|
|
4364
|
+
Jr(E.store, w);
|
|
4365
|
+
const S = Zt(a, E.store), I = Eu(E.store, w)[T];
|
|
4366
|
+
for (const [x, { oldValue: q, newValue: Te }] of Object.entries(I || {}))
|
|
4367
|
+
q === Te && delete I[x];
|
|
4368
|
+
S ? (y.push({
|
|
4369
|
+
oldEntity: E.entity,
|
|
4370
|
+
newEntity: S,
|
|
4371
|
+
changedFields: I || {}
|
|
4372
|
+
}), E.entity = S) : c.push(m), delete f[T];
|
|
4379
4373
|
continue e;
|
|
4380
4374
|
}
|
|
4381
4375
|
const b = [];
|
|
4382
|
-
for (const [
|
|
4383
|
-
const
|
|
4384
|
-
l.attrs =
|
|
4385
|
-
const
|
|
4386
|
-
if (!
|
|
4376
|
+
for (const [T, w] of Object.entries(f)) {
|
|
4377
|
+
const m = this.createStore([]);
|
|
4378
|
+
l.attrs = m.attrs, Jr(m, w);
|
|
4379
|
+
const E = Zt(a, m);
|
|
4380
|
+
if (!E) {
|
|
4387
4381
|
this.log.error("No entity found after applying change", {
|
|
4388
4382
|
sub: a,
|
|
4389
|
-
changes:
|
|
4390
|
-
store:
|
|
4383
|
+
changes: w,
|
|
4384
|
+
store: m
|
|
4391
4385
|
});
|
|
4392
4386
|
continue;
|
|
4393
4387
|
}
|
|
4394
4388
|
p.push({
|
|
4395
|
-
store:
|
|
4396
|
-
entity:
|
|
4397
|
-
serverCreatedAt: Yr(a,
|
|
4398
|
-
}), b.push(
|
|
4389
|
+
store: m,
|
|
4390
|
+
entity: E,
|
|
4391
|
+
serverCreatedAt: Yr(a, m, E.id)
|
|
4392
|
+
}), b.push(E);
|
|
4399
4393
|
}
|
|
4400
4394
|
const _ = [];
|
|
4401
|
-
for (const
|
|
4402
|
-
_.push(p[
|
|
4403
|
-
|
|
4404
|
-
ku(a, w, p), this.notifyCbs(o, {
|
|
4395
|
+
for (const T of c.sort().reverse())
|
|
4396
|
+
_.push(p[T].entity), p.splice(T, 1);
|
|
4397
|
+
Au(a, p), this.notifyCbs(o, {
|
|
4405
4398
|
type: Se.SyncTransaction,
|
|
4406
|
-
data:
|
|
4399
|
+
data: Tt(a, (i = a.values) === null || i === void 0 ? void 0 : i.entities),
|
|
4407
4400
|
added: b,
|
|
4408
4401
|
removed: _,
|
|
4409
4402
|
updated: y
|
|
@@ -4468,7 +4461,7 @@ var F = function(t, e, n, r) {
|
|
|
4468
4461
|
}
|
|
4469
4462
|
d((r = r.apply(t, e || [])).next());
|
|
4470
4463
|
});
|
|
4471
|
-
},
|
|
4464
|
+
}, ju = function(t, e) {
|
|
4472
4465
|
var n = {};
|
|
4473
4466
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
4474
4467
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4482,11 +4475,11 @@ const le = {
|
|
|
4482
4475
|
AUTHENTICATED: "authenticated",
|
|
4483
4476
|
CLOSED: "closed",
|
|
4484
4477
|
ERRORED: "errored"
|
|
4485
|
-
},
|
|
4478
|
+
}, Cu = 3e4, Pu = 3e4, Iu = 200, Mu = {
|
|
4486
4479
|
apiURI: "https://api.instantdb.com",
|
|
4487
4480
|
websocketURI: "wss://api.instantdb.com/runtime/session"
|
|
4488
|
-
}, Xt = "_instant_oauth_redirect",
|
|
4489
|
-
function
|
|
4481
|
+
}, Xt = "_instant_oauth_redirect", Qe = "currentUser";
|
|
4482
|
+
function Ru({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl: i }) {
|
|
4490
4483
|
if (!i)
|
|
4491
4484
|
return new Qr(`${r}?app_id=${e}`);
|
|
4492
4485
|
switch (t) {
|
|
@@ -4498,7 +4491,7 @@ function xu({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl:
|
|
|
4498
4491
|
throw new Error("Unknown transport type " + t);
|
|
4499
4492
|
}
|
|
4500
4493
|
}
|
|
4501
|
-
function
|
|
4494
|
+
function xu() {
|
|
4502
4495
|
return typeof window < "u" || typeof chrome < "u";
|
|
4503
4496
|
}
|
|
4504
4497
|
const Zr = {
|
|
@@ -4507,7 +4500,7 @@ const Zr = {
|
|
|
4507
4500
|
"refresh-presence": !0,
|
|
4508
4501
|
"patch-presence": !0
|
|
4509
4502
|
};
|
|
4510
|
-
function
|
|
4503
|
+
function $u(t, e) {
|
|
4511
4504
|
var n;
|
|
4512
4505
|
const r = typeof t == "string" ? JSON.parse(t) : t;
|
|
4513
4506
|
if (!((n = r == null ? void 0 : r.result) === null || n === void 0) && n.store) {
|
|
@@ -4516,12 +4509,12 @@ function Du(t, e) {
|
|
|
4516
4509
|
}
|
|
4517
4510
|
return r;
|
|
4518
4511
|
}
|
|
4519
|
-
function
|
|
4512
|
+
function Du(t, e) {
|
|
4520
4513
|
var n;
|
|
4521
4514
|
const r = Object.assign({}, e);
|
|
4522
4515
|
return !((n = e.result) === null || n === void 0) && n.store && (r.result = Object.assign(Object.assign({}, e.result), { store: Si(e.result.store) })), r;
|
|
4523
4516
|
}
|
|
4524
|
-
function
|
|
4517
|
+
function Uu(t, e) {
|
|
4525
4518
|
switch (t) {
|
|
4526
4519
|
case "pendingMutations":
|
|
4527
4520
|
return new Map(typeof e == "string" ? JSON.parse(e) : e);
|
|
@@ -4529,7 +4522,7 @@ function Lu(t, e) {
|
|
|
4529
4522
|
return e;
|
|
4530
4523
|
}
|
|
4531
4524
|
}
|
|
4532
|
-
function
|
|
4525
|
+
function Lu(t, e) {
|
|
4533
4526
|
switch (t) {
|
|
4534
4527
|
case "pendingMutations":
|
|
4535
4528
|
return [...e.entries()];
|
|
@@ -4537,7 +4530,7 @@ function Fu(t, e) {
|
|
|
4537
4530
|
return e;
|
|
4538
4531
|
}
|
|
4539
4532
|
}
|
|
4540
|
-
function
|
|
4533
|
+
function Fu(t, e, n) {
|
|
4541
4534
|
const r = e == null ? void 0 : e.result, i = n == null ? void 0 : n.result;
|
|
4542
4535
|
return r && !i && n && (n.result = r), n || e;
|
|
4543
4536
|
}
|
|
@@ -4547,7 +4540,7 @@ function Xr(t) {
|
|
|
4547
4540
|
return a == u ? r < s ? -1 : r > s ? 1 : 0 : a - u;
|
|
4548
4541
|
});
|
|
4549
4542
|
}
|
|
4550
|
-
class
|
|
4543
|
+
class Nu {
|
|
4551
4544
|
constructor(e, n = Ki, r = qi, i, s) {
|
|
4552
4545
|
var o, a, u;
|
|
4553
4546
|
if (this._isOnline = !0, this._isShutdown = !1, this.status = le.CONNECTING, this.queryCbs = {}, this.queryOnceDfds = {}, this.authCbs = [], this.attrsCbs = [], this.mutationErrorCbs = [], this.connectionStatusCbs = [], this.mutationDeferredStore = /* @__PURE__ */ new Map(), this._reconnectTimeoutId = null, this._reconnectTimeoutMs = 0, this._transportType = "ws", this._wsOk = null, this._localIdPromises = {}, this._errorMessage = null, this._oauthCallbackResponse = null, this._linkIndex = null, this._rooms = {}, this._roomsPendingLeave = {}, this._presence = {}, this._broadcastQueue = [], this._broadcastSubs = {}, this._currentUserCached = { isLoading: !0, error: void 0, user: void 0 }, this._beforeUnloadCbs = [], this._dataForQueryCache = {}, this._inFlightMutationEventIds = /* @__PURE__ */ new Set(), this._onMergeKv = (d, c, f) => {
|
|
@@ -4555,9 +4548,9 @@ class Ku {
|
|
|
4555
4548
|
switch (d) {
|
|
4556
4549
|
case "pendingMutations": {
|
|
4557
4550
|
const y = (l = c == null ? void 0 : c.entries()) !== null && l !== void 0 ? l : [], b = (p = f == null ? void 0 : f.entries()) !== null && p !== void 0 ? p : [], _ = new Map([...y, ...b]);
|
|
4558
|
-
return (c ? this._rewriteMutationsSorted(this.attrs, c) : []).forEach(([
|
|
4551
|
+
return (c ? this._rewriteMutationsSorted(this.attrs, c) : []).forEach(([w, m]) => {
|
|
4559
4552
|
var E;
|
|
4560
|
-
!(!((E = f == null ? void 0 : f.pendingMutations) === null || E === void 0) && E.has(
|
|
4553
|
+
!(!((E = f == null ? void 0 : f.pendingMutations) === null || E === void 0) && E.has(w)) && !m["tx-id"] && this._sendMutation(w, m);
|
|
4561
4554
|
}), _;
|
|
4562
4555
|
}
|
|
4563
4556
|
default:
|
|
@@ -4579,7 +4572,7 @@ class Ku {
|
|
|
4579
4572
|
}, this.notifyQueryError = (d, c) => {
|
|
4580
4573
|
(this.queryCbs[d] || []).forEach((l) => l.cb({ error: c }));
|
|
4581
4574
|
}, this.pushTx = (d) => {
|
|
4582
|
-
this.config.disableValidation ||
|
|
4575
|
+
this.config.disableValidation || Tu(d, this.config.schema);
|
|
4583
4576
|
try {
|
|
4584
4577
|
const c = qa({
|
|
4585
4578
|
attrs: this.optimisticAttrs(),
|
|
@@ -4666,10 +4659,10 @@ class Ku {
|
|
|
4666
4659
|
return;
|
|
4667
4660
|
}
|
|
4668
4661
|
this._log.info("[socket][close]", c.id, "schedule reconnect, ms =", this._reconnectTimeoutMs), this._scheduleReconnect();
|
|
4669
|
-
}, this._EventSource = s, this.config = Object.assign(Object.assign({},
|
|
4662
|
+
}, this._EventSource = s, this.config = Object.assign(Object.assign({}, Mu), e), this.queryCacheLimit = (o = this.config.queryCacheLimit) !== null && o !== void 0 ? o : 10, this._pendingTxCleanupTimeout = (a = this.config.pendingTxCleanupTimeout) !== null && a !== void 0 ? a : Pu, this._pendingMutationCleanupThreshold = (u = this.config.pendingMutationCleanupThreshold) !== null && u !== void 0 ? u : Iu, this._log = fu(e.verbose || Bn || Wi, () => this._reactorStats()), this.versions = Object.assign(Object.assign({}, i || {}), { "@instantdb/core": Gn }), this.config.schema && (this._linkIndex = Kr(this.config.schema)), !!xu()) {
|
|
4670
4663
|
if (!e.appId)
|
|
4671
4664
|
throw new Error("Instant must be initialized with an appId.");
|
|
4672
|
-
if (!
|
|
4665
|
+
if (!Ne(e.appId))
|
|
4673
4666
|
throw new Error(`Instant must be initialized with a valid appId. \`${e.appId}\` is not a valid uuid.`);
|
|
4674
4667
|
typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) => F(this, void 0, void 0, function* () {
|
|
4675
4668
|
var c;
|
|
@@ -4681,7 +4674,7 @@ class Ku {
|
|
|
4681
4674
|
} catch (f) {
|
|
4682
4675
|
this._log.error("[error] handle broadcast channel", f);
|
|
4683
4676
|
}
|
|
4684
|
-
}))), this._initStorage(n), this._syncTable = new
|
|
4677
|
+
}))), this._initStorage(n), this._syncTable = new ku(this._trySendAuthed.bind(this), new n(this.config.appId, "syncSubs"), {
|
|
4685
4678
|
useDateObjects: this.config.useDateObjects
|
|
4686
4679
|
}, this._log, (d) => Et(this.attrs, d, this.config.enableCardinalityInference, this._linkIndex, this.config.useDateObjects)), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser(), r.getIsOnline().then((d) => {
|
|
4687
4680
|
this._isOnline = d, this._startSocket(), r.listen((c) => {
|
|
@@ -4704,11 +4697,11 @@ class Ku {
|
|
|
4704
4697
|
this.kv.waitForKeyToLoad("pendingMutations").then(() => this.notifyOne(e));
|
|
4705
4698
|
}
|
|
4706
4699
|
_initStorage(e) {
|
|
4707
|
-
this.querySubs = new
|
|
4700
|
+
this.querySubs = new Tn({
|
|
4708
4701
|
persister: new e(this.config.appId, "querySubs"),
|
|
4709
|
-
merge:
|
|
4710
|
-
serialize:
|
|
4711
|
-
parse: (n, r) =>
|
|
4702
|
+
merge: Fu,
|
|
4703
|
+
serialize: Du,
|
|
4704
|
+
parse: (n, r) => $u(r, this.config.useDateObjects),
|
|
4712
4705
|
// objectSize
|
|
4713
4706
|
objectSize: (n) => {
|
|
4714
4707
|
var r, i, s, o;
|
|
@@ -4724,11 +4717,11 @@ class Ku {
|
|
|
4724
4717
|
maxSize: 1e6
|
|
4725
4718
|
// 1 million triples
|
|
4726
4719
|
}
|
|
4727
|
-
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new
|
|
4720
|
+
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new Tn({
|
|
4728
4721
|
persister: new e(this.config.appId, "kv"),
|
|
4729
4722
|
merge: this._onMergeKv,
|
|
4730
|
-
serialize:
|
|
4731
|
-
parse:
|
|
4723
|
+
serialize: Lu,
|
|
4724
|
+
parse: Uu,
|
|
4732
4725
|
objectSize: () => 0,
|
|
4733
4726
|
logger: this._log,
|
|
4734
4727
|
saveThrottleMs: 100,
|
|
@@ -4737,7 +4730,7 @@ class Ku {
|
|
|
4737
4730
|
gc: null
|
|
4738
4731
|
}), this.kv.onKeyLoaded = (n) => {
|
|
4739
4732
|
n === "pendingMutations" && this.notifyAll();
|
|
4740
|
-
}, this.kv.waitForKeyToLoad("pendingMutations"), this.kv.waitForKeyToLoad(
|
|
4733
|
+
}, this.kv.waitForKeyToLoad("pendingMutations"), this.kv.waitForKeyToLoad(Qe), this._beforeUnloadCbs.push(() => {
|
|
4741
4734
|
this.kv.flush(), this.querySubs.flush();
|
|
4742
4735
|
});
|
|
4743
4736
|
}
|
|
@@ -4759,14 +4752,14 @@ class Ku {
|
|
|
4759
4752
|
if (s)
|
|
4760
4753
|
i.resolve({ status: e, eventId: n });
|
|
4761
4754
|
else if (r.type) {
|
|
4762
|
-
const { status: o } = r, a =
|
|
4755
|
+
const { status: o } = r, a = ju(r, ["status"]);
|
|
4763
4756
|
i.reject(new Dt({
|
|
4764
4757
|
// @ts-expect-error body.type is not constant typed
|
|
4765
4758
|
body: a,
|
|
4766
4759
|
status: o
|
|
4767
4760
|
}));
|
|
4768
4761
|
} else
|
|
4769
|
-
i.reject(new
|
|
4762
|
+
i.reject(new qe(r.message, r.hint));
|
|
4770
4763
|
}
|
|
4771
4764
|
_setStatus(e, n) {
|
|
4772
4765
|
this.status = e, this._errorMessage = n, this.notifyConnectionStatusSubs(e);
|
|
@@ -4800,14 +4793,14 @@ class Ku {
|
|
|
4800
4793
|
const { q: l, result: p } = n, y = V(l);
|
|
4801
4794
|
if (!this._hasQueryListeners() && !this.querySubs.currentValue[y])
|
|
4802
4795
|
break;
|
|
4803
|
-
const b = (o = (s = p == null ? void 0 : p[0]) === null || s === void 0 ? void 0 : s.data) === null || o === void 0 ? void 0 : o["page-info"], _ = (u = (a = p == null ? void 0 : p[0]) === null || a === void 0 ? void 0 : a.data) === null || u === void 0 ? void 0 : u.aggregate,
|
|
4796
|
+
const b = (o = (s = p == null ? void 0 : p[0]) === null || s === void 0 ? void 0 : s.data) === null || o === void 0 ? void 0 : o["page-info"], _ = (u = (a = p == null ? void 0 : p[0]) === null || a === void 0 ? void 0 : a.data) === null || u === void 0 ? void 0 : u.aggregate, T = Nr(p), w = Et(this.attrs, T, d, this._linkIndex, this.config.useDateObjects);
|
|
4804
4797
|
this.querySubs.updateInPlace((m) => {
|
|
4805
4798
|
if (!m[y]) {
|
|
4806
4799
|
this._log.info("Missing value in querySubs", { hash: y, q: l });
|
|
4807
4800
|
return;
|
|
4808
4801
|
}
|
|
4809
4802
|
m[y].result = {
|
|
4810
|
-
store:
|
|
4803
|
+
store: w,
|
|
4811
4804
|
pageInfo: b,
|
|
4812
4805
|
aggregate: _,
|
|
4813
4806
|
processedTxId: n["processed-tx-id"]
|
|
@@ -4835,24 +4828,24 @@ class Ku {
|
|
|
4835
4828
|
const { computations: l, attrs: p } = n, y = n["processed-tx-id"];
|
|
4836
4829
|
p && this._setAttrs(p), this._cleanupPendingMutationsTimeout();
|
|
4837
4830
|
const b = this._rewriteMutations(this.attrs, this._pendingMutations(), y);
|
|
4838
|
-
b !== this._pendingMutations() && this.kv.updateInPlace((
|
|
4839
|
-
|
|
4831
|
+
b !== this._pendingMutations() && this.kv.updateInPlace((w) => {
|
|
4832
|
+
w.pendingMutations = b;
|
|
4840
4833
|
});
|
|
4841
|
-
const _ = Xr(b.entries()),
|
|
4834
|
+
const _ = Xr(b.entries()), T = l.map((w) => {
|
|
4842
4835
|
var m, E, S, I;
|
|
4843
|
-
const
|
|
4844
|
-
return { q:
|
|
4836
|
+
const x = w["instaql-query"], q = w["instaql-result"], Te = V(x), lt = Nr(q), Ft = Et(this.attrs, lt, d, this._linkIndex, this.config.useDateObjects), Nt = this._applyOptimisticUpdates(Ft, _, y), ht = (E = (m = q == null ? void 0 : q[0]) === null || m === void 0 ? void 0 : m.data) === null || E === void 0 ? void 0 : E["page-info"], ce = (I = (S = q == null ? void 0 : q[0]) === null || S === void 0 ? void 0 : S.data) === null || I === void 0 ? void 0 : I.aggregate;
|
|
4837
|
+
return { q: x, hash: Te, store: Nt, pageInfo: ht, aggregate: ce };
|
|
4845
4838
|
});
|
|
4846
|
-
|
|
4847
|
-
this.querySubs.updateInPlace((
|
|
4848
|
-
if (!
|
|
4849
|
-
this._log.error("Missing value in querySubs", { hash:
|
|
4839
|
+
T.forEach(({ hash: w, q: m, store: E, pageInfo: S, aggregate: I }) => {
|
|
4840
|
+
this.querySubs.updateInPlace((x) => {
|
|
4841
|
+
if (!x[w]) {
|
|
4842
|
+
this._log.error("Missing value in querySubs", { hash: w, q: m });
|
|
4850
4843
|
return;
|
|
4851
4844
|
}
|
|
4852
|
-
|
|
4845
|
+
x[w].result = { store: E, pageInfo: S, aggregate: I, processedTxId: y };
|
|
4853
4846
|
});
|
|
4854
|
-
}), this._cleanupPendingMutationsQueries(),
|
|
4855
|
-
this.notifyOne(
|
|
4847
|
+
}), this._cleanupPendingMutationsQueries(), T.forEach(({ hash: w }) => {
|
|
4848
|
+
this.notifyOne(w);
|
|
4856
4849
|
});
|
|
4857
4850
|
break;
|
|
4858
4851
|
}
|
|
@@ -4862,10 +4855,10 @@ class Ku {
|
|
|
4862
4855
|
const b = this._rewriteMutations(this.attrs, this._pendingMutations()).get(l);
|
|
4863
4856
|
if (!b)
|
|
4864
4857
|
break;
|
|
4865
|
-
this._updatePendingMutations((
|
|
4866
|
-
|
|
4858
|
+
this._updatePendingMutations((T) => {
|
|
4859
|
+
T.set(l, Object.assign(Object.assign({}, T.get(l)), { "tx-id": p, confirmed: Date.now() }));
|
|
4867
4860
|
});
|
|
4868
|
-
const _ = b["tx-steps"].filter(([
|
|
4861
|
+
const _ = b["tx-steps"].filter(([T, ...w]) => T === "add-attr").map(([T, w]) => w).concat(Object.values(this.attrs));
|
|
4869
4862
|
this._setAttrs(_), this._finishTransaction("synced", l), this._cleanupPendingMutationsTimeout();
|
|
4870
4863
|
break;
|
|
4871
4864
|
}
|
|
@@ -5018,7 +5011,7 @@ class Ku {
|
|
|
5018
5011
|
if (!this.querySubs)
|
|
5019
5012
|
return i.reject(new Error("We can't run `queryOnce` on the backend. Use adminAPI.query instead: https://www.instantdb.com/docs/backend#query")), i.promise;
|
|
5020
5013
|
const s = V(e), o = this._startQuerySub(e, s);
|
|
5021
|
-
return this.queryOnceDfds[s] = (r = this.queryOnceDfds[s]) !== null && r !== void 0 ? r : [], this.queryOnceDfds[s].push({ q: e, dfd: i, eventId: o }), setTimeout(() => i.reject(new Error("Query timed out")),
|
|
5014
|
+
return this.queryOnceDfds[s] = (r = this.queryOnceDfds[s]) !== null && r !== void 0 ? r : [], this.queryOnceDfds[s].push({ q: e, dfd: i, eventId: o }), setTimeout(() => i.reject(new Error("Query timed out")), Cu), i.promise;
|
|
5022
5015
|
}
|
|
5023
5016
|
_completeQueryOnce(e, n, r) {
|
|
5024
5017
|
this.queryOnceDfds[n] && (this.queryOnceDfds[n] = this.queryOnceDfds[n].filter((i) => i.dfd !== r), this._cleanupQuery(e, n));
|
|
@@ -5062,15 +5055,15 @@ class Ku {
|
|
|
5062
5055
|
for (const p of c) {
|
|
5063
5056
|
const [y] = p;
|
|
5064
5057
|
if (y === "add-attr") {
|
|
5065
|
-
const [_,
|
|
5066
|
-
if (
|
|
5067
|
-
o.attrIdMap[
|
|
5058
|
+
const [_, T] = p, w = i(T);
|
|
5059
|
+
if (w && T.id !== w.id) {
|
|
5060
|
+
o.attrIdMap[T.id] = w.id, a = !0;
|
|
5068
5061
|
continue;
|
|
5069
5062
|
}
|
|
5070
|
-
if (
|
|
5071
|
-
const m = s(
|
|
5063
|
+
if (T["value-type"] === "ref") {
|
|
5064
|
+
const m = s(T);
|
|
5072
5065
|
if (m) {
|
|
5073
|
-
o.attrIdMap[
|
|
5066
|
+
o.attrIdMap[T.id] = m.id, o.refSwapAttrIds.add(T.id), a = !0;
|
|
5074
5067
|
continue;
|
|
5075
5068
|
}
|
|
5076
5069
|
}
|
|
@@ -5131,7 +5124,7 @@ class Ku {
|
|
|
5131
5124
|
}
|
|
5132
5125
|
_applyOptimisticUpdates(e, n, r) {
|
|
5133
5126
|
for (const [i, s] of n)
|
|
5134
|
-
(!s["tx-id"] || r && s["tx-id"] > r) && (e =
|
|
5127
|
+
(!s["tx-id"] || r && s["tx-id"] > r) && (e = wo(e, s["tx-steps"]));
|
|
5135
5128
|
return e;
|
|
5136
5129
|
}
|
|
5137
5130
|
/** Re-compute all subscriptions */
|
|
@@ -5240,7 +5233,7 @@ class Ku {
|
|
|
5240
5233
|
return;
|
|
5241
5234
|
}
|
|
5242
5235
|
const e = this._transport;
|
|
5243
|
-
this._transport =
|
|
5236
|
+
this._transport = Ru({
|
|
5244
5237
|
transportType: this._transportType,
|
|
5245
5238
|
appId: this.config.appId,
|
|
5246
5239
|
apiURI: this.config.apiURI,
|
|
@@ -5350,7 +5343,7 @@ class Ku {
|
|
|
5350
5343
|
return F(this, void 0, void 0, function* () {
|
|
5351
5344
|
const { user: e, error: n } = yield this.getCurrentUser();
|
|
5352
5345
|
if (n)
|
|
5353
|
-
throw new
|
|
5346
|
+
throw new qe("Could not get current user: " + n.message);
|
|
5354
5347
|
return e;
|
|
5355
5348
|
});
|
|
5356
5349
|
}
|
|
@@ -5382,8 +5375,8 @@ class Ku {
|
|
|
5382
5375
|
setCurrentUser(e) {
|
|
5383
5376
|
return F(this, void 0, void 0, function* () {
|
|
5384
5377
|
this.kv.updateInPlace((n) => {
|
|
5385
|
-
n[
|
|
5386
|
-
}), yield this.kv.waitForKeyToLoad(
|
|
5378
|
+
n[Qe] = e;
|
|
5379
|
+
}), yield this.kv.waitForKeyToLoad(Qe);
|
|
5387
5380
|
});
|
|
5388
5381
|
}
|
|
5389
5382
|
getCurrentUserCached() {
|
|
@@ -5391,7 +5384,7 @@ class Ku {
|
|
|
5391
5384
|
}
|
|
5392
5385
|
_getCurrentUser() {
|
|
5393
5386
|
return F(this, void 0, void 0, function* () {
|
|
5394
|
-
const e = yield this.kv.waitForKeyToLoad(
|
|
5387
|
+
const e = yield this.kv.waitForKeyToLoad(Qe);
|
|
5395
5388
|
return typeof e == "string" ? JSON.parse(e) : e;
|
|
5396
5389
|
});
|
|
5397
5390
|
}
|
|
@@ -5416,7 +5409,7 @@ class Ku {
|
|
|
5416
5409
|
}
|
|
5417
5410
|
_hasCurrentUser() {
|
|
5418
5411
|
return F(this, void 0, void 0, function* () {
|
|
5419
|
-
const e = yield this.kv.waitForKeyToLoad(
|
|
5412
|
+
const e = yield this.kv.waitForKeyToLoad(Qe);
|
|
5420
5413
|
return typeof e == "string" ? JSON.parse(e) != null : e != null;
|
|
5421
5414
|
});
|
|
5422
5415
|
}
|
|
@@ -5656,7 +5649,7 @@ class Ku {
|
|
|
5656
5649
|
Or(d, c, l);
|
|
5657
5650
|
break;
|
|
5658
5651
|
case "-":
|
|
5659
|
-
|
|
5652
|
+
Ti(d, c);
|
|
5660
5653
|
break;
|
|
5661
5654
|
}
|
|
5662
5655
|
delete d[this._sessionId];
|
|
@@ -5755,7 +5748,7 @@ class Ku {
|
|
|
5755
5748
|
});
|
|
5756
5749
|
}
|
|
5757
5750
|
}
|
|
5758
|
-
function
|
|
5751
|
+
function Ku(t, e) {
|
|
5759
5752
|
return new Lt(
|
|
5760
5753
|
Zi(t, e),
|
|
5761
5754
|
// (XXX): LinksDef<any> stems from TypeScript’s inability to reconcile the
|
|
@@ -5767,25 +5760,25 @@ function qu(t, e) {
|
|
|
5767
5760
|
void 0
|
|
5768
5761
|
);
|
|
5769
5762
|
}
|
|
5770
|
-
function
|
|
5763
|
+
function qu(t) {
|
|
5771
5764
|
return new Ut(t, {});
|
|
5772
5765
|
}
|
|
5773
|
-
function
|
|
5766
|
+
function Wu() {
|
|
5774
5767
|
return new H("string", !0, !1);
|
|
5775
5768
|
}
|
|
5776
|
-
function
|
|
5769
|
+
function zu() {
|
|
5777
5770
|
return new H("number", !0, !1);
|
|
5778
5771
|
}
|
|
5779
|
-
function
|
|
5772
|
+
function Vu() {
|
|
5780
5773
|
return new H("boolean", !0, !1);
|
|
5781
5774
|
}
|
|
5782
|
-
function
|
|
5775
|
+
function Bu() {
|
|
5783
5776
|
return new H("date", !0, !1);
|
|
5784
5777
|
}
|
|
5785
|
-
function
|
|
5778
|
+
function Gu() {
|
|
5786
5779
|
return new H("json", !0, !1);
|
|
5787
5780
|
}
|
|
5788
|
-
function
|
|
5781
|
+
function Qu() {
|
|
5789
5782
|
return new H("json", !0, !1);
|
|
5790
5783
|
}
|
|
5791
5784
|
function Zi(t, e) {
|
|
@@ -5804,7 +5797,7 @@ function Zi(t, e) {
|
|
|
5804
5797
|
new Ut(d.attrs, Object.assign(Object.assign({}, o.fwd[u]), o.rev[u]))
|
|
5805
5798
|
]));
|
|
5806
5799
|
}
|
|
5807
|
-
function
|
|
5800
|
+
function Hu({ entities: t, links: e, rooms: n }) {
|
|
5808
5801
|
const r = e ?? {}, i = n ?? {};
|
|
5809
5802
|
return new Lt(
|
|
5810
5803
|
Zi(t, r),
|
|
@@ -5817,23 +5810,23 @@ function Yu({ entities: t, links: e, rooms: n }) {
|
|
|
5817
5810
|
i
|
|
5818
5811
|
);
|
|
5819
5812
|
}
|
|
5820
|
-
const
|
|
5813
|
+
const Nc = {
|
|
5821
5814
|
// constructs
|
|
5822
|
-
graph:
|
|
5823
|
-
schema:
|
|
5824
|
-
entity:
|
|
5815
|
+
graph: Ku,
|
|
5816
|
+
schema: Hu,
|
|
5817
|
+
entity: qu,
|
|
5825
5818
|
// value types
|
|
5826
|
-
string:
|
|
5827
|
-
number:
|
|
5828
|
-
boolean:
|
|
5829
|
-
date:
|
|
5830
|
-
json:
|
|
5831
|
-
any:
|
|
5819
|
+
string: Wu,
|
|
5820
|
+
number: zu,
|
|
5821
|
+
boolean: Vu,
|
|
5822
|
+
date: Bu,
|
|
5823
|
+
json: Gu,
|
|
5824
|
+
any: Qu
|
|
5832
5825
|
};
|
|
5833
5826
|
let mt;
|
|
5834
|
-
function
|
|
5827
|
+
function Yu(t, e) {
|
|
5835
5828
|
mt == null || mt.dispose();
|
|
5836
|
-
const n =
|
|
5829
|
+
const n = nc(e), r = Xu(e, a), i = Zu(Ju(t));
|
|
5837
5830
|
function s(c) {
|
|
5838
5831
|
var f;
|
|
5839
5832
|
c.source === i.element.contentWindow && ((f = c.data) === null || f === void 0 ? void 0 : f.type) === "close" && n.isVisible() && a();
|
|
@@ -5855,10 +5848,10 @@ function Ju(t, e) {
|
|
|
5855
5848
|
}
|
|
5856
5849
|
return d();
|
|
5857
5850
|
}
|
|
5858
|
-
function
|
|
5851
|
+
function Ju(t) {
|
|
5859
5852
|
return `${Bn || zi ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
|
|
5860
5853
|
}
|
|
5861
|
-
function
|
|
5854
|
+
function Zu(t) {
|
|
5862
5855
|
const e = document.createElement("iframe");
|
|
5863
5856
|
return e.src = t, e.className = "instant-devtool-iframe", Object.assign(e.style, {
|
|
5864
5857
|
width: "100%",
|
|
@@ -5867,7 +5860,7 @@ function Xu(t) {
|
|
|
5867
5860
|
border: "none"
|
|
5868
5861
|
}), { element: e };
|
|
5869
5862
|
}
|
|
5870
|
-
function
|
|
5863
|
+
function Xu(t, e) {
|
|
5871
5864
|
const n = `
|
|
5872
5865
|
<svg width="32" height="32" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5873
5866
|
<rect width="512" height="512" fill="black"/>
|
|
@@ -5877,7 +5870,7 @@ function ec(t, e) {
|
|
|
5877
5870
|
return r.innerHTML = n, r.className = "instant-devtool-toggler", Object.assign(r.style, Object.assign(Object.assign({
|
|
5878
5871
|
// pos
|
|
5879
5872
|
position: "fixed"
|
|
5880
|
-
},
|
|
5873
|
+
}, ec(t.position)), {
|
|
5881
5874
|
height: "32px",
|
|
5882
5875
|
width: "32px",
|
|
5883
5876
|
// layout
|
|
@@ -5892,7 +5885,7 @@ function ec(t, e) {
|
|
|
5892
5885
|
cursor: "pointer"
|
|
5893
5886
|
})), r.addEventListener("click", e), { element: r };
|
|
5894
5887
|
}
|
|
5895
|
-
function
|
|
5888
|
+
function ec(t) {
|
|
5896
5889
|
switch (t) {
|
|
5897
5890
|
case "bottom-left":
|
|
5898
5891
|
return { bottom: "24px", left: "24px" };
|
|
@@ -5904,7 +5897,7 @@ function tc(t) {
|
|
|
5904
5897
|
return { top: "24px", left: "24px" };
|
|
5905
5898
|
}
|
|
5906
5899
|
}
|
|
5907
|
-
function
|
|
5900
|
+
function tc(t) {
|
|
5908
5901
|
switch (t) {
|
|
5909
5902
|
case "bottom-left":
|
|
5910
5903
|
return { bottom: "24px", right: "24px", left: "60px", top: "72px" };
|
|
@@ -5916,23 +5909,23 @@ function nc(t) {
|
|
|
5916
5909
|
return { top: "24px", right: "24px", left: "60px", bottom: "72px" };
|
|
5917
5910
|
}
|
|
5918
5911
|
}
|
|
5919
|
-
function
|
|
5912
|
+
function nc(t) {
|
|
5920
5913
|
const e = document.createElement("div");
|
|
5921
|
-
Object.assign(e.style, Object.assign(Object.assign({ position: "fixed" },
|
|
5914
|
+
Object.assign(e.style, Object.assign(Object.assign({ position: "fixed" }, tc(t.position)), { display: "block", borderRadius: "4px", border: "1px #ccc solid", boxShadow: "0px 0px 8px #00000044", backgroundColor: "#eee", zIndex: "999990" })), e.style.display = "none", e.className = "instant-devtool-container";
|
|
5922
5915
|
function n() {
|
|
5923
5916
|
return e.style.display !== "none";
|
|
5924
5917
|
}
|
|
5925
5918
|
return { element: e, isVisible: n };
|
|
5926
5919
|
}
|
|
5927
|
-
const
|
|
5920
|
+
const rc = {
|
|
5928
5921
|
apiURI: "https://api.instantdb.com",
|
|
5929
5922
|
websocketURI: "wss://api.instantdb.com/runtime/session"
|
|
5930
5923
|
};
|
|
5931
|
-
function
|
|
5924
|
+
function ic() {
|
|
5932
5925
|
var t;
|
|
5933
5926
|
return globalThis.__instantDbSchemaHashStore = (t = globalThis.__instantDbSchemaHashStore) !== null && t !== void 0 ? t : /* @__PURE__ */ new WeakMap(), globalThis.__instantDbSchemaHashStore;
|
|
5934
5927
|
}
|
|
5935
|
-
function
|
|
5928
|
+
function sc() {
|
|
5936
5929
|
var t;
|
|
5937
5930
|
return globalThis.__instantDbStore = (t = globalThis.__instantDbStore) !== null && t !== void 0 ? t : {}, globalThis.__instantDbStore;
|
|
5938
5931
|
}
|
|
@@ -5940,23 +5933,23 @@ function mn(t) {
|
|
|
5940
5933
|
const e = t.__adminToken;
|
|
5941
5934
|
return t.appId + "_" + (t.websocketURI || "default_ws_uri") + "_" + (t.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + t.useDateObjects;
|
|
5942
5935
|
}
|
|
5943
|
-
const vn =
|
|
5944
|
-
class
|
|
5936
|
+
const vn = sc(), en = ic();
|
|
5937
|
+
class oc {
|
|
5945
5938
|
constructor(e) {
|
|
5946
5939
|
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);
|
|
5947
5940
|
}
|
|
5948
5941
|
}
|
|
5949
|
-
class
|
|
5942
|
+
class ac {
|
|
5950
5943
|
constructor(e) {
|
|
5951
5944
|
this.db = e, this.uploadFile = (n, r, i = {}) => this.db.uploadFile(n, r, i), 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);
|
|
5952
5945
|
}
|
|
5953
5946
|
}
|
|
5954
|
-
function
|
|
5947
|
+
function uc(t) {
|
|
5955
5948
|
return JSON.parse(JSON.stringify(t));
|
|
5956
5949
|
}
|
|
5957
|
-
class
|
|
5950
|
+
class cc {
|
|
5958
5951
|
constructor(e) {
|
|
5959
|
-
this.tx = Vn(), this._reactor = e, this.auth = new
|
|
5952
|
+
this.tx = Vn(), this._reactor = e, this.auth = new oc(this._reactor), this.storage = new ac(this._reactor);
|
|
5960
5953
|
}
|
|
5961
5954
|
/**
|
|
5962
5955
|
* Use this to write data! You can create, update, delete, and link objects
|
|
@@ -6138,23 +6131,23 @@ function ei(t) {
|
|
|
6138
6131
|
const e = V(t);
|
|
6139
6132
|
return en.set(t, e), e;
|
|
6140
6133
|
}
|
|
6141
|
-
function
|
|
6134
|
+
function dc(t, e) {
|
|
6142
6135
|
return ei(t._reactor.config.schema) !== ei(e);
|
|
6143
6136
|
}
|
|
6144
|
-
function
|
|
6137
|
+
function fc(t, e, n, r, i) {
|
|
6145
6138
|
const s = vn[mn(t)];
|
|
6146
6139
|
if (s)
|
|
6147
|
-
return
|
|
6148
|
-
const o = new
|
|
6149
|
-
return vn[mn(t)] = a,
|
|
6140
|
+
return dc(s, t.schema) && s._reactor.updateSchema(t.schema), s;
|
|
6141
|
+
const o = new Nu(Object.assign(Object.assign(Object.assign({}, rc), t), { cardinalityInference: !!t.schema }), e || Ki, n || qi, Object.assign(Object.assign({}, r || {}), { "@instantdb/core": Gn }), i), a = new cc(o);
|
|
6142
|
+
return vn[mn(t)] = a, lc(t.appId, t.devtool), a;
|
|
6150
6143
|
}
|
|
6151
|
-
function
|
|
6144
|
+
function lc(t, e) {
|
|
6152
6145
|
if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
|
|
6153
6146
|
return;
|
|
6154
6147
|
const n = Object.assign({ position: "bottom-right", allowedHosts: ["localhost"] }, typeof e == "object" ? e : {});
|
|
6155
|
-
n.allowedHosts.includes(window.location.hostname) &&
|
|
6148
|
+
n.allowedHosts.includes(window.location.hostname) && Yu(t, n);
|
|
6156
6149
|
}
|
|
6157
|
-
var Sn = { exports: {} },
|
|
6150
|
+
var Sn = { exports: {} }, He = {};
|
|
6158
6151
|
/**
|
|
6159
6152
|
* @license React
|
|
6160
6153
|
* react-jsx-runtime.production.min.js
|
|
@@ -6165,8 +6158,8 @@ var Sn = { exports: {} }, Ye = {};
|
|
|
6165
6158
|
* LICENSE file in the root directory of this source tree.
|
|
6166
6159
|
*/
|
|
6167
6160
|
var ti;
|
|
6168
|
-
function
|
|
6169
|
-
if (ti) return
|
|
6161
|
+
function hc() {
|
|
6162
|
+
if (ti) return He;
|
|
6170
6163
|
ti = 1;
|
|
6171
6164
|
var t = ci, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
6172
6165
|
function o(a, u, d) {
|
|
@@ -6176,11 +6169,11 @@ function pc() {
|
|
|
6176
6169
|
if (a && a.defaultProps) for (c in u = a.defaultProps, u) f[c] === void 0 && (f[c] = u[c]);
|
|
6177
6170
|
return { $$typeof: e, type: a, key: l, ref: p, props: f, _owner: i.current };
|
|
6178
6171
|
}
|
|
6179
|
-
return
|
|
6172
|
+
return He.Fragment = n, He.jsx = o, He.jsxs = o, He;
|
|
6180
6173
|
}
|
|
6181
|
-
var
|
|
6182
|
-
function
|
|
6183
|
-
if (ni) return
|
|
6174
|
+
var Ye = {}, ni;
|
|
6175
|
+
function pc() {
|
|
6176
|
+
if (ni) return Ye;
|
|
6184
6177
|
ni = 1;
|
|
6185
6178
|
var t = {};
|
|
6186
6179
|
/**
|
|
@@ -6194,44 +6187,44 @@ function yc() {
|
|
|
6194
6187
|
*/
|
|
6195
6188
|
return t.NODE_ENV !== "production" && function() {
|
|
6196
6189
|
var e = ci, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), u = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), b = Symbol.iterator, _ = "@@iterator";
|
|
6197
|
-
function
|
|
6190
|
+
function T(h) {
|
|
6198
6191
|
if (h === null || typeof h != "object")
|
|
6199
6192
|
return null;
|
|
6200
|
-
var
|
|
6201
|
-
return typeof
|
|
6193
|
+
var g = b && h[b] || h[_];
|
|
6194
|
+
return typeof g == "function" ? g : null;
|
|
6202
6195
|
}
|
|
6203
|
-
var
|
|
6196
|
+
var w = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
6204
6197
|
function m(h) {
|
|
6205
6198
|
{
|
|
6206
|
-
for (var
|
|
6199
|
+
for (var g = arguments.length, v = new Array(g > 1 ? g - 1 : 0), O = 1; O < g; O++)
|
|
6207
6200
|
v[O - 1] = arguments[O];
|
|
6208
6201
|
E("error", h, v);
|
|
6209
6202
|
}
|
|
6210
6203
|
}
|
|
6211
|
-
function E(h,
|
|
6204
|
+
function E(h, g, v) {
|
|
6212
6205
|
{
|
|
6213
|
-
var O =
|
|
6214
|
-
P !== "" && (
|
|
6206
|
+
var O = w.ReactDebugCurrentFrame, P = O.getStackAddendum();
|
|
6207
|
+
P !== "" && (g += "%s", v = v.concat([P]));
|
|
6215
6208
|
var M = v.map(function(C) {
|
|
6216
6209
|
return String(C);
|
|
6217
6210
|
});
|
|
6218
|
-
M.unshift("Warning: " +
|
|
6211
|
+
M.unshift("Warning: " + g), Function.prototype.apply.call(console[h], console, M);
|
|
6219
6212
|
}
|
|
6220
6213
|
}
|
|
6221
|
-
var S = !1, I = !1,
|
|
6222
|
-
|
|
6214
|
+
var S = !1, I = !1, x = !1, q = !1, Te = !1, lt;
|
|
6215
|
+
lt = Symbol.for("react.module.reference");
|
|
6223
6216
|
function Ft(h) {
|
|
6224
|
-
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o ||
|
|
6217
|
+
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o || Te || h === s || h === c || h === f || q || h === y || S || I || x || typeof h == "object" && h !== null && (h.$$typeof === p || h.$$typeof === l || h.$$typeof === a || h.$$typeof === u || h.$$typeof === d || // This needs to include all possible module reference object
|
|
6225
6218
|
// types supported by any Flight configuration anywhere since
|
|
6226
6219
|
// we don't know which Flight build this will end up being used
|
|
6227
6220
|
// with.
|
|
6228
|
-
h.$$typeof ===
|
|
6221
|
+
h.$$typeof === lt || h.getModuleId !== void 0));
|
|
6229
6222
|
}
|
|
6230
|
-
function Nt(h,
|
|
6223
|
+
function Nt(h, g, v) {
|
|
6231
6224
|
var O = h.displayName;
|
|
6232
6225
|
if (O)
|
|
6233
6226
|
return O;
|
|
6234
|
-
var P =
|
|
6227
|
+
var P = g.displayName || g.name || "";
|
|
6235
6228
|
return P !== "" ? v + "(" + P + ")" : v;
|
|
6236
6229
|
}
|
|
6237
6230
|
function ht(h) {
|
|
@@ -6261,8 +6254,8 @@ function yc() {
|
|
|
6261
6254
|
if (typeof h == "object")
|
|
6262
6255
|
switch (h.$$typeof) {
|
|
6263
6256
|
case u:
|
|
6264
|
-
var
|
|
6265
|
-
return ht(
|
|
6257
|
+
var g = h;
|
|
6258
|
+
return ht(g) + ".Consumer";
|
|
6266
6259
|
case a:
|
|
6267
6260
|
var v = h;
|
|
6268
6261
|
return ht(v._context) + ".Provider";
|
|
@@ -6282,13 +6275,13 @@ function yc() {
|
|
|
6282
6275
|
}
|
|
6283
6276
|
return null;
|
|
6284
6277
|
}
|
|
6285
|
-
var me = Object.assign,
|
|
6278
|
+
var me = Object.assign, Be = 0, Yn, Jn, Zn, Xn, er, tr, nr;
|
|
6286
6279
|
function rr() {
|
|
6287
6280
|
}
|
|
6288
6281
|
rr.__reactDisabledLog = !0;
|
|
6289
6282
|
function es() {
|
|
6290
6283
|
{
|
|
6291
|
-
if (
|
|
6284
|
+
if (Be === 0) {
|
|
6292
6285
|
Yn = console.log, Jn = console.info, Zn = console.warn, Xn = console.error, er = console.group, tr = console.groupCollapsed, nr = console.groupEnd;
|
|
6293
6286
|
var h = {
|
|
6294
6287
|
configurable: !0,
|
|
@@ -6306,12 +6299,12 @@ function yc() {
|
|
|
6306
6299
|
groupEnd: h
|
|
6307
6300
|
});
|
|
6308
6301
|
}
|
|
6309
|
-
|
|
6302
|
+
Be++;
|
|
6310
6303
|
}
|
|
6311
6304
|
}
|
|
6312
6305
|
function ts() {
|
|
6313
6306
|
{
|
|
6314
|
-
if (
|
|
6307
|
+
if (Be--, Be === 0) {
|
|
6315
6308
|
var h = {
|
|
6316
6309
|
configurable: !0,
|
|
6317
6310
|
enumerable: !0,
|
|
@@ -6341,11 +6334,11 @@ function yc() {
|
|
|
6341
6334
|
})
|
|
6342
6335
|
});
|
|
6343
6336
|
}
|
|
6344
|
-
|
|
6337
|
+
Be < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
6345
6338
|
}
|
|
6346
6339
|
}
|
|
6347
|
-
var Kt =
|
|
6348
|
-
function pt(h,
|
|
6340
|
+
var Kt = w.ReactCurrentDispatcher, qt;
|
|
6341
|
+
function pt(h, g, v) {
|
|
6349
6342
|
{
|
|
6350
6343
|
if (qt === void 0)
|
|
6351
6344
|
try {
|
|
@@ -6363,7 +6356,7 @@ function yc() {
|
|
|
6363
6356
|
var ns = typeof WeakMap == "function" ? WeakMap : Map;
|
|
6364
6357
|
yt = new ns();
|
|
6365
6358
|
}
|
|
6366
|
-
function ir(h,
|
|
6359
|
+
function ir(h, g) {
|
|
6367
6360
|
if (!h || Wt)
|
|
6368
6361
|
return "";
|
|
6369
6362
|
{
|
|
@@ -6378,7 +6371,7 @@ function yc() {
|
|
|
6378
6371
|
var M;
|
|
6379
6372
|
M = Kt.current, Kt.current = null, es();
|
|
6380
6373
|
try {
|
|
6381
|
-
if (
|
|
6374
|
+
if (g) {
|
|
6382
6375
|
var C = function() {
|
|
6383
6376
|
throw Error();
|
|
6384
6377
|
};
|
|
@@ -6431,17 +6424,17 @@ function yc() {
|
|
|
6431
6424
|
} finally {
|
|
6432
6425
|
Wt = !1, Kt.current = M, ts(), Error.prepareStackTrace = P;
|
|
6433
6426
|
}
|
|
6434
|
-
var
|
|
6427
|
+
var Me = h ? h.displayName || h.name : "", ve = Me ? pt(Me) : "";
|
|
6435
6428
|
return typeof h == "function" && yt.set(h, ve), ve;
|
|
6436
6429
|
}
|
|
6437
|
-
function rs(h,
|
|
6430
|
+
function rs(h, g, v) {
|
|
6438
6431
|
return ir(h, !1);
|
|
6439
6432
|
}
|
|
6440
6433
|
function is(h) {
|
|
6441
|
-
var
|
|
6442
|
-
return !!(
|
|
6434
|
+
var g = h.prototype;
|
|
6435
|
+
return !!(g && g.isReactComponent);
|
|
6443
6436
|
}
|
|
6444
|
-
function bt(h,
|
|
6437
|
+
function bt(h, g, v) {
|
|
6445
6438
|
if (h == null)
|
|
6446
6439
|
return "";
|
|
6447
6440
|
if (typeof h == "function")
|
|
@@ -6459,28 +6452,28 @@ function yc() {
|
|
|
6459
6452
|
case d:
|
|
6460
6453
|
return rs(h.render);
|
|
6461
6454
|
case l:
|
|
6462
|
-
return bt(h.type,
|
|
6455
|
+
return bt(h.type, g, v);
|
|
6463
6456
|
case p: {
|
|
6464
6457
|
var O = h, P = O._payload, M = O._init;
|
|
6465
6458
|
try {
|
|
6466
|
-
return bt(M(P),
|
|
6459
|
+
return bt(M(P), g, v);
|
|
6467
6460
|
} catch {
|
|
6468
6461
|
}
|
|
6469
6462
|
}
|
|
6470
6463
|
}
|
|
6471
6464
|
return "";
|
|
6472
6465
|
}
|
|
6473
|
-
var
|
|
6466
|
+
var Ge = Object.prototype.hasOwnProperty, sr = {}, or = w.ReactDebugCurrentFrame;
|
|
6474
6467
|
function _t(h) {
|
|
6475
6468
|
if (h) {
|
|
6476
|
-
var
|
|
6469
|
+
var g = h._owner, v = bt(h.type, h._source, g ? g.type : null);
|
|
6477
6470
|
or.setExtraStackFrame(v);
|
|
6478
6471
|
} else
|
|
6479
6472
|
or.setExtraStackFrame(null);
|
|
6480
6473
|
}
|
|
6481
|
-
function ss(h,
|
|
6474
|
+
function ss(h, g, v, O, P) {
|
|
6482
6475
|
{
|
|
6483
|
-
var M = Function.call.bind(
|
|
6476
|
+
var M = Function.call.bind(Ge);
|
|
6484
6477
|
for (var C in h)
|
|
6485
6478
|
if (M(h, C)) {
|
|
6486
6479
|
var k = void 0;
|
|
@@ -6489,7 +6482,7 @@ function yc() {
|
|
|
6489
6482
|
var G = Error((O || "React class") + ": " + v + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
6490
6483
|
throw G.name = "Invariant Violation", G;
|
|
6491
6484
|
}
|
|
6492
|
-
k = h[C](
|
|
6485
|
+
k = h[C](g, C, O, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
6493
6486
|
} catch (D) {
|
|
6494
6487
|
k = D;
|
|
6495
6488
|
}
|
|
@@ -6503,7 +6496,7 @@ function yc() {
|
|
|
6503
6496
|
}
|
|
6504
6497
|
function as(h) {
|
|
6505
6498
|
{
|
|
6506
|
-
var
|
|
6499
|
+
var g = typeof Symbol == "function" && Symbol.toStringTag, v = g && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
6507
6500
|
return v;
|
|
6508
6501
|
}
|
|
6509
6502
|
}
|
|
@@ -6521,35 +6514,35 @@ function yc() {
|
|
|
6521
6514
|
if (us(h))
|
|
6522
6515
|
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", as(h)), ar(h);
|
|
6523
6516
|
}
|
|
6524
|
-
var cr =
|
|
6517
|
+
var cr = w.ReactCurrentOwner, cs = {
|
|
6525
6518
|
key: !0,
|
|
6526
6519
|
ref: !0,
|
|
6527
6520
|
__self: !0,
|
|
6528
6521
|
__source: !0
|
|
6529
6522
|
}, dr, fr;
|
|
6530
6523
|
function ds(h) {
|
|
6531
|
-
if (
|
|
6532
|
-
var
|
|
6533
|
-
if (
|
|
6524
|
+
if (Ge.call(h, "ref")) {
|
|
6525
|
+
var g = Object.getOwnPropertyDescriptor(h, "ref").get;
|
|
6526
|
+
if (g && g.isReactWarning)
|
|
6534
6527
|
return !1;
|
|
6535
6528
|
}
|
|
6536
6529
|
return h.ref !== void 0;
|
|
6537
6530
|
}
|
|
6538
6531
|
function fs(h) {
|
|
6539
|
-
if (
|
|
6540
|
-
var
|
|
6541
|
-
if (
|
|
6532
|
+
if (Ge.call(h, "key")) {
|
|
6533
|
+
var g = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
6534
|
+
if (g && g.isReactWarning)
|
|
6542
6535
|
return !1;
|
|
6543
6536
|
}
|
|
6544
6537
|
return h.key !== void 0;
|
|
6545
6538
|
}
|
|
6546
|
-
function ls(h,
|
|
6539
|
+
function ls(h, g) {
|
|
6547
6540
|
typeof h.ref == "string" && cr.current;
|
|
6548
6541
|
}
|
|
6549
|
-
function hs(h,
|
|
6542
|
+
function hs(h, g) {
|
|
6550
6543
|
{
|
|
6551
6544
|
var v = function() {
|
|
6552
|
-
dr || (dr = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
6545
|
+
dr || (dr = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
|
6553
6546
|
};
|
|
6554
6547
|
v.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
6555
6548
|
get: v,
|
|
@@ -6557,10 +6550,10 @@ function yc() {
|
|
|
6557
6550
|
});
|
|
6558
6551
|
}
|
|
6559
6552
|
}
|
|
6560
|
-
function ps(h,
|
|
6553
|
+
function ps(h, g) {
|
|
6561
6554
|
{
|
|
6562
6555
|
var v = function() {
|
|
6563
|
-
fr || (fr = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
6556
|
+
fr || (fr = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
|
6564
6557
|
};
|
|
6565
6558
|
v.isReactWarning = !0, Object.defineProperty(h, "ref", {
|
|
6566
6559
|
get: v,
|
|
@@ -6568,13 +6561,13 @@ function yc() {
|
|
|
6568
6561
|
});
|
|
6569
6562
|
}
|
|
6570
6563
|
}
|
|
6571
|
-
var ys = function(h,
|
|
6564
|
+
var ys = function(h, g, v, O, P, M, C) {
|
|
6572
6565
|
var k = {
|
|
6573
6566
|
// This tag allows us to uniquely identify this as a React Element
|
|
6574
6567
|
$$typeof: n,
|
|
6575
6568
|
// Built-in properties that belong on the element
|
|
6576
6569
|
type: h,
|
|
6577
|
-
key:
|
|
6570
|
+
key: g,
|
|
6578
6571
|
ref: v,
|
|
6579
6572
|
props: C,
|
|
6580
6573
|
// Record the component responsible for creating this element.
|
|
@@ -6597,12 +6590,12 @@ function yc() {
|
|
|
6597
6590
|
value: P
|
|
6598
6591
|
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
|
|
6599
6592
|
};
|
|
6600
|
-
function bs(h,
|
|
6593
|
+
function bs(h, g, v, O, P) {
|
|
6601
6594
|
{
|
|
6602
6595
|
var M, C = {}, k = null, G = null;
|
|
6603
|
-
v !== void 0 && (ur(v), k = "" + v), fs(
|
|
6604
|
-
for (M in
|
|
6605
|
-
|
|
6596
|
+
v !== void 0 && (ur(v), k = "" + v), fs(g) && (ur(g.key), k = "" + g.key), ds(g) && (G = g.ref, ls(g, P));
|
|
6597
|
+
for (M in g)
|
|
6598
|
+
Ge.call(g, M) && !cs.hasOwnProperty(M) && (C[M] = g[M]);
|
|
6606
6599
|
if (h && h.defaultProps) {
|
|
6607
6600
|
var D = h.defaultProps;
|
|
6608
6601
|
for (M in D)
|
|
@@ -6615,10 +6608,10 @@ function yc() {
|
|
|
6615
6608
|
return ys(h, k, G, P, O, cr.current, C);
|
|
6616
6609
|
}
|
|
6617
6610
|
}
|
|
6618
|
-
var Vt =
|
|
6619
|
-
function
|
|
6611
|
+
var Vt = w.ReactCurrentOwner, lr = w.ReactDebugCurrentFrame;
|
|
6612
|
+
function Ie(h) {
|
|
6620
6613
|
if (h) {
|
|
6621
|
-
var
|
|
6614
|
+
var g = h._owner, v = bt(h.type, h._source, g ? g.type : null);
|
|
6622
6615
|
lr.setExtraStackFrame(v);
|
|
6623
6616
|
} else
|
|
6624
6617
|
lr.setExtraStackFrame(null);
|
|
@@ -6646,87 +6639,87 @@ Check the render method of \`` + h + "`.";
|
|
|
6646
6639
|
var pr = {};
|
|
6647
6640
|
function gs(h) {
|
|
6648
6641
|
{
|
|
6649
|
-
var
|
|
6650
|
-
if (!
|
|
6642
|
+
var g = hr();
|
|
6643
|
+
if (!g) {
|
|
6651
6644
|
var v = typeof h == "string" ? h : h.displayName || h.name;
|
|
6652
|
-
v && (
|
|
6645
|
+
v && (g = `
|
|
6653
6646
|
|
|
6654
6647
|
Check the top-level render call using <` + v + ">.");
|
|
6655
6648
|
}
|
|
6656
|
-
return
|
|
6649
|
+
return g;
|
|
6657
6650
|
}
|
|
6658
6651
|
}
|
|
6659
|
-
function yr(h,
|
|
6652
|
+
function yr(h, g) {
|
|
6660
6653
|
{
|
|
6661
6654
|
if (!h._store || h._store.validated || h.key != null)
|
|
6662
6655
|
return;
|
|
6663
6656
|
h._store.validated = !0;
|
|
6664
|
-
var v = gs(
|
|
6657
|
+
var v = gs(g);
|
|
6665
6658
|
if (pr[v])
|
|
6666
6659
|
return;
|
|
6667
6660
|
pr[v] = !0;
|
|
6668
6661
|
var O = "";
|
|
6669
|
-
h && h._owner && h._owner !== Vt.current && (O = " It was passed a child from " + ce(h._owner.type) + "."),
|
|
6662
|
+
h && h._owner && h._owner !== Vt.current && (O = " It was passed a child from " + ce(h._owner.type) + "."), Ie(h), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, O), Ie(null);
|
|
6670
6663
|
}
|
|
6671
6664
|
}
|
|
6672
|
-
function br(h,
|
|
6665
|
+
function br(h, g) {
|
|
6673
6666
|
{
|
|
6674
6667
|
if (typeof h != "object")
|
|
6675
6668
|
return;
|
|
6676
6669
|
if (zt(h))
|
|
6677
6670
|
for (var v = 0; v < h.length; v++) {
|
|
6678
6671
|
var O = h[v];
|
|
6679
|
-
Gt(O) && yr(O,
|
|
6672
|
+
Gt(O) && yr(O, g);
|
|
6680
6673
|
}
|
|
6681
6674
|
else if (Gt(h))
|
|
6682
6675
|
h._store && (h._store.validated = !0);
|
|
6683
6676
|
else if (h) {
|
|
6684
|
-
var P =
|
|
6677
|
+
var P = T(h);
|
|
6685
6678
|
if (typeof P == "function" && P !== h.entries)
|
|
6686
6679
|
for (var M = P.call(h), C; !(C = M.next()).done; )
|
|
6687
|
-
Gt(C.value) && yr(C.value,
|
|
6680
|
+
Gt(C.value) && yr(C.value, g);
|
|
6688
6681
|
}
|
|
6689
6682
|
}
|
|
6690
6683
|
}
|
|
6691
|
-
function
|
|
6684
|
+
function ws(h) {
|
|
6692
6685
|
{
|
|
6693
|
-
var
|
|
6694
|
-
if (
|
|
6686
|
+
var g = h.type;
|
|
6687
|
+
if (g == null || typeof g == "string")
|
|
6695
6688
|
return;
|
|
6696
6689
|
var v;
|
|
6697
|
-
if (typeof
|
|
6698
|
-
v =
|
|
6699
|
-
else if (typeof
|
|
6690
|
+
if (typeof g == "function")
|
|
6691
|
+
v = g.propTypes;
|
|
6692
|
+
else if (typeof g == "object" && (g.$$typeof === d || // Note: Memo only checks outer props here.
|
|
6700
6693
|
// Inner props are checked in the reconciler.
|
|
6701
|
-
|
|
6702
|
-
v =
|
|
6694
|
+
g.$$typeof === l))
|
|
6695
|
+
v = g.propTypes;
|
|
6703
6696
|
else
|
|
6704
6697
|
return;
|
|
6705
6698
|
if (v) {
|
|
6706
|
-
var O = ce(
|
|
6699
|
+
var O = ce(g);
|
|
6707
6700
|
ss(v, h.props, "prop", O, h);
|
|
6708
|
-
} else if (
|
|
6701
|
+
} else if (g.PropTypes !== void 0 && !Bt) {
|
|
6709
6702
|
Bt = !0;
|
|
6710
|
-
var P = ce(
|
|
6703
|
+
var P = ce(g);
|
|
6711
6704
|
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
|
|
6712
6705
|
}
|
|
6713
|
-
typeof
|
|
6706
|
+
typeof g.getDefaultProps == "function" && !g.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
6714
6707
|
}
|
|
6715
6708
|
}
|
|
6716
|
-
function
|
|
6709
|
+
function Ts(h) {
|
|
6717
6710
|
{
|
|
6718
|
-
for (var
|
|
6719
|
-
var O =
|
|
6711
|
+
for (var g = Object.keys(h.props), v = 0; v < g.length; v++) {
|
|
6712
|
+
var O = g[v];
|
|
6720
6713
|
if (O !== "children" && O !== "key") {
|
|
6721
|
-
|
|
6714
|
+
Ie(h), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", O), Ie(null);
|
|
6722
6715
|
break;
|
|
6723
6716
|
}
|
|
6724
6717
|
}
|
|
6725
|
-
h.ref !== null && (
|
|
6718
|
+
h.ref !== null && (Ie(h), m("Invalid attribute `ref` supplied to `React.Fragment`."), Ie(null));
|
|
6726
6719
|
}
|
|
6727
6720
|
}
|
|
6728
6721
|
var _r = {};
|
|
6729
|
-
function gr(h,
|
|
6722
|
+
function gr(h, g, v, O, P, M) {
|
|
6730
6723
|
{
|
|
6731
6724
|
var C = Ft(h);
|
|
6732
6725
|
if (!C) {
|
|
@@ -6737,24 +6730,24 @@ Check the top-level render call using <` + v + ">.");
|
|
|
6737
6730
|
var D;
|
|
6738
6731
|
h === null ? D = "null" : zt(h) ? D = "array" : h !== void 0 && h.$$typeof === n ? (D = "<" + (ce(h.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : D = typeof h, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, k);
|
|
6739
6732
|
}
|
|
6740
|
-
var L = bs(h,
|
|
6733
|
+
var L = bs(h, g, v, P, M);
|
|
6741
6734
|
if (L == null)
|
|
6742
6735
|
return L;
|
|
6743
6736
|
if (C) {
|
|
6744
|
-
var re =
|
|
6737
|
+
var re = g.children;
|
|
6745
6738
|
if (re !== void 0)
|
|
6746
6739
|
if (O)
|
|
6747
6740
|
if (zt(re)) {
|
|
6748
|
-
for (var
|
|
6749
|
-
br(re[
|
|
6741
|
+
for (var Me = 0; Me < re.length; Me++)
|
|
6742
|
+
br(re[Me], h);
|
|
6750
6743
|
Object.freeze && Object.freeze(re);
|
|
6751
6744
|
} else
|
|
6752
6745
|
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
6753
6746
|
else
|
|
6754
6747
|
br(re, h);
|
|
6755
6748
|
}
|
|
6756
|
-
if (
|
|
6757
|
-
var ve = ce(h), Y = Object.keys(
|
|
6749
|
+
if (Ge.call(g, "key")) {
|
|
6750
|
+
var ve = ce(h), Y = Object.keys(g).filter(function(As) {
|
|
6758
6751
|
return As !== "key";
|
|
6759
6752
|
}), Qt = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
6760
6753
|
if (!_r[ve + Qt]) {
|
|
@@ -6767,23 +6760,23 @@ React keys must be passed directly to JSX without using spread:
|
|
|
6767
6760
|
<%s key={someKey} {...props} />`, Qt, ve, Es, ve), _r[ve + Qt] = !0;
|
|
6768
6761
|
}
|
|
6769
6762
|
}
|
|
6770
|
-
return h === i ?
|
|
6763
|
+
return h === i ? Ts(L) : ws(L), L;
|
|
6771
6764
|
}
|
|
6772
6765
|
}
|
|
6773
|
-
function ms(h,
|
|
6774
|
-
return gr(h,
|
|
6766
|
+
function ms(h, g, v) {
|
|
6767
|
+
return gr(h, g, v, !0);
|
|
6775
6768
|
}
|
|
6776
|
-
function vs(h,
|
|
6777
|
-
return gr(h,
|
|
6769
|
+
function vs(h, g, v) {
|
|
6770
|
+
return gr(h, g, v, !1);
|
|
6778
6771
|
}
|
|
6779
6772
|
var Ss = vs, Os = ms;
|
|
6780
|
-
|
|
6781
|
-
}(),
|
|
6773
|
+
Ye.Fragment = i, Ye.jsx = Ss, Ye.jsxs = Os;
|
|
6774
|
+
}(), Ye;
|
|
6782
6775
|
}
|
|
6783
|
-
var
|
|
6784
|
-
|
|
6776
|
+
var yc = {};
|
|
6777
|
+
yc.NODE_ENV === "production" ? Sn.exports = hc() : Sn.exports = pc();
|
|
6785
6778
|
var z = Sn.exports;
|
|
6786
|
-
const
|
|
6779
|
+
const bc = {
|
|
6787
6780
|
isLoading: !0,
|
|
6788
6781
|
data: void 0,
|
|
6789
6782
|
pageInfo: void 0,
|
|
@@ -6792,9 +6785,9 @@ const _c = {
|
|
|
6792
6785
|
function ri(t) {
|
|
6793
6786
|
return Object.assign({ isLoading: !t, data: void 0, pageInfo: void 0, error: void 0 }, t || {});
|
|
6794
6787
|
}
|
|
6795
|
-
function
|
|
6788
|
+
function _c(t, e, n) {
|
|
6796
6789
|
e && n && "ruleParams" in n && (e = Object.assign({ $$ruleParams: n.ruleParams }, e));
|
|
6797
|
-
const r = e ?
|
|
6790
|
+
const r = e ? uc(e) : null, i = V(r), s = at(ri(t._reactor.getPreviousResult(r))), o = ge(
|
|
6798
6791
|
(u) => (s.current = ri(t._reactor.getPreviousResult(r)), r ? t.subscribeQuery(r, (c) => {
|
|
6799
6792
|
s.current = Object.assign({ isLoading: !c, data: void 0, pageInfo: void 0, error: void 0 }, c), u();
|
|
6800
6793
|
}) : () => {
|
|
@@ -6802,10 +6795,10 @@ function gc(t, e, n) {
|
|
|
6802
6795
|
// Build a new subscribe function if the query changes
|
|
6803
6796
|
[i]
|
|
6804
6797
|
);
|
|
6805
|
-
return { state: nn(o, () => s.current, () =>
|
|
6798
|
+
return { state: nn(o, () => s.current, () => bc), query: r };
|
|
6806
6799
|
}
|
|
6807
|
-
function
|
|
6808
|
-
const t =
|
|
6800
|
+
function gc() {
|
|
6801
|
+
const t = at(null);
|
|
6809
6802
|
je(() => {
|
|
6810
6803
|
n();
|
|
6811
6804
|
}, []);
|
|
@@ -6818,13 +6811,13 @@ function Tc() {
|
|
|
6818
6811
|
return { set: e, clear: n };
|
|
6819
6812
|
}
|
|
6820
6813
|
const wc = 1e3;
|
|
6821
|
-
function
|
|
6822
|
-
const r =
|
|
6814
|
+
function Tc(t, e, n) {
|
|
6815
|
+
const r = at(n);
|
|
6823
6816
|
r.current = n, je(() => t.core._reactor.subscribeTopic(t.id, e, (s, o) => {
|
|
6824
6817
|
r.current(s, o);
|
|
6825
6818
|
}), [t.id, e]);
|
|
6826
6819
|
}
|
|
6827
|
-
function
|
|
6820
|
+
function mc(t, e) {
|
|
6828
6821
|
return je(() => t.core._reactor.joinRoom(t.id), [t.id]), ge((r) => {
|
|
6829
6822
|
t.core._reactor.publishTopic({
|
|
6830
6823
|
roomType: t.type,
|
|
@@ -6834,7 +6827,7 @@ function vc(t, e) {
|
|
|
6834
6827
|
});
|
|
6835
6828
|
}, [t.id, e]);
|
|
6836
6829
|
}
|
|
6837
|
-
function
|
|
6830
|
+
function vc(t, e = {}) {
|
|
6838
6831
|
var n, r;
|
|
6839
6832
|
const [i, s] = di(() => {
|
|
6840
6833
|
var u;
|
|
@@ -6851,11 +6844,11 @@ function Sc(t, e = {}) {
|
|
|
6851
6844
|
}, [t.type, t.id]);
|
|
6852
6845
|
return rn(() => Object.assign(Object.assign({}, i), { publishPresence: o }), [i, o]);
|
|
6853
6846
|
}
|
|
6854
|
-
function
|
|
6847
|
+
function Sc(t, e, n) {
|
|
6855
6848
|
je(() => t.core._reactor.joinRoom(t.id, e), [t.id]), je(() => t.core._reactor.publishPresence(t.type, t.id, e), [t.type, t.id, n ?? JSON.stringify(e)]);
|
|
6856
6849
|
}
|
|
6857
|
-
function
|
|
6858
|
-
const r =
|
|
6850
|
+
function Oc(t, e, n = {}) {
|
|
6851
|
+
const r = gc(), i = Oe.usePresence(t, {
|
|
6859
6852
|
keys: [e]
|
|
6860
6853
|
}), s = rn(() => {
|
|
6861
6854
|
var c;
|
|
@@ -6883,20 +6876,20 @@ function Ec(t, e, n = {}) {
|
|
|
6883
6876
|
};
|
|
6884
6877
|
}
|
|
6885
6878
|
const Oe = {
|
|
6886
|
-
useTopicEffect:
|
|
6887
|
-
usePublishTopic:
|
|
6888
|
-
usePresence:
|
|
6889
|
-
useSyncPresence:
|
|
6890
|
-
useTypingIndicator:
|
|
6879
|
+
useTopicEffect: Tc,
|
|
6880
|
+
usePublishTopic: mc,
|
|
6881
|
+
usePresence: vc,
|
|
6882
|
+
useSyncPresence: Sc,
|
|
6883
|
+
useTypingIndicator: Oc
|
|
6891
6884
|
};
|
|
6892
|
-
class
|
|
6885
|
+
class Ec {
|
|
6893
6886
|
constructor(e, n, r) {
|
|
6894
6887
|
this.useTopicEffect = (i, s) => {
|
|
6895
6888
|
Oe.useTopicEffect(this, i, s);
|
|
6896
6889
|
}, this.usePublishTopic = (i) => Oe.usePublishTopic(this, i), this.usePresence = (i = {}) => Oe.usePresence(this, i), this.useSyncPresence = (i, s) => Oe.useSyncPresence(this, i, s), this.useTypingIndicator = (i, s = {}) => Oe.useTypingIndicator(this, i, s), this.core = e, this._core = this.core, this.type = n, this.id = r;
|
|
6897
6890
|
}
|
|
6898
6891
|
}
|
|
6899
|
-
var
|
|
6892
|
+
var Ac = function(t, e, n, r) {
|
|
6900
6893
|
function i(s) {
|
|
6901
6894
|
return s instanceof n ? s : new n(function(o) {
|
|
6902
6895
|
o(s);
|
|
@@ -6923,33 +6916,33 @@ var kc = function(t, e, n, r) {
|
|
|
6923
6916
|
d((r = r.apply(t, e || [])).next());
|
|
6924
6917
|
});
|
|
6925
6918
|
};
|
|
6926
|
-
const
|
|
6919
|
+
const kc = {
|
|
6927
6920
|
isLoading: !0,
|
|
6928
6921
|
user: void 0,
|
|
6929
6922
|
error: void 0
|
|
6930
6923
|
};
|
|
6931
|
-
class
|
|
6924
|
+
class jc {
|
|
6932
6925
|
constructor(e, n) {
|
|
6933
6926
|
this.tx = Vn(), this.getLocalId = (r) => this.core.getLocalId(r), this.useLocalId = (r) => {
|
|
6934
6927
|
const [i, s] = di(null);
|
|
6935
6928
|
return je(() => {
|
|
6936
|
-
|
|
6929
|
+
Ac(this, void 0, void 0, function* () {
|
|
6937
6930
|
const a = yield this.getLocalId(r);
|
|
6938
6931
|
s(a);
|
|
6939
6932
|
});
|
|
6940
6933
|
}, [r]), i;
|
|
6941
|
-
}, this.rooms = Oe, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) =>
|
|
6942
|
-
const r =
|
|
6934
|
+
}, this.rooms = Oe, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => _c(this.core, r, i).state, this.useAuth = () => {
|
|
6935
|
+
const r = at(this.core._reactor._currentUserCached), i = ge((o) => this.core.subscribeAuth((u) => {
|
|
6943
6936
|
r.current = Object.assign({ isLoading: !1 }, u), o();
|
|
6944
6937
|
}), []);
|
|
6945
|
-
return nn(i, () => r.current, () =>
|
|
6938
|
+
return nn(i, () => r.current, () => kc);
|
|
6946
6939
|
}, this.useUser = () => {
|
|
6947
6940
|
const { user: r } = this.useAuth();
|
|
6948
6941
|
if (!r)
|
|
6949
|
-
throw new
|
|
6942
|
+
throw new qe("useUser must be used within an auth-protected route");
|
|
6950
6943
|
return r;
|
|
6951
6944
|
}, this.useConnectionStatus = () => {
|
|
6952
|
-
const r =
|
|
6945
|
+
const r = at(this.core._reactor.status), i = ge((o) => this.core.subscribeConnectionStatus((u) => {
|
|
6953
6946
|
u !== r.current && (r.current = u, o());
|
|
6954
6947
|
}), []);
|
|
6955
6948
|
return nn(
|
|
@@ -6964,7 +6957,7 @@ class Cc {
|
|
|
6964
6957
|
}, this.SignedOut = ({ children: r }) => {
|
|
6965
6958
|
const i = this.useAuth();
|
|
6966
6959
|
return i.isLoading || i.error || i.user ? null : z.jsx(z.Fragment, { children: r });
|
|
6967
|
-
}, this.core =
|
|
6960
|
+
}, this.core = fc(
|
|
6968
6961
|
e,
|
|
6969
6962
|
// @ts-expect-error because TS can't resolve subclass statics
|
|
6970
6963
|
this.constructor.Storage,
|
|
@@ -6988,7 +6981,7 @@ class Cc {
|
|
|
6988
6981
|
* const { peers } = db.rooms.usePresence(room);
|
|
6989
6982
|
*/
|
|
6990
6983
|
room(e = "_defaultRoomType", n = "_defaultRoomId") {
|
|
6991
|
-
return new
|
|
6984
|
+
return new Ec(this.core, e, n);
|
|
6992
6985
|
}
|
|
6993
6986
|
/**
|
|
6994
6987
|
* One time query for the logged in state. This is useful
|
|
@@ -7011,7 +7004,7 @@ class ii extends Error {
|
|
|
7011
7004
|
}
|
|
7012
7005
|
function tn(t) {
|
|
7013
7006
|
}
|
|
7014
|
-
function
|
|
7007
|
+
function Cc(t) {
|
|
7015
7008
|
if (typeof t == "function")
|
|
7016
7009
|
throw new TypeError(
|
|
7017
7010
|
"`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
|
|
@@ -7019,10 +7012,10 @@ function Pc(t) {
|
|
|
7019
7012
|
const { onEvent: e = tn, onError: n = tn, onRetry: r = tn, onComment: i } = t;
|
|
7020
7013
|
let s = "", o = !0, a, u = "", d = "";
|
|
7021
7014
|
function c(b) {
|
|
7022
|
-
const _ = o ? b.replace(/^\xEF\xBB\xBF/, "") : b, [
|
|
7023
|
-
for (const m of
|
|
7015
|
+
const _ = o ? b.replace(/^\xEF\xBB\xBF/, "") : b, [T, w] = Pc(`${s}${_}`);
|
|
7016
|
+
for (const m of T)
|
|
7024
7017
|
f(m);
|
|
7025
|
-
s =
|
|
7018
|
+
s = w, o = !1;
|
|
7026
7019
|
}
|
|
7027
7020
|
function f(b) {
|
|
7028
7021
|
if (b === "") {
|
|
@@ -7035,13 +7028,13 @@ function Pc(t) {
|
|
|
7035
7028
|
}
|
|
7036
7029
|
const _ = b.indexOf(":");
|
|
7037
7030
|
if (_ !== -1) {
|
|
7038
|
-
const
|
|
7039
|
-
l(
|
|
7031
|
+
const T = b.slice(0, _), w = b[_ + 1] === " " ? 2 : 1, m = b.slice(_ + w);
|
|
7032
|
+
l(T, m, b);
|
|
7040
7033
|
return;
|
|
7041
7034
|
}
|
|
7042
7035
|
l(b, "", b);
|
|
7043
7036
|
}
|
|
7044
|
-
function l(b, _,
|
|
7037
|
+
function l(b, _, T) {
|
|
7045
7038
|
switch (b) {
|
|
7046
7039
|
case "event":
|
|
7047
7040
|
d = _;
|
|
@@ -7058,7 +7051,7 @@ function Pc(t) {
|
|
|
7058
7051
|
new ii(`Invalid \`retry\` value: "${_}"`, {
|
|
7059
7052
|
type: "invalid-retry",
|
|
7060
7053
|
value: _,
|
|
7061
|
-
line:
|
|
7054
|
+
line: T
|
|
7062
7055
|
})
|
|
7063
7056
|
);
|
|
7064
7057
|
break;
|
|
@@ -7066,7 +7059,7 @@ function Pc(t) {
|
|
|
7066
7059
|
n(
|
|
7067
7060
|
new ii(
|
|
7068
7061
|
`Unknown field "${b.length > 20 ? `${b.slice(0, 20)}…` : b}"`,
|
|
7069
|
-
{ type: "unknown-field", field: b, value: _, line:
|
|
7062
|
+
{ type: "unknown-field", field: b, value: _, line: T }
|
|
7070
7063
|
)
|
|
7071
7064
|
);
|
|
7072
7065
|
break;
|
|
@@ -7087,7 +7080,7 @@ function Pc(t) {
|
|
|
7087
7080
|
}
|
|
7088
7081
|
return { feed: c, reset: y };
|
|
7089
7082
|
}
|
|
7090
|
-
function
|
|
7083
|
+
function Pc(t) {
|
|
7091
7084
|
const e = [];
|
|
7092
7085
|
let n = "", r = 0;
|
|
7093
7086
|
for (; r < t.length; ) {
|
|
@@ -7147,7 +7140,7 @@ class si extends Event {
|
|
|
7147
7140
|
return e(oi(this), n);
|
|
7148
7141
|
}
|
|
7149
7142
|
}
|
|
7150
|
-
function
|
|
7143
|
+
function Ic(t) {
|
|
7151
7144
|
const e = globalThis.DOMException;
|
|
7152
7145
|
return typeof e == "function" ? new e(t, "SyntaxError") : new SyntaxError(t);
|
|
7153
7146
|
}
|
|
@@ -7166,69 +7159,69 @@ function oi(t) {
|
|
|
7166
7159
|
}
|
|
7167
7160
|
var Xi = (t) => {
|
|
7168
7161
|
throw TypeError(t);
|
|
7169
|
-
}, Qn = (t, e, n) => e.has(t) || Xi("Cannot " + n), A = (t, e, n) => (Qn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), N = (t, e, n) => e.has(t) ? Xi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), $ = (t, e, n, r) => (Qn(t, e, "write to private field"), e.set(t, n), n), he = (t, e, n) => (Qn(t, e, "access private method"), n), J, Ee,
|
|
7162
|
+
}, Qn = (t, e, n) => e.has(t) || Xi("Cannot " + n), A = (t, e, n) => (Qn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), N = (t, e, n) => e.has(t) ? Xi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), $ = (t, e, n, r) => (Qn(t, e, "write to private field"), e.set(t, n), n), he = (t, e, n) => (Qn(t, e, "access private method"), n), J, Ee, xe, At, Rt, st, Ue, ot, _e, $e, Fe, De, et, se, En, An, kn, ai, jn, Cn, tt, Pn, In;
|
|
7170
7163
|
class kt extends EventTarget {
|
|
7171
7164
|
constructor(e, n) {
|
|
7172
7165
|
var r, i;
|
|
7173
|
-
super(), N(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, N(this, J), N(this, Ee), N(this,
|
|
7166
|
+
super(), N(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, N(this, J), N(this, Ee), N(this, xe), N(this, At), N(this, Rt), N(this, st), N(this, Ue), N(this, ot, null), N(this, _e), N(this, $e), N(this, Fe, null), N(this, De, null), N(this, et, null), N(this, An, async (s) => {
|
|
7174
7167
|
var o;
|
|
7175
|
-
A(this,
|
|
7168
|
+
A(this, $e).reset();
|
|
7176
7169
|
const { body: a, redirected: u, status: d, headers: c } = s;
|
|
7177
7170
|
if (d === 204) {
|
|
7178
|
-
he(this, se,
|
|
7171
|
+
he(this, se, tt).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
7179
7172
|
return;
|
|
7180
7173
|
}
|
|
7181
|
-
if (u ? $(this,
|
|
7182
|
-
he(this, se,
|
|
7174
|
+
if (u ? $(this, xe, new URL(s.url)) : $(this, xe, void 0), d !== 200) {
|
|
7175
|
+
he(this, se, tt).call(this, `Non-200 status code (${d})`, d);
|
|
7183
7176
|
return;
|
|
7184
7177
|
}
|
|
7185
7178
|
if (!(c.get("content-type") || "").startsWith("text/event-stream")) {
|
|
7186
|
-
he(this, se,
|
|
7179
|
+
he(this, se, tt).call(this, 'Invalid content type, expected "text/event-stream"', d);
|
|
7187
7180
|
return;
|
|
7188
7181
|
}
|
|
7189
7182
|
if (A(this, J) === this.CLOSED)
|
|
7190
7183
|
return;
|
|
7191
7184
|
$(this, J, this.OPEN);
|
|
7192
7185
|
const f = new Event("open");
|
|
7193
|
-
if ((o = A(this,
|
|
7194
|
-
he(this, se,
|
|
7186
|
+
if ((o = A(this, et)) == null || o.call(this, f), this.dispatchEvent(f), typeof a != "object" || !a || !("getReader" in a)) {
|
|
7187
|
+
he(this, se, tt).call(this, "Invalid response body, expected a web ReadableStream", d), this.close();
|
|
7195
7188
|
return;
|
|
7196
7189
|
}
|
|
7197
7190
|
const l = new TextDecoder(), p = a.getReader();
|
|
7198
7191
|
let y = !0;
|
|
7199
7192
|
do {
|
|
7200
7193
|
const { done: b, value: _ } = await p.read();
|
|
7201
|
-
_ && A(this,
|
|
7194
|
+
_ && A(this, $e).feed(l.decode(_, { stream: !b })), b && (y = !1, A(this, $e).reset(), he(this, se, Pn).call(this));
|
|
7202
7195
|
} while (y);
|
|
7203
7196
|
}), N(this, kn, (s) => {
|
|
7204
7197
|
$(this, _e, void 0), !(s.name === "AbortError" || s.type === "aborted") && he(this, se, Pn).call(this, On(s));
|
|
7205
7198
|
}), N(this, jn, (s) => {
|
|
7206
|
-
typeof s.id == "string" && $(this,
|
|
7199
|
+
typeof s.id == "string" && $(this, ot, s.id);
|
|
7207
7200
|
const o = new MessageEvent(s.event || "message", {
|
|
7208
7201
|
data: s.data,
|
|
7209
|
-
origin: A(this,
|
|
7202
|
+
origin: A(this, xe) ? A(this, xe).origin : A(this, Ee).origin,
|
|
7210
7203
|
lastEventId: s.id || ""
|
|
7211
7204
|
});
|
|
7212
|
-
A(this,
|
|
7205
|
+
A(this, De) && (!s.event || s.event === "message") && A(this, De).call(this, o), this.dispatchEvent(o);
|
|
7213
7206
|
}), N(this, Cn, (s) => {
|
|
7214
|
-
$(this,
|
|
7207
|
+
$(this, st, s);
|
|
7215
7208
|
}), N(this, In, () => {
|
|
7216
|
-
$(this,
|
|
7209
|
+
$(this, Ue, void 0), A(this, J) === this.CONNECTING && he(this, se, En).call(this);
|
|
7217
7210
|
});
|
|
7218
7211
|
try {
|
|
7219
7212
|
if (e instanceof URL)
|
|
7220
7213
|
$(this, Ee, e);
|
|
7221
7214
|
else if (typeof e == "string")
|
|
7222
|
-
$(this, Ee, new URL(e,
|
|
7215
|
+
$(this, Ee, new URL(e, Mc()));
|
|
7223
7216
|
else
|
|
7224
7217
|
throw new Error("Invalid URL");
|
|
7225
7218
|
} catch {
|
|
7226
|
-
throw
|
|
7219
|
+
throw Ic("An invalid or illegal string was specified");
|
|
7227
7220
|
}
|
|
7228
|
-
$(this,
|
|
7221
|
+
$(this, $e, Cc({
|
|
7229
7222
|
onEvent: A(this, jn),
|
|
7230
7223
|
onRetry: A(this, Cn)
|
|
7231
|
-
})), $(this, J, this.CONNECTING), $(this,
|
|
7224
|
+
})), $(this, J, this.CONNECTING), $(this, st, 3e3), $(this, Rt, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), $(this, At, (i = n == null ? void 0 : n.withCredentials) != null ? i : !1), he(this, se, En).call(this);
|
|
7232
7225
|
}
|
|
7233
7226
|
/**
|
|
7234
7227
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -7263,24 +7256,24 @@ class kt extends EventTarget {
|
|
|
7263
7256
|
}
|
|
7264
7257
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
7265
7258
|
get onerror() {
|
|
7266
|
-
return A(this,
|
|
7259
|
+
return A(this, Fe);
|
|
7267
7260
|
}
|
|
7268
7261
|
set onerror(e) {
|
|
7269
|
-
$(this,
|
|
7262
|
+
$(this, Fe, e);
|
|
7270
7263
|
}
|
|
7271
7264
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
7272
7265
|
get onmessage() {
|
|
7273
|
-
return A(this,
|
|
7266
|
+
return A(this, De);
|
|
7274
7267
|
}
|
|
7275
7268
|
set onmessage(e) {
|
|
7276
|
-
$(this,
|
|
7269
|
+
$(this, De, e);
|
|
7277
7270
|
}
|
|
7278
7271
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
7279
7272
|
get onopen() {
|
|
7280
|
-
return A(this,
|
|
7273
|
+
return A(this, et);
|
|
7281
7274
|
}
|
|
7282
7275
|
set onopen(e) {
|
|
7283
|
-
$(this,
|
|
7276
|
+
$(this, et, e);
|
|
7284
7277
|
}
|
|
7285
7278
|
addEventListener(e, n, r) {
|
|
7286
7279
|
const i = n;
|
|
@@ -7298,10 +7291,10 @@ class kt extends EventTarget {
|
|
|
7298
7291
|
* @public
|
|
7299
7292
|
*/
|
|
7300
7293
|
close() {
|
|
7301
|
-
A(this,
|
|
7294
|
+
A(this, Ue) && clearTimeout(A(this, Ue)), A(this, J) !== this.CLOSED && (A(this, _e) && A(this, _e).abort(), $(this, J, this.CLOSED), $(this, _e, void 0));
|
|
7302
7295
|
}
|
|
7303
7296
|
}
|
|
7304
|
-
J = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(),
|
|
7297
|
+
J = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakSet(), /**
|
|
7305
7298
|
* Connect to the given URL and start receiving events
|
|
7306
7299
|
*
|
|
7307
7300
|
* @internal
|
|
@@ -7321,7 +7314,7 @@ ai = function() {
|
|
|
7321
7314
|
// [spec] …will have their mode set to "cors"…
|
|
7322
7315
|
mode: "cors",
|
|
7323
7316
|
redirect: "follow",
|
|
7324
|
-
headers: { Accept: "text/event-stream", ...A(this,
|
|
7317
|
+
headers: { Accept: "text/event-stream", ...A(this, ot) ? { "Last-Event-ID": A(this, ot) } : void 0 },
|
|
7325
7318
|
cache: "no-store",
|
|
7326
7319
|
signal: (t = A(this, _e)) == null ? void 0 : t.signal
|
|
7327
7320
|
};
|
|
@@ -7333,11 +7326,11 @@ ai = function() {
|
|
|
7333
7326
|
* @param code - The HTTP status code, if available
|
|
7334
7327
|
* @internal
|
|
7335
7328
|
*/
|
|
7336
|
-
|
|
7329
|
+
tt = function(t, e) {
|
|
7337
7330
|
var n;
|
|
7338
7331
|
A(this, J) !== this.CLOSED && $(this, J, this.CLOSED);
|
|
7339
7332
|
const r = new si("error", { code: e, message: t });
|
|
7340
|
-
(n = A(this,
|
|
7333
|
+
(n = A(this, Fe)) == null || n.call(this, r), this.dispatchEvent(r);
|
|
7341
7334
|
}, /**
|
|
7342
7335
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
7343
7336
|
*
|
|
@@ -7351,7 +7344,7 @@ Pn = function(t, e) {
|
|
|
7351
7344
|
return;
|
|
7352
7345
|
$(this, J, this.CONNECTING);
|
|
7353
7346
|
const r = new si("error", { code: e, message: t });
|
|
7354
|
-
(n = A(this,
|
|
7347
|
+
(n = A(this, Fe)) == null || n.call(this, r), this.dispatchEvent(r), $(this, Ue, setTimeout(A(this, In), A(this, st)));
|
|
7355
7348
|
}, In = /* @__PURE__ */ new WeakMap(), /**
|
|
7356
7349
|
* ReadyState representing an EventSource currently trying to connect
|
|
7357
7350
|
*
|
|
@@ -7368,15 +7361,15 @@ kt.OPEN = 1, /**
|
|
|
7368
7361
|
* @public
|
|
7369
7362
|
*/
|
|
7370
7363
|
kt.CLOSED = 2;
|
|
7371
|
-
function
|
|
7364
|
+
function Mc() {
|
|
7372
7365
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
7373
7366
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
7374
7367
|
}
|
|
7375
|
-
const Hn = class Hn extends
|
|
7368
|
+
const Hn = class Hn extends jc {
|
|
7376
7369
|
};
|
|
7377
7370
|
Hn.EventSourceImpl = kt;
|
|
7378
7371
|
let Mn = Hn;
|
|
7379
|
-
function
|
|
7372
|
+
function Rc(t) {
|
|
7380
7373
|
return new Mn(
|
|
7381
7374
|
t,
|
|
7382
7375
|
{
|
|
@@ -7384,8 +7377,8 @@ function xc(t) {
|
|
|
7384
7377
|
}
|
|
7385
7378
|
);
|
|
7386
7379
|
}
|
|
7387
|
-
const
|
|
7388
|
-
function
|
|
7380
|
+
const Kc = Rc;
|
|
7381
|
+
function qc({
|
|
7389
7382
|
as: t = "div",
|
|
7390
7383
|
spaceId: e,
|
|
7391
7384
|
room: n,
|
|
@@ -7400,39 +7393,39 @@ function Wc({
|
|
|
7400
7393
|
const c = e || `cursors-space-default--${String(n.type)}-${n.id}`, f = n.usePresence({
|
|
7401
7394
|
keys: [c]
|
|
7402
7395
|
}), l = n._core._reactor.getPresence(n.type, n.id);
|
|
7403
|
-
function p(
|
|
7404
|
-
const E = m.clientX, S = m.clientY, I = (E -
|
|
7396
|
+
function p(w, m) {
|
|
7397
|
+
const E = m.clientX, S = m.clientY, I = (E - w.left) / w.width * 100, x = (S - w.top) / w.height * 100;
|
|
7405
7398
|
f.publishPresence({
|
|
7406
7399
|
[c]: {
|
|
7407
7400
|
x: E,
|
|
7408
7401
|
y: S,
|
|
7409
7402
|
xPercent: I,
|
|
7410
|
-
yPercent:
|
|
7403
|
+
yPercent: x,
|
|
7411
7404
|
color: s
|
|
7412
7405
|
}
|
|
7413
7406
|
});
|
|
7414
7407
|
}
|
|
7415
|
-
function y(
|
|
7416
|
-
u ||
|
|
7417
|
-
const m =
|
|
7418
|
-
p(m,
|
|
7408
|
+
function y(w) {
|
|
7409
|
+
u || w.stopPropagation();
|
|
7410
|
+
const m = w.currentTarget.getBoundingClientRect();
|
|
7411
|
+
p(m, w);
|
|
7419
7412
|
}
|
|
7420
|
-
function b(
|
|
7413
|
+
function b(w) {
|
|
7421
7414
|
f.publishPresence({
|
|
7422
7415
|
[c]: void 0
|
|
7423
7416
|
});
|
|
7424
7417
|
}
|
|
7425
|
-
function _(
|
|
7426
|
-
if (
|
|
7418
|
+
function _(w) {
|
|
7419
|
+
if (w.touches.length !== 1)
|
|
7427
7420
|
return;
|
|
7428
|
-
const m =
|
|
7421
|
+
const m = w.touches[0];
|
|
7429
7422
|
if (m.target instanceof Element) {
|
|
7430
|
-
u ||
|
|
7423
|
+
u || w.stopPropagation();
|
|
7431
7424
|
const E = m.target.getBoundingClientRect();
|
|
7432
7425
|
p(E, m);
|
|
7433
7426
|
}
|
|
7434
7427
|
}
|
|
7435
|
-
function w
|
|
7428
|
+
function T(w) {
|
|
7436
7429
|
f.publishPresence({
|
|
7437
7430
|
[c]: void 0
|
|
7438
7431
|
});
|
|
@@ -7443,7 +7436,7 @@ function Wc({
|
|
|
7443
7436
|
onMouseMove: y,
|
|
7444
7437
|
onMouseOut: b,
|
|
7445
7438
|
onTouchMove: _,
|
|
7446
|
-
onTouchEnd:
|
|
7439
|
+
onTouchEnd: T,
|
|
7447
7440
|
className: r,
|
|
7448
7441
|
style: {
|
|
7449
7442
|
position: "relative",
|
|
@@ -7457,10 +7450,10 @@ function Wc({
|
|
|
7457
7450
|
{
|
|
7458
7451
|
style: {
|
|
7459
7452
|
...ui,
|
|
7460
|
-
|
|
7461
|
-
zIndex: d !== void 0 ? d :
|
|
7453
|
+
...$c,
|
|
7454
|
+
zIndex: d !== void 0 ? d : Dc
|
|
7462
7455
|
},
|
|
7463
|
-
children: Object.entries(f.peers).map(([
|
|
7456
|
+
children: Object.entries(f.peers).map(([w, m]) => {
|
|
7464
7457
|
const E = m[c];
|
|
7465
7458
|
return E ? /* @__PURE__ */ z.jsx(
|
|
7466
7459
|
"div",
|
|
@@ -7473,10 +7466,10 @@ function Wc({
|
|
|
7473
7466
|
},
|
|
7474
7467
|
children: a ? a({
|
|
7475
7468
|
color: E.color,
|
|
7476
|
-
presence: l.peers[
|
|
7477
|
-
}) : /* @__PURE__ */ z.jsx(
|
|
7469
|
+
presence: l.peers[w]
|
|
7470
|
+
}) : /* @__PURE__ */ z.jsx(xc, { ...E })
|
|
7478
7471
|
},
|
|
7479
|
-
|
|
7472
|
+
w
|
|
7480
7473
|
) : null;
|
|
7481
7474
|
})
|
|
7482
7475
|
},
|
|
@@ -7485,7 +7478,7 @@ function Wc({
|
|
|
7485
7478
|
]
|
|
7486
7479
|
);
|
|
7487
7480
|
}
|
|
7488
|
-
function
|
|
7481
|
+
function xc({ color: t }) {
|
|
7489
7482
|
const n = t || "black";
|
|
7490
7483
|
return /* @__PURE__ */ z.jsxs(
|
|
7491
7484
|
"svg",
|
|
@@ -7538,21 +7531,21 @@ const ui = {
|
|
|
7538
7531
|
left: 0,
|
|
7539
7532
|
bottom: 0,
|
|
7540
7533
|
right: 0
|
|
7541
|
-
},
|
|
7534
|
+
}, $c = {
|
|
7542
7535
|
overflow: "hidden",
|
|
7543
7536
|
pointerEvents: "none",
|
|
7544
7537
|
userSelect: "none"
|
|
7545
|
-
},
|
|
7538
|
+
}, Dc = 99999;
|
|
7546
7539
|
export {
|
|
7547
|
-
|
|
7540
|
+
qc as Cursors,
|
|
7548
7541
|
Dt as InstantAPIError,
|
|
7549
|
-
|
|
7542
|
+
jc as InstantReactAbstractDatabase,
|
|
7550
7543
|
Mn as InstantReactWebDatabase,
|
|
7551
7544
|
Se as SyncTableCallbackEventType,
|
|
7552
|
-
|
|
7545
|
+
Nc as i,
|
|
7553
7546
|
K as id,
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7547
|
+
Rc as init,
|
|
7548
|
+
Kc as init_experimental,
|
|
7549
|
+
Lc as lookup,
|
|
7550
|
+
Fc as tx
|
|
7558
7551
|
};
|