@instantdb/react 0.22.60 → 0.22.61-experimental.delay-looking-at-store.19576224038.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/index.js +617 -601
- package/dist/standalone/index.umd.cjs +12 -12
- package/package.json +4 -4
package/dist/standalone/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ci, { useRef as at, useCallback as ge, useSyncExternalStore as nn, useEffect as
|
|
2
|
-
function
|
|
1
|
+
import ci, { useRef as at, useCallback as ge, useSyncExternalStore as nn, useEffect as ke, useMemo as rn, useState as di, createElement as ks } from "react";
|
|
2
|
+
function z(t) {
|
|
3
3
|
if (typeof t == "number")
|
|
4
4
|
return (Math.abs(t * 2654435761) >>> 0).toString(16);
|
|
5
5
|
if (typeof t == "boolean")
|
|
@@ -18,7 +18,7 @@ function V(t) {
|
|
|
18
18
|
let e = 2166136261;
|
|
19
19
|
for (let n = 0; n < t.length; n++) {
|
|
20
20
|
e ^= (n + 1) * 2654435761;
|
|
21
|
-
const r =
|
|
21
|
+
const r = z(t[n]);
|
|
22
22
|
for (let i = 0; i < r.length; i++)
|
|
23
23
|
e ^= r.charCodeAt(i), e *= 16777619, e = e >>> 0;
|
|
24
24
|
}
|
|
@@ -28,14 +28,14 @@ function V(t) {
|
|
|
28
28
|
let e = 2166136261;
|
|
29
29
|
const n = Object.keys(t).sort();
|
|
30
30
|
for (let r = 0; r < n.length; r++) {
|
|
31
|
-
const i = n[r], s =
|
|
31
|
+
const i = n[r], s = z(i);
|
|
32
32
|
e ^= parseInt(s, 16), e *= 16777619, e = e >>> 0;
|
|
33
|
-
const o =
|
|
33
|
+
const o = z(t[i]);
|
|
34
34
|
e ^= parseInt(o, 16), e *= 16777619, e = e >>> 0;
|
|
35
35
|
}
|
|
36
36
|
return e.toString(16);
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return z(String(t));
|
|
39
39
|
}
|
|
40
40
|
const U = {
|
|
41
41
|
Remove: "remove",
|
|
@@ -48,7 +48,7 @@ const U = {
|
|
|
48
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 Tr(t, e) {
|
|
52
52
|
if (e in t) {
|
|
53
53
|
let n = Reflect.getPrototypeOf(t);
|
|
54
54
|
for (; n; ) {
|
|
@@ -69,7 +69,7 @@ function te(t) {
|
|
|
69
69
|
var e;
|
|
70
70
|
return (e = t.copy) !== null && e !== void 0 ? e : t.original;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function je(t) {
|
|
73
73
|
return !!j(t);
|
|
74
74
|
}
|
|
75
75
|
function j(t) {
|
|
@@ -106,14 +106,14 @@ function li(t, e = []) {
|
|
|
106
106
|
}
|
|
107
107
|
return e;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function Ce(t) {
|
|
110
110
|
return Array.isArray(t) ? 1 : t instanceof Map ? 2 : t instanceof Set ? 3 : 0;
|
|
111
111
|
}
|
|
112
112
|
function be(t, e) {
|
|
113
|
-
return
|
|
113
|
+
return Ce(t) === 2 ? t.get(e) : t[e];
|
|
114
114
|
}
|
|
115
115
|
function ct(t, e, n) {
|
|
116
|
-
|
|
116
|
+
Ce(t) === 2 ? t.set(e, n) : t[e] = n;
|
|
117
117
|
}
|
|
118
118
|
function Ht(t, e) {
|
|
119
119
|
const n = j(t);
|
|
@@ -127,7 +127,7 @@ function sn(t) {
|
|
|
127
127
|
for (; t.finalities.revoke.length > 0; )
|
|
128
128
|
t.finalities.revoke.pop()();
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Ee(t, e) {
|
|
131
131
|
return e ? t : [""].concat(t).map((n) => {
|
|
132
132
|
const r = `${n}`;
|
|
133
133
|
return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
@@ -136,7 +136,7 @@ function Ae(t, e) {
|
|
|
136
136
|
function Cs(t, e) {
|
|
137
137
|
for (let n = 0; n < e.length - 1; n += 1) {
|
|
138
138
|
const r = e[n];
|
|
139
|
-
if (t = be(
|
|
139
|
+
if (t = be(Ce(t) === 3 ? Array.from(t) : t, r), typeof t != "object")
|
|
140
140
|
throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
|
|
141
141
|
}
|
|
142
142
|
return t;
|
|
@@ -226,16 +226,16 @@ function Je(t) {
|
|
|
226
226
|
return e;
|
|
227
227
|
}
|
|
228
228
|
function St(t) {
|
|
229
|
-
return
|
|
229
|
+
return je(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 wr() {
|
|
236
236
|
throw new Error("Cannot modify frozen object");
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Me(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;
|
|
@@ -252,37 +252,37 @@ function Re(t, e, n, r, i) {
|
|
|
252
252
|
} else
|
|
253
253
|
r.push(o);
|
|
254
254
|
}
|
|
255
|
-
if (Object.isFrozen(t) ||
|
|
255
|
+
if (Object.isFrozen(t) || je(t)) {
|
|
256
256
|
r.pop(), i.pop();
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
switch (
|
|
259
|
+
switch (Ce(t)) {
|
|
260
260
|
case 2:
|
|
261
261
|
for (const [a, u] of t)
|
|
262
|
-
|
|
263
|
-
t.set = t.clear = t.delete =
|
|
262
|
+
Me(a, a, n, r, i), Me(u, a, n, r, i);
|
|
263
|
+
t.set = t.clear = t.delete = wr;
|
|
264
264
|
break;
|
|
265
265
|
case 3:
|
|
266
266
|
for (const a of t)
|
|
267
|
-
|
|
268
|
-
t.add = t.clear = t.delete =
|
|
267
|
+
Me(a, a, n, r, i);
|
|
268
|
+
t.add = t.clear = t.delete = wr;
|
|
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
|
+
Me(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
|
+
Me(u, a, n, r, i);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
r.pop(), i.pop();
|
|
283
283
|
}
|
|
284
284
|
function Un(t, e) {
|
|
285
|
-
const n =
|
|
285
|
+
const n = Ce(t);
|
|
286
286
|
if (n === 0)
|
|
287
287
|
Reflect.ownKeys(t).forEach((r) => {
|
|
288
288
|
e(r, t[r], t);
|
|
@@ -295,12 +295,12 @@ function Un(t, e) {
|
|
|
295
295
|
t.forEach((r, i) => e(i, r, t));
|
|
296
296
|
}
|
|
297
297
|
function pi(t, e, n) {
|
|
298
|
-
if (
|
|
298
|
+
if (je(t) || !ae(t, n) || e.has(t) || Object.isFrozen(t))
|
|
299
299
|
return;
|
|
300
300
|
const r = t instanceof Set, i = r ? /* @__PURE__ */ new Map() : void 0;
|
|
301
301
|
if (e.add(t), Un(t, (s, o) => {
|
|
302
302
|
var a;
|
|
303
|
-
if (
|
|
303
|
+
if (je(o)) {
|
|
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;
|
|
@@ -351,7 +351,7 @@ function Rs(t, e, n, r, i) {
|
|
|
351
351
|
u.length < s.length && ([s, u] = [u, s], [n, r] = [r, n]);
|
|
352
352
|
for (let d = 0; d < s.length; d += 1)
|
|
353
353
|
if (o.get(d.toString()) && u[d] !== s[d]) {
|
|
354
|
-
const c = e.concat([d]), f =
|
|
354
|
+
const c = e.concat([d]), f = Ee(c, i);
|
|
355
355
|
n.push({
|
|
356
356
|
op: U.Replace,
|
|
357
357
|
path: f,
|
|
@@ -365,7 +365,7 @@ function Rs(t, e, n, r, i) {
|
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
for (let d = s.length; d < u.length; d += 1) {
|
|
368
|
-
const c = e.concat([d]), f =
|
|
368
|
+
const c = e.concat([d]), f = Ee(c, i);
|
|
369
369
|
n.push({
|
|
370
370
|
op: U.Add,
|
|
371
371
|
path: f,
|
|
@@ -376,7 +376,7 @@ function Rs(t, e, n, r, i) {
|
|
|
376
376
|
if (s.length < u.length) {
|
|
377
377
|
const { arrayLengthAssignment: d = !0 } = a.enablePatches;
|
|
378
378
|
if (d) {
|
|
379
|
-
const c = e.concat(["length"]), f =
|
|
379
|
+
const c = e.concat(["length"]), f = Ee(c, i);
|
|
380
380
|
r.push({
|
|
381
381
|
op: U.Replace,
|
|
382
382
|
path: f,
|
|
@@ -384,7 +384,7 @@ function Rs(t, e, n, r, i) {
|
|
|
384
384
|
});
|
|
385
385
|
} else
|
|
386
386
|
for (let c = u.length; s.length < c; c -= 1) {
|
|
387
|
-
const f = e.concat([c - 1]), l =
|
|
387
|
+
const f = e.concat([c - 1]), l = Ee(f, i);
|
|
388
388
|
r.push({
|
|
389
389
|
op: U.Remove,
|
|
390
390
|
path: l
|
|
@@ -397,7 +397,7 @@ function xs({ original: t, copy: e, assignedMap: n }, r, i, s, o) {
|
|
|
397
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
|
-
const l = r.concat(u), p =
|
|
400
|
+
const l = r.concat(u), p = Ee(l, o);
|
|
401
401
|
i.push(f === U.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), s.push(f === U.Add ? { op: U.Remove, path: p } : f === U.Remove ? { op: U.Add, path: p, value: d } : { op: U.Replace, path: p, value: d });
|
|
402
402
|
});
|
|
403
403
|
}
|
|
@@ -405,7 +405,7 @@ function $s({ original: t, copy: e }, n, r, i, s) {
|
|
|
405
405
|
let o = 0;
|
|
406
406
|
t.forEach((a) => {
|
|
407
407
|
if (!e.has(a)) {
|
|
408
|
-
const u = n.concat([o]), d =
|
|
408
|
+
const u = n.concat([o]), d = Ee(u, s);
|
|
409
409
|
r.push({
|
|
410
410
|
op: U.Remove,
|
|
411
411
|
path: d,
|
|
@@ -419,7 +419,7 @@ function $s({ original: t, copy: e }, n, r, i, s) {
|
|
|
419
419
|
o += 1;
|
|
420
420
|
}), o = 0, e.forEach((a) => {
|
|
421
421
|
if (!t.has(a)) {
|
|
422
|
-
const u = n.concat([o]), d =
|
|
422
|
+
const u = n.concat([o]), d = Ee(u, s);
|
|
423
423
|
r.push({
|
|
424
424
|
op: U.Add,
|
|
425
425
|
path: d,
|
|
@@ -670,7 +670,7 @@ const Us = Reflect.ownKeys(Ct), yi = /* @__PURE__ */ new WeakSet(), bi = {
|
|
|
670
670
|
return d.bind(t.proxy);
|
|
671
671
|
}
|
|
672
672
|
if (!nt(a, e)) {
|
|
673
|
-
const d =
|
|
673
|
+
const d = Tr(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,7 +701,7 @@ 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 = Tr(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);
|
|
@@ -737,7 +737,7 @@ const Us = Reflect.ownKeys(Ct), yi = /* @__PURE__ */ new WeakSet(), bi = {
|
|
|
737
737
|
}
|
|
738
738
|
};
|
|
739
739
|
function Fn(t) {
|
|
740
|
-
const { original: e, parentDraft: n, key: r, finalities: i, options: s } = t, o =
|
|
740
|
+
const { original: e, parentDraft: n, key: r, finalities: i, options: s } = t, o = Ce(e), a = {
|
|
741
741
|
type: o,
|
|
742
742
|
finalized: !1,
|
|
743
743
|
parent: n,
|
|
@@ -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 w = be(_, r), g = j(w);
|
|
761
|
+
if (g) {
|
|
762
|
+
let m = g.original;
|
|
763
|
+
g.operated && (m = Dn(w)), on(g), an(g, 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, g.original)), ct(_, r, m);
|
|
764
764
|
}
|
|
765
765
|
(y = b.callbacks) === null || y === void 0 || y.forEach((m) => {
|
|
766
766
|
m(f, l);
|
|
@@ -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 && Me(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
|
|
@@ -831,7 +831,7 @@ function _i(t) {
|
|
|
831
831
|
const n = j(t);
|
|
832
832
|
if (!ae(t, n == null ? void 0 : n.options))
|
|
833
833
|
return t;
|
|
834
|
-
const r =
|
|
834
|
+
const r = Ce(t);
|
|
835
835
|
if (n && !n.operated)
|
|
836
836
|
return n.original;
|
|
837
837
|
let i;
|
|
@@ -859,7 +859,7 @@ function _i(t) {
|
|
|
859
859
|
return i;
|
|
860
860
|
}
|
|
861
861
|
function vr(t) {
|
|
862
|
-
if (!
|
|
862
|
+
if (!je(t))
|
|
863
863
|
throw new Error(`current() is only used for Draft, parameter: ${t}`);
|
|
864
864
|
return _i(t);
|
|
865
865
|
}
|
|
@@ -874,13 +874,13 @@ const Ns = (t) => function e(n, r, i) {
|
|
|
874
874
|
if (typeof r != "function" && (c = r), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
|
|
875
875
|
throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
|
|
876
876
|
c = Object.assign(Object.assign({}, t), c);
|
|
877
|
-
const f =
|
|
877
|
+
const f = je(u) ? vr(u) : u, l = Array.isArray(c.mark) ? (S, I) => {
|
|
878
878
|
for (const x of c.mark) {
|
|
879
879
|
if (typeof x != "function")
|
|
880
880
|
throw new Error(`Invalid mark: ${x}, 'mark' should be a function.`);
|
|
881
|
-
const
|
|
882
|
-
if (
|
|
883
|
-
return
|
|
881
|
+
const B = x(S, I);
|
|
882
|
+
if (B)
|
|
883
|
+
return B;
|
|
884
884
|
}
|
|
885
885
|
} : c.mark, p = (s = c.enablePatches) !== null && s !== void 0 ? s : !1, y = (o = c.strict) !== null && o !== void 0 ? o : !1, _ = {
|
|
886
886
|
enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
|
|
@@ -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 [w, g] = 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 [w, g];
|
|
898
898
|
}
|
|
899
899
|
let m;
|
|
900
900
|
try {
|
|
901
|
-
m = d(
|
|
901
|
+
m = d(w);
|
|
902
902
|
} catch (S) {
|
|
903
|
-
throw sn(j(
|
|
903
|
+
throw sn(j(w)), S;
|
|
904
904
|
}
|
|
905
905
|
const E = (S) => {
|
|
906
|
-
const I = j(
|
|
907
|
-
if (!
|
|
908
|
-
if (S !== void 0 && !ye(S,
|
|
906
|
+
const I = j(w);
|
|
907
|
+
if (!je(S)) {
|
|
908
|
+
if (S !== void 0 && !ye(S, w) && (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
|
-
const
|
|
911
|
-
if (
|
|
912
|
-
const
|
|
910
|
+
const B = S == null ? void 0 : S[js];
|
|
911
|
+
if (B) {
|
|
912
|
+
const Ve = B[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
|
+
}), g([Ve]);
|
|
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 }), g([S]);
|
|
921
921
|
}
|
|
922
|
-
if (S ===
|
|
923
|
-
return
|
|
922
|
+
if (S === w || S === void 0)
|
|
923
|
+
return g([]);
|
|
924
924
|
const x = j(S);
|
|
925
925
|
if (_ === x.options) {
|
|
926
926
|
if (x.operated)
|
|
927
927
|
throw new Error("Cannot return a modified child draft.");
|
|
928
|
-
return
|
|
928
|
+
return g([vr(S)]);
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return g([S]);
|
|
931
931
|
};
|
|
932
932
|
return m instanceof Promise ? m.then(E, (S) => {
|
|
933
|
-
throw sn(j(
|
|
933
|
+
throw sn(j(w)), S;
|
|
934
934
|
}) : E(m);
|
|
935
935
|
}, Pt = Ns();
|
|
936
936
|
Object.prototype.constructor.toString();
|
|
@@ -952,7 +952,7 @@ function Nn(t) {
|
|
|
952
952
|
r !== void 0 && (e[n] = r);
|
|
953
953
|
return e;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function Ti(t, e) {
|
|
956
956
|
if (!Ze(t) || !Ze(e))
|
|
957
957
|
return e;
|
|
958
958
|
const n = Object.assign({}, t);
|
|
@@ -964,7 +964,7 @@ function wi(t, e) {
|
|
|
964
964
|
continue;
|
|
965
965
|
}
|
|
966
966
|
const i = Ze(t[r]) && Ze(e[r]);
|
|
967
|
-
n[r] = i ?
|
|
967
|
+
n[r] = i ? Ti(t[r], e[r]) : e[r];
|
|
968
968
|
}
|
|
969
969
|
return n;
|
|
970
970
|
}
|
|
@@ -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 wi(t, e) {
|
|
996
996
|
if (!t || e.length === 0)
|
|
997
997
|
return;
|
|
998
998
|
const [n, ...r] = e;
|
|
@@ -1001,7 +1001,7 @@ function Ti(t, e) {
|
|
|
1001
1001
|
Array.isArray(t) ? t.splice(n, 1) : delete t[n];
|
|
1002
1002
|
return;
|
|
1003
1003
|
}
|
|
1004
|
-
|
|
1004
|
+
wi(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 qe(t, e) {
|
|
1335
1335
|
return t[e];
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function We(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 = qe(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 We(t.eav, [e]) !== void 0;
|
|
1400
1400
|
}
|
|
1401
1401
|
function Wn(t) {
|
|
1402
1402
|
t.attrIndexes = vi(t.attrs);
|
|
@@ -1436,14 +1436,14 @@ function Ei(t, e) {
|
|
|
1436
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 = qe(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 = We(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) {
|
|
@@ -1452,11 +1452,11 @@ function ki(t, e) {
|
|
|
1452
1452
|
if (!r)
|
|
1453
1453
|
return;
|
|
1454
1454
|
let [i, s, o] = r;
|
|
1455
|
-
const a =
|
|
1455
|
+
const a = qe(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 = We(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) {
|
|
@@ -1464,18 +1464,18 @@ function uo(t, e) {
|
|
|
1464
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 = qe(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 = We(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 = Ti(c, o), l = [
|
|
1479
1479
|
i,
|
|
1480
1480
|
s,
|
|
1481
1481
|
f,
|
|
@@ -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, w = t.attrs[b];
|
|
1510
|
+
(!s || !w || ((f = w["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])), w && w["on-delete"] === "cascade" && ((l = w["reverse-identity"]) === null || l === void 0 ? void 0 : l[1]) === s && fn(t, [y, (p = w["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 Te(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
|
}
|
|
@@ -1692,10 +1692,10 @@ function go(t, e) {
|
|
|
1692
1692
|
if (!n)
|
|
1693
1693
|
return;
|
|
1694
1694
|
const [r, i, s] = n;
|
|
1695
|
-
if (
|
|
1696
|
-
return
|
|
1695
|
+
if (qe(t.attrs, i))
|
|
1696
|
+
return We(t.eav, [r, i]);
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1698
|
+
function To(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 wo(t, e) {
|
|
|
1703
1703
|
if (u !== "create" && u !== "update")
|
|
1704
1704
|
return !0;
|
|
1705
1705
|
let d = !1;
|
|
1706
|
-
const c =
|
|
1706
|
+
const c = qe(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 wo(t, e) {
|
|
|
1716
1716
|
});
|
|
1717
1717
|
});
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1719
|
+
function wo(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)) : wo(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,14 +1779,14 @@ 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 Fe(t) {
|
|
1783
1783
|
return typeof t == "string" && Po.test(t);
|
|
1784
1784
|
}
|
|
1785
|
-
const
|
|
1785
|
+
const q = [];
|
|
1786
1786
|
for (let t = 0; t < 256; ++t)
|
|
1787
|
-
|
|
1787
|
+
q.push((t + 256).toString(16).slice(1));
|
|
1788
1788
|
function Io(t, e = 0) {
|
|
1789
|
-
return (
|
|
1789
|
+
return (q[t[e + 0]] + q[t[e + 1]] + q[t[e + 2]] + q[t[e + 3]] + "-" + q[t[e + 4]] + q[t[e + 5]] + "-" + q[t[e + 6]] + q[t[e + 7]] + "-" + q[t[e + 8]] + q[t[e + 9]] + "-" + q[t[e + 10]] + q[t[e + 11]] + q[t[e + 12]] + q[t[e + 13]] + q[t[e + 14]] + q[t[e + 15]]).toLowerCase();
|
|
1790
1790
|
}
|
|
1791
1791
|
let Yt;
|
|
1792
1792
|
const Mo = new Uint8Array(16);
|
|
@@ -1850,7 +1850,7 @@ function rt(t) {
|
|
|
1850
1850
|
function $t(t, e) {
|
|
1851
1851
|
return `?${t}-${e}`;
|
|
1852
1852
|
}
|
|
1853
|
-
class
|
|
1853
|
+
class Ne extends Error {
|
|
1854
1854
|
constructor(e) {
|
|
1855
1855
|
super(e), this.name = "AttrNotFoundError";
|
|
1856
1856
|
}
|
|
@@ -1858,7 +1858,7 @@ class Ke 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 Ne(`Could not find id attr for ${e}`);
|
|
1862
1862
|
return n;
|
|
1863
1863
|
}
|
|
1864
1864
|
function Cr(t, e, n, r) {
|
|
@@ -1876,9 +1876,9 @@ 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 = Te(e, n, i), o = Pi(e, n, i), a = s || o;
|
|
1880
1880
|
if (!a)
|
|
1881
|
-
throw new
|
|
1881
|
+
throw new Ne(`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 ? [
|
|
@@ -1965,13 +1965,13 @@ 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 = Te(e, n, i), a = Pi(e, n, i), u = o || a;
|
|
1969
1969
|
if (!u)
|
|
1970
|
-
throw new
|
|
1970
|
+
throw new Ne(`No attr for etype = ${n} label = ${i}`);
|
|
1971
1971
|
if (s != null && s.hasOwnProperty("$isNull")) {
|
|
1972
|
-
const d =
|
|
1972
|
+
const d = Te(e, n, "id");
|
|
1973
1973
|
if (!d)
|
|
1974
|
-
throw new
|
|
1974
|
+
throw new Ne(`No attr for etype = ${n} label = id`);
|
|
1975
1975
|
return [
|
|
1976
1976
|
t(n, r),
|
|
1977
1977
|
d.id,
|
|
@@ -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 [w, g, m] = ta(t, e, n, r, l, u), E = Di(e, {
|
|
2080
|
+
etype: w,
|
|
2081
|
+
level: g,
|
|
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 (w) {
|
|
2087
|
+
if (w instanceof Ne)
|
|
2088
2088
|
return { [l]: _ ? void 0 : [] };
|
|
2089
|
-
throw
|
|
2089
|
+
throw w;
|
|
2090
2090
|
}
|
|
2091
2091
|
}).reduce(function(l, p) {
|
|
2092
2092
|
return Object.assign(Object.assign({}, l), p);
|
|
@@ -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 Te(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 = Te(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 = Te(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 x = (I = (S = (E = (m = (
|
|
2155
|
-
return b && (x = pn(x)), [
|
|
2152
|
+
c = c.map(([w]) => {
|
|
2153
|
+
var g, m, E, S, I;
|
|
2154
|
+
let x = (I = (S = (E = (m = (g = t.eav.get(w)) === null || g === void 0 ? void 0 : g.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)), [w, 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(_, w) {
|
|
2159
|
+
return It(_, w, l == null ? void 0 : l["checked-data-type"]);
|
|
2160
|
+
} : function(_, w) {
|
|
2161
|
+
return It(w, _, 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 w = bo(t, y, _);
|
|
2170
|
+
w && (p[_] = w);
|
|
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 Ne)
|
|
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 Fc(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 Nc = Vn();
|
|
2300
2300
|
function _a(t) {
|
|
2301
2301
|
return t.__ops;
|
|
2302
2302
|
}
|
|
@@ -2319,13 +2319,13 @@ function ga(t, e) {
|
|
|
2319
2319
|
}
|
|
2320
2320
|
return i;
|
|
2321
2321
|
}
|
|
2322
|
-
function
|
|
2322
|
+
function V(t, e, n) {
|
|
2323
2323
|
return Object.values(t).find((r) => {
|
|
2324
2324
|
const [i, s, o] = r["forward-identity"];
|
|
2325
2325
|
return s === e && o === n;
|
|
2326
2326
|
});
|
|
2327
2327
|
}
|
|
2328
|
-
function
|
|
2328
|
+
function Ae(t, e, n) {
|
|
2329
2329
|
return Object.values(t).find((r) => {
|
|
2330
2330
|
const i = r["reverse-identity"];
|
|
2331
2331
|
if (!i)
|
|
@@ -2334,7 +2334,7 @@ function ke(t, e, n) {
|
|
|
2334
2334
|
return o === e && a === n;
|
|
2335
2335
|
});
|
|
2336
2336
|
}
|
|
2337
|
-
function
|
|
2337
|
+
function Ta(t) {
|
|
2338
2338
|
if (Array.isArray(t))
|
|
2339
2339
|
return t;
|
|
2340
2340
|
const e = Object.entries(t);
|
|
@@ -2345,7 +2345,7 @@ function wa(t) {
|
|
|
2345
2345
|
function bn(t, e, n) {
|
|
2346
2346
|
return n.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
|
|
2347
2347
|
// before assuming it's a ref lookup.
|
|
2348
|
-
!
|
|
2348
|
+
!V(t, e, n);
|
|
2349
2349
|
}
|
|
2350
2350
|
function _n(t) {
|
|
2351
2351
|
const [e, n, ...r] = t.split(".");
|
|
@@ -2353,22 +2353,22 @@ 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 wa(t, e, n) {
|
|
2357
2357
|
if (!bn(t, e, n))
|
|
2358
|
-
return
|
|
2359
|
-
const r = _n(n), i =
|
|
2358
|
+
return V(t, e, n);
|
|
2359
|
+
const r = _n(n), i = V(t, e, r) || Ae(t, e, r);
|
|
2360
2360
|
if (i && i["value-type"] !== "ref")
|
|
2361
2361
|
throw new Error(`${n} does not reference a valid link attribute.`);
|
|
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) : Ta(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 = wa(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];
|
|
@@ -2378,13 +2378,13 @@ function Fi(t, e, n, r) {
|
|
|
2378
2378
|
return Array.isArray(i) ? [[
|
|
2379
2379
|
"add-triple",
|
|
2380
2380
|
i,
|
|
2381
|
-
|
|
2381
|
+
V(t, e, "id").id,
|
|
2382
2382
|
i
|
|
2383
2383
|
]].concat(r) : r;
|
|
2384
2384
|
}
|
|
2385
2385
|
function ma({ attrs: t }, [e, n, r]) {
|
|
2386
2386
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
2387
|
-
const a = Array.isArray(o) ? o : [o], u =
|
|
2387
|
+
const a = Array.isArray(o) ? o : [o], u = V(t, e, s), d = Ae(t, e, s);
|
|
2388
2388
|
return a.map((c) => u ? [
|
|
2389
2389
|
"add-triple",
|
|
2390
2390
|
ee(t, e, n),
|
|
@@ -2401,7 +2401,7 @@ function ma({ attrs: t }, [e, n, r]) {
|
|
|
2401
2401
|
}
|
|
2402
2402
|
function va({ attrs: t }, [e, n, r]) {
|
|
2403
2403
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
2404
|
-
const a = Array.isArray(o) ? o : [o], u =
|
|
2404
|
+
const a = Array.isArray(o) ? o : [o], u = V(t, e, s), d = Ae(t, e, s);
|
|
2405
2405
|
return a.map((c) => u ? [
|
|
2406
2406
|
"retract-triple",
|
|
2407
2407
|
ee(t, e, n),
|
|
@@ -2444,14 +2444,14 @@ function Ni({ stores: t, attrs: e }, [n, r, i, s]) {
|
|
|
2444
2444
|
function Oa(t, e) {
|
|
2445
2445
|
const { stores: n, attrs: r } = t, [i, s, o, a] = e, u = Nn(o), d = ee(r, i, s);
|
|
2446
2446
|
return [["id", d]].concat(Object.entries(u)).map(([f, l]) => {
|
|
2447
|
-
const p =
|
|
2447
|
+
const p = V(r, i, f);
|
|
2448
2448
|
return p["checked-data-type"] === "date" && t.useDateObjects && (l = xt(l)), ["add-triple", d, p.id, l, { mode: "create" }];
|
|
2449
2449
|
});
|
|
2450
2450
|
}
|
|
2451
2451
|
function Ea(t, e) {
|
|
2452
2452
|
const { stores: n, attrs: r } = t, [i, s, o, a] = e, u = Nn(o), d = ee(r, i, s), c = Ni(t, [i, d, o, a]);
|
|
2453
2453
|
return [["id", d]].concat(Object.entries(u)).map(([l, p]) => {
|
|
2454
|
-
const y =
|
|
2454
|
+
const y = V(r, i, l);
|
|
2455
2455
|
return y["checked-data-type"] === "date" && t.useDateObjects && (p = xt(p)), [
|
|
2456
2456
|
"add-triple",
|
|
2457
2457
|
d,
|
|
@@ -2466,7 +2466,7 @@ function Aa({ attrs: t }, [e, n]) {
|
|
|
2466
2466
|
}
|
|
2467
2467
|
function ka(t, e) {
|
|
2468
2468
|
const { stores: n, attrs: r } = t, [i, s, o, a] = e, u = Nn(o), d = ee(r, i, s), c = Ni(t, [i, d, o, a]), f = Object.entries(u).map(([p, y]) => {
|
|
2469
|
-
const b =
|
|
2469
|
+
const b = V(r, i, p);
|
|
2470
2470
|
return [
|
|
2471
2471
|
"deep-merge-triple",
|
|
2472
2472
|
d,
|
|
@@ -2478,7 +2478,7 @@ function ka(t, e) {
|
|
|
2478
2478
|
return [[
|
|
2479
2479
|
"add-triple",
|
|
2480
2480
|
d,
|
|
2481
|
-
|
|
2481
|
+
V(r, i, "id").id,
|
|
2482
2482
|
d,
|
|
2483
2483
|
...c ? [c] : []
|
|
2484
2484
|
]].concat(f);
|
|
@@ -2539,7 +2539,7 @@ function Ma(t, e, n) {
|
|
|
2539
2539
|
"checked-data-type": u
|
|
2540
2540
|
};
|
|
2541
2541
|
}
|
|
2542
|
-
function
|
|
2542
|
+
function Tt(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
|
+
]), Tn = { "unique?": !0, "index?": !0 }, Fa = Object.assign(Object.assign({}, Tn), { cardinality: "one" });
|
|
2576
2576
|
function Na(t) {
|
|
2577
2577
|
const e = [], [n, r, i, s] = t;
|
|
2578
2578
|
if (!La.has(n))
|
|
@@ -2602,7 +2602,7 @@ function Ka({ attrs: t, schema: e }, n) {
|
|
|
2602
2602
|
f != null && f.isUnsynced && !s.has(f.id) && (a.push(["add-attr", f]), s.add(f.id));
|
|
2603
2603
|
}
|
|
2604
2604
|
function c(f, l) {
|
|
2605
|
-
const p =
|
|
2605
|
+
const p = V(o, f, l), y = Ae(o, f, l);
|
|
2606
2606
|
d(p), d(y), !p && !y && u(Rr(e, f, l, Fa));
|
|
2607
2607
|
}
|
|
2608
2608
|
for (const f of 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 _ =
|
|
2614
|
-
d(_), d(
|
|
2615
|
-
const
|
|
2616
|
-
if (bn(o,
|
|
2617
|
-
c(
|
|
2613
|
+
const _ = V(o, l, y), w = Ae(o, l, y);
|
|
2614
|
+
d(_), d(w);
|
|
2615
|
+
const g = ((r = _ == null ? void 0 : _["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = w == null ? void 0 : w["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) || y;
|
|
2616
|
+
if (bn(o, g, b))
|
|
2617
|
+
c(g, _n(b));
|
|
2618
2618
|
else {
|
|
2619
|
-
const m =
|
|
2620
|
-
m || u(
|
|
2619
|
+
const m = V(o, g, b);
|
|
2620
|
+
m || u(Tt(e, g, b, Tn)), d(m);
|
|
2621
2621
|
}
|
|
2622
2622
|
} else if (bn(o, l, b))
|
|
2623
2623
|
c(l, _n(b));
|
|
2624
2624
|
else {
|
|
2625
|
-
const _ =
|
|
2626
|
-
_ || u(
|
|
2625
|
+
const _ = V(o, l, b);
|
|
2626
|
+
_ || u(Tt(e, l, b, Tn)), 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
|
-
const _ =
|
|
2633
|
-
d(_), _ || u(
|
|
2634
|
-
for (const
|
|
2635
|
-
const
|
|
2636
|
-
if (d(
|
|
2637
|
-
const m =
|
|
2638
|
-
!
|
|
2632
|
+
const _ = V(o, p, "id");
|
|
2633
|
+
d(_), _ || u(Tt(e, p, "id", { "unique?": !0 }));
|
|
2634
|
+
for (const w of Object.keys(b)) {
|
|
2635
|
+
const g = V(o, p, w);
|
|
2636
|
+
if (d(g), Ua.has(l) && (g || u(Tt(e, p, w, w === "id" ? { "unique?": !0 } : null))), Da.has(l)) {
|
|
2637
|
+
const m = Ae(o, p, w);
|
|
2638
|
+
!g && !m && u(Rr(e, p, w)), d(m);
|
|
2639
2639
|
}
|
|
2640
2640
|
}
|
|
2641
2641
|
}
|
|
@@ -2681,7 +2681,7 @@ class Wa {
|
|
|
2681
2681
|
constructor(e, n) {
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
class
|
|
2684
|
+
class wn {
|
|
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 = {
|
|
@@ -2720,7 +2720,10 @@ class Tn {
|
|
|
2720
2720
|
}
|
|
2721
2721
|
_preloadEntries(e) {
|
|
2722
2722
|
return de(this, void 0, void 0, function* () {
|
|
2723
|
-
const n = yield this.waitForMetaToLoad()
|
|
2723
|
+
const n = yield this.waitForMetaToLoad();
|
|
2724
|
+
if (!n)
|
|
2725
|
+
return;
|
|
2726
|
+
const r = Object.entries(n.objects);
|
|
2724
2727
|
r.sort(([i, s], [o, a]) => a.updatedAt - s.updatedAt);
|
|
2725
2728
|
for (const [i] of r.slice(0, e))
|
|
2726
2729
|
this._loadKey(i);
|
|
@@ -2965,7 +2968,8 @@ function Ga(t) {
|
|
|
2965
2968
|
const s = r.target.result;
|
|
2966
2969
|
e(s);
|
|
2967
2970
|
}, n.onupgradeneeded = (r) => {
|
|
2968
|
-
|
|
2971
|
+
var i;
|
|
2972
|
+
(i = r.target.transaction) === null || i === void 0 || i.abort(), e(null);
|
|
2969
2973
|
};
|
|
2970
2974
|
});
|
|
2971
2975
|
});
|
|
@@ -2985,15 +2989,15 @@ function Qa(t, e, n) {
|
|
|
2985
2989
|
for (const [y, b] of Object.entries(r)) {
|
|
2986
2990
|
const _ = typeof b == "string" ? JSON.parse(b) : b;
|
|
2987
2991
|
if (_.lastAccessed) {
|
|
2988
|
-
const
|
|
2992
|
+
const g = {
|
|
2989
2993
|
createdAt: _.lastAccessed,
|
|
2990
2994
|
updatedAt: _.lastAccessed,
|
|
2991
2995
|
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
2996
|
};
|
|
2993
|
-
f[y] =
|
|
2997
|
+
f[y] = g;
|
|
2994
2998
|
}
|
|
2995
|
-
const
|
|
2996
|
-
i.add(
|
|
2999
|
+
const w = n.put(_, y);
|
|
3000
|
+
i.add(w);
|
|
2997
3001
|
}
|
|
2998
3002
|
const l = { objects: f }, p = n.put(l, it);
|
|
2999
3003
|
i.add(p);
|
|
@@ -3028,8 +3032,8 @@ function Ha(t, e) {
|
|
|
3028
3032
|
y.onsuccess = () => {
|
|
3029
3033
|
const _ = y.result;
|
|
3030
3034
|
if (_) {
|
|
3031
|
-
const
|
|
3032
|
-
b.push([
|
|
3035
|
+
const w = _.key, g = _.value;
|
|
3036
|
+
b.push([w, g]), _.continue();
|
|
3033
3037
|
} else
|
|
3034
3038
|
c(b);
|
|
3035
3039
|
}, y.onerror = (_) => {
|
|
@@ -3209,11 +3213,11 @@ class qi {
|
|
|
3209
3213
|
};
|
|
3210
3214
|
}
|
|
3211
3215
|
}
|
|
3212
|
-
class
|
|
3216
|
+
class Ke extends Error {
|
|
3213
3217
|
constructor(e, n) {
|
|
3214
3218
|
super(e), this.hint = n;
|
|
3215
3219
|
const r = new.target.prototype;
|
|
3216
|
-
Object.setPrototypeOf && Object.setPrototypeOf(this, r), Error.captureStackTrace && Error.captureStackTrace(this,
|
|
3220
|
+
Object.setPrototypeOf && Object.setPrototypeOf(this, r), Error.captureStackTrace && Error.captureStackTrace(this, Ke), this.name = "InstantError";
|
|
3217
3221
|
}
|
|
3218
3222
|
get [Symbol.toStringTag]() {
|
|
3219
3223
|
return "InstantError";
|
|
@@ -3246,7 +3250,7 @@ var Ja = function(t, e, n, r) {
|
|
|
3246
3250
|
d((r = r.apply(t, e || [])).next());
|
|
3247
3251
|
});
|
|
3248
3252
|
};
|
|
3249
|
-
class Dt extends
|
|
3253
|
+
class Dt extends Ke {
|
|
3250
3254
|
constructor(e) {
|
|
3251
3255
|
var n;
|
|
3252
3256
|
const r = ((n = e.body) === null || n === void 0 ? void 0 : n.message) || `API Error (${e.status})`;
|
|
@@ -3264,7 +3268,7 @@ function ue(t, e) {
|
|
|
3264
3268
|
return n.status === 200 ? Promise.resolve(r) : Promise.reject(new Dt({ status: n.status, body: r }));
|
|
3265
3269
|
});
|
|
3266
3270
|
}
|
|
3267
|
-
var
|
|
3271
|
+
var ze = function(t, e, n, r) {
|
|
3268
3272
|
function i(s) {
|
|
3269
3273
|
return s instanceof n ? s : new n(function(o) {
|
|
3270
3274
|
o(s);
|
|
@@ -3299,7 +3303,7 @@ function Za({ apiURI: t, appId: e, email: n }) {
|
|
|
3299
3303
|
});
|
|
3300
3304
|
}
|
|
3301
3305
|
function Xa(t) {
|
|
3302
|
-
return
|
|
3306
|
+
return ze(this, arguments, void 0, function* ({ apiURI: e, appId: n, email: r, code: i, refreshToken: s }) {
|
|
3303
3307
|
return yield ue(`${e}/runtime/auth/verify_magic_code`, {
|
|
3304
3308
|
method: "POST",
|
|
3305
3309
|
headers: { "content-type": "application/json" },
|
|
@@ -3312,7 +3316,7 @@ function Xa(t) {
|
|
|
3312
3316
|
});
|
|
3313
3317
|
}
|
|
3314
3318
|
function eu(t) {
|
|
3315
|
-
return
|
|
3319
|
+
return ze(this, arguments, void 0, function* ({ apiURI: e, appId: n, refreshToken: r }) {
|
|
3316
3320
|
return yield ue(`${e}/runtime/auth/verify_refresh_token`, {
|
|
3317
3321
|
method: "POST",
|
|
3318
3322
|
headers: { "content-type": "application/json" },
|
|
@@ -3324,7 +3328,7 @@ function eu(t) {
|
|
|
3324
3328
|
});
|
|
3325
3329
|
}
|
|
3326
3330
|
function tu(t) {
|
|
3327
|
-
return
|
|
3331
|
+
return ze(this, arguments, void 0, function* ({ apiURI: e, appId: n }) {
|
|
3328
3332
|
return yield ue(`${e}/runtime/auth/sign_in_guest`, {
|
|
3329
3333
|
method: "POST",
|
|
3330
3334
|
headers: { "content-type": "application/json" },
|
|
@@ -3335,7 +3339,7 @@ function tu(t) {
|
|
|
3335
3339
|
});
|
|
3336
3340
|
}
|
|
3337
3341
|
function Ur(t) {
|
|
3338
|
-
return
|
|
3342
|
+
return ze(this, arguments, void 0, function* ({ apiURI: e, appId: n, code: r, codeVerifier: i, refreshToken: s }) {
|
|
3339
3343
|
return yield ue(`${e}/runtime/oauth/token`, {
|
|
3340
3344
|
method: "POST",
|
|
3341
3345
|
headers: { "content-type": "application/json" },
|
|
@@ -3349,7 +3353,7 @@ function Ur(t) {
|
|
|
3349
3353
|
});
|
|
3350
3354
|
}
|
|
3351
3355
|
function nu(t) {
|
|
3352
|
-
return
|
|
3356
|
+
return ze(this, arguments, void 0, function* ({ apiURI: e, appId: n, nonce: r, idToken: i, clientName: s, refreshToken: o }) {
|
|
3353
3357
|
return yield ue(`${e}/runtime/oauth/id_token`, {
|
|
3354
3358
|
method: "POST",
|
|
3355
3359
|
headers: { "content-type": "application/json" },
|
|
@@ -3364,7 +3368,7 @@ function nu(t) {
|
|
|
3364
3368
|
});
|
|
3365
3369
|
}
|
|
3366
3370
|
function ru(t) {
|
|
3367
|
-
return
|
|
3371
|
+
return ze(this, arguments, void 0, function* ({ apiURI: e, appId: n, refreshToken: r }) {
|
|
3368
3372
|
return yield ue(`${e}/runtime/signout`, {
|
|
3369
3373
|
method: "POST",
|
|
3370
3374
|
headers: {
|
|
@@ -3546,7 +3550,7 @@ function Kr(t) {
|
|
|
3546
3550
|
}, e;
|
|
3547
3551
|
}, {});
|
|
3548
3552
|
}
|
|
3549
|
-
const Gn = "v0.22.
|
|
3553
|
+
const Gn = "v0.22.61-experimental.delay-looking-at-store.19576224038.1";
|
|
3550
3554
|
function fu(t, e) {
|
|
3551
3555
|
return {
|
|
3552
3556
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -3678,7 +3682,7 @@ const qr = [
|
|
|
3678
3682
|
default:
|
|
3679
3683
|
throw new R(`Unknown operator '${t}' for attribute '${r}' in entity '${i}'`, o);
|
|
3680
3684
|
}
|
|
3681
|
-
},
|
|
3685
|
+
}, Ue = (t, e, n, r, i) => {
|
|
3682
3686
|
const s = lu(n), o = n.valueType === "json";
|
|
3683
3687
|
if (typeof t == "object" && t !== null && !Array.isArray(t)) {
|
|
3684
3688
|
if (o)
|
|
@@ -3708,23 +3712,23 @@ const qr = [
|
|
|
3708
3712
|
if (!u)
|
|
3709
3713
|
throw new R(`Target entity '${o}' does not exist in schema for dot notation path '${t}'.`, i);
|
|
3710
3714
|
if (a === "id") {
|
|
3711
|
-
if (typeof e == "string" && !
|
|
3715
|
+
if (typeof e == "string" && !Fe(e))
|
|
3712
3716
|
throw new R(`Invalid value for id field in entity '${o}'. Expected a UUID, but received: ${e}`, i);
|
|
3713
|
-
|
|
3717
|
+
Ue(e, t, new H("string", !1, !0), n, i);
|
|
3714
3718
|
return;
|
|
3715
3719
|
}
|
|
3716
3720
|
const d = u.attrs[a];
|
|
3717
3721
|
if (Object.keys(u.links).includes(a)) {
|
|
3718
|
-
if (typeof e == "string" && !
|
|
3722
|
+
if (typeof e == "string" && !Fe(e))
|
|
3719
3723
|
throw new R(`Invalid value for link '${a}' in entity '${o}'. Expected a UUID, but received: ${e}`, i);
|
|
3720
|
-
|
|
3724
|
+
Ue(e, t, new H("string", !1, !0), n, i);
|
|
3721
3725
|
return;
|
|
3722
3726
|
}
|
|
3723
3727
|
if (!d) {
|
|
3724
3728
|
const c = Object.keys(u.attrs);
|
|
3725
3729
|
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
3730
|
}
|
|
3727
|
-
|
|
3731
|
+
Ue(e, t, d, n, i);
|
|
3728
3732
|
}, Gi = (t, e, n, r) => {
|
|
3729
3733
|
for (const [i, s] of Object.entries(t)) {
|
|
3730
3734
|
if (i === "or" || i === "and") {
|
|
@@ -3734,7 +3738,7 @@ const qr = [
|
|
|
3734
3738
|
continue;
|
|
3735
3739
|
}
|
|
3736
3740
|
if (i === "id") {
|
|
3737
|
-
|
|
3741
|
+
Ue(s, "id", new H("string", !1, !0), e, `${r}.id`);
|
|
3738
3742
|
continue;
|
|
3739
3743
|
}
|
|
3740
3744
|
if (i.includes(".")) {
|
|
@@ -3750,12 +3754,12 @@ const qr = [
|
|
|
3750
3754
|
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
3755
|
}
|
|
3752
3756
|
if (a)
|
|
3753
|
-
|
|
3757
|
+
Ue(s, i, a, e, `${r}.${i}`);
|
|
3754
3758
|
else if (u) {
|
|
3755
|
-
if (typeof s == "string" && !
|
|
3759
|
+
if (typeof s == "string" && !Fe(s))
|
|
3756
3760
|
throw new R(`Invalid value for link '${i}' in entity '${e}'. Expected a UUID, but received: ${s}`, `${r}.${i}`);
|
|
3757
3761
|
const d = new H("string", !1, !0);
|
|
3758
|
-
|
|
3762
|
+
Ue(s, i, d, e, `${r}.${i}`);
|
|
3759
3763
|
}
|
|
3760
3764
|
}
|
|
3761
3765
|
}, yu = (t, e, n, r, i = 0) => {
|
|
@@ -3818,7 +3822,7 @@ const qr = [
|
|
|
3818
3822
|
Qi(n[r], r, e, r, 0);
|
|
3819
3823
|
}
|
|
3820
3824
|
}
|
|
3821
|
-
}, zr = (t) => typeof t != "string" ? !1 : Mt(t) ? !0 :
|
|
3825
|
+
}, zr = (t) => typeof t != "string" ? !1 : Mt(t) ? !0 : Fe(t);
|
|
3822
3826
|
class ie extends Error {
|
|
3823
3827
|
constructor(e) {
|
|
3824
3828
|
super(e), this.name = "TransactionValidationError";
|
|
@@ -3875,17 +3879,17 @@ const Hi = (t) => t.length > 0 ? t.join(", ") : "none", bu = (t, e) => new ie(`E
|
|
|
3875
3879
|
unlink: Br,
|
|
3876
3880
|
delete: () => {
|
|
3877
3881
|
}
|
|
3878
|
-
},
|
|
3882
|
+
}, Tu = (t, e) => {
|
|
3879
3883
|
if (!e)
|
|
3880
3884
|
return;
|
|
3881
3885
|
const [n, r, i, s] = t;
|
|
3882
|
-
if (!Array.isArray(i) && !
|
|
3886
|
+
if (!Array.isArray(i) && !Fe(i))
|
|
3883
3887
|
throw new ie(`Invalid id for entity '${r}'. Expected a UUID, but received: ${i}`);
|
|
3884
3888
|
if (typeof r != "string")
|
|
3885
3889
|
throw new ie(`Entity name must be a string, but received: ${typeof r}`);
|
|
3886
3890
|
const o = gu[n];
|
|
3887
3891
|
o && s !== void 0 && o(r, s, e);
|
|
3888
|
-
},
|
|
3892
|
+
}, wu = (t, e) => {
|
|
3889
3893
|
const n = Array.isArray(t) ? t : [t];
|
|
3890
3894
|
for (const r of n) {
|
|
3891
3895
|
if (!r || typeof r != "object")
|
|
@@ -3895,7 +3899,7 @@ const Hi = (t) => t.length > 0 ? t.join(", ") : "none", bu = (t, e) => new ie(`E
|
|
|
3895
3899
|
for (const i of r.__ops) {
|
|
3896
3900
|
if (!Array.isArray(i))
|
|
3897
3901
|
throw new ie(`Transaction operation must be an array, but received: ${typeof i}`);
|
|
3898
|
-
|
|
3902
|
+
Tu(i, e);
|
|
3899
3903
|
}
|
|
3900
3904
|
}
|
|
3901
3905
|
};
|
|
@@ -4082,18 +4086,19 @@ function Su(t, e) {
|
|
|
4082
4086
|
return e;
|
|
4083
4087
|
}
|
|
4084
4088
|
function Ou(t, e, n) {
|
|
4085
|
-
|
|
4086
|
-
|
|
4089
|
+
var r, i;
|
|
4090
|
+
const s = (r = e == null ? void 0 : e.state) === null || r === void 0 ? void 0 : r.txId, o = (i = n == null ? void 0 : n.state) === null || i === void 0 ? void 0 : i.txId;
|
|
4091
|
+
return s && (!o || s > o) ? e : o && (!s || o > s) ? n : e || n;
|
|
4087
4092
|
}
|
|
4088
4093
|
function Zt(t, e) {
|
|
4089
4094
|
return Ui({ store: e, pageInfo: null, aggregate: null }, t.query).data[t.table][0];
|
|
4090
4095
|
}
|
|
4091
4096
|
function Yr(t, e, n) {
|
|
4092
4097
|
var r;
|
|
4093
|
-
const i = (r =
|
|
4098
|
+
const i = (r = Te(e, t.table, "id")) === null || r === void 0 ? void 0 : r.id;
|
|
4094
4099
|
if (!i)
|
|
4095
4100
|
return -1;
|
|
4096
|
-
const s =
|
|
4101
|
+
const s = We(e.eav, [n, i, n]);
|
|
4097
4102
|
return s ? s[3] : -1;
|
|
4098
4103
|
}
|
|
4099
4104
|
function Jr(t, e) {
|
|
@@ -4126,35 +4131,46 @@ function Eu(t, e) {
|
|
|
4126
4131
|
break;
|
|
4127
4132
|
}
|
|
4128
4133
|
}
|
|
4134
|
+
for (const a of Object.keys(o)) {
|
|
4135
|
+
const { oldValue: u, newValue: d } = o[a];
|
|
4136
|
+
u === d && delete o[a];
|
|
4137
|
+
}
|
|
4129
4138
|
return o;
|
|
4130
4139
|
}
|
|
4131
|
-
function
|
|
4140
|
+
function wt(t, e) {
|
|
4132
4141
|
return { [t.table]: e.map((n) => n.entity) };
|
|
4133
4142
|
}
|
|
4134
4143
|
function Au(t, e) {
|
|
4135
|
-
|
|
4144
|
+
var n;
|
|
4145
|
+
if (t.orderFieldType)
|
|
4146
|
+
return t.orderFieldType;
|
|
4147
|
+
const r = t.orderField === "serverCreatedAt" ? "number" : (n = Te(e([]), t.table, t.orderField)) === null || n === void 0 ? void 0 : n["checked-data-type"];
|
|
4148
|
+
return t.orderFieldType = r, r;
|
|
4149
|
+
}
|
|
4150
|
+
function ku(t, e, n) {
|
|
4151
|
+
const r = e;
|
|
4136
4152
|
if (t.orderField === "serverCreatedAt") {
|
|
4137
|
-
|
|
4138
|
-
return Xe(
|
|
4139
|
-
} : function(
|
|
4140
|
-
return Xe(
|
|
4153
|
+
n.sort(t.orderDirection === "asc" ? function(o, a) {
|
|
4154
|
+
return Xe(o.entity.id, o.serverCreatedAt, a.entity.id, a.serverCreatedAt, r);
|
|
4155
|
+
} : function(o, a) {
|
|
4156
|
+
return Xe(a.entity.id, a.serverCreatedAt, o.entity.id, o.serverCreatedAt, r);
|
|
4141
4157
|
});
|
|
4142
4158
|
return;
|
|
4143
4159
|
}
|
|
4144
|
-
const
|
|
4145
|
-
|
|
4146
|
-
return Xe(
|
|
4147
|
-
} : function(
|
|
4148
|
-
return Xe(
|
|
4160
|
+
const i = t.orderField;
|
|
4161
|
+
n.sort(t.orderDirection === "asc" ? function(o, a) {
|
|
4162
|
+
return Xe(o.entity.id, o.entity[i], a.entity.id, a.entity[i], r);
|
|
4163
|
+
} : function(o, a) {
|
|
4164
|
+
return Xe(a.entity.id, a.entity[i], o.entity.id, o.entity[i], r);
|
|
4149
4165
|
});
|
|
4150
4166
|
}
|
|
4151
|
-
var
|
|
4167
|
+
var ve;
|
|
4152
4168
|
(function(t) {
|
|
4153
4169
|
t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error";
|
|
4154
|
-
})(
|
|
4155
|
-
class
|
|
4170
|
+
})(ve || (ve = {}));
|
|
4171
|
+
class ju {
|
|
4156
4172
|
constructor(e, n, r, i, s) {
|
|
4157
|
-
this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = i, this.createStore = s, this.subs = new
|
|
4173
|
+
this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = i, this.createStore = s, this.subs = new wn({
|
|
4158
4174
|
persister: n,
|
|
4159
4175
|
merge: Ou,
|
|
4160
4176
|
serialize: Su,
|
|
@@ -4178,7 +4194,7 @@ class ku {
|
|
|
4178
4194
|
this.subs.flush();
|
|
4179
4195
|
}
|
|
4180
4196
|
subscribe(e, n) {
|
|
4181
|
-
const r =
|
|
4197
|
+
const r = z(e);
|
|
4182
4198
|
return this.callbacks[r] = this.callbacks[r] || [], this.callbacks[r].push(n), this.initSubscription(e, r, n), (i) => {
|
|
4183
4199
|
this.unsubscribe(r, n, i == null ? void 0 : i.keepSubscription);
|
|
4184
4200
|
};
|
|
@@ -4188,7 +4204,7 @@ class ku {
|
|
|
4188
4204
|
if (this.callbacks[e] = i, !i.length) {
|
|
4189
4205
|
delete this.callbacks[e];
|
|
4190
4206
|
const s = this.subs.currentValue[e];
|
|
4191
|
-
s != null && s.state && this.clearSubscriptionData(s.state.subscriptionId, r), r || this.subs.updateInPlace((o) => {
|
|
4207
|
+
s != null && s.state && this.clearSubscriptionData(s.state.subscriptionId, !!r), r || this.subs.updateInPlace((o) => {
|
|
4192
4208
|
delete o[e];
|
|
4193
4209
|
});
|
|
4194
4210
|
}
|
|
@@ -4199,11 +4215,11 @@ class ku {
|
|
|
4199
4215
|
q: e
|
|
4200
4216
|
});
|
|
4201
4217
|
}
|
|
4202
|
-
sendResync(e, n) {
|
|
4218
|
+
sendResync(e, n, r) {
|
|
4203
4219
|
this.idToHash[n.subscriptionId] = e.hash, this.trySend(n.subscriptionId, {
|
|
4204
4220
|
op: "resync-table",
|
|
4205
4221
|
"subscription-id": n.subscriptionId,
|
|
4206
|
-
"tx-id":
|
|
4222
|
+
"tx-id": r,
|
|
4207
4223
|
token: n.token
|
|
4208
4224
|
});
|
|
4209
4225
|
}
|
|
@@ -4216,25 +4232,24 @@ class ku {
|
|
|
4216
4232
|
}
|
|
4217
4233
|
initSubscription(e, n, r) {
|
|
4218
4234
|
return Hr(this, void 0, void 0, function* () {
|
|
4219
|
-
var i, s, o, a
|
|
4235
|
+
var i, s, o, a;
|
|
4220
4236
|
yield this.subs.waitForKeyToLoad(n);
|
|
4221
|
-
const
|
|
4222
|
-
if (
|
|
4223
|
-
this.sendResync(
|
|
4224
|
-
type:
|
|
4225
|
-
data:
|
|
4237
|
+
const u = this.subs.currentValue[n];
|
|
4238
|
+
if (u && u.state && u.state.txId) {
|
|
4239
|
+
this.sendResync(u, u.state, u.state.txId), !((i = u.values) === null || i === void 0) && i.entities && r && (Object.keys(e)[0], r({
|
|
4240
|
+
type: ve.LoadFromStorage,
|
|
4241
|
+
data: wt(u, (s = u.values) === null || s === void 0 ? void 0 : s.entities)
|
|
4226
4242
|
}));
|
|
4227
4243
|
return;
|
|
4228
4244
|
}
|
|
4229
|
-
const
|
|
4230
|
-
this.subs.updateInPlace((
|
|
4231
|
-
|
|
4245
|
+
const d = Object.keys(e)[0], c = ((a = (o = e[d]) === null || o === void 0 ? void 0 : o.$) === null || a === void 0 ? void 0 : a.order) || { serverCreatedAt: "asc" }, [f, l] = Object.entries(c)[0];
|
|
4246
|
+
this.subs.updateInPlace((p) => {
|
|
4247
|
+
p[n] = {
|
|
4232
4248
|
query: e,
|
|
4233
4249
|
hash: n,
|
|
4234
|
-
table:
|
|
4235
|
-
orderDirection:
|
|
4236
|
-
orderField:
|
|
4237
|
-
orderFieldType: y,
|
|
4250
|
+
table: d,
|
|
4251
|
+
orderDirection: l,
|
|
4252
|
+
orderField: f,
|
|
4238
4253
|
createdAt: Date.now(),
|
|
4239
4254
|
updatedAt: Date.now()
|
|
4240
4255
|
};
|
|
@@ -4251,7 +4266,7 @@ class ku {
|
|
|
4251
4266
|
});
|
|
4252
4267
|
}
|
|
4253
4268
|
onStartSyncOk(e) {
|
|
4254
|
-
const n = e["subscription-id"], r = e.q, i =
|
|
4269
|
+
const n = e["subscription-id"], r = e.q, i = z(r);
|
|
4255
4270
|
this.idToHash[n] = i, this.subs.updateInPlace((s) => {
|
|
4256
4271
|
const o = s[i];
|
|
4257
4272
|
if (!o)
|
|
@@ -4297,8 +4312,8 @@ class ku {
|
|
|
4297
4312
|
this.subs.updateInPlace((c) => {
|
|
4298
4313
|
c[s] = a, c[s].updatedAt = Date.now();
|
|
4299
4314
|
}), a.values && this.notifyCbs(s, {
|
|
4300
|
-
type:
|
|
4301
|
-
data:
|
|
4315
|
+
type: ve.InitialSyncBatch,
|
|
4316
|
+
data: wt(a, a.values.entities),
|
|
4302
4317
|
batch: o
|
|
4303
4318
|
});
|
|
4304
4319
|
}
|
|
@@ -4322,8 +4337,8 @@ class ku {
|
|
|
4322
4337
|
});
|
|
4323
4338
|
const s = this.subs.currentValue[i];
|
|
4324
4339
|
s && this.notifyCbs(i, {
|
|
4325
|
-
type:
|
|
4326
|
-
data:
|
|
4340
|
+
type: ve.InitialSyncComplete,
|
|
4341
|
+
data: wt(s, ((n = s.values) === null || n === void 0 ? void 0 : n.entities) || [])
|
|
4327
4342
|
});
|
|
4328
4343
|
}
|
|
4329
4344
|
onSyncUpdateTriples(e) {
|
|
@@ -4344,13 +4359,13 @@ class ku {
|
|
|
4344
4359
|
return;
|
|
4345
4360
|
}
|
|
4346
4361
|
for (const d of e.txes) {
|
|
4347
|
-
if (u.txId >= d["tx-id"])
|
|
4362
|
+
if (u.txId && u.txId >= d["tx-id"])
|
|
4348
4363
|
continue;
|
|
4349
4364
|
u.txId = d["tx-id"];
|
|
4350
4365
|
const c = [], f = {};
|
|
4351
|
-
for (const
|
|
4352
|
-
const
|
|
4353
|
-
f[
|
|
4366
|
+
for (const g of d.changes) {
|
|
4367
|
+
const m = (n = f[g.triple[0]]) !== null && n !== void 0 ? n : [];
|
|
4368
|
+
f[g.triple[0]] = m, m.push(g);
|
|
4354
4369
|
}
|
|
4355
4370
|
const l = (r = a.values) !== null && r !== void 0 ? r : {
|
|
4356
4371
|
entities: [],
|
|
@@ -4358,45 +4373,46 @@ class ku {
|
|
|
4358
4373
|
}, p = l.entities;
|
|
4359
4374
|
a.values = l;
|
|
4360
4375
|
const y = [];
|
|
4361
|
-
e: for (const [
|
|
4362
|
-
for (
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
}), E.entity = S) : c.push(m), delete f[T];
|
|
4376
|
+
e: for (const [g, m] of Object.entries(f))
|
|
4377
|
+
for (let E = 0; E < p.length; E++) {
|
|
4378
|
+
const S = p[E];
|
|
4379
|
+
if (oo(S.store, g)) {
|
|
4380
|
+
Jr(S.store, m);
|
|
4381
|
+
const I = Zt(a, S.store), x = Eu(S.store, m)[g];
|
|
4382
|
+
I ? (y.push({
|
|
4383
|
+
oldEntity: S.entity,
|
|
4384
|
+
newEntity: I,
|
|
4385
|
+
changedFields: x || {}
|
|
4386
|
+
}), S.entity = I) : c.push(E), delete f[g];
|
|
4373
4387
|
continue e;
|
|
4374
4388
|
}
|
|
4389
|
+
}
|
|
4375
4390
|
const b = [];
|
|
4376
|
-
for (const [
|
|
4377
|
-
const
|
|
4378
|
-
l.attrs =
|
|
4379
|
-
const
|
|
4380
|
-
if (!
|
|
4391
|
+
for (const [g, m] of Object.entries(f)) {
|
|
4392
|
+
const E = this.createStore([]);
|
|
4393
|
+
l.attrs = E.attrs, Jr(E, m);
|
|
4394
|
+
const S = Zt(a, E);
|
|
4395
|
+
if (!S) {
|
|
4381
4396
|
this.log.error("No entity found after applying change", {
|
|
4382
4397
|
sub: a,
|
|
4383
|
-
changes:
|
|
4384
|
-
store:
|
|
4398
|
+
changes: m,
|
|
4399
|
+
store: E
|
|
4385
4400
|
});
|
|
4386
4401
|
continue;
|
|
4387
4402
|
}
|
|
4388
4403
|
p.push({
|
|
4389
|
-
store:
|
|
4390
|
-
entity:
|
|
4391
|
-
serverCreatedAt: Yr(a,
|
|
4392
|
-
}), b.push(
|
|
4404
|
+
store: E,
|
|
4405
|
+
entity: S,
|
|
4406
|
+
serverCreatedAt: Yr(a, E, S.id)
|
|
4407
|
+
}), b.push(S);
|
|
4393
4408
|
}
|
|
4394
4409
|
const _ = [];
|
|
4395
|
-
for (const
|
|
4396
|
-
_.push(p[
|
|
4397
|
-
Au(a,
|
|
4398
|
-
|
|
4399
|
-
|
|
4410
|
+
for (const g of c.sort().reverse())
|
|
4411
|
+
_.push(p[g].entity), p.splice(g, 1);
|
|
4412
|
+
const w = Au(a, this.createStore);
|
|
4413
|
+
ku(a, w, p), this.notifyCbs(o, {
|
|
4414
|
+
type: ve.SyncTransaction,
|
|
4415
|
+
data: wt(a, (i = a.values) === null || i === void 0 ? void 0 : i.entities),
|
|
4400
4416
|
added: b,
|
|
4401
4417
|
removed: _,
|
|
4402
4418
|
updated: y
|
|
@@ -4418,14 +4434,14 @@ class ku {
|
|
|
4418
4434
|
}
|
|
4419
4435
|
}
|
|
4420
4436
|
onStartSyncError(e) {
|
|
4421
|
-
const n =
|
|
4437
|
+
const n = z(e["original-event"].q), r = {
|
|
4422
4438
|
message: e.message || "Uh-oh, something went wrong. Ping Joe & Stopa.",
|
|
4423
4439
|
status: e.status,
|
|
4424
4440
|
type: e.type,
|
|
4425
4441
|
hint: e.hint
|
|
4426
4442
|
}, i = Object.keys(e["original-event"].q)[0];
|
|
4427
4443
|
this.notifyCbs(n, {
|
|
4428
|
-
type:
|
|
4444
|
+
type: ve.Error,
|
|
4429
4445
|
data: { [i]: [] },
|
|
4430
4446
|
error: r
|
|
4431
4447
|
});
|
|
@@ -4461,7 +4477,7 @@ var F = function(t, e, n, r) {
|
|
|
4461
4477
|
}
|
|
4462
4478
|
d((r = r.apply(t, e || [])).next());
|
|
4463
4479
|
});
|
|
4464
|
-
},
|
|
4480
|
+
}, Cu = function(t, e) {
|
|
4465
4481
|
var n = {};
|
|
4466
4482
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
4467
4483
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4475,11 +4491,11 @@ const le = {
|
|
|
4475
4491
|
AUTHENTICATED: "authenticated",
|
|
4476
4492
|
CLOSED: "closed",
|
|
4477
4493
|
ERRORED: "errored"
|
|
4478
|
-
},
|
|
4494
|
+
}, Pu = 3e4, Iu = 3e4, Mu = 200, Ru = {
|
|
4479
4495
|
apiURI: "https://api.instantdb.com",
|
|
4480
4496
|
websocketURI: "wss://api.instantdb.com/runtime/session"
|
|
4481
4497
|
}, Xt = "_instant_oauth_redirect", Qe = "currentUser";
|
|
4482
|
-
function
|
|
4498
|
+
function xu({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl: i }) {
|
|
4483
4499
|
if (!i)
|
|
4484
4500
|
return new Qr(`${r}?app_id=${e}`);
|
|
4485
4501
|
switch (t) {
|
|
@@ -4491,7 +4507,7 @@ function Ru({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl:
|
|
|
4491
4507
|
throw new Error("Unknown transport type " + t);
|
|
4492
4508
|
}
|
|
4493
4509
|
}
|
|
4494
|
-
function
|
|
4510
|
+
function $u() {
|
|
4495
4511
|
return typeof window < "u" || typeof chrome < "u";
|
|
4496
4512
|
}
|
|
4497
4513
|
const Zr = {
|
|
@@ -4500,7 +4516,7 @@ const Zr = {
|
|
|
4500
4516
|
"refresh-presence": !0,
|
|
4501
4517
|
"patch-presence": !0
|
|
4502
4518
|
};
|
|
4503
|
-
function
|
|
4519
|
+
function Du(t, e) {
|
|
4504
4520
|
var n;
|
|
4505
4521
|
const r = typeof t == "string" ? JSON.parse(t) : t;
|
|
4506
4522
|
if (!((n = r == null ? void 0 : r.result) === null || n === void 0) && n.store) {
|
|
@@ -4509,12 +4525,12 @@ function $u(t, e) {
|
|
|
4509
4525
|
}
|
|
4510
4526
|
return r;
|
|
4511
4527
|
}
|
|
4512
|
-
function
|
|
4528
|
+
function Uu(t, e) {
|
|
4513
4529
|
var n;
|
|
4514
4530
|
const r = Object.assign({}, e);
|
|
4515
4531
|
return !((n = e.result) === null || n === void 0) && n.store && (r.result = Object.assign(Object.assign({}, e.result), { store: Si(e.result.store) })), r;
|
|
4516
4532
|
}
|
|
4517
|
-
function
|
|
4533
|
+
function Lu(t, e) {
|
|
4518
4534
|
switch (t) {
|
|
4519
4535
|
case "pendingMutations":
|
|
4520
4536
|
return new Map(typeof e == "string" ? JSON.parse(e) : e);
|
|
@@ -4522,7 +4538,7 @@ function Uu(t, e) {
|
|
|
4522
4538
|
return e;
|
|
4523
4539
|
}
|
|
4524
4540
|
}
|
|
4525
|
-
function
|
|
4541
|
+
function Fu(t, e) {
|
|
4526
4542
|
switch (t) {
|
|
4527
4543
|
case "pendingMutations":
|
|
4528
4544
|
return [...e.entries()];
|
|
@@ -4530,7 +4546,7 @@ function Lu(t, e) {
|
|
|
4530
4546
|
return e;
|
|
4531
4547
|
}
|
|
4532
4548
|
}
|
|
4533
|
-
function
|
|
4549
|
+
function Nu(t, e, n) {
|
|
4534
4550
|
const r = e == null ? void 0 : e.result, i = n == null ? void 0 : n.result;
|
|
4535
4551
|
return r && !i && n && (n.result = r), n || e;
|
|
4536
4552
|
}
|
|
@@ -4540,7 +4556,7 @@ function Xr(t) {
|
|
|
4540
4556
|
return a == u ? r < s ? -1 : r > s ? 1 : 0 : a - u;
|
|
4541
4557
|
});
|
|
4542
4558
|
}
|
|
4543
|
-
class
|
|
4559
|
+
class Ku {
|
|
4544
4560
|
constructor(e, n = Ki, r = qi, i, s) {
|
|
4545
4561
|
var o, a, u;
|
|
4546
4562
|
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) => {
|
|
@@ -4548,16 +4564,16 @@ class Nu {
|
|
|
4548
4564
|
switch (d) {
|
|
4549
4565
|
case "pendingMutations": {
|
|
4550
4566
|
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]);
|
|
4551
|
-
return (c ? this._rewriteMutationsSorted(this.attrs, c) : []).forEach(([
|
|
4567
|
+
return (c ? this._rewriteMutationsSorted(this.attrs, c) : []).forEach(([g, m]) => {
|
|
4552
4568
|
var E;
|
|
4553
|
-
!(!((E = f == null ? void 0 : f.pendingMutations) === null || E === void 0) && E.has(
|
|
4569
|
+
!(!((E = f == null ? void 0 : f.pendingMutations) === null || E === void 0) && E.has(g)) && !m["tx-id"] && this._sendMutation(g, m);
|
|
4554
4570
|
}), _;
|
|
4555
4571
|
}
|
|
4556
4572
|
default:
|
|
4557
4573
|
return f || c;
|
|
4558
4574
|
}
|
|
4559
4575
|
}, this.getPreviousResult = (d) => {
|
|
4560
|
-
const c =
|
|
4576
|
+
const c = z(d);
|
|
4561
4577
|
return this.dataForQuery(c);
|
|
4562
4578
|
}, this.notifyOne = (d) => {
|
|
4563
4579
|
var c, f;
|
|
@@ -4572,7 +4588,7 @@ class Nu {
|
|
|
4572
4588
|
}, this.notifyQueryError = (d, c) => {
|
|
4573
4589
|
(this.queryCbs[d] || []).forEach((l) => l.cb({ error: c }));
|
|
4574
4590
|
}, this.pushTx = (d) => {
|
|
4575
|
-
this.config.disableValidation ||
|
|
4591
|
+
this.config.disableValidation || wu(d, this.config.schema);
|
|
4576
4592
|
try {
|
|
4577
4593
|
const c = qa({
|
|
4578
4594
|
attrs: this.optimisticAttrs(),
|
|
@@ -4659,10 +4675,10 @@ class Nu {
|
|
|
4659
4675
|
return;
|
|
4660
4676
|
}
|
|
4661
4677
|
this._log.info("[socket][close]", c.id, "schedule reconnect, ms =", this._reconnectTimeoutMs), this._scheduleReconnect();
|
|
4662
|
-
}, this._EventSource = s, this.config = Object.assign(Object.assign({},
|
|
4678
|
+
}, this._EventSource = s, this.config = Object.assign(Object.assign({}, Ru), e), this.queryCacheLimit = (o = this.config.queryCacheLimit) !== null && o !== void 0 ? o : 10, this._pendingTxCleanupTimeout = (a = this.config.pendingTxCleanupTimeout) !== null && a !== void 0 ? a : Iu, this._pendingMutationCleanupThreshold = (u = this.config.pendingMutationCleanupThreshold) !== null && u !== void 0 ? u : Mu, 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)), !!$u()) {
|
|
4663
4679
|
if (!e.appId)
|
|
4664
4680
|
throw new Error("Instant must be initialized with an appId.");
|
|
4665
|
-
if (!
|
|
4681
|
+
if (!Fe(e.appId))
|
|
4666
4682
|
throw new Error(`Instant must be initialized with a valid appId. \`${e.appId}\` is not a valid uuid.`);
|
|
4667
4683
|
typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) => F(this, void 0, void 0, function* () {
|
|
4668
4684
|
var c;
|
|
@@ -4674,7 +4690,7 @@ class Nu {
|
|
|
4674
4690
|
} catch (f) {
|
|
4675
4691
|
this._log.error("[error] handle broadcast channel", f);
|
|
4676
4692
|
}
|
|
4677
|
-
}))), this._initStorage(n), this._syncTable = new
|
|
4693
|
+
}))), this._initStorage(n), this._syncTable = new ju(this._trySendAuthed.bind(this), new n(this.config.appId, "syncSubs"), {
|
|
4678
4694
|
useDateObjects: this.config.useDateObjects
|
|
4679
4695
|
}, 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) => {
|
|
4680
4696
|
this._isOnline = d, this._startSocket(), r.listen((c) => {
|
|
@@ -4697,11 +4713,11 @@ class Nu {
|
|
|
4697
4713
|
this.kv.waitForKeyToLoad("pendingMutations").then(() => this.notifyOne(e));
|
|
4698
4714
|
}
|
|
4699
4715
|
_initStorage(e) {
|
|
4700
|
-
this.querySubs = new
|
|
4716
|
+
this.querySubs = new wn({
|
|
4701
4717
|
persister: new e(this.config.appId, "querySubs"),
|
|
4702
|
-
merge:
|
|
4703
|
-
serialize:
|
|
4704
|
-
parse: (n, r) =>
|
|
4718
|
+
merge: Nu,
|
|
4719
|
+
serialize: Uu,
|
|
4720
|
+
parse: (n, r) => Du(r, this.config.useDateObjects),
|
|
4705
4721
|
// objectSize
|
|
4706
4722
|
objectSize: (n) => {
|
|
4707
4723
|
var r, i, s, o;
|
|
@@ -4717,11 +4733,11 @@ class Nu {
|
|
|
4717
4733
|
maxSize: 1e6
|
|
4718
4734
|
// 1 million triples
|
|
4719
4735
|
}
|
|
4720
|
-
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new
|
|
4736
|
+
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new wn({
|
|
4721
4737
|
persister: new e(this.config.appId, "kv"),
|
|
4722
4738
|
merge: this._onMergeKv,
|
|
4723
|
-
serialize:
|
|
4724
|
-
parse:
|
|
4739
|
+
serialize: Fu,
|
|
4740
|
+
parse: Lu,
|
|
4725
4741
|
objectSize: () => 0,
|
|
4726
4742
|
logger: this._log,
|
|
4727
4743
|
saveThrottleMs: 100,
|
|
@@ -4751,15 +4767,15 @@ class Nu {
|
|
|
4751
4767
|
if (!i && !s && console.error("Mutation failed", Object.assign({ status: e, eventId: n }, r)), !!i)
|
|
4752
4768
|
if (s)
|
|
4753
4769
|
i.resolve({ status: e, eventId: n });
|
|
4754
|
-
else if (r.type) {
|
|
4755
|
-
const { status: o } = r, a =
|
|
4770
|
+
else if (r != null && r.type) {
|
|
4771
|
+
const { status: o } = r, a = Cu(r, ["status"]);
|
|
4756
4772
|
i.reject(new Dt({
|
|
4757
4773
|
// @ts-expect-error body.type is not constant typed
|
|
4758
4774
|
body: a,
|
|
4759
|
-
status: o
|
|
4775
|
+
status: o ?? 0
|
|
4760
4776
|
}));
|
|
4761
4777
|
} else
|
|
4762
|
-
i.reject(new
|
|
4778
|
+
i.reject(new Ke((r == null ? void 0 : r.message) || "Unknown error", r == null ? void 0 : r.hint));
|
|
4763
4779
|
}
|
|
4764
4780
|
_setStatus(e, n) {
|
|
4765
4781
|
this.status = e, this._errorMessage = n, this.notifyConnectionStatusSubs(e);
|
|
@@ -4786,21 +4802,21 @@ class Nu {
|
|
|
4786
4802
|
break;
|
|
4787
4803
|
}
|
|
4788
4804
|
case "add-query-exists": {
|
|
4789
|
-
this.notifyOneQueryOnce(
|
|
4805
|
+
this.notifyOneQueryOnce(z(n.q));
|
|
4790
4806
|
break;
|
|
4791
4807
|
}
|
|
4792
4808
|
case "add-query-ok": {
|
|
4793
|
-
const { q: l, result: p } = n, y =
|
|
4809
|
+
const { q: l, result: p } = n, y = z(l);
|
|
4794
4810
|
if (!this._hasQueryListeners() && !this.querySubs.currentValue[y])
|
|
4795
4811
|
break;
|
|
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,
|
|
4812
|
+
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, w = Nr(p), g = Et(this.attrs, w, d, this._linkIndex, this.config.useDateObjects);
|
|
4797
4813
|
this.querySubs.updateInPlace((m) => {
|
|
4798
4814
|
if (!m[y]) {
|
|
4799
4815
|
this._log.info("Missing value in querySubs", { hash: y, q: l });
|
|
4800
4816
|
return;
|
|
4801
4817
|
}
|
|
4802
4818
|
m[y].result = {
|
|
4803
|
-
store:
|
|
4819
|
+
store: g,
|
|
4804
4820
|
pageInfo: b,
|
|
4805
4821
|
aggregate: _,
|
|
4806
4822
|
processedTxId: n["processed-tx-id"]
|
|
@@ -4828,24 +4844,24 @@ class Nu {
|
|
|
4828
4844
|
const { computations: l, attrs: p } = n, y = n["processed-tx-id"];
|
|
4829
4845
|
p && this._setAttrs(p), this._cleanupPendingMutationsTimeout();
|
|
4830
4846
|
const b = this._rewriteMutations(this.attrs, this._pendingMutations(), y);
|
|
4831
|
-
b !== this._pendingMutations() && this.kv.updateInPlace((
|
|
4832
|
-
|
|
4847
|
+
b !== this._pendingMutations() && this.kv.updateInPlace((g) => {
|
|
4848
|
+
g.pendingMutations = b;
|
|
4833
4849
|
});
|
|
4834
|
-
const _ = Xr(b.entries()),
|
|
4850
|
+
const _ = Xr(b.entries()), w = l.map((g) => {
|
|
4835
4851
|
var m, E, S, I;
|
|
4836
|
-
const x =
|
|
4837
|
-
return { q: x, hash:
|
|
4852
|
+
const x = g["instaql-query"], B = g["instaql-result"], Ve = z(x), lt = Nr(B), Ft = Et(this.attrs, lt, d, this._linkIndex, this.config.useDateObjects), Nt = this._applyOptimisticUpdates(Ft, _, y), ht = (E = (m = B == null ? void 0 : B[0]) === null || m === void 0 ? void 0 : m.data) === null || E === void 0 ? void 0 : E["page-info"], ce = (I = (S = B == null ? void 0 : B[0]) === null || S === void 0 ? void 0 : S.data) === null || I === void 0 ? void 0 : I.aggregate;
|
|
4853
|
+
return { q: x, hash: Ve, store: Nt, pageInfo: ht, aggregate: ce };
|
|
4838
4854
|
});
|
|
4839
|
-
|
|
4855
|
+
w.forEach(({ hash: g, q: m, store: E, pageInfo: S, aggregate: I }) => {
|
|
4840
4856
|
this.querySubs.updateInPlace((x) => {
|
|
4841
|
-
if (!x[
|
|
4842
|
-
this._log.error("Missing value in querySubs", { hash:
|
|
4857
|
+
if (!x[g]) {
|
|
4858
|
+
this._log.error("Missing value in querySubs", { hash: g, q: m });
|
|
4843
4859
|
return;
|
|
4844
4860
|
}
|
|
4845
|
-
x[
|
|
4861
|
+
x[g].result = { store: E, pageInfo: S, aggregate: I, processedTxId: y };
|
|
4846
4862
|
});
|
|
4847
|
-
}), this._cleanupPendingMutationsQueries(),
|
|
4848
|
-
this.notifyOne(
|
|
4863
|
+
}), this._cleanupPendingMutationsQueries(), w.forEach(({ hash: g }) => {
|
|
4864
|
+
this.notifyOne(g);
|
|
4849
4865
|
});
|
|
4850
4866
|
break;
|
|
4851
4867
|
}
|
|
@@ -4855,10 +4871,10 @@ class Nu {
|
|
|
4855
4871
|
const b = this._rewriteMutations(this.attrs, this._pendingMutations()).get(l);
|
|
4856
4872
|
if (!b)
|
|
4857
4873
|
break;
|
|
4858
|
-
this._updatePendingMutations((
|
|
4859
|
-
|
|
4874
|
+
this._updatePendingMutations((w) => {
|
|
4875
|
+
w.set(l, Object.assign(Object.assign({}, w.get(l)), { "tx-id": p, confirmed: Date.now() }));
|
|
4860
4876
|
});
|
|
4861
|
-
const _ = b["tx-steps"].filter(([
|
|
4877
|
+
const _ = b["tx-steps"].filter(([w, ...g]) => w === "add-attr").map(([w, g]) => g).concat(Object.values(this.attrs));
|
|
4862
4878
|
this._setAttrs(_), this._finishTransaction("synced", l), this._cleanupPendingMutationsTimeout();
|
|
4863
4879
|
break;
|
|
4864
4880
|
}
|
|
@@ -4917,7 +4933,7 @@ class Nu {
|
|
|
4917
4933
|
/**
|
|
4918
4934
|
* @param {'timeout' | 'error'} status
|
|
4919
4935
|
* @param {string} eventId
|
|
4920
|
-
* @param {{message
|
|
4936
|
+
* @param {{message?: string, type?: string, status?: number, hint?: unknown}} errorMsg
|
|
4921
4937
|
*/
|
|
4922
4938
|
_handleMutationError(e, n, r) {
|
|
4923
4939
|
const i = this._pendingMutations().get(n);
|
|
@@ -4943,8 +4959,8 @@ class Nu {
|
|
|
4943
4959
|
return;
|
|
4944
4960
|
}
|
|
4945
4961
|
if (!((n = e["original-event"]) === null || n === void 0) && n.hasOwnProperty("q") && ((r = e["original-event"]) === null || r === void 0 ? void 0 : r.op) === "add-query") {
|
|
4946
|
-
const y = (i = e["original-event"]) === null || i === void 0 ? void 0 : i.q, b =
|
|
4947
|
-
this.notifyQueryError(
|
|
4962
|
+
const y = (i = e["original-event"]) === null || i === void 0 ? void 0 : i.q, b = z(y);
|
|
4963
|
+
this.notifyQueryError(z(y), f), this.notifyQueryOnceError(y, b, d, f);
|
|
4948
4964
|
return;
|
|
4949
4965
|
}
|
|
4950
4966
|
if (((s = e["original-event"]) === null || s === void 0 ? void 0 : s.op) === "init") {
|
|
@@ -4997,7 +5013,7 @@ class Nu {
|
|
|
4997
5013
|
subscribeQuery(e, n, r) {
|
|
4998
5014
|
var i;
|
|
4999
5015
|
this.config.disableValidation || Wr(e, this.config.schema), r && "ruleParams" in r && (e = Object.assign({ $$ruleParams: r.ruleParams }, e));
|
|
5000
|
-
const s =
|
|
5016
|
+
const s = z(e), o = this.getPreviousResult(e);
|
|
5001
5017
|
return o && n(o), this.queryCbs[s] = (i = this.queryCbs[s]) !== null && i !== void 0 ? i : [], this.queryCbs[s].push({ q: e, cb: n }), this._startQuerySub(e, s), () => {
|
|
5002
5018
|
this._unsubQuery(e, s, n);
|
|
5003
5019
|
};
|
|
@@ -5010,8 +5026,8 @@ class Nu {
|
|
|
5010
5026
|
return i.reject(new Error("We can't run `queryOnce`, because the device is offline.")), i.promise;
|
|
5011
5027
|
if (!this.querySubs)
|
|
5012
5028
|
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;
|
|
5013
|
-
const s =
|
|
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")),
|
|
5029
|
+
const s = z(e), o = this._startQuerySub(e, s);
|
|
5030
|
+
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")), Pu), i.promise;
|
|
5015
5031
|
}
|
|
5016
5032
|
_completeQueryOnce(e, n, r) {
|
|
5017
5033
|
this.queryOnceDfds[n] && (this.queryOnceDfds[n] = this.queryOnceDfds[n].filter((i) => i.dfd !== r), this._cleanupQuery(e, n));
|
|
@@ -5044,10 +5060,10 @@ class Nu {
|
|
|
5044
5060
|
return /* @__PURE__ */ new Map();
|
|
5045
5061
|
const i = (c) => {
|
|
5046
5062
|
const [f, l, p] = c["forward-identity"];
|
|
5047
|
-
return
|
|
5063
|
+
return V(e, l, p);
|
|
5048
5064
|
}, s = (c) => {
|
|
5049
5065
|
const [f, l, p] = c["forward-identity"];
|
|
5050
|
-
return
|
|
5066
|
+
return Ae(e, l, p);
|
|
5051
5067
|
}, o = { attrIdMap: {}, refSwapAttrIds: /* @__PURE__ */ new Set() };
|
|
5052
5068
|
let a = !1;
|
|
5053
5069
|
const u = (c, f) => {
|
|
@@ -5055,15 +5071,15 @@ class Nu {
|
|
|
5055
5071
|
for (const p of c) {
|
|
5056
5072
|
const [y] = p;
|
|
5057
5073
|
if (y === "add-attr") {
|
|
5058
|
-
const [_,
|
|
5059
|
-
if (
|
|
5060
|
-
o.attrIdMap[
|
|
5074
|
+
const [_, w] = p, g = i(w);
|
|
5075
|
+
if (g && w.id !== g.id) {
|
|
5076
|
+
o.attrIdMap[w.id] = g.id, a = !0;
|
|
5061
5077
|
continue;
|
|
5062
5078
|
}
|
|
5063
|
-
if (
|
|
5064
|
-
const m = s(
|
|
5079
|
+
if (w["value-type"] === "ref") {
|
|
5080
|
+
const m = s(w);
|
|
5065
5081
|
if (m) {
|
|
5066
|
-
o.attrIdMap[
|
|
5082
|
+
o.attrIdMap[w.id] = m.id, o.refSwapAttrIds.add(w.id), a = !0;
|
|
5067
5083
|
continue;
|
|
5068
5084
|
}
|
|
5069
5085
|
}
|
|
@@ -5124,7 +5140,7 @@ class Nu {
|
|
|
5124
5140
|
}
|
|
5125
5141
|
_applyOptimisticUpdates(e, n, r) {
|
|
5126
5142
|
for (const [i, s] of n)
|
|
5127
|
-
(!s["tx-id"] || r && s["tx-id"] > r) && (e =
|
|
5143
|
+
(!s["tx-id"] || r && s["tx-id"] > r) && (e = To(e, s["tx-steps"]));
|
|
5128
5144
|
return e;
|
|
5129
5145
|
}
|
|
5130
5146
|
/** Re-compute all subscriptions */
|
|
@@ -5233,7 +5249,7 @@ class Nu {
|
|
|
5233
5249
|
return;
|
|
5234
5250
|
}
|
|
5235
5251
|
const e = this._transport;
|
|
5236
|
-
this._transport =
|
|
5252
|
+
this._transport = xu({
|
|
5237
5253
|
transportType: this._transportType,
|
|
5238
5254
|
appId: this.config.appId,
|
|
5239
5255
|
apiURI: this.config.apiURI,
|
|
@@ -5343,7 +5359,7 @@ class Nu {
|
|
|
5343
5359
|
return F(this, void 0, void 0, function* () {
|
|
5344
5360
|
const { user: e, error: n } = yield this.getCurrentUser();
|
|
5345
5361
|
if (n)
|
|
5346
|
-
throw new
|
|
5362
|
+
throw new Ke("Could not get current user: " + n.message);
|
|
5347
5363
|
return e;
|
|
5348
5364
|
});
|
|
5349
5365
|
}
|
|
@@ -5649,7 +5665,7 @@ class Nu {
|
|
|
5649
5665
|
Or(d, c, l);
|
|
5650
5666
|
break;
|
|
5651
5667
|
case "-":
|
|
5652
|
-
|
|
5668
|
+
wi(d, c);
|
|
5653
5669
|
break;
|
|
5654
5670
|
}
|
|
5655
5671
|
delete d[this._sessionId];
|
|
@@ -5748,7 +5764,7 @@ class Nu {
|
|
|
5748
5764
|
});
|
|
5749
5765
|
}
|
|
5750
5766
|
}
|
|
5751
|
-
function
|
|
5767
|
+
function qu(t, e) {
|
|
5752
5768
|
return new Lt(
|
|
5753
5769
|
Zi(t, e),
|
|
5754
5770
|
// (XXX): LinksDef<any> stems from TypeScript’s inability to reconcile the
|
|
@@ -5760,25 +5776,25 @@ function Ku(t, e) {
|
|
|
5760
5776
|
void 0
|
|
5761
5777
|
);
|
|
5762
5778
|
}
|
|
5763
|
-
function
|
|
5779
|
+
function Wu(t) {
|
|
5764
5780
|
return new Ut(t, {});
|
|
5765
5781
|
}
|
|
5766
|
-
function
|
|
5782
|
+
function zu() {
|
|
5767
5783
|
return new H("string", !0, !1);
|
|
5768
5784
|
}
|
|
5769
|
-
function
|
|
5785
|
+
function Vu() {
|
|
5770
5786
|
return new H("number", !0, !1);
|
|
5771
5787
|
}
|
|
5772
|
-
function
|
|
5788
|
+
function Bu() {
|
|
5773
5789
|
return new H("boolean", !0, !1);
|
|
5774
5790
|
}
|
|
5775
|
-
function
|
|
5791
|
+
function Gu() {
|
|
5776
5792
|
return new H("date", !0, !1);
|
|
5777
5793
|
}
|
|
5778
|
-
function
|
|
5794
|
+
function Qu() {
|
|
5779
5795
|
return new H("json", !0, !1);
|
|
5780
5796
|
}
|
|
5781
|
-
function
|
|
5797
|
+
function Hu() {
|
|
5782
5798
|
return new H("json", !0, !1);
|
|
5783
5799
|
}
|
|
5784
5800
|
function Zi(t, e) {
|
|
@@ -5797,7 +5813,7 @@ function Zi(t, e) {
|
|
|
5797
5813
|
new Ut(d.attrs, Object.assign(Object.assign({}, o.fwd[u]), o.rev[u]))
|
|
5798
5814
|
]));
|
|
5799
5815
|
}
|
|
5800
|
-
function
|
|
5816
|
+
function Yu({ entities: t, links: e, rooms: n }) {
|
|
5801
5817
|
const r = e ?? {}, i = n ?? {};
|
|
5802
5818
|
return new Lt(
|
|
5803
5819
|
Zi(t, r),
|
|
@@ -5810,23 +5826,23 @@ function Hu({ entities: t, links: e, rooms: n }) {
|
|
|
5810
5826
|
i
|
|
5811
5827
|
);
|
|
5812
5828
|
}
|
|
5813
|
-
const
|
|
5829
|
+
const Kc = {
|
|
5814
5830
|
// constructs
|
|
5815
|
-
graph:
|
|
5816
|
-
schema:
|
|
5817
|
-
entity:
|
|
5831
|
+
graph: qu,
|
|
5832
|
+
schema: Yu,
|
|
5833
|
+
entity: Wu,
|
|
5818
5834
|
// value types
|
|
5819
|
-
string:
|
|
5820
|
-
number:
|
|
5821
|
-
boolean:
|
|
5822
|
-
date:
|
|
5823
|
-
json:
|
|
5824
|
-
any:
|
|
5835
|
+
string: zu,
|
|
5836
|
+
number: Vu,
|
|
5837
|
+
boolean: Bu,
|
|
5838
|
+
date: Gu,
|
|
5839
|
+
json: Qu,
|
|
5840
|
+
any: Hu
|
|
5825
5841
|
};
|
|
5826
5842
|
let mt;
|
|
5827
|
-
function
|
|
5843
|
+
function Ju(t, e) {
|
|
5828
5844
|
mt == null || mt.dispose();
|
|
5829
|
-
const n =
|
|
5845
|
+
const n = rc(e), r = ec(e, a), i = Xu(Zu(t));
|
|
5830
5846
|
function s(c) {
|
|
5831
5847
|
var f;
|
|
5832
5848
|
c.source === i.element.contentWindow && ((f = c.data) === null || f === void 0 ? void 0 : f.type) === "close" && n.isVisible() && a();
|
|
@@ -5848,10 +5864,10 @@ function Yu(t, e) {
|
|
|
5848
5864
|
}
|
|
5849
5865
|
return d();
|
|
5850
5866
|
}
|
|
5851
|
-
function
|
|
5867
|
+
function Zu(t) {
|
|
5852
5868
|
return `${Bn || zi ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
|
|
5853
5869
|
}
|
|
5854
|
-
function
|
|
5870
|
+
function Xu(t) {
|
|
5855
5871
|
const e = document.createElement("iframe");
|
|
5856
5872
|
return e.src = t, e.className = "instant-devtool-iframe", Object.assign(e.style, {
|
|
5857
5873
|
width: "100%",
|
|
@@ -5860,7 +5876,7 @@ function Zu(t) {
|
|
|
5860
5876
|
border: "none"
|
|
5861
5877
|
}), { element: e };
|
|
5862
5878
|
}
|
|
5863
|
-
function
|
|
5879
|
+
function ec(t, e) {
|
|
5864
5880
|
const n = `
|
|
5865
5881
|
<svg width="32" height="32" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5866
5882
|
<rect width="512" height="512" fill="black"/>
|
|
@@ -5870,7 +5886,7 @@ function Xu(t, e) {
|
|
|
5870
5886
|
return r.innerHTML = n, r.className = "instant-devtool-toggler", Object.assign(r.style, Object.assign(Object.assign({
|
|
5871
5887
|
// pos
|
|
5872
5888
|
position: "fixed"
|
|
5873
|
-
},
|
|
5889
|
+
}, tc(t.position)), {
|
|
5874
5890
|
height: "32px",
|
|
5875
5891
|
width: "32px",
|
|
5876
5892
|
// layout
|
|
@@ -5885,7 +5901,7 @@ function Xu(t, e) {
|
|
|
5885
5901
|
cursor: "pointer"
|
|
5886
5902
|
})), r.addEventListener("click", e), { element: r };
|
|
5887
5903
|
}
|
|
5888
|
-
function
|
|
5904
|
+
function tc(t) {
|
|
5889
5905
|
switch (t) {
|
|
5890
5906
|
case "bottom-left":
|
|
5891
5907
|
return { bottom: "24px", left: "24px" };
|
|
@@ -5897,7 +5913,7 @@ function ec(t) {
|
|
|
5897
5913
|
return { top: "24px", left: "24px" };
|
|
5898
5914
|
}
|
|
5899
5915
|
}
|
|
5900
|
-
function
|
|
5916
|
+
function nc(t) {
|
|
5901
5917
|
switch (t) {
|
|
5902
5918
|
case "bottom-left":
|
|
5903
5919
|
return { bottom: "24px", right: "24px", left: "60px", top: "72px" };
|
|
@@ -5909,23 +5925,23 @@ function tc(t) {
|
|
|
5909
5925
|
return { top: "24px", right: "24px", left: "60px", bottom: "72px" };
|
|
5910
5926
|
}
|
|
5911
5927
|
}
|
|
5912
|
-
function
|
|
5928
|
+
function rc(t) {
|
|
5913
5929
|
const e = document.createElement("div");
|
|
5914
|
-
Object.assign(e.style, Object.assign(Object.assign({ position: "fixed" },
|
|
5930
|
+
Object.assign(e.style, Object.assign(Object.assign({ position: "fixed" }, nc(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";
|
|
5915
5931
|
function n() {
|
|
5916
5932
|
return e.style.display !== "none";
|
|
5917
5933
|
}
|
|
5918
5934
|
return { element: e, isVisible: n };
|
|
5919
5935
|
}
|
|
5920
|
-
const
|
|
5936
|
+
const ic = {
|
|
5921
5937
|
apiURI: "https://api.instantdb.com",
|
|
5922
5938
|
websocketURI: "wss://api.instantdb.com/runtime/session"
|
|
5923
5939
|
};
|
|
5924
|
-
function
|
|
5940
|
+
function sc() {
|
|
5925
5941
|
var t;
|
|
5926
5942
|
return globalThis.__instantDbSchemaHashStore = (t = globalThis.__instantDbSchemaHashStore) !== null && t !== void 0 ? t : /* @__PURE__ */ new WeakMap(), globalThis.__instantDbSchemaHashStore;
|
|
5927
5943
|
}
|
|
5928
|
-
function
|
|
5944
|
+
function oc() {
|
|
5929
5945
|
var t;
|
|
5930
5946
|
return globalThis.__instantDbStore = (t = globalThis.__instantDbStore) !== null && t !== void 0 ? t : {}, globalThis.__instantDbStore;
|
|
5931
5947
|
}
|
|
@@ -5933,23 +5949,23 @@ function mn(t) {
|
|
|
5933
5949
|
const e = t.__adminToken;
|
|
5934
5950
|
return t.appId + "_" + (t.websocketURI || "default_ws_uri") + "_" + (t.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + t.useDateObjects;
|
|
5935
5951
|
}
|
|
5936
|
-
const vn =
|
|
5937
|
-
class
|
|
5952
|
+
const vn = oc(), en = sc();
|
|
5953
|
+
class ac {
|
|
5938
5954
|
constructor(e) {
|
|
5939
5955
|
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);
|
|
5940
5956
|
}
|
|
5941
5957
|
}
|
|
5942
|
-
class
|
|
5958
|
+
class uc {
|
|
5943
5959
|
constructor(e) {
|
|
5944
5960
|
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);
|
|
5945
5961
|
}
|
|
5946
5962
|
}
|
|
5947
|
-
function
|
|
5963
|
+
function cc(t) {
|
|
5948
5964
|
return JSON.parse(JSON.stringify(t));
|
|
5949
5965
|
}
|
|
5950
|
-
class
|
|
5966
|
+
class dc {
|
|
5951
5967
|
constructor(e) {
|
|
5952
|
-
this.tx = Vn(), this._reactor = e, this.auth = new
|
|
5968
|
+
this.tx = Vn(), this._reactor = e, this.auth = new ac(this._reactor), this.storage = new uc(this._reactor);
|
|
5953
5969
|
}
|
|
5954
5970
|
/**
|
|
5955
5971
|
* Use this to write data! You can create, update, delete, and link objects
|
|
@@ -6128,24 +6144,24 @@ function ei(t) {
|
|
|
6128
6144
|
return "0";
|
|
6129
6145
|
if (en.get(t))
|
|
6130
6146
|
return en.get(t);
|
|
6131
|
-
const e =
|
|
6147
|
+
const e = z(t);
|
|
6132
6148
|
return en.set(t, e), e;
|
|
6133
6149
|
}
|
|
6134
|
-
function
|
|
6150
|
+
function fc(t, e) {
|
|
6135
6151
|
return ei(t._reactor.config.schema) !== ei(e);
|
|
6136
6152
|
}
|
|
6137
|
-
function
|
|
6153
|
+
function lc(t, e, n, r, i) {
|
|
6138
6154
|
const s = vn[mn(t)];
|
|
6139
6155
|
if (s)
|
|
6140
|
-
return
|
|
6141
|
-
const o = new
|
|
6142
|
-
return vn[mn(t)] = a,
|
|
6156
|
+
return fc(s, t.schema) && s._reactor.updateSchema(t.schema), s;
|
|
6157
|
+
const o = new Ku(Object.assign(Object.assign(Object.assign({}, ic), t), { cardinalityInference: !!t.schema }), e || Ki, n || qi, Object.assign(Object.assign({}, r || {}), { "@instantdb/core": Gn }), i), a = new dc(o);
|
|
6158
|
+
return vn[mn(t)] = a, hc(t.appId, t.devtool), a;
|
|
6143
6159
|
}
|
|
6144
|
-
function
|
|
6160
|
+
function hc(t, e) {
|
|
6145
6161
|
if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
|
|
6146
6162
|
return;
|
|
6147
6163
|
const n = Object.assign({ position: "bottom-right", allowedHosts: ["localhost"] }, typeof e == "object" ? e : {});
|
|
6148
|
-
n.allowedHosts.includes(window.location.hostname) &&
|
|
6164
|
+
n.allowedHosts.includes(window.location.hostname) && Ju(t, n);
|
|
6149
6165
|
}
|
|
6150
6166
|
var Sn = { exports: {} }, He = {};
|
|
6151
6167
|
/**
|
|
@@ -6158,7 +6174,7 @@ var Sn = { exports: {} }, He = {};
|
|
|
6158
6174
|
* LICENSE file in the root directory of this source tree.
|
|
6159
6175
|
*/
|
|
6160
6176
|
var ti;
|
|
6161
|
-
function
|
|
6177
|
+
function pc() {
|
|
6162
6178
|
if (ti) return He;
|
|
6163
6179
|
ti = 1;
|
|
6164
6180
|
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,7 +6188,7 @@ function hc() {
|
|
|
6172
6188
|
return He.Fragment = n, He.jsx = o, He.jsxs = o, He;
|
|
6173
6189
|
}
|
|
6174
6190
|
var Ye = {}, ni;
|
|
6175
|
-
function
|
|
6191
|
+
function yc() {
|
|
6176
6192
|
if (ni) return Ye;
|
|
6177
6193
|
ni = 1;
|
|
6178
6194
|
var t = {};
|
|
@@ -6187,44 +6203,44 @@ function pc() {
|
|
|
6187
6203
|
*/
|
|
6188
6204
|
return t.NODE_ENV !== "production" && function() {
|
|
6189
6205
|
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";
|
|
6190
|
-
function
|
|
6206
|
+
function w(h) {
|
|
6191
6207
|
if (h === null || typeof h != "object")
|
|
6192
6208
|
return null;
|
|
6193
|
-
var
|
|
6194
|
-
return typeof
|
|
6209
|
+
var T = b && h[b] || h[_];
|
|
6210
|
+
return typeof T == "function" ? T : null;
|
|
6195
6211
|
}
|
|
6196
|
-
var
|
|
6212
|
+
var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
6197
6213
|
function m(h) {
|
|
6198
6214
|
{
|
|
6199
|
-
for (var
|
|
6215
|
+
for (var T = arguments.length, v = new Array(T > 1 ? T - 1 : 0), O = 1; O < T; O++)
|
|
6200
6216
|
v[O - 1] = arguments[O];
|
|
6201
6217
|
E("error", h, v);
|
|
6202
6218
|
}
|
|
6203
6219
|
}
|
|
6204
|
-
function E(h,
|
|
6220
|
+
function E(h, T, v) {
|
|
6205
6221
|
{
|
|
6206
|
-
var O =
|
|
6207
|
-
P !== "" && (
|
|
6222
|
+
var O = g.ReactDebugCurrentFrame, P = O.getStackAddendum();
|
|
6223
|
+
P !== "" && (T += "%s", v = v.concat([P]));
|
|
6208
6224
|
var M = v.map(function(C) {
|
|
6209
6225
|
return String(C);
|
|
6210
6226
|
});
|
|
6211
|
-
M.unshift("Warning: " +
|
|
6227
|
+
M.unshift("Warning: " + T), Function.prototype.apply.call(console[h], console, M);
|
|
6212
6228
|
}
|
|
6213
6229
|
}
|
|
6214
|
-
var S = !1, I = !1, x = !1,
|
|
6230
|
+
var S = !1, I = !1, x = !1, B = !1, Ve = !1, lt;
|
|
6215
6231
|
lt = Symbol.for("react.module.reference");
|
|
6216
6232
|
function Ft(h) {
|
|
6217
|
-
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o ||
|
|
6233
|
+
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o || Ve || h === s || h === c || h === f || B || 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
|
|
6218
6234
|
// types supported by any Flight configuration anywhere since
|
|
6219
6235
|
// we don't know which Flight build this will end up being used
|
|
6220
6236
|
// with.
|
|
6221
6237
|
h.$$typeof === lt || h.getModuleId !== void 0));
|
|
6222
6238
|
}
|
|
6223
|
-
function Nt(h,
|
|
6239
|
+
function Nt(h, T, v) {
|
|
6224
6240
|
var O = h.displayName;
|
|
6225
6241
|
if (O)
|
|
6226
6242
|
return O;
|
|
6227
|
-
var P =
|
|
6243
|
+
var P = T.displayName || T.name || "";
|
|
6228
6244
|
return P !== "" ? v + "(" + P + ")" : v;
|
|
6229
6245
|
}
|
|
6230
6246
|
function ht(h) {
|
|
@@ -6254,8 +6270,8 @@ function pc() {
|
|
|
6254
6270
|
if (typeof h == "object")
|
|
6255
6271
|
switch (h.$$typeof) {
|
|
6256
6272
|
case u:
|
|
6257
|
-
var
|
|
6258
|
-
return ht(
|
|
6273
|
+
var T = h;
|
|
6274
|
+
return ht(T) + ".Consumer";
|
|
6259
6275
|
case a:
|
|
6260
6276
|
var v = h;
|
|
6261
6277
|
return ht(v._context) + ".Provider";
|
|
@@ -6275,7 +6291,7 @@ function pc() {
|
|
|
6275
6291
|
}
|
|
6276
6292
|
return null;
|
|
6277
6293
|
}
|
|
6278
|
-
var
|
|
6294
|
+
var we = Object.assign, Be = 0, Yn, Jn, Zn, Xn, er, tr, nr;
|
|
6279
6295
|
function rr() {
|
|
6280
6296
|
}
|
|
6281
6297
|
rr.__reactDisabledLog = !0;
|
|
@@ -6311,25 +6327,25 @@ function pc() {
|
|
|
6311
6327
|
writable: !0
|
|
6312
6328
|
};
|
|
6313
6329
|
Object.defineProperties(console, {
|
|
6314
|
-
log:
|
|
6330
|
+
log: we({}, h, {
|
|
6315
6331
|
value: Yn
|
|
6316
6332
|
}),
|
|
6317
|
-
info:
|
|
6333
|
+
info: we({}, h, {
|
|
6318
6334
|
value: Jn
|
|
6319
6335
|
}),
|
|
6320
|
-
warn:
|
|
6336
|
+
warn: we({}, h, {
|
|
6321
6337
|
value: Zn
|
|
6322
6338
|
}),
|
|
6323
|
-
error:
|
|
6339
|
+
error: we({}, h, {
|
|
6324
6340
|
value: Xn
|
|
6325
6341
|
}),
|
|
6326
|
-
group:
|
|
6342
|
+
group: we({}, h, {
|
|
6327
6343
|
value: er
|
|
6328
6344
|
}),
|
|
6329
|
-
groupCollapsed:
|
|
6345
|
+
groupCollapsed: we({}, h, {
|
|
6330
6346
|
value: tr
|
|
6331
6347
|
}),
|
|
6332
|
-
groupEnd:
|
|
6348
|
+
groupEnd: we({}, h, {
|
|
6333
6349
|
value: nr
|
|
6334
6350
|
})
|
|
6335
6351
|
});
|
|
@@ -6337,8 +6353,8 @@ function pc() {
|
|
|
6337
6353
|
Be < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
6338
6354
|
}
|
|
6339
6355
|
}
|
|
6340
|
-
var Kt =
|
|
6341
|
-
function pt(h,
|
|
6356
|
+
var Kt = g.ReactCurrentDispatcher, qt;
|
|
6357
|
+
function pt(h, T, v) {
|
|
6342
6358
|
{
|
|
6343
6359
|
if (qt === void 0)
|
|
6344
6360
|
try {
|
|
@@ -6356,7 +6372,7 @@ function pc() {
|
|
|
6356
6372
|
var ns = typeof WeakMap == "function" ? WeakMap : Map;
|
|
6357
6373
|
yt = new ns();
|
|
6358
6374
|
}
|
|
6359
|
-
function ir(h,
|
|
6375
|
+
function ir(h, T) {
|
|
6360
6376
|
if (!h || Wt)
|
|
6361
6377
|
return "";
|
|
6362
6378
|
{
|
|
@@ -6371,7 +6387,7 @@ function pc() {
|
|
|
6371
6387
|
var M;
|
|
6372
6388
|
M = Kt.current, Kt.current = null, es();
|
|
6373
6389
|
try {
|
|
6374
|
-
if (
|
|
6390
|
+
if (T) {
|
|
6375
6391
|
var C = function() {
|
|
6376
6392
|
throw Error();
|
|
6377
6393
|
};
|
|
@@ -6424,17 +6440,17 @@ function pc() {
|
|
|
6424
6440
|
} finally {
|
|
6425
6441
|
Wt = !1, Kt.current = M, ts(), Error.prepareStackTrace = P;
|
|
6426
6442
|
}
|
|
6427
|
-
var
|
|
6428
|
-
return typeof h == "function" && yt.set(h,
|
|
6443
|
+
var Ie = h ? h.displayName || h.name : "", me = Ie ? pt(Ie) : "";
|
|
6444
|
+
return typeof h == "function" && yt.set(h, me), me;
|
|
6429
6445
|
}
|
|
6430
|
-
function rs(h,
|
|
6446
|
+
function rs(h, T, v) {
|
|
6431
6447
|
return ir(h, !1);
|
|
6432
6448
|
}
|
|
6433
6449
|
function is(h) {
|
|
6434
|
-
var
|
|
6435
|
-
return !!(
|
|
6450
|
+
var T = h.prototype;
|
|
6451
|
+
return !!(T && T.isReactComponent);
|
|
6436
6452
|
}
|
|
6437
|
-
function bt(h,
|
|
6453
|
+
function bt(h, T, v) {
|
|
6438
6454
|
if (h == null)
|
|
6439
6455
|
return "";
|
|
6440
6456
|
if (typeof h == "function")
|
|
@@ -6452,26 +6468,26 @@ function pc() {
|
|
|
6452
6468
|
case d:
|
|
6453
6469
|
return rs(h.render);
|
|
6454
6470
|
case l:
|
|
6455
|
-
return bt(h.type,
|
|
6471
|
+
return bt(h.type, T, v);
|
|
6456
6472
|
case p: {
|
|
6457
6473
|
var O = h, P = O._payload, M = O._init;
|
|
6458
6474
|
try {
|
|
6459
|
-
return bt(M(P),
|
|
6475
|
+
return bt(M(P), T, v);
|
|
6460
6476
|
} catch {
|
|
6461
6477
|
}
|
|
6462
6478
|
}
|
|
6463
6479
|
}
|
|
6464
6480
|
return "";
|
|
6465
6481
|
}
|
|
6466
|
-
var Ge = Object.prototype.hasOwnProperty, sr = {}, or =
|
|
6482
|
+
var Ge = Object.prototype.hasOwnProperty, sr = {}, or = g.ReactDebugCurrentFrame;
|
|
6467
6483
|
function _t(h) {
|
|
6468
6484
|
if (h) {
|
|
6469
|
-
var
|
|
6485
|
+
var T = h._owner, v = bt(h.type, h._source, T ? T.type : null);
|
|
6470
6486
|
or.setExtraStackFrame(v);
|
|
6471
6487
|
} else
|
|
6472
6488
|
or.setExtraStackFrame(null);
|
|
6473
6489
|
}
|
|
6474
|
-
function ss(h,
|
|
6490
|
+
function ss(h, T, v, O, P) {
|
|
6475
6491
|
{
|
|
6476
6492
|
var M = Function.call.bind(Ge);
|
|
6477
6493
|
for (var C in h)
|
|
@@ -6482,7 +6498,7 @@ function pc() {
|
|
|
6482
6498
|
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`.");
|
|
6483
6499
|
throw G.name = "Invariant Violation", G;
|
|
6484
6500
|
}
|
|
6485
|
-
k = h[C](
|
|
6501
|
+
k = h[C](T, C, O, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
6486
6502
|
} catch (D) {
|
|
6487
6503
|
k = D;
|
|
6488
6504
|
}
|
|
@@ -6496,7 +6512,7 @@ function pc() {
|
|
|
6496
6512
|
}
|
|
6497
6513
|
function as(h) {
|
|
6498
6514
|
{
|
|
6499
|
-
var
|
|
6515
|
+
var T = typeof Symbol == "function" && Symbol.toStringTag, v = T && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
6500
6516
|
return v;
|
|
6501
6517
|
}
|
|
6502
6518
|
}
|
|
@@ -6514,7 +6530,7 @@ function pc() {
|
|
|
6514
6530
|
if (us(h))
|
|
6515
6531
|
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);
|
|
6516
6532
|
}
|
|
6517
|
-
var cr =
|
|
6533
|
+
var cr = g.ReactCurrentOwner, cs = {
|
|
6518
6534
|
key: !0,
|
|
6519
6535
|
ref: !0,
|
|
6520
6536
|
__self: !0,
|
|
@@ -6522,27 +6538,27 @@ function pc() {
|
|
|
6522
6538
|
}, dr, fr;
|
|
6523
6539
|
function ds(h) {
|
|
6524
6540
|
if (Ge.call(h, "ref")) {
|
|
6525
|
-
var
|
|
6526
|
-
if (
|
|
6541
|
+
var T = Object.getOwnPropertyDescriptor(h, "ref").get;
|
|
6542
|
+
if (T && T.isReactWarning)
|
|
6527
6543
|
return !1;
|
|
6528
6544
|
}
|
|
6529
6545
|
return h.ref !== void 0;
|
|
6530
6546
|
}
|
|
6531
6547
|
function fs(h) {
|
|
6532
6548
|
if (Ge.call(h, "key")) {
|
|
6533
|
-
var
|
|
6534
|
-
if (
|
|
6549
|
+
var T = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
6550
|
+
if (T && T.isReactWarning)
|
|
6535
6551
|
return !1;
|
|
6536
6552
|
}
|
|
6537
6553
|
return h.key !== void 0;
|
|
6538
6554
|
}
|
|
6539
|
-
function ls(h,
|
|
6555
|
+
function ls(h, T) {
|
|
6540
6556
|
typeof h.ref == "string" && cr.current;
|
|
6541
6557
|
}
|
|
6542
|
-
function hs(h,
|
|
6558
|
+
function hs(h, T) {
|
|
6543
6559
|
{
|
|
6544
6560
|
var v = function() {
|
|
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)",
|
|
6561
|
+
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)", T));
|
|
6546
6562
|
};
|
|
6547
6563
|
v.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
6548
6564
|
get: v,
|
|
@@ -6550,10 +6566,10 @@ function pc() {
|
|
|
6550
6566
|
});
|
|
6551
6567
|
}
|
|
6552
6568
|
}
|
|
6553
|
-
function ps(h,
|
|
6569
|
+
function ps(h, T) {
|
|
6554
6570
|
{
|
|
6555
6571
|
var v = function() {
|
|
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)",
|
|
6572
|
+
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)", T));
|
|
6557
6573
|
};
|
|
6558
6574
|
v.isReactWarning = !0, Object.defineProperty(h, "ref", {
|
|
6559
6575
|
get: v,
|
|
@@ -6561,13 +6577,13 @@ function pc() {
|
|
|
6561
6577
|
});
|
|
6562
6578
|
}
|
|
6563
6579
|
}
|
|
6564
|
-
var ys = function(h,
|
|
6580
|
+
var ys = function(h, T, v, O, P, M, C) {
|
|
6565
6581
|
var k = {
|
|
6566
6582
|
// This tag allows us to uniquely identify this as a React Element
|
|
6567
6583
|
$$typeof: n,
|
|
6568
6584
|
// Built-in properties that belong on the element
|
|
6569
6585
|
type: h,
|
|
6570
|
-
key:
|
|
6586
|
+
key: T,
|
|
6571
6587
|
ref: v,
|
|
6572
6588
|
props: C,
|
|
6573
6589
|
// Record the component responsible for creating this element.
|
|
@@ -6590,12 +6606,12 @@ function pc() {
|
|
|
6590
6606
|
value: P
|
|
6591
6607
|
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
|
|
6592
6608
|
};
|
|
6593
|
-
function bs(h,
|
|
6609
|
+
function bs(h, T, v, O, P) {
|
|
6594
6610
|
{
|
|
6595
6611
|
var M, C = {}, k = null, G = null;
|
|
6596
|
-
v !== void 0 && (ur(v), k = "" + v), fs(
|
|
6597
|
-
for (M in
|
|
6598
|
-
Ge.call(
|
|
6612
|
+
v !== void 0 && (ur(v), k = "" + v), fs(T) && (ur(T.key), k = "" + T.key), ds(T) && (G = T.ref, ls(T, P));
|
|
6613
|
+
for (M in T)
|
|
6614
|
+
Ge.call(T, M) && !cs.hasOwnProperty(M) && (C[M] = T[M]);
|
|
6599
6615
|
if (h && h.defaultProps) {
|
|
6600
6616
|
var D = h.defaultProps;
|
|
6601
6617
|
for (M in D)
|
|
@@ -6608,10 +6624,10 @@ function pc() {
|
|
|
6608
6624
|
return ys(h, k, G, P, O, cr.current, C);
|
|
6609
6625
|
}
|
|
6610
6626
|
}
|
|
6611
|
-
var Vt =
|
|
6612
|
-
function
|
|
6627
|
+
var Vt = g.ReactCurrentOwner, lr = g.ReactDebugCurrentFrame;
|
|
6628
|
+
function Pe(h) {
|
|
6613
6629
|
if (h) {
|
|
6614
|
-
var
|
|
6630
|
+
var T = h._owner, v = bt(h.type, h._source, T ? T.type : null);
|
|
6615
6631
|
lr.setExtraStackFrame(v);
|
|
6616
6632
|
} else
|
|
6617
6633
|
lr.setExtraStackFrame(null);
|
|
@@ -6639,87 +6655,87 @@ Check the render method of \`` + h + "`.";
|
|
|
6639
6655
|
var pr = {};
|
|
6640
6656
|
function gs(h) {
|
|
6641
6657
|
{
|
|
6642
|
-
var
|
|
6643
|
-
if (!
|
|
6658
|
+
var T = hr();
|
|
6659
|
+
if (!T) {
|
|
6644
6660
|
var v = typeof h == "string" ? h : h.displayName || h.name;
|
|
6645
|
-
v && (
|
|
6661
|
+
v && (T = `
|
|
6646
6662
|
|
|
6647
6663
|
Check the top-level render call using <` + v + ">.");
|
|
6648
6664
|
}
|
|
6649
|
-
return
|
|
6665
|
+
return T;
|
|
6650
6666
|
}
|
|
6651
6667
|
}
|
|
6652
|
-
function yr(h,
|
|
6668
|
+
function yr(h, T) {
|
|
6653
6669
|
{
|
|
6654
6670
|
if (!h._store || h._store.validated || h.key != null)
|
|
6655
6671
|
return;
|
|
6656
6672
|
h._store.validated = !0;
|
|
6657
|
-
var v = gs(
|
|
6673
|
+
var v = gs(T);
|
|
6658
6674
|
if (pr[v])
|
|
6659
6675
|
return;
|
|
6660
6676
|
pr[v] = !0;
|
|
6661
6677
|
var O = "";
|
|
6662
|
-
h && h._owner && h._owner !== Vt.current && (O = " It was passed a child from " + ce(h._owner.type) + "."),
|
|
6678
|
+
h && h._owner && h._owner !== Vt.current && (O = " It was passed a child from " + ce(h._owner.type) + "."), Pe(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), Pe(null);
|
|
6663
6679
|
}
|
|
6664
6680
|
}
|
|
6665
|
-
function br(h,
|
|
6681
|
+
function br(h, T) {
|
|
6666
6682
|
{
|
|
6667
6683
|
if (typeof h != "object")
|
|
6668
6684
|
return;
|
|
6669
6685
|
if (zt(h))
|
|
6670
6686
|
for (var v = 0; v < h.length; v++) {
|
|
6671
6687
|
var O = h[v];
|
|
6672
|
-
Gt(O) && yr(O,
|
|
6688
|
+
Gt(O) && yr(O, T);
|
|
6673
6689
|
}
|
|
6674
6690
|
else if (Gt(h))
|
|
6675
6691
|
h._store && (h._store.validated = !0);
|
|
6676
6692
|
else if (h) {
|
|
6677
|
-
var P =
|
|
6693
|
+
var P = w(h);
|
|
6678
6694
|
if (typeof P == "function" && P !== h.entries)
|
|
6679
6695
|
for (var M = P.call(h), C; !(C = M.next()).done; )
|
|
6680
|
-
Gt(C.value) && yr(C.value,
|
|
6696
|
+
Gt(C.value) && yr(C.value, T);
|
|
6681
6697
|
}
|
|
6682
6698
|
}
|
|
6683
6699
|
}
|
|
6684
|
-
function
|
|
6700
|
+
function Ts(h) {
|
|
6685
6701
|
{
|
|
6686
|
-
var
|
|
6687
|
-
if (
|
|
6702
|
+
var T = h.type;
|
|
6703
|
+
if (T == null || typeof T == "string")
|
|
6688
6704
|
return;
|
|
6689
6705
|
var v;
|
|
6690
|
-
if (typeof
|
|
6691
|
-
v =
|
|
6692
|
-
else if (typeof
|
|
6706
|
+
if (typeof T == "function")
|
|
6707
|
+
v = T.propTypes;
|
|
6708
|
+
else if (typeof T == "object" && (T.$$typeof === d || // Note: Memo only checks outer props here.
|
|
6693
6709
|
// Inner props are checked in the reconciler.
|
|
6694
|
-
|
|
6695
|
-
v =
|
|
6710
|
+
T.$$typeof === l))
|
|
6711
|
+
v = T.propTypes;
|
|
6696
6712
|
else
|
|
6697
6713
|
return;
|
|
6698
6714
|
if (v) {
|
|
6699
|
-
var O = ce(
|
|
6715
|
+
var O = ce(T);
|
|
6700
6716
|
ss(v, h.props, "prop", O, h);
|
|
6701
|
-
} else if (
|
|
6717
|
+
} else if (T.PropTypes !== void 0 && !Bt) {
|
|
6702
6718
|
Bt = !0;
|
|
6703
|
-
var P = ce(
|
|
6719
|
+
var P = ce(T);
|
|
6704
6720
|
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
|
|
6705
6721
|
}
|
|
6706
|
-
typeof
|
|
6722
|
+
typeof T.getDefaultProps == "function" && !T.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
6707
6723
|
}
|
|
6708
6724
|
}
|
|
6709
|
-
function
|
|
6725
|
+
function ws(h) {
|
|
6710
6726
|
{
|
|
6711
|
-
for (var
|
|
6712
|
-
var O =
|
|
6727
|
+
for (var T = Object.keys(h.props), v = 0; v < T.length; v++) {
|
|
6728
|
+
var O = T[v];
|
|
6713
6729
|
if (O !== "children" && O !== "key") {
|
|
6714
|
-
|
|
6730
|
+
Pe(h), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", O), Pe(null);
|
|
6715
6731
|
break;
|
|
6716
6732
|
}
|
|
6717
6733
|
}
|
|
6718
|
-
h.ref !== null && (
|
|
6734
|
+
h.ref !== null && (Pe(h), m("Invalid attribute `ref` supplied to `React.Fragment`."), Pe(null));
|
|
6719
6735
|
}
|
|
6720
6736
|
}
|
|
6721
6737
|
var _r = {};
|
|
6722
|
-
function gr(h,
|
|
6738
|
+
function gr(h, T, v, O, P, M) {
|
|
6723
6739
|
{
|
|
6724
6740
|
var C = Ft(h);
|
|
6725
6741
|
if (!C) {
|
|
@@ -6730,53 +6746,53 @@ Check the top-level render call using <` + v + ">.");
|
|
|
6730
6746
|
var D;
|
|
6731
6747
|
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);
|
|
6732
6748
|
}
|
|
6733
|
-
var L = bs(h,
|
|
6749
|
+
var L = bs(h, T, v, P, M);
|
|
6734
6750
|
if (L == null)
|
|
6735
6751
|
return L;
|
|
6736
6752
|
if (C) {
|
|
6737
|
-
var re =
|
|
6753
|
+
var re = T.children;
|
|
6738
6754
|
if (re !== void 0)
|
|
6739
6755
|
if (O)
|
|
6740
6756
|
if (zt(re)) {
|
|
6741
|
-
for (var
|
|
6742
|
-
br(re[
|
|
6757
|
+
for (var Ie = 0; Ie < re.length; Ie++)
|
|
6758
|
+
br(re[Ie], h);
|
|
6743
6759
|
Object.freeze && Object.freeze(re);
|
|
6744
6760
|
} else
|
|
6745
6761
|
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.");
|
|
6746
6762
|
else
|
|
6747
6763
|
br(re, h);
|
|
6748
6764
|
}
|
|
6749
|
-
if (Ge.call(
|
|
6750
|
-
var
|
|
6765
|
+
if (Ge.call(T, "key")) {
|
|
6766
|
+
var me = ce(h), Y = Object.keys(T).filter(function(As) {
|
|
6751
6767
|
return As !== "key";
|
|
6752
6768
|
}), Qt = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
6753
|
-
if (!_r[
|
|
6769
|
+
if (!_r[me + Qt]) {
|
|
6754
6770
|
var Es = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
6755
6771
|
m(`A props object containing a "key" prop is being spread into JSX:
|
|
6756
6772
|
let props = %s;
|
|
6757
6773
|
<%s {...props} />
|
|
6758
6774
|
React keys must be passed directly to JSX without using spread:
|
|
6759
6775
|
let props = %s;
|
|
6760
|
-
<%s key={someKey} {...props} />`, Qt,
|
|
6776
|
+
<%s key={someKey} {...props} />`, Qt, me, Es, me), _r[me + Qt] = !0;
|
|
6761
6777
|
}
|
|
6762
6778
|
}
|
|
6763
|
-
return h === i ?
|
|
6779
|
+
return h === i ? ws(L) : Ts(L), L;
|
|
6764
6780
|
}
|
|
6765
6781
|
}
|
|
6766
|
-
function ms(h,
|
|
6767
|
-
return gr(h,
|
|
6782
|
+
function ms(h, T, v) {
|
|
6783
|
+
return gr(h, T, v, !0);
|
|
6768
6784
|
}
|
|
6769
|
-
function vs(h,
|
|
6770
|
-
return gr(h,
|
|
6785
|
+
function vs(h, T, v) {
|
|
6786
|
+
return gr(h, T, v, !1);
|
|
6771
6787
|
}
|
|
6772
6788
|
var Ss = vs, Os = ms;
|
|
6773
6789
|
Ye.Fragment = i, Ye.jsx = Ss, Ye.jsxs = Os;
|
|
6774
6790
|
}(), Ye;
|
|
6775
6791
|
}
|
|
6776
|
-
var
|
|
6777
|
-
|
|
6778
|
-
var
|
|
6779
|
-
const
|
|
6792
|
+
var bc = {};
|
|
6793
|
+
bc.NODE_ENV === "production" ? Sn.exports = pc() : Sn.exports = yc();
|
|
6794
|
+
var W = Sn.exports;
|
|
6795
|
+
const _c = {
|
|
6780
6796
|
isLoading: !0,
|
|
6781
6797
|
data: void 0,
|
|
6782
6798
|
pageInfo: void 0,
|
|
@@ -6785,9 +6801,9 @@ const bc = {
|
|
|
6785
6801
|
function ri(t) {
|
|
6786
6802
|
return Object.assign({ isLoading: !t, data: void 0, pageInfo: void 0, error: void 0 }, t || {});
|
|
6787
6803
|
}
|
|
6788
|
-
function
|
|
6804
|
+
function gc(t, e, n) {
|
|
6789
6805
|
e && n && "ruleParams" in n && (e = Object.assign({ $$ruleParams: n.ruleParams }, e));
|
|
6790
|
-
const r = e ?
|
|
6806
|
+
const r = e ? cc(e) : null, i = z(r), s = at(ri(t._reactor.getPreviousResult(r))), o = ge(
|
|
6791
6807
|
(u) => (s.current = ri(t._reactor.getPreviousResult(r)), r ? t.subscribeQuery(r, (c) => {
|
|
6792
6808
|
s.current = Object.assign({ isLoading: !c, data: void 0, pageInfo: void 0, error: void 0 }, c), u();
|
|
6793
6809
|
}) : () => {
|
|
@@ -6795,11 +6811,11 @@ function _c(t, e, n) {
|
|
|
6795
6811
|
// Build a new subscribe function if the query changes
|
|
6796
6812
|
[i]
|
|
6797
6813
|
);
|
|
6798
|
-
return { state: nn(o, () => s.current, () =>
|
|
6814
|
+
return { state: nn(o, () => s.current, () => _c), query: r };
|
|
6799
6815
|
}
|
|
6800
|
-
function
|
|
6816
|
+
function Tc() {
|
|
6801
6817
|
const t = at(null);
|
|
6802
|
-
|
|
6818
|
+
ke(() => {
|
|
6803
6819
|
n();
|
|
6804
6820
|
}, []);
|
|
6805
6821
|
function e(r, i) {
|
|
@@ -6811,14 +6827,14 @@ function gc() {
|
|
|
6811
6827
|
return { set: e, clear: n };
|
|
6812
6828
|
}
|
|
6813
6829
|
const wc = 1e3;
|
|
6814
|
-
function
|
|
6830
|
+
function mc(t, e, n) {
|
|
6815
6831
|
const r = at(n);
|
|
6816
|
-
r.current = n,
|
|
6832
|
+
r.current = n, ke(() => t.core._reactor.subscribeTopic(t.id, e, (s, o) => {
|
|
6817
6833
|
r.current(s, o);
|
|
6818
6834
|
}), [t.id, e]);
|
|
6819
6835
|
}
|
|
6820
|
-
function
|
|
6821
|
-
return
|
|
6836
|
+
function vc(t, e) {
|
|
6837
|
+
return ke(() => t.core._reactor.joinRoom(t.id), [t.id]), ge((r) => {
|
|
6822
6838
|
t.core._reactor.publishTopic({
|
|
6823
6839
|
roomType: t.type,
|
|
6824
6840
|
roomId: t.id,
|
|
@@ -6827,7 +6843,7 @@ function mc(t, e) {
|
|
|
6827
6843
|
});
|
|
6828
6844
|
}, [t.id, e]);
|
|
6829
6845
|
}
|
|
6830
|
-
function
|
|
6846
|
+
function Sc(t, e = {}) {
|
|
6831
6847
|
var n, r;
|
|
6832
6848
|
const [i, s] = di(() => {
|
|
6833
6849
|
var u;
|
|
@@ -6836,7 +6852,7 @@ function vc(t, e = {}) {
|
|
|
6836
6852
|
isLoading: !0
|
|
6837
6853
|
};
|
|
6838
6854
|
});
|
|
6839
|
-
|
|
6855
|
+
ke(() => t.core._reactor.subscribePresence(t.type, t.id, e, (d) => {
|
|
6840
6856
|
s(d);
|
|
6841
6857
|
}), [t.id, e.user, (n = e.peers) === null || n === void 0 ? void 0 : n.join(), (r = e.keys) === null || r === void 0 ? void 0 : r.join()]);
|
|
6842
6858
|
const o = ge((u) => {
|
|
@@ -6844,11 +6860,11 @@ function vc(t, e = {}) {
|
|
|
6844
6860
|
}, [t.type, t.id]);
|
|
6845
6861
|
return rn(() => Object.assign(Object.assign({}, i), { publishPresence: o }), [i, o]);
|
|
6846
6862
|
}
|
|
6847
|
-
function
|
|
6848
|
-
|
|
6863
|
+
function Oc(t, e, n) {
|
|
6864
|
+
ke(() => t.core._reactor.joinRoom(t.id, e), [t.id]), ke(() => t.core._reactor.publishPresence(t.type, t.id, e), [t.type, t.id, n ?? JSON.stringify(e)]);
|
|
6849
6865
|
}
|
|
6850
|
-
function
|
|
6851
|
-
const r =
|
|
6866
|
+
function Ec(t, e, n = {}) {
|
|
6867
|
+
const r = Tc(), i = Se.usePresence(t, {
|
|
6852
6868
|
keys: [e]
|
|
6853
6869
|
}), s = rn(() => {
|
|
6854
6870
|
var c;
|
|
@@ -6875,21 +6891,21 @@ function Oc(t, e, n = {}) {
|
|
|
6875
6891
|
inputProps: d
|
|
6876
6892
|
};
|
|
6877
6893
|
}
|
|
6878
|
-
const
|
|
6879
|
-
useTopicEffect:
|
|
6880
|
-
usePublishTopic:
|
|
6881
|
-
usePresence:
|
|
6882
|
-
useSyncPresence:
|
|
6883
|
-
useTypingIndicator:
|
|
6894
|
+
const Se = {
|
|
6895
|
+
useTopicEffect: mc,
|
|
6896
|
+
usePublishTopic: vc,
|
|
6897
|
+
usePresence: Sc,
|
|
6898
|
+
useSyncPresence: Oc,
|
|
6899
|
+
useTypingIndicator: Ec
|
|
6884
6900
|
};
|
|
6885
|
-
class
|
|
6901
|
+
class Ac {
|
|
6886
6902
|
constructor(e, n, r) {
|
|
6887
6903
|
this.useTopicEffect = (i, s) => {
|
|
6888
|
-
|
|
6889
|
-
}, this.usePublishTopic = (i) =>
|
|
6904
|
+
Se.useTopicEffect(this, i, s);
|
|
6905
|
+
}, this.usePublishTopic = (i) => Se.usePublishTopic(this, i), this.usePresence = (i = {}) => Se.usePresence(this, i), this.useSyncPresence = (i, s) => Se.useSyncPresence(this, i, s), this.useTypingIndicator = (i, s = {}) => Se.useTypingIndicator(this, i, s), this.core = e, this._core = this.core, this.type = n, this.id = r;
|
|
6890
6906
|
}
|
|
6891
6907
|
}
|
|
6892
|
-
var
|
|
6908
|
+
var kc = function(t, e, n, r) {
|
|
6893
6909
|
function i(s) {
|
|
6894
6910
|
return s instanceof n ? s : new n(function(o) {
|
|
6895
6911
|
o(s);
|
|
@@ -6916,30 +6932,30 @@ var Ac = function(t, e, n, r) {
|
|
|
6916
6932
|
d((r = r.apply(t, e || [])).next());
|
|
6917
6933
|
});
|
|
6918
6934
|
};
|
|
6919
|
-
const
|
|
6935
|
+
const jc = {
|
|
6920
6936
|
isLoading: !0,
|
|
6921
6937
|
user: void 0,
|
|
6922
6938
|
error: void 0
|
|
6923
6939
|
};
|
|
6924
|
-
class
|
|
6940
|
+
class Cc {
|
|
6925
6941
|
constructor(e, n) {
|
|
6926
6942
|
this.tx = Vn(), this.getLocalId = (r) => this.core.getLocalId(r), this.useLocalId = (r) => {
|
|
6927
6943
|
const [i, s] = di(null);
|
|
6928
|
-
return
|
|
6929
|
-
|
|
6944
|
+
return ke(() => {
|
|
6945
|
+
kc(this, void 0, void 0, function* () {
|
|
6930
6946
|
const a = yield this.getLocalId(r);
|
|
6931
6947
|
s(a);
|
|
6932
6948
|
});
|
|
6933
6949
|
}, [r]), i;
|
|
6934
|
-
}, this.rooms =
|
|
6950
|
+
}, this.rooms = Se, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => gc(this.core, r, i).state, this.useAuth = () => {
|
|
6935
6951
|
const r = at(this.core._reactor._currentUserCached), i = ge((o) => this.core.subscribeAuth((u) => {
|
|
6936
6952
|
r.current = Object.assign({ isLoading: !1 }, u), o();
|
|
6937
6953
|
}), []);
|
|
6938
|
-
return nn(i, () => r.current, () =>
|
|
6954
|
+
return nn(i, () => r.current, () => jc);
|
|
6939
6955
|
}, this.useUser = () => {
|
|
6940
6956
|
const { user: r } = this.useAuth();
|
|
6941
6957
|
if (!r)
|
|
6942
|
-
throw new
|
|
6958
|
+
throw new Ke("useUser must be used within an auth-protected route");
|
|
6943
6959
|
return r;
|
|
6944
6960
|
}, this.useConnectionStatus = () => {
|
|
6945
6961
|
const r = at(this.core._reactor.status), i = ge((o) => this.core.subscribeConnectionStatus((u) => {
|
|
@@ -6953,11 +6969,11 @@ class jc {
|
|
|
6953
6969
|
);
|
|
6954
6970
|
}, this.queryOnce = (r, i) => this.core.queryOnce(r, i), this.SignedIn = ({ children: r }) => {
|
|
6955
6971
|
const i = this.useAuth();
|
|
6956
|
-
return i.isLoading || i.error || !i.user ? null :
|
|
6972
|
+
return i.isLoading || i.error || !i.user ? null : W.jsx(W.Fragment, { children: r });
|
|
6957
6973
|
}, this.SignedOut = ({ children: r }) => {
|
|
6958
6974
|
const i = this.useAuth();
|
|
6959
|
-
return i.isLoading || i.error || i.user ? null :
|
|
6960
|
-
}, this.core =
|
|
6975
|
+
return i.isLoading || i.error || i.user ? null : W.jsx(W.Fragment, { children: r });
|
|
6976
|
+
}, this.core = lc(
|
|
6961
6977
|
e,
|
|
6962
6978
|
// @ts-expect-error because TS can't resolve subclass statics
|
|
6963
6979
|
this.constructor.Storage,
|
|
@@ -6981,7 +6997,7 @@ class jc {
|
|
|
6981
6997
|
* const { peers } = db.rooms.usePresence(room);
|
|
6982
6998
|
*/
|
|
6983
6999
|
room(e = "_defaultRoomType", n = "_defaultRoomId") {
|
|
6984
|
-
return new
|
|
7000
|
+
return new Ac(this.core, e, n);
|
|
6985
7001
|
}
|
|
6986
7002
|
/**
|
|
6987
7003
|
* One time query for the logged in state. This is useful
|
|
@@ -7004,7 +7020,7 @@ class ii extends Error {
|
|
|
7004
7020
|
}
|
|
7005
7021
|
function tn(t) {
|
|
7006
7022
|
}
|
|
7007
|
-
function
|
|
7023
|
+
function Pc(t) {
|
|
7008
7024
|
if (typeof t == "function")
|
|
7009
7025
|
throw new TypeError(
|
|
7010
7026
|
"`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
|
|
@@ -7012,10 +7028,10 @@ function Cc(t) {
|
|
|
7012
7028
|
const { onEvent: e = tn, onError: n = tn, onRetry: r = tn, onComment: i } = t;
|
|
7013
7029
|
let s = "", o = !0, a, u = "", d = "";
|
|
7014
7030
|
function c(b) {
|
|
7015
|
-
const _ = o ? b.replace(/^\xEF\xBB\xBF/, "") : b, [
|
|
7016
|
-
for (const m of
|
|
7031
|
+
const _ = o ? b.replace(/^\xEF\xBB\xBF/, "") : b, [w, g] = Ic(`${s}${_}`);
|
|
7032
|
+
for (const m of w)
|
|
7017
7033
|
f(m);
|
|
7018
|
-
s =
|
|
7034
|
+
s = g, o = !1;
|
|
7019
7035
|
}
|
|
7020
7036
|
function f(b) {
|
|
7021
7037
|
if (b === "") {
|
|
@@ -7028,13 +7044,13 @@ function Cc(t) {
|
|
|
7028
7044
|
}
|
|
7029
7045
|
const _ = b.indexOf(":");
|
|
7030
7046
|
if (_ !== -1) {
|
|
7031
|
-
const
|
|
7032
|
-
l(
|
|
7047
|
+
const w = b.slice(0, _), g = b[_ + 1] === " " ? 2 : 1, m = b.slice(_ + g);
|
|
7048
|
+
l(w, m, b);
|
|
7033
7049
|
return;
|
|
7034
7050
|
}
|
|
7035
7051
|
l(b, "", b);
|
|
7036
7052
|
}
|
|
7037
|
-
function l(b, _,
|
|
7053
|
+
function l(b, _, w) {
|
|
7038
7054
|
switch (b) {
|
|
7039
7055
|
case "event":
|
|
7040
7056
|
d = _;
|
|
@@ -7051,7 +7067,7 @@ function Cc(t) {
|
|
|
7051
7067
|
new ii(`Invalid \`retry\` value: "${_}"`, {
|
|
7052
7068
|
type: "invalid-retry",
|
|
7053
7069
|
value: _,
|
|
7054
|
-
line:
|
|
7070
|
+
line: w
|
|
7055
7071
|
})
|
|
7056
7072
|
);
|
|
7057
7073
|
break;
|
|
@@ -7059,7 +7075,7 @@ function Cc(t) {
|
|
|
7059
7075
|
n(
|
|
7060
7076
|
new ii(
|
|
7061
7077
|
`Unknown field "${b.length > 20 ? `${b.slice(0, 20)}…` : b}"`,
|
|
7062
|
-
{ type: "unknown-field", field: b, value: _, line:
|
|
7078
|
+
{ type: "unknown-field", field: b, value: _, line: w }
|
|
7063
7079
|
)
|
|
7064
7080
|
);
|
|
7065
7081
|
break;
|
|
@@ -7080,7 +7096,7 @@ function Cc(t) {
|
|
|
7080
7096
|
}
|
|
7081
7097
|
return { feed: c, reset: y };
|
|
7082
7098
|
}
|
|
7083
|
-
function
|
|
7099
|
+
function Ic(t) {
|
|
7084
7100
|
const e = [];
|
|
7085
7101
|
let n = "", r = 0;
|
|
7086
7102
|
for (; r < t.length; ) {
|
|
@@ -7140,7 +7156,7 @@ class si extends Event {
|
|
|
7140
7156
|
return e(oi(this), n);
|
|
7141
7157
|
}
|
|
7142
7158
|
}
|
|
7143
|
-
function
|
|
7159
|
+
function Mc(t) {
|
|
7144
7160
|
const e = globalThis.DOMException;
|
|
7145
7161
|
return typeof e == "function" ? new e(t, "SyntaxError") : new SyntaxError(t);
|
|
7146
7162
|
}
|
|
@@ -7159,19 +7175,19 @@ function oi(t) {
|
|
|
7159
7175
|
}
|
|
7160
7176
|
var Xi = (t) => {
|
|
7161
7177
|
throw TypeError(t);
|
|
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,
|
|
7178
|
+
}, 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, Oe, Re, At, Rt, st, De, ot, _e, xe, Le, $e, et, se, En, An, kn, ai, jn, Cn, tt, Pn, In;
|
|
7163
7179
|
class kt extends EventTarget {
|
|
7164
7180
|
constructor(e, n) {
|
|
7165
7181
|
var r, i;
|
|
7166
|
-
super(), N(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, N(this, J), N(this,
|
|
7182
|
+
super(), N(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, N(this, J), N(this, Oe), N(this, Re), N(this, At), N(this, Rt), N(this, st), N(this, De), N(this, ot, null), N(this, _e), N(this, xe), N(this, Le, null), N(this, $e, null), N(this, et, null), N(this, An, async (s) => {
|
|
7167
7183
|
var o;
|
|
7168
|
-
A(this,
|
|
7184
|
+
A(this, xe).reset();
|
|
7169
7185
|
const { body: a, redirected: u, status: d, headers: c } = s;
|
|
7170
7186
|
if (d === 204) {
|
|
7171
7187
|
he(this, se, tt).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
7172
7188
|
return;
|
|
7173
7189
|
}
|
|
7174
|
-
if (u ? $(this,
|
|
7190
|
+
if (u ? $(this, Re, new URL(s.url)) : $(this, Re, void 0), d !== 200) {
|
|
7175
7191
|
he(this, se, tt).call(this, `Non-200 status code (${d})`, d);
|
|
7176
7192
|
return;
|
|
7177
7193
|
}
|
|
@@ -7191,7 +7207,7 @@ class kt extends EventTarget {
|
|
|
7191
7207
|
let y = !0;
|
|
7192
7208
|
do {
|
|
7193
7209
|
const { done: b, value: _ } = await p.read();
|
|
7194
|
-
_ && A(this,
|
|
7210
|
+
_ && A(this, xe).feed(l.decode(_, { stream: !b })), b && (y = !1, A(this, xe).reset(), he(this, se, Pn).call(this));
|
|
7195
7211
|
} while (y);
|
|
7196
7212
|
}), N(this, kn, (s) => {
|
|
7197
7213
|
$(this, _e, void 0), !(s.name === "AbortError" || s.type === "aborted") && he(this, se, Pn).call(this, On(s));
|
|
@@ -7199,26 +7215,26 @@ class kt extends EventTarget {
|
|
|
7199
7215
|
typeof s.id == "string" && $(this, ot, s.id);
|
|
7200
7216
|
const o = new MessageEvent(s.event || "message", {
|
|
7201
7217
|
data: s.data,
|
|
7202
|
-
origin: A(this,
|
|
7218
|
+
origin: A(this, Re) ? A(this, Re).origin : A(this, Oe).origin,
|
|
7203
7219
|
lastEventId: s.id || ""
|
|
7204
7220
|
});
|
|
7205
|
-
A(this,
|
|
7221
|
+
A(this, $e) && (!s.event || s.event === "message") && A(this, $e).call(this, o), this.dispatchEvent(o);
|
|
7206
7222
|
}), N(this, Cn, (s) => {
|
|
7207
7223
|
$(this, st, s);
|
|
7208
7224
|
}), N(this, In, () => {
|
|
7209
|
-
$(this,
|
|
7225
|
+
$(this, De, void 0), A(this, J) === this.CONNECTING && he(this, se, En).call(this);
|
|
7210
7226
|
});
|
|
7211
7227
|
try {
|
|
7212
7228
|
if (e instanceof URL)
|
|
7213
|
-
$(this,
|
|
7229
|
+
$(this, Oe, e);
|
|
7214
7230
|
else if (typeof e == "string")
|
|
7215
|
-
$(this,
|
|
7231
|
+
$(this, Oe, new URL(e, Rc()));
|
|
7216
7232
|
else
|
|
7217
7233
|
throw new Error("Invalid URL");
|
|
7218
7234
|
} catch {
|
|
7219
|
-
throw
|
|
7235
|
+
throw Mc("An invalid or illegal string was specified");
|
|
7220
7236
|
}
|
|
7221
|
-
$(this,
|
|
7237
|
+
$(this, xe, Pc({
|
|
7222
7238
|
onEvent: A(this, jn),
|
|
7223
7239
|
onRetry: A(this, Cn)
|
|
7224
7240
|
})), $(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);
|
|
@@ -7244,7 +7260,7 @@ class kt extends EventTarget {
|
|
|
7244
7260
|
* @public
|
|
7245
7261
|
*/
|
|
7246
7262
|
get url() {
|
|
7247
|
-
return A(this,
|
|
7263
|
+
return A(this, Oe).href;
|
|
7248
7264
|
}
|
|
7249
7265
|
/**
|
|
7250
7266
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
@@ -7256,17 +7272,17 @@ class kt extends EventTarget {
|
|
|
7256
7272
|
}
|
|
7257
7273
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
7258
7274
|
get onerror() {
|
|
7259
|
-
return A(this,
|
|
7275
|
+
return A(this, Le);
|
|
7260
7276
|
}
|
|
7261
7277
|
set onerror(e) {
|
|
7262
|
-
$(this,
|
|
7278
|
+
$(this, Le, e);
|
|
7263
7279
|
}
|
|
7264
7280
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
7265
7281
|
get onmessage() {
|
|
7266
|
-
return A(this,
|
|
7282
|
+
return A(this, $e);
|
|
7267
7283
|
}
|
|
7268
7284
|
set onmessage(e) {
|
|
7269
|
-
$(this,
|
|
7285
|
+
$(this, $e, e);
|
|
7270
7286
|
}
|
|
7271
7287
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
7272
7288
|
get onopen() {
|
|
@@ -7291,16 +7307,16 @@ class kt extends EventTarget {
|
|
|
7291
7307
|
* @public
|
|
7292
7308
|
*/
|
|
7293
7309
|
close() {
|
|
7294
|
-
A(this,
|
|
7310
|
+
A(this, De) && clearTimeout(A(this, De)), A(this, J) !== this.CLOSED && (A(this, _e) && A(this, _e).abort(), $(this, J, this.CLOSED), $(this, _e, void 0));
|
|
7295
7311
|
}
|
|
7296
7312
|
}
|
|
7297
|
-
J = /* @__PURE__ */ new WeakMap(),
|
|
7313
|
+
J = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakSet(), /**
|
|
7298
7314
|
* Connect to the given URL and start receiving events
|
|
7299
7315
|
*
|
|
7300
7316
|
* @internal
|
|
7301
7317
|
*/
|
|
7302
7318
|
En = function() {
|
|
7303
|
-
$(this, J, this.CONNECTING), $(this, _e, new AbortController()), A(this, Rt)(A(this,
|
|
7319
|
+
$(this, J, this.CONNECTING), $(this, _e, new AbortController()), A(this, Rt)(A(this, Oe), he(this, se, ai).call(this)).then(A(this, An)).catch(A(this, kn));
|
|
7304
7320
|
}, An = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), /**
|
|
7305
7321
|
* Get request options for the `fetch()` request
|
|
7306
7322
|
*
|
|
@@ -7330,7 +7346,7 @@ tt = function(t, e) {
|
|
|
7330
7346
|
var n;
|
|
7331
7347
|
A(this, J) !== this.CLOSED && $(this, J, this.CLOSED);
|
|
7332
7348
|
const r = new si("error", { code: e, message: t });
|
|
7333
|
-
(n = A(this,
|
|
7349
|
+
(n = A(this, Le)) == null || n.call(this, r), this.dispatchEvent(r);
|
|
7334
7350
|
}, /**
|
|
7335
7351
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
7336
7352
|
*
|
|
@@ -7344,7 +7360,7 @@ Pn = function(t, e) {
|
|
|
7344
7360
|
return;
|
|
7345
7361
|
$(this, J, this.CONNECTING);
|
|
7346
7362
|
const r = new si("error", { code: e, message: t });
|
|
7347
|
-
(n = A(this,
|
|
7363
|
+
(n = A(this, Le)) == null || n.call(this, r), this.dispatchEvent(r), $(this, De, setTimeout(A(this, In), A(this, st)));
|
|
7348
7364
|
}, In = /* @__PURE__ */ new WeakMap(), /**
|
|
7349
7365
|
* ReadyState representing an EventSource currently trying to connect
|
|
7350
7366
|
*
|
|
@@ -7361,15 +7377,15 @@ kt.OPEN = 1, /**
|
|
|
7361
7377
|
* @public
|
|
7362
7378
|
*/
|
|
7363
7379
|
kt.CLOSED = 2;
|
|
7364
|
-
function
|
|
7380
|
+
function Rc() {
|
|
7365
7381
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
7366
7382
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
7367
7383
|
}
|
|
7368
|
-
const Hn = class Hn extends
|
|
7384
|
+
const Hn = class Hn extends Cc {
|
|
7369
7385
|
};
|
|
7370
7386
|
Hn.EventSourceImpl = kt;
|
|
7371
7387
|
let Mn = Hn;
|
|
7372
|
-
function
|
|
7388
|
+
function xc(t) {
|
|
7373
7389
|
return new Mn(
|
|
7374
7390
|
t,
|
|
7375
7391
|
{
|
|
@@ -7377,8 +7393,8 @@ function Rc(t) {
|
|
|
7377
7393
|
}
|
|
7378
7394
|
);
|
|
7379
7395
|
}
|
|
7380
|
-
const
|
|
7381
|
-
function
|
|
7396
|
+
const qc = xc;
|
|
7397
|
+
function Wc({
|
|
7382
7398
|
as: t = "div",
|
|
7383
7399
|
spaceId: e,
|
|
7384
7400
|
room: n,
|
|
@@ -7393,8 +7409,8 @@ function qc({
|
|
|
7393
7409
|
const c = e || `cursors-space-default--${String(n.type)}-${n.id}`, f = n.usePresence({
|
|
7394
7410
|
keys: [c]
|
|
7395
7411
|
}), l = n._core._reactor.getPresence(n.type, n.id);
|
|
7396
|
-
function p(
|
|
7397
|
-
const E = m.clientX, S = m.clientY, I = (E -
|
|
7412
|
+
function p(g, m) {
|
|
7413
|
+
const E = m.clientX, S = m.clientY, I = (E - g.left) / g.width * 100, x = (S - g.top) / g.height * 100;
|
|
7398
7414
|
f.publishPresence({
|
|
7399
7415
|
[c]: {
|
|
7400
7416
|
x: E,
|
|
@@ -7405,27 +7421,27 @@ function qc({
|
|
|
7405
7421
|
}
|
|
7406
7422
|
});
|
|
7407
7423
|
}
|
|
7408
|
-
function y(
|
|
7409
|
-
u ||
|
|
7410
|
-
const m =
|
|
7411
|
-
p(m,
|
|
7424
|
+
function y(g) {
|
|
7425
|
+
u || g.stopPropagation();
|
|
7426
|
+
const m = g.currentTarget.getBoundingClientRect();
|
|
7427
|
+
p(m, g);
|
|
7412
7428
|
}
|
|
7413
|
-
function b(
|
|
7429
|
+
function b(g) {
|
|
7414
7430
|
f.publishPresence({
|
|
7415
7431
|
[c]: void 0
|
|
7416
7432
|
});
|
|
7417
7433
|
}
|
|
7418
|
-
function _(
|
|
7419
|
-
if (
|
|
7434
|
+
function _(g) {
|
|
7435
|
+
if (g.touches.length !== 1)
|
|
7420
7436
|
return;
|
|
7421
|
-
const m =
|
|
7437
|
+
const m = g.touches[0];
|
|
7422
7438
|
if (m.target instanceof Element) {
|
|
7423
|
-
u ||
|
|
7439
|
+
u || g.stopPropagation();
|
|
7424
7440
|
const E = m.target.getBoundingClientRect();
|
|
7425
7441
|
p(E, m);
|
|
7426
7442
|
}
|
|
7427
7443
|
}
|
|
7428
|
-
function
|
|
7444
|
+
function w(g) {
|
|
7429
7445
|
f.publishPresence({
|
|
7430
7446
|
[c]: void 0
|
|
7431
7447
|
});
|
|
@@ -7436,7 +7452,7 @@ function qc({
|
|
|
7436
7452
|
onMouseMove: y,
|
|
7437
7453
|
onMouseOut: b,
|
|
7438
7454
|
onTouchMove: _,
|
|
7439
|
-
onTouchEnd:
|
|
7455
|
+
onTouchEnd: w,
|
|
7440
7456
|
className: r,
|
|
7441
7457
|
style: {
|
|
7442
7458
|
position: "relative",
|
|
@@ -7445,17 +7461,17 @@ function qc({
|
|
|
7445
7461
|
},
|
|
7446
7462
|
[
|
|
7447
7463
|
o,
|
|
7448
|
-
/* @__PURE__ */
|
|
7464
|
+
/* @__PURE__ */ W.jsx(
|
|
7449
7465
|
"div",
|
|
7450
7466
|
{
|
|
7451
7467
|
style: {
|
|
7452
7468
|
...ui,
|
|
7453
|
-
|
|
7454
|
-
zIndex: d !== void 0 ? d :
|
|
7469
|
+
...Dc,
|
|
7470
|
+
zIndex: d !== void 0 ? d : Uc
|
|
7455
7471
|
},
|
|
7456
|
-
children: Object.entries(f.peers).map(([
|
|
7472
|
+
children: Object.entries(f.peers).map(([g, m]) => {
|
|
7457
7473
|
const E = m[c];
|
|
7458
|
-
return E ? /* @__PURE__ */
|
|
7474
|
+
return E ? /* @__PURE__ */ W.jsx(
|
|
7459
7475
|
"div",
|
|
7460
7476
|
{
|
|
7461
7477
|
style: {
|
|
@@ -7466,10 +7482,10 @@ function qc({
|
|
|
7466
7482
|
},
|
|
7467
7483
|
children: a ? a({
|
|
7468
7484
|
color: E.color,
|
|
7469
|
-
presence: l.peers[
|
|
7470
|
-
}) : /* @__PURE__ */
|
|
7485
|
+
presence: l.peers[g]
|
|
7486
|
+
}) : /* @__PURE__ */ W.jsx($c, { ...E })
|
|
7471
7487
|
},
|
|
7472
|
-
|
|
7488
|
+
g
|
|
7473
7489
|
) : null;
|
|
7474
7490
|
})
|
|
7475
7491
|
},
|
|
@@ -7478,9 +7494,9 @@ function qc({
|
|
|
7478
7494
|
]
|
|
7479
7495
|
);
|
|
7480
7496
|
}
|
|
7481
|
-
function
|
|
7497
|
+
function $c({ color: t }) {
|
|
7482
7498
|
const n = t || "black";
|
|
7483
|
-
return /* @__PURE__ */
|
|
7499
|
+
return /* @__PURE__ */ W.jsxs(
|
|
7484
7500
|
"svg",
|
|
7485
7501
|
{
|
|
7486
7502
|
style: { height: 35, width: 35 },
|
|
@@ -7488,36 +7504,36 @@ function xc({ color: t }) {
|
|
|
7488
7504
|
fill: "none",
|
|
7489
7505
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7490
7506
|
children: [
|
|
7491
|
-
/* @__PURE__ */
|
|
7507
|
+
/* @__PURE__ */ W.jsxs(
|
|
7492
7508
|
"g",
|
|
7493
7509
|
{
|
|
7494
7510
|
fill: "rgba(0,0,0,.2)",
|
|
7495
7511
|
transform: "matrix(1, 0, 0, 1, -11.999999046325684, -8.406899452209473)",
|
|
7496
7512
|
children: [
|
|
7497
|
-
/* @__PURE__ */
|
|
7498
|
-
/* @__PURE__ */
|
|
7513
|
+
/* @__PURE__ */ W.jsx("path", { d: "m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z" }),
|
|
7514
|
+
/* @__PURE__ */ W.jsx("path", { d: "m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z" })
|
|
7499
7515
|
]
|
|
7500
7516
|
}
|
|
7501
7517
|
),
|
|
7502
|
-
/* @__PURE__ */
|
|
7518
|
+
/* @__PURE__ */ W.jsxs(
|
|
7503
7519
|
"g",
|
|
7504
7520
|
{
|
|
7505
7521
|
fill: "white",
|
|
7506
7522
|
transform: "matrix(1, 0, 0, 1, -11.999999046325684, -8.406899452209473)",
|
|
7507
7523
|
children: [
|
|
7508
|
-
/* @__PURE__ */
|
|
7509
|
-
/* @__PURE__ */
|
|
7524
|
+
/* @__PURE__ */ W.jsx("path", { d: "m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z" }),
|
|
7525
|
+
/* @__PURE__ */ W.jsx("path", { d: "m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z" })
|
|
7510
7526
|
]
|
|
7511
7527
|
}
|
|
7512
7528
|
),
|
|
7513
|
-
/* @__PURE__ */
|
|
7529
|
+
/* @__PURE__ */ W.jsxs(
|
|
7514
7530
|
"g",
|
|
7515
7531
|
{
|
|
7516
7532
|
fill: n,
|
|
7517
7533
|
transform: "matrix(1, 0, 0, 1, -11.999999046325684, -8.406899452209473)",
|
|
7518
7534
|
children: [
|
|
7519
|
-
/* @__PURE__ */
|
|
7520
|
-
/* @__PURE__ */
|
|
7535
|
+
/* @__PURE__ */ W.jsx("path", { d: "m19.751 24.4155-1.844.774-3.1-7.374 1.841-.775z" }),
|
|
7536
|
+
/* @__PURE__ */ W.jsx("path", { d: "m13 10.814v11.188l2.969-2.866.428-.139h4.768z" })
|
|
7521
7537
|
]
|
|
7522
7538
|
}
|
|
7523
7539
|
)
|
|
@@ -7531,21 +7547,21 @@ const ui = {
|
|
|
7531
7547
|
left: 0,
|
|
7532
7548
|
bottom: 0,
|
|
7533
7549
|
right: 0
|
|
7534
|
-
},
|
|
7550
|
+
}, Dc = {
|
|
7535
7551
|
overflow: "hidden",
|
|
7536
7552
|
pointerEvents: "none",
|
|
7537
7553
|
userSelect: "none"
|
|
7538
|
-
},
|
|
7554
|
+
}, Uc = 99999;
|
|
7539
7555
|
export {
|
|
7540
|
-
|
|
7556
|
+
Wc as Cursors,
|
|
7541
7557
|
Dt as InstantAPIError,
|
|
7542
|
-
|
|
7558
|
+
Cc as InstantReactAbstractDatabase,
|
|
7543
7559
|
Mn as InstantReactWebDatabase,
|
|
7544
|
-
|
|
7545
|
-
|
|
7560
|
+
ve as SyncTableCallbackEventType,
|
|
7561
|
+
Kc as i,
|
|
7546
7562
|
K as id,
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7563
|
+
xc as init,
|
|
7564
|
+
qc as init_experimental,
|
|
7565
|
+
Fc as lookup,
|
|
7566
|
+
Nc as tx
|
|
7551
7567
|
};
|