@instantdb/react 0.22.92-experimental.add-push-pull-help.20346685322.1 → 0.22.92-experimental.drewh-ssr.20347788876.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/commonjs/next-ssr/HydrationStreamProvider.d.ts +66 -0
- package/dist/commonjs/next-ssr/HydrationStreamProvider.d.ts.map +1 -0
- package/dist/commonjs/next-ssr/HydrationStreamProvider.js +135 -0
- package/dist/commonjs/next-ssr/HydrationStreamProvider.js.map +1 -0
- package/dist/commonjs/next-ssr/InstantNextDatabase.d.ts +12 -0
- package/dist/commonjs/next-ssr/InstantNextDatabase.d.ts.map +1 -0
- package/dist/commonjs/next-ssr/InstantNextDatabase.js +43 -0
- package/dist/commonjs/next-ssr/InstantNextDatabase.js.map +1 -0
- package/dist/commonjs/next-ssr/InstantSuspenseProvider.d.ts +28 -0
- package/dist/commonjs/next-ssr/InstantSuspenseProvider.d.ts.map +1 -0
- package/dist/commonjs/next-ssr/InstantSuspenseProvider.js +98 -0
- package/dist/commonjs/next-ssr/InstantSuspenseProvider.js.map +1 -0
- package/dist/commonjs/next-ssr/getUserOnServer.d.ts +2 -0
- package/dist/commonjs/next-ssr/getUserOnServer.d.ts.map +1 -0
- package/dist/commonjs/next-ssr/getUserOnServer.js +21 -0
- package/dist/commonjs/next-ssr/getUserOnServer.js.map +1 -0
- package/dist/commonjs/next-ssr/htmlescape.d.ts +3 -0
- package/dist/commonjs/next-ssr/htmlescape.d.ts.map +1 -0
- package/dist/commonjs/next-ssr/htmlescape.js +25 -0
- package/dist/commonjs/next-ssr/htmlescape.js.map +1 -0
- package/dist/commonjs/next-ssr/index.d.ts +28 -0
- package/dist/commonjs/next-ssr/index.d.ts.map +1 -0
- package/dist/commonjs/next-ssr/index.js +43 -0
- package/dist/commonjs/next-ssr/index.js.map +1 -0
- package/dist/esm/next-ssr/HydrationStreamProvider.d.ts +66 -0
- package/dist/esm/next-ssr/HydrationStreamProvider.d.ts.map +1 -0
- package/dist/esm/next-ssr/HydrationStreamProvider.js +98 -0
- package/dist/esm/next-ssr/HydrationStreamProvider.js.map +1 -0
- package/dist/esm/next-ssr/InstantNextDatabase.d.ts +12 -0
- package/dist/esm/next-ssr/InstantNextDatabase.d.ts.map +1 -0
- package/dist/esm/next-ssr/InstantNextDatabase.js +36 -0
- package/dist/esm/next-ssr/InstantNextDatabase.js.map +1 -0
- package/dist/esm/next-ssr/InstantSuspenseProvider.d.ts +28 -0
- package/dist/esm/next-ssr/InstantSuspenseProvider.d.ts.map +1 -0
- package/dist/esm/next-ssr/InstantSuspenseProvider.js +93 -0
- package/dist/esm/next-ssr/InstantSuspenseProvider.js.map +1 -0
- package/dist/esm/next-ssr/getUserOnServer.d.ts +2 -0
- package/dist/esm/next-ssr/getUserOnServer.d.ts.map +1 -0
- package/dist/esm/next-ssr/getUserOnServer.js +17 -0
- package/dist/esm/next-ssr/getUserOnServer.js.map +1 -0
- package/dist/esm/next-ssr/htmlescape.d.ts +3 -0
- package/dist/esm/next-ssr/htmlescape.d.ts.map +1 -0
- package/dist/esm/next-ssr/htmlescape.js +21 -0
- package/dist/esm/next-ssr/htmlescape.js.map +1 -0
- package/dist/esm/next-ssr/index.d.ts +28 -0
- package/dist/esm/next-ssr/index.d.ts.map +1 -0
- package/dist/esm/next-ssr/index.js +32 -0
- package/dist/esm/next-ssr/index.js.map +1 -0
- package/dist/standalone/index.js +472 -416
- package/dist/standalone/index.umd.cjs +11 -11
- package/package.json +18 -6
- package/src/next-ssr/HydrationStreamProvider.tsx +193 -0
- package/src/next-ssr/InstantNextDatabase.tsx +57 -0
- package/src/next-ssr/InstantSuspenseProvider.tsx +187 -0
- package/src/next-ssr/getUserOnServer.ts +8 -0
- package/src/next-ssr/htmlescape.ts +24 -0
- package/src/next-ssr/index.tsx +47 -0
- package/tsconfig.json +1 -0
package/dist/standalone/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import oi, { useRef as
|
|
2
|
-
function
|
|
1
|
+
import oi, { useRef as ut, useCallback as we, useSyncExternalStore as en, useEffect as ke, useMemo as tn, useState as ui, createElement as Os } from "react";
|
|
2
|
+
function W(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 B(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 = W(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,24 +28,24 @@ function B(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 = W(i);
|
|
32
32
|
e ^= parseInt(s, 16), e *= 16777619, e = e >>> 0;
|
|
33
|
-
const o =
|
|
33
|
+
const o = W(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 W(String(t));
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const F = {
|
|
41
41
|
Remove: "remove",
|
|
42
42
|
Replace: "replace",
|
|
43
43
|
Add: "add"
|
|
44
|
-
}, ai = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Es = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),
|
|
44
|
+
}, ai = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Es = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), St = Symbol.iterator, ne = {
|
|
45
45
|
mutable: "mutable",
|
|
46
46
|
immutable: "immutable"
|
|
47
47
|
}, In = {};
|
|
48
|
-
function
|
|
48
|
+
function nt(t, e) {
|
|
49
49
|
return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
50
50
|
}
|
|
51
51
|
function yr(t, e) {
|
|
@@ -92,7 +92,7 @@ function ci(t, e = []) {
|
|
|
92
92
|
if (r !== null && (r == null ? void 0 : r.original) !== t.original)
|
|
93
93
|
return null;
|
|
94
94
|
const i = t.parent.type === 3, s = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
|
|
95
|
-
if (!(i && n.size > s ||
|
|
95
|
+
if (!(i && n.size > s || nt(n, s)))
|
|
96
96
|
return null;
|
|
97
97
|
e.push(s);
|
|
98
98
|
}
|
|
@@ -112,7 +112,7 @@ function Ce(t) {
|
|
|
112
112
|
function _e(t, e) {
|
|
113
113
|
return Ce(t) === 2 ? t.get(e) : t[e];
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ct(t, e, n) {
|
|
116
116
|
Ce(t) === 2 ? t.set(e, n) : t[e] = n;
|
|
117
117
|
}
|
|
118
118
|
function Qt(t, e) {
|
|
@@ -225,7 +225,7 @@ function Ye(t) {
|
|
|
225
225
|
e[n] = Ye(t[n]);
|
|
226
226
|
return e;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function Ot(t) {
|
|
229
229
|
return je(t) ? Ye(t) : t;
|
|
230
230
|
}
|
|
231
231
|
function fe(t) {
|
|
@@ -304,7 +304,7 @@ function fi(t, e, n) {
|
|
|
304
304
|
const a = j(o);
|
|
305
305
|
Q(a);
|
|
306
306
|
const d = !((u = a.assignedMap) === null || u === void 0) && u.size || a.operated ? a.copy : a.original;
|
|
307
|
-
|
|
307
|
+
ct(r ? i : t, s, d);
|
|
308
308
|
} else
|
|
309
309
|
fi(o, e, n);
|
|
310
310
|
}), i) {
|
|
@@ -339,7 +339,7 @@ function $n(t, e, n, r) {
|
|
|
339
339
|
const a = t.type === 3 ? t.setMap : t.copy;
|
|
340
340
|
if (be(_e(a, e), n)) {
|
|
341
341
|
let d = i.original;
|
|
342
|
-
i.copy && (d = i.copy), rn(t), sn(t, r, s, o), t.options.enableAutoFreeze && (t.options.updatedValues = (u = t.options.updatedValues) !== null && u !== void 0 ? u : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(d, i.original)),
|
|
342
|
+
i.copy && (d = i.copy), rn(t), sn(t, r, s, o), t.options.enableAutoFreeze && (t.options.updatedValues = (u = t.options.updatedValues) !== null && u !== void 0 ? u : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(d, i.original)), ct(a, e, d);
|
|
343
343
|
}
|
|
344
344
|
}), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), ue(n, t.options) && t.finalities.draft.push(() => {
|
|
345
345
|
const s = t.type === 3 ? t.setMap : t.copy;
|
|
@@ -353,24 +353,24 @@ function Is(t, e, n, r, i) {
|
|
|
353
353
|
if (o.get(d.toString()) && a[d] !== s[d]) {
|
|
354
354
|
const c = e.concat([d]), f = Ee(c, i);
|
|
355
355
|
n.push({
|
|
356
|
-
op:
|
|
356
|
+
op: F.Replace,
|
|
357
357
|
path: f,
|
|
358
358
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
359
|
-
value:
|
|
359
|
+
value: Ot(a[d])
|
|
360
360
|
}), r.push({
|
|
361
|
-
op:
|
|
361
|
+
op: F.Replace,
|
|
362
362
|
path: f,
|
|
363
363
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
364
|
-
value:
|
|
364
|
+
value: Ot(s[d])
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
for (let d = s.length; d < a.length; d += 1) {
|
|
368
368
|
const c = e.concat([d]), f = Ee(c, i);
|
|
369
369
|
n.push({
|
|
370
|
-
op:
|
|
370
|
+
op: F.Add,
|
|
371
371
|
path: f,
|
|
372
372
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
373
|
-
value:
|
|
373
|
+
value: Ot(a[d])
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
376
|
if (s.length < a.length) {
|
|
@@ -378,7 +378,7 @@ function Is(t, e, n, r, i) {
|
|
|
378
378
|
if (d) {
|
|
379
379
|
const c = e.concat(["length"]), f = Ee(c, i);
|
|
380
380
|
r.push({
|
|
381
|
-
op:
|
|
381
|
+
op: F.Replace,
|
|
382
382
|
path: f,
|
|
383
383
|
value: s.length
|
|
384
384
|
});
|
|
@@ -386,7 +386,7 @@ function Is(t, e, n, r, i) {
|
|
|
386
386
|
for (let c = a.length; s.length < c; c -= 1) {
|
|
387
387
|
const f = e.concat([c - 1]), l = Ee(f, i);
|
|
388
388
|
r.push({
|
|
389
|
-
op:
|
|
389
|
+
op: F.Remove,
|
|
390
390
|
path: l
|
|
391
391
|
});
|
|
392
392
|
}
|
|
@@ -394,11 +394,11 @@ function Is(t, e, n, r, i) {
|
|
|
394
394
|
}
|
|
395
395
|
function Ps({ original: t, copy: e, assignedMap: n }, r, i, s, o) {
|
|
396
396
|
n.forEach((u, a) => {
|
|
397
|
-
const d = _e(t, a), c =
|
|
398
|
-
if (be(d, c) && f ===
|
|
397
|
+
const d = _e(t, a), c = Ot(_e(e, a)), f = u ? nt(t, a) ? F.Replace : F.Add : F.Remove;
|
|
398
|
+
if (be(d, c) && f === F.Replace)
|
|
399
399
|
return;
|
|
400
400
|
const l = r.concat(a), p = Ee(l, o);
|
|
401
|
-
i.push(f ===
|
|
401
|
+
i.push(f === F.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), s.push(f === F.Add ? { op: F.Remove, path: p } : f === F.Remove ? { op: F.Add, path: p, value: d } : { op: F.Replace, path: p, value: d });
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
function Ms({ original: t, copy: e }, n, r, i, s) {
|
|
@@ -407,11 +407,11 @@ function Ms({ original: t, copy: e }, n, r, i, s) {
|
|
|
407
407
|
if (!e.has(u)) {
|
|
408
408
|
const a = n.concat([o]), d = Ee(a, s);
|
|
409
409
|
r.push({
|
|
410
|
-
op:
|
|
410
|
+
op: F.Remove,
|
|
411
411
|
path: d,
|
|
412
412
|
value: u
|
|
413
413
|
}), i.unshift({
|
|
414
|
-
op:
|
|
414
|
+
op: F.Add,
|
|
415
415
|
path: d,
|
|
416
416
|
value: u
|
|
417
417
|
});
|
|
@@ -421,11 +421,11 @@ function Ms({ original: t, copy: e }, n, r, i, s) {
|
|
|
421
421
|
if (!t.has(u)) {
|
|
422
422
|
const a = n.concat([o]), d = Ee(a, s);
|
|
423
423
|
r.push({
|
|
424
|
-
op:
|
|
424
|
+
op: F.Add,
|
|
425
425
|
path: d,
|
|
426
426
|
value: u
|
|
427
427
|
}), i.unshift({
|
|
428
|
-
op:
|
|
428
|
+
op: F.Remove,
|
|
429
429
|
path: d,
|
|
430
430
|
value: u
|
|
431
431
|
});
|
|
@@ -433,7 +433,7 @@ function Ms({ original: t, copy: e }, n, r, i, s) {
|
|
|
433
433
|
o += 1;
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function at(t, e, n, r) {
|
|
437
437
|
const { pathAsArray: i = !0 } = t.options.enablePatches;
|
|
438
438
|
switch (t.type) {
|
|
439
439
|
case 0:
|
|
@@ -457,7 +457,7 @@ const jt = (t, e, n = !1) => {
|
|
|
457
457
|
},
|
|
458
458
|
set(t, e) {
|
|
459
459
|
const n = j(this), r = te(n);
|
|
460
|
-
return (!r.has(t) || !be(r.get(t), e)) && (Q(n), fe(n), n.assignedMap.set(t, !0), n.copy.set(t, e), $n(n, t, e,
|
|
460
|
+
return (!r.has(t) || !be(r.get(t), e)) && (Q(n), fe(n), n.assignedMap.set(t, !0), n.copy.set(t, e), $n(n, t, e, at)), this;
|
|
461
461
|
},
|
|
462
462
|
delete(t) {
|
|
463
463
|
if (!this.has(t))
|
|
@@ -500,7 +500,7 @@ const jt = (t, e, n = !1) => {
|
|
|
500
500
|
values() {
|
|
501
501
|
const t = this.keys();
|
|
502
502
|
return {
|
|
503
|
-
[
|
|
503
|
+
[St]: () => this.values(),
|
|
504
504
|
next: () => {
|
|
505
505
|
const e = t.next();
|
|
506
506
|
return e.done ? e : {
|
|
@@ -513,7 +513,7 @@ const jt = (t, e, n = !1) => {
|
|
|
513
513
|
entries() {
|
|
514
514
|
const t = this.keys();
|
|
515
515
|
return {
|
|
516
|
-
[
|
|
516
|
+
[St]: () => this.entries(),
|
|
517
517
|
next: () => {
|
|
518
518
|
const e = t.next();
|
|
519
519
|
if (e.done)
|
|
@@ -526,7 +526,7 @@ const jt = (t, e, n = !1) => {
|
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
528
|
},
|
|
529
|
-
[
|
|
529
|
+
[St]() {
|
|
530
530
|
return this.entries();
|
|
531
531
|
}
|
|
532
532
|
}, Rs = Reflect.ownKeys(on), _r = (t, e, { isValuesIterator: n }) => () => {
|
|
@@ -565,7 +565,7 @@ const jt = (t, e, n = !1) => {
|
|
|
565
565
|
},
|
|
566
566
|
add(t) {
|
|
567
567
|
const e = j(this);
|
|
568
|
-
return this.has(t) || (Q(e), fe(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), $n(e, t, t,
|
|
568
|
+
return this.has(t) || (Q(e), fe(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), $n(e, t, t, at)), this;
|
|
569
569
|
},
|
|
570
570
|
delete(t) {
|
|
571
571
|
if (!this.has(t))
|
|
@@ -607,7 +607,7 @@ const jt = (t, e, n = !1) => {
|
|
|
607
607
|
keys() {
|
|
608
608
|
return this.values();
|
|
609
609
|
},
|
|
610
|
-
[
|
|
610
|
+
[St]() {
|
|
611
611
|
return this.values();
|
|
612
612
|
},
|
|
613
613
|
forEach(t, e) {
|
|
@@ -669,7 +669,7 @@ const xs = Reflect.ownKeys(Ct), li = /* @__PURE__ */ new WeakSet(), hi = {
|
|
|
669
669
|
if (d)
|
|
670
670
|
return d.bind(t.proxy);
|
|
671
671
|
}
|
|
672
|
-
if (!
|
|
672
|
+
if (!nt(u, e)) {
|
|
673
673
|
const d = yr(u, e);
|
|
674
674
|
return d ? "value" in d ? d.value : (
|
|
675
675
|
// !case: support for getter
|
|
@@ -705,7 +705,7 @@ const xs = Reflect.ownKeys(Ct), li = /* @__PURE__ */ new WeakSet(), hi = {
|
|
|
705
705
|
if (s != null && s.set)
|
|
706
706
|
return s.set.call(t.proxy, n), !0;
|
|
707
707
|
const o = Qt(te(t), e), u = j(o);
|
|
708
|
-
return u && be(u.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (be(n, o) && (n !== void 0 ||
|
|
708
|
+
return u && be(u.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (be(n, o) && (n !== void 0 || nt(t.original, e)) || (Q(t), fe(t), nt(t.original, e) && be(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, $n(t, e, n, at)), !0);
|
|
709
709
|
},
|
|
710
710
|
has(t, e) {
|
|
711
711
|
return e in te(t);
|
|
@@ -756,11 +756,11 @@ function Dn(t) {
|
|
|
756
756
|
c.finalities.draft.push((f, l) => {
|
|
757
757
|
var p, y;
|
|
758
758
|
const b = j(a);
|
|
759
|
-
let
|
|
760
|
-
const T = _e(
|
|
761
|
-
if (
|
|
762
|
-
let m =
|
|
763
|
-
|
|
759
|
+
let g = c.type === 3 ? c.setMap : c.copy;
|
|
760
|
+
const T = _e(g, r), _ = j(T);
|
|
761
|
+
if (_) {
|
|
762
|
+
let m = _.original;
|
|
763
|
+
_.operated && (m = Rn(T)), rn(_), sn(_, at, 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, _.original)), ct(g, r, m);
|
|
764
764
|
}
|
|
765
765
|
(y = b.callbacks) === null || y === void 0 || y.forEach((m) => {
|
|
766
766
|
m(f, l);
|
|
@@ -769,7 +769,7 @@ function Dn(t) {
|
|
|
769
769
|
} else {
|
|
770
770
|
const c = j(a);
|
|
771
771
|
c.finalities.draft.push((f, l) => {
|
|
772
|
-
rn(c), sn(c,
|
|
772
|
+
rn(c), sn(c, at, f, l);
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
775
|
return a;
|
|
@@ -784,8 +784,8 @@ function $s(t, e, n, r, i) {
|
|
|
784
784
|
const d = a ? e[0] : o ? o.operated ? o.copy : o.original : t;
|
|
785
785
|
return o && nn(o), i && Re(d, d, o == null ? void 0 : o.options.updatedValues), [
|
|
786
786
|
d,
|
|
787
|
-
n && a ? [{ op:
|
|
788
|
-
r && a ? [{ op:
|
|
787
|
+
n && a ? [{ op: F.Replace, path: [], value: e[0] }] : n,
|
|
788
|
+
r && a ? [{ op: F.Replace, path: [], value: u }] : r
|
|
789
789
|
];
|
|
790
790
|
}
|
|
791
791
|
function Ds(t, e) {
|
|
@@ -822,7 +822,7 @@ function un(t) {
|
|
|
822
822
|
const c = Array.from(u);
|
|
823
823
|
u.clear(), c.forEach((f) => u.add(s === f ? d : f));
|
|
824
824
|
} else
|
|
825
|
-
|
|
825
|
+
ct(u, s, d);
|
|
826
826
|
} else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1, un(t));
|
|
827
827
|
}), i && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
828
828
|
}
|
|
@@ -851,7 +851,7 @@ function pi(t) {
|
|
|
851
851
|
if (n && be(_e(n.original, o), u))
|
|
852
852
|
return;
|
|
853
853
|
const a = pi(u);
|
|
854
|
-
a !== u && (i === t && s(),
|
|
854
|
+
a !== u && (i === t && s(), ct(i, o, a));
|
|
855
855
|
}), r === 3) {
|
|
856
856
|
const o = (e = n == null ? void 0 : n.original) !== null && e !== void 0 ? e : i;
|
|
857
857
|
return Pn(o) ? new Set(i) : new (Object.getPrototypeOf(o)).constructor(i);
|
|
@@ -882,19 +882,19 @@ const Us = (t) => function e(n, r, i) {
|
|
|
882
882
|
if (D)
|
|
883
883
|
return D;
|
|
884
884
|
}
|
|
885
|
-
} : c.mark, p = (s = c.enablePatches) !== null && s !== void 0 ? s : !1, y = (o = c.strict) !== null && o !== void 0 ? o : !1,
|
|
885
|
+
} : c.mark, p = (s = c.enablePatches) !== null && s !== void 0 ? s : !1, y = (o = c.strict) !== null && o !== void 0 ? o : !1, g = {
|
|
886
886
|
enableAutoFreeze: (u = c.enableAutoFreeze) !== null && u !== void 0 ? u : !1,
|
|
887
887
|
mark: l,
|
|
888
888
|
strict: y,
|
|
889
889
|
enablePatches: p
|
|
890
890
|
};
|
|
891
|
-
if (!ue(f,
|
|
891
|
+
if (!ue(f, g) && 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 [T,
|
|
893
|
+
const [T, _] = Ds(f, g);
|
|
894
894
|
if (typeof r != "function") {
|
|
895
|
-
if (!ue(f,
|
|
895
|
+
if (!ue(f, g))
|
|
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 [T,
|
|
897
|
+
return [T, _];
|
|
898
898
|
}
|
|
899
899
|
let m;
|
|
900
900
|
try {
|
|
@@ -910,24 +910,24 @@ const Us = (t) => function e(n, r, i) {
|
|
|
910
910
|
const D = S == null ? void 0 : S[Es];
|
|
911
911
|
if (D) {
|
|
912
912
|
const Ve = D[0];
|
|
913
|
-
return
|
|
913
|
+
return g.strict && typeof S == "object" && S !== null && un({
|
|
914
914
|
rootDraft: C,
|
|
915
915
|
value: S,
|
|
916
916
|
useRawReturn: !0
|
|
917
|
-
}),
|
|
917
|
+
}), _([Ve]);
|
|
918
918
|
}
|
|
919
919
|
if (S !== void 0)
|
|
920
|
-
return typeof S == "object" && S !== null && un({ rootDraft: C, value: S }),
|
|
920
|
+
return typeof S == "object" && S !== null && un({ rootDraft: C, value: S }), _([S]);
|
|
921
921
|
}
|
|
922
922
|
if (S === T || S === void 0)
|
|
923
|
-
return
|
|
923
|
+
return _([]);
|
|
924
924
|
const $ = j(S);
|
|
925
|
-
if (
|
|
925
|
+
if (g === $.options) {
|
|
926
926
|
if ($.operated)
|
|
927
927
|
throw new Error("Cannot return a modified child draft.");
|
|
928
|
-
return
|
|
928
|
+
return _([gr(S)]);
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return _([S]);
|
|
931
931
|
};
|
|
932
932
|
return m instanceof Promise ? m.then(O, (S) => {
|
|
933
933
|
throw nn(j(T)), S;
|
|
@@ -941,8 +941,8 @@ function yi(t, e) {
|
|
|
941
941
|
function wr(t, e) {
|
|
942
942
|
return Object.keys(t).length === Object.keys(e).length && Object.keys(t).every((n) => e.hasOwnProperty(n) && t[n] === e[n]);
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : yi(t, e) ? Object.keys(t).every((n) =>
|
|
944
|
+
function Et(t, e) {
|
|
945
|
+
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : yi(t, e) ? Object.keys(t).every((n) => Et(t[n], e[n])) : !1;
|
|
946
946
|
}
|
|
947
947
|
function Un(t) {
|
|
948
948
|
if (!Je(t))
|
|
@@ -1454,7 +1454,7 @@ function wi(t) {
|
|
|
1454
1454
|
};
|
|
1455
1455
|
}
|
|
1456
1456
|
function Ti(t, e) {
|
|
1457
|
-
return
|
|
1457
|
+
return Ze(t, e.triples, e.cardinalityInference, e.useDateObjects);
|
|
1458
1458
|
}
|
|
1459
1459
|
function mi(t, e) {
|
|
1460
1460
|
if (t)
|
|
@@ -1465,11 +1465,11 @@ function mi(t, e) {
|
|
|
1465
1465
|
function io(t, e) {
|
|
1466
1466
|
return We(t.eav, [e]) !== void 0;
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function Ze(t, e, n, r) {
|
|
1469
1469
|
const i = gi(t, e, r);
|
|
1470
1470
|
return i.cardinalityInference = n, i.useDateObjects = r, i;
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function dt(t, e) {
|
|
1473
1473
|
var n, r;
|
|
1474
1474
|
let i;
|
|
1475
1475
|
if (Array.isArray(e[0])) {
|
|
@@ -1497,7 +1497,7 @@ function ct(t, e) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
function vi(t, e, n) {
|
|
1500
|
-
const r =
|
|
1500
|
+
const r = dt(t, n);
|
|
1501
1501
|
if (!r)
|
|
1502
1502
|
return;
|
|
1503
1503
|
const [i, s, o] = r, u = e.getAttr(s);
|
|
@@ -1512,7 +1512,7 @@ function Si(t, e, n) {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
function Oi(t, e, n) {
|
|
1514
1514
|
var r;
|
|
1515
|
-
const i =
|
|
1515
|
+
const i = dt(t, n);
|
|
1516
1516
|
if (!i)
|
|
1517
1517
|
return;
|
|
1518
1518
|
let [s, o, u] = i;
|
|
@@ -1525,7 +1525,7 @@ function Oi(t, e, n) {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
function oo(t, e, n) {
|
|
1527
1527
|
var r;
|
|
1528
|
-
const i =
|
|
1528
|
+
const i = dt(t, n);
|
|
1529
1529
|
if (!i)
|
|
1530
1530
|
return;
|
|
1531
1531
|
const [s, o, u] = i, a = e.getAttr(o);
|
|
@@ -1549,7 +1549,7 @@ function oo(t, e, n) {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
function cn(t, e, n) {
|
|
1551
1551
|
var r, i;
|
|
1552
|
-
const [s, o] = n, u =
|
|
1552
|
+
const [s, o] = n, u = dt(t, [s]);
|
|
1553
1553
|
if (!u)
|
|
1554
1554
|
return;
|
|
1555
1555
|
const [a] = u, d = t.eav.get(a);
|
|
@@ -1557,8 +1557,8 @@ function cn(t, e, n) {
|
|
|
1557
1557
|
for (const f of d.keys()) {
|
|
1558
1558
|
const l = e.getAttr(f);
|
|
1559
1559
|
l && l["on-delete-reverse"] === "cascade" && X(d.get(f), 1).forEach(([p, y, b]) => {
|
|
1560
|
-
var
|
|
1561
|
-
return cn(t, e, [b, (
|
|
1560
|
+
var g;
|
|
1561
|
+
return cn(t, e, [b, (g = l["reverse-identity"]) === null || g === void 0 ? void 0 : g[1]]);
|
|
1562
1562
|
}), // Fall back to deleting everything if we've rehydrated tx-steps from
|
|
1563
1563
|
// the store that didn't set `etype` in deleteEntity
|
|
1564
1564
|
(!o || // If we don't know about the attr, let's just get rid of it
|
|
@@ -1570,8 +1570,8 @@ function cn(t, e, n) {
|
|
|
1570
1570
|
const c = t.vae.get(a) && X(t.vae.get(a), 2);
|
|
1571
1571
|
c && c.forEach((f) => {
|
|
1572
1572
|
var l, p, y;
|
|
1573
|
-
const [b,
|
|
1574
|
-
(!o || !
|
|
1573
|
+
const [b, g, T] = f, _ = e.getAttr(g);
|
|
1574
|
+
(!o || !_ || ((l = _["reverse-identity"]) === null || l === void 0 ? void 0 : l[1]) === o) && (oe(t.eav, [b, g, T]), oe(t.aev, [g, b, T]), oe(t.vae, [T, g, b])), _ && _["on-delete"] === "cascade" && ((p = _["reverse-identity"]) === null || p === void 0 ? void 0 : p[1]) === o && cn(t, e, [b, (y = _["forward-identity"]) === null || y === void 0 ? void 0 : y[1]]);
|
|
1575
1575
|
}), ((i = t.vae.get(a)) === null || i === void 0 ? void 0 : i.size) === 0 && oe(t.vae, [a]);
|
|
1576
1576
|
}
|
|
1577
1577
|
function Ei(t, e, n) {
|
|
@@ -1639,7 +1639,7 @@ function X(t, e, n = []) {
|
|
|
1639
1639
|
X(r, e - 1, n);
|
|
1640
1640
|
return n;
|
|
1641
1641
|
}
|
|
1642
|
-
function
|
|
1642
|
+
function wt(t, e, n) {
|
|
1643
1643
|
var r;
|
|
1644
1644
|
const i = [];
|
|
1645
1645
|
if (n != null && n.hasOwnProperty("$not")) {
|
|
@@ -1689,7 +1689,7 @@ function ho(t, [e, n, r]) {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
case "eav": {
|
|
1691
1691
|
const u = (s = t.eav.get(e)) === null || s === void 0 ? void 0 : s.get(n);
|
|
1692
|
-
return u ?
|
|
1692
|
+
return u ? wt(t, u, r) : [];
|
|
1693
1693
|
}
|
|
1694
1694
|
case "ev": {
|
|
1695
1695
|
const u = t.eav.get(e);
|
|
@@ -1697,7 +1697,7 @@ function ho(t, [e, n, r]) {
|
|
|
1697
1697
|
return [];
|
|
1698
1698
|
const a = [];
|
|
1699
1699
|
for (const d of u.values())
|
|
1700
|
-
a.push(...
|
|
1700
|
+
a.push(...wt(t, d, r));
|
|
1701
1701
|
return a;
|
|
1702
1702
|
}
|
|
1703
1703
|
case "a": {
|
|
@@ -1710,14 +1710,14 @@ function ho(t, [e, n, r]) {
|
|
|
1710
1710
|
return [];
|
|
1711
1711
|
const a = [];
|
|
1712
1712
|
for (const d of u.values())
|
|
1713
|
-
a.push(...
|
|
1713
|
+
a.push(...wt(t, d, r));
|
|
1714
1714
|
return a;
|
|
1715
1715
|
}
|
|
1716
1716
|
case "v": {
|
|
1717
1717
|
const u = [];
|
|
1718
1718
|
for (const a of t.eav.values())
|
|
1719
1719
|
for (const d of a.values())
|
|
1720
|
-
u.push(...
|
|
1720
|
+
u.push(...wt(t, d, r));
|
|
1721
1721
|
return u;
|
|
1722
1722
|
}
|
|
1723
1723
|
default:
|
|
@@ -1753,7 +1753,7 @@ function ki(t, e) {
|
|
|
1753
1753
|
return r || ((n = t.forwardIdents.get(e)) === null || n === void 0 ? void 0 : n.get("id"));
|
|
1754
1754
|
}
|
|
1755
1755
|
function bo(t, e, n) {
|
|
1756
|
-
const r =
|
|
1756
|
+
const r = dt(t, n);
|
|
1757
1757
|
if (!r)
|
|
1758
1758
|
return;
|
|
1759
1759
|
const [i, s, o] = r;
|
|
@@ -1856,11 +1856,11 @@ const jo = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a
|
|
|
1856
1856
|
function Ne(t) {
|
|
1857
1857
|
return typeof t == "string" && jo.test(t);
|
|
1858
1858
|
}
|
|
1859
|
-
const
|
|
1859
|
+
const V = [];
|
|
1860
1860
|
for (let t = 0; t < 256; ++t)
|
|
1861
|
-
|
|
1861
|
+
V.push((t + 256).toString(16).slice(1));
|
|
1862
1862
|
function Co(t, e = 0) {
|
|
1863
|
-
return (
|
|
1863
|
+
return (V[t[e + 0]] + V[t[e + 1]] + V[t[e + 2]] + V[t[e + 3]] + "-" + V[t[e + 4]] + V[t[e + 5]] + "-" + V[t[e + 6]] + V[t[e + 7]] + "-" + V[t[e + 8]] + V[t[e + 9]] + "-" + V[t[e + 10]] + V[t[e + 11]] + V[t[e + 12]] + V[t[e + 13]] + V[t[e + 14]] + V[t[e + 15]]).toLowerCase();
|
|
1864
1864
|
}
|
|
1865
1865
|
let Ht;
|
|
1866
1866
|
const Io = new Uint8Array(16);
|
|
@@ -1901,7 +1901,7 @@ function xo(t, e) {
|
|
|
1901
1901
|
function $o(t, e) {
|
|
1902
1902
|
return xo(Or(t), Or(e));
|
|
1903
1903
|
}
|
|
1904
|
-
function
|
|
1904
|
+
function z() {
|
|
1905
1905
|
return Ro();
|
|
1906
1906
|
}
|
|
1907
1907
|
function Do(t, e) {
|
|
@@ -1918,7 +1918,7 @@ function Uo() {
|
|
|
1918
1918
|
}
|
|
1919
1919
|
const Lo = Uo();
|
|
1920
1920
|
let Fo = 0;
|
|
1921
|
-
function
|
|
1921
|
+
function rt(t) {
|
|
1922
1922
|
return $t(`_${t}`, Fo++);
|
|
1923
1923
|
}
|
|
1924
1924
|
function $t(t, e) {
|
|
@@ -1959,12 +1959,12 @@ function Ci(t, e, n, r, i) {
|
|
|
1959
1959
|
t(d, r),
|
|
1960
1960
|
u.id,
|
|
1961
1961
|
t(f, l),
|
|
1962
|
-
|
|
1962
|
+
rt("time")
|
|
1963
1963
|
] : [
|
|
1964
1964
|
t(d, l),
|
|
1965
1965
|
u.id,
|
|
1966
1966
|
t(f, r),
|
|
1967
|
-
|
|
1967
|
+
rt("time")
|
|
1968
1968
|
];
|
|
1969
1969
|
return [s ? f : d, l, p, u, !!s];
|
|
1970
1970
|
}
|
|
@@ -2050,15 +2050,15 @@ function zo(t, e, n, r, i, s) {
|
|
|
2050
2050
|
t(n, r),
|
|
2051
2051
|
d.id,
|
|
2052
2052
|
{ $isNull: { attrId: a.id, isNull: s.$isNull, reverse: !o } },
|
|
2053
|
-
|
|
2053
|
+
rt("time")
|
|
2054
2054
|
];
|
|
2055
2055
|
}
|
|
2056
2056
|
return o ? [
|
|
2057
2057
|
t(n, r),
|
|
2058
2058
|
a.id,
|
|
2059
2059
|
Wo(a, s),
|
|
2060
|
-
|
|
2061
|
-
] : [s, a.id, t(n, r),
|
|
2060
|
+
rt("time")
|
|
2061
|
+
] : [s, a.id, t(n, r), rt("time")];
|
|
2062
2062
|
}
|
|
2063
2063
|
function Vo(t, e, n, r, i) {
|
|
2064
2064
|
const [s, o, u] = i.reduce((a, d) => {
|
|
@@ -2149,20 +2149,20 @@ function eu(t, e, n, { etype: r, level: i, form: s }, o) {
|
|
|
2149
2149
|
const u = Object.keys(s).filter((a) => a !== "$");
|
|
2150
2150
|
return u.length ? Object.entries(o).map(function([d, c]) {
|
|
2151
2151
|
return u.map(function(p) {
|
|
2152
|
-
var y, b,
|
|
2153
|
-
const T = !!(e.cardinalityInference && (!((
|
|
2152
|
+
var y, b, g;
|
|
2153
|
+
const T = !!(e.cardinalityInference && (!((g = (b = (y = n.linkIndex) === null || y === void 0 ? void 0 : y[r]) === null || b === void 0 ? void 0 : b[p]) === null || g === void 0) && g.isSingular));
|
|
2154
2154
|
try {
|
|
2155
|
-
const [
|
|
2156
|
-
etype:
|
|
2155
|
+
const [_, m, O] = Xo(t, n, r, i, p, d), S = Mi(e, n, {
|
|
2156
|
+
etype: _,
|
|
2157
2157
|
level: m,
|
|
2158
2158
|
form: s[p],
|
|
2159
2159
|
join: O
|
|
2160
2160
|
}), C = T ? S[0] : S;
|
|
2161
2161
|
return { [p]: C };
|
|
2162
|
-
} catch (
|
|
2163
|
-
if (
|
|
2162
|
+
} catch (_) {
|
|
2163
|
+
if (_ instanceof Ke)
|
|
2164
2164
|
return { [p]: T ? void 0 : [] };
|
|
2165
|
-
throw
|
|
2165
|
+
throw _;
|
|
2166
2166
|
}
|
|
2167
2167
|
}).reduce(function(p, y) {
|
|
2168
2168
|
return Object.assign(Object.assign({}, p), y);
|
|
@@ -2172,11 +2172,11 @@ function eu(t, e, n, { etype: r, level: i, form: s }, o) {
|
|
|
2172
2172
|
function tu(t, e, n) {
|
|
2173
2173
|
return n === "string" ? Lo(t, e) : t > e ? 1 : -1;
|
|
2174
2174
|
}
|
|
2175
|
-
function
|
|
2175
|
+
function Xe(t, e, n, r, i) {
|
|
2176
2176
|
return e === r || e == null && r == null ? $o(t, n) : r == null ? 1 : e == null ? -1 : tu(e, r, i);
|
|
2177
2177
|
}
|
|
2178
2178
|
function Pt([t, e], [n, r], i) {
|
|
2179
|
-
return
|
|
2179
|
+
return Xe(t, e, n, r, i);
|
|
2180
2180
|
}
|
|
2181
2181
|
function ln(t) {
|
|
2182
2182
|
return t == null ? t : new Date(t).getTime();
|
|
@@ -2224,26 +2224,26 @@ function uu(t, e, { etype: n, pageInfo: r, dq: i, form: s }) {
|
|
|
2224
2224
|
let f = Ao(t, i);
|
|
2225
2225
|
const l = r == null ? void 0 : r["start-cursor"], p = su(e, n, l, a);
|
|
2226
2226
|
if (p && ((u = p == null ? void 0 : p["forward-identity"]) === null || u === void 0 ? void 0 : u[2]) !== "id") {
|
|
2227
|
-
const
|
|
2228
|
-
f = f.map(([
|
|
2227
|
+
const g = p["checked-data-type"] === "date", T = p.id;
|
|
2228
|
+
f = f.map(([_]) => {
|
|
2229
2229
|
var m, O, S, C, $;
|
|
2230
|
-
let D = ($ = (C = (S = (O = (m = t.eav.get(
|
|
2231
|
-
return
|
|
2230
|
+
let D = ($ = (C = (S = (O = (m = t.eav.get(_)) === null || m === void 0 ? void 0 : m.get(T)) === null || O === void 0 ? void 0 : O.values()) === null || S === void 0 ? void 0 : S.next()) === null || C === void 0 ? void 0 : C.value) === null || $ === void 0 ? void 0 : $[2];
|
|
2231
|
+
return g && (D = ln(D)), [_, D];
|
|
2232
2232
|
});
|
|
2233
2233
|
}
|
|
2234
|
-
f.sort(c === "asc" ? function(T,
|
|
2235
|
-
return Pt(T,
|
|
2236
|
-
} : function(T,
|
|
2237
|
-
return Pt(
|
|
2234
|
+
f.sort(c === "asc" ? function(T, _) {
|
|
2235
|
+
return Pt(T, _, p == null ? void 0 : p["checked-data-type"]);
|
|
2236
|
+
} : function(T, _) {
|
|
2237
|
+
return Pt(_, T, p == null ? void 0 : p["checked-data-type"]);
|
|
2238
2238
|
});
|
|
2239
2239
|
let y = {};
|
|
2240
2240
|
const b = ou(e, n, i);
|
|
2241
|
-
for (const
|
|
2242
|
-
const [T] =
|
|
2243
|
-
if (y[T] || !d && l && p && nu(l, p, c,
|
|
2241
|
+
for (const g of f) {
|
|
2242
|
+
const [T] = g;
|
|
2243
|
+
if (y[T] || !d && l && p && nu(l, p, c, g))
|
|
2244
2244
|
continue;
|
|
2245
|
-
const
|
|
2246
|
-
|
|
2245
|
+
const _ = po(t, b, T);
|
|
2246
|
+
_ && (y[T] = _);
|
|
2247
2247
|
}
|
|
2248
2248
|
return y;
|
|
2249
2249
|
}
|
|
@@ -2266,11 +2266,11 @@ function cu(t, e, { etype: n, level: r, form: i, join: s, pageInfo: o }) {
|
|
|
2266
2266
|
pageInfo: o,
|
|
2267
2267
|
form: i,
|
|
2268
2268
|
dq: { where: l, find: p, fields: y }
|
|
2269
|
-
}),
|
|
2270
|
-
if (
|
|
2269
|
+
}), g = ((d = i.$) === null || d === void 0 ? void 0 : d.limit) || ((c = i.$) === null || c === void 0 ? void 0 : c.first) || ((f = i.$) === null || f === void 0 ? void 0 : f.last);
|
|
2270
|
+
if (g != null) {
|
|
2271
2271
|
r > 0 && console.warn("WARNING: Limits in child queries are only run client-side. Data returned from the server will not have a limit.");
|
|
2272
2272
|
const T = Object.entries(b);
|
|
2273
|
-
return T.length <=
|
|
2273
|
+
return T.length <= g ? b : Object.fromEntries(T.slice(0, g));
|
|
2274
2274
|
}
|
|
2275
2275
|
return b;
|
|
2276
2276
|
}
|
|
@@ -2610,8 +2610,8 @@ function Pu(t, e, n) {
|
|
|
2610
2610
|
"checked-data-type": a
|
|
2611
2611
|
};
|
|
2612
2612
|
}
|
|
2613
|
-
function
|
|
2614
|
-
const i = t ? Pu(t, e, n) : null, s =
|
|
2613
|
+
function Tt(t, e, n, r) {
|
|
2614
|
+
const i = t ? Pu(t, e, n) : null, s = z(), u = [z(), e, n];
|
|
2615
2615
|
return Object.assign(Object.assign({ id: s, "forward-identity": u, "value-type": "blob", cardinality: "one", "unique?": !1, "index?": !1, isUnsynced: !0 }, i || {}), r || {});
|
|
2616
2616
|
}
|
|
2617
2617
|
function Mu(t, e, n) {
|
|
@@ -2623,8 +2623,8 @@ function Ru(t, e, n) {
|
|
|
2623
2623
|
throw new Error(`Couldn't find the link ${e}.${n} in your schema`);
|
|
2624
2624
|
const { forward: i, reverse: s } = r;
|
|
2625
2625
|
return {
|
|
2626
|
-
"forward-identity": [
|
|
2627
|
-
"reverse-identity": [
|
|
2626
|
+
"forward-identity": [z(), i.on, i.label],
|
|
2627
|
+
"reverse-identity": [z(), s.on, s.label],
|
|
2628
2628
|
cardinality: i.has === "one" ? "one" : "many",
|
|
2629
2629
|
"unique?": s.has === "one",
|
|
2630
2630
|
"on-delete": i.onDelete,
|
|
@@ -2632,7 +2632,7 @@ function Ru(t, e, n) {
|
|
|
2632
2632
|
};
|
|
2633
2633
|
}
|
|
2634
2634
|
function Cr(t, e, n, r) {
|
|
2635
|
-
const i = t ? Ru(t, e, n) : null, s =
|
|
2635
|
+
const i = t ? Ru(t, e, n) : null, s = z(), o = [z(), e, n], u = [z(), n, e];
|
|
2636
2636
|
return Object.assign(Object.assign({
|
|
2637
2637
|
id: s,
|
|
2638
2638
|
// @ts-ignore: ts thinks it's any[]
|
|
@@ -2679,12 +2679,12 @@ function Nu({ attrsStore: t, schema: e }, n) {
|
|
|
2679
2679
|
var r, i;
|
|
2680
2680
|
const s = /* @__PURE__ */ new Set(), o = [], u = [];
|
|
2681
2681
|
function a(y, b) {
|
|
2682
|
-
return K(t, y, b) || o.find((
|
|
2682
|
+
return K(t, y, b) || o.find((g) => g["forward-identity"][1] === y && g["forward-identity"][2] === b);
|
|
2683
2683
|
}
|
|
2684
2684
|
function d(y, b) {
|
|
2685
|
-
return Ie(t, y, b) || o.find((
|
|
2686
|
-
var T,
|
|
2687
|
-
return ((T =
|
|
2685
|
+
return Ie(t, y, b) || o.find((g) => {
|
|
2686
|
+
var T, _;
|
|
2687
|
+
return ((T = g["reverse-identity"]) === null || T === void 0 ? void 0 : T[1]) === y && ((_ = g["reverse-identity"]) === null || _ === void 0 ? void 0 : _[2]) === b;
|
|
2688
2688
|
});
|
|
2689
2689
|
}
|
|
2690
2690
|
function c(y) {
|
|
@@ -2699,40 +2699,40 @@ function Nu({ attrsStore: t, schema: e }, n) {
|
|
|
2699
2699
|
!a(y, b);
|
|
2700
2700
|
}
|
|
2701
2701
|
function p(y, b) {
|
|
2702
|
-
const
|
|
2703
|
-
f(
|
|
2702
|
+
const g = a(y, b), T = d(y, b);
|
|
2703
|
+
f(g), f(T), !g && !T && c(Cr(e, y, b, Lu));
|
|
2704
2704
|
}
|
|
2705
2705
|
for (const y of n)
|
|
2706
|
-
for (const { etype: b, lookupPair:
|
|
2707
|
-
const
|
|
2706
|
+
for (const { etype: b, lookupPair: g, linkLabel: T } of Fu(y)) {
|
|
2707
|
+
const _ = g[0];
|
|
2708
2708
|
if (T) {
|
|
2709
2709
|
p(b, T);
|
|
2710
2710
|
const m = a(b, T), O = d(b, T);
|
|
2711
2711
|
f(m), f(O);
|
|
2712
2712
|
const S = ((r = m == null ? void 0 : m["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = O == null ? void 0 : O["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) || T;
|
|
2713
|
-
if (l(S,
|
|
2714
|
-
p(S, pn(
|
|
2713
|
+
if (l(S, _))
|
|
2714
|
+
p(S, pn(_));
|
|
2715
2715
|
else {
|
|
2716
|
-
const C = a(S,
|
|
2717
|
-
C || c(
|
|
2716
|
+
const C = a(S, _);
|
|
2717
|
+
C || c(Tt(e, S, _, bn)), f(C);
|
|
2718
2718
|
}
|
|
2719
|
-
} else if (l(b,
|
|
2720
|
-
p(b, pn(
|
|
2719
|
+
} else if (l(b, _))
|
|
2720
|
+
p(b, pn(_));
|
|
2721
2721
|
else {
|
|
2722
|
-
const m = a(b,
|
|
2723
|
-
m || c(
|
|
2722
|
+
const m = a(b, _);
|
|
2723
|
+
m || c(Tt(e, b, _, bn)), f(m);
|
|
2724
2724
|
}
|
|
2725
2725
|
}
|
|
2726
2726
|
for (const y of n) {
|
|
2727
|
-
const [b,
|
|
2727
|
+
const [b, g, T, _] = y;
|
|
2728
2728
|
if (xu.has(b)) {
|
|
2729
|
-
const m = a(
|
|
2730
|
-
f(m), m || c(
|
|
2731
|
-
for (const O of Object.keys(
|
|
2732
|
-
const S = a(
|
|
2733
|
-
if (f(S), Du.has(b) && (S || c(
|
|
2734
|
-
const C = d(
|
|
2735
|
-
!S && !C && c(Cr(e,
|
|
2729
|
+
const m = a(g, "id");
|
|
2730
|
+
f(m), m || c(Tt(e, g, "id", { "unique?": !0 }));
|
|
2731
|
+
for (const O of Object.keys(_)) {
|
|
2732
|
+
const S = a(g, O);
|
|
2733
|
+
if (f(S), Du.has(b) && (S || c(Tt(e, g, O, O === "id" ? { "unique?": !0 } : null))), $u.has(b)) {
|
|
2734
|
+
const C = d(g, O);
|
|
2735
|
+
!S && !C && c(Cr(e, g, O)), f(C);
|
|
2736
2736
|
}
|
|
2737
2737
|
}
|
|
2738
2738
|
}
|
|
@@ -2779,7 +2779,7 @@ var de = function(t, e, n, r) {
|
|
|
2779
2779
|
function Ir(t, e) {
|
|
2780
2780
|
typeof requestIdleCallback > "u" ? t() : requestIdleCallback(t, { timeout: e });
|
|
2781
2781
|
}
|
|
2782
|
-
const
|
|
2782
|
+
const it = "__meta";
|
|
2783
2783
|
class qu {
|
|
2784
2784
|
constructor(e, n) {
|
|
2785
2785
|
}
|
|
@@ -2800,7 +2800,7 @@ class _n {
|
|
|
2800
2800
|
var e, n, r;
|
|
2801
2801
|
this._meta.loadingPromise && (yield this._meta.loadingPromise);
|
|
2802
2802
|
try {
|
|
2803
|
-
const i = this._persister.getItem(
|
|
2803
|
+
const i = this._persister.getItem(it);
|
|
2804
2804
|
this._meta.loadingPromise = i;
|
|
2805
2805
|
const s = yield i;
|
|
2806
2806
|
this._meta.isLoading = !1, this._meta.error = null, this._meta.loadingPromise = null, this._meta.attempts = 0;
|
|
@@ -2881,10 +2881,10 @@ class _n {
|
|
|
2881
2881
|
const i = [], s = e == null ? void 0 : e.skipGc;
|
|
2882
2882
|
if (this._meta.isLoading) {
|
|
2883
2883
|
const p = new Promise((y, b) => {
|
|
2884
|
-
var
|
|
2885
|
-
setTimeout(() => this._enqueuePersist(e ? Object.assign(Object.assign({}, e), { attempts: (e.attempts || 0) + 1 }) : { attempts: 1 }).then(y).catch(b), 10 + ((
|
|
2884
|
+
var g;
|
|
2885
|
+
setTimeout(() => this._enqueuePersist(e ? Object.assign(Object.assign({}, e), { attempts: (e.attempts || 0) + 1 }) : { attempts: 1 }).then(y).catch(b), 10 + ((g = e == null ? void 0 : e.attempts) !== null && g !== void 0 ? g : 0) * 1e3);
|
|
2886
2886
|
});
|
|
2887
|
-
return i.push(p), Promise.all(i).then((y) => y.reduce((b,
|
|
2887
|
+
return i.push(p), Promise.all(i).then((y) => y.reduce((b, g) => b + g, 0));
|
|
2888
2888
|
}
|
|
2889
2889
|
const o = this._meta.value;
|
|
2890
2890
|
if (!o)
|
|
@@ -2896,18 +2896,18 @@ class _n {
|
|
|
2896
2896
|
const y = this._persister.removeItem(p);
|
|
2897
2897
|
i.push(y.then(() => 1)), this._loadedKeys.delete(p), this._pendingSaveKeys.delete(p);
|
|
2898
2898
|
}
|
|
2899
|
-
const d = [], c = [[
|
|
2899
|
+
const d = [], c = [[it, o]], f = (n = o.objects) !== null && n !== void 0 ? n : {};
|
|
2900
2900
|
o.objects = f;
|
|
2901
2901
|
for (const p of a)
|
|
2902
2902
|
if (this._loadedKeys.has(p)) {
|
|
2903
2903
|
const y = this.serialize(p, this.currentValue[p]);
|
|
2904
2904
|
c.push([p, y]);
|
|
2905
|
-
const b = this._objectSize(y),
|
|
2905
|
+
const b = this._objectSize(y), g = (r = f[p]) !== null && r !== void 0 ? r : {
|
|
2906
2906
|
createdAt: Date.now(),
|
|
2907
2907
|
updatedAt: Date.now(),
|
|
2908
2908
|
size: b
|
|
2909
2909
|
};
|
|
2910
|
-
|
|
2910
|
+
g.updatedAt = Date.now(), g.size = b, f[p] = g, this._pendingSaveKeys.delete(p);
|
|
2911
2911
|
} else
|
|
2912
2912
|
d.push(p);
|
|
2913
2913
|
const l = this._persister.multiSet(c);
|
|
@@ -2928,7 +2928,7 @@ class _n {
|
|
|
2928
2928
|
if (!this._gcOpts)
|
|
2929
2929
|
return;
|
|
2930
2930
|
const e = new Set(yield this._persister.getAllKeys());
|
|
2931
|
-
e.delete(
|
|
2931
|
+
e.delete(it);
|
|
2932
2932
|
const n = new Set(Object.keys(this.currentValue));
|
|
2933
2933
|
for (const l of Object.keys(this._loadingKeys))
|
|
2934
2934
|
n.add(l);
|
|
@@ -3087,19 +3087,19 @@ function Gu(t, e, n) {
|
|
|
3087
3087
|
var u, a, d, c;
|
|
3088
3088
|
const f = {};
|
|
3089
3089
|
for (const [y, b] of Object.entries(r)) {
|
|
3090
|
-
const
|
|
3091
|
-
if (
|
|
3092
|
-
const
|
|
3093
|
-
createdAt:
|
|
3094
|
-
updatedAt:
|
|
3095
|
-
size: (c = (d = (a = (u =
|
|
3090
|
+
const g = typeof b == "string" ? JSON.parse(b) : b;
|
|
3091
|
+
if (g.lastAccessed) {
|
|
3092
|
+
const _ = {
|
|
3093
|
+
createdAt: g.lastAccessed,
|
|
3094
|
+
updatedAt: g.lastAccessed,
|
|
3095
|
+
size: (c = (d = (a = (u = g.result) === null || u === void 0 ? void 0 : u.store) === null || a === void 0 ? void 0 : a.triples) === null || d === void 0 ? void 0 : d.length) !== null && c !== void 0 ? c : 0
|
|
3096
3096
|
};
|
|
3097
|
-
f[y] =
|
|
3097
|
+
f[y] = _;
|
|
3098
3098
|
}
|
|
3099
|
-
const T = n.put(
|
|
3099
|
+
const T = n.put(g, y);
|
|
3100
3100
|
i.add(T);
|
|
3101
3101
|
}
|
|
3102
|
-
const l = { objects: f }, p = n.put(l,
|
|
3102
|
+
const l = { objects: f }, p = n.put(l, it);
|
|
3103
3103
|
i.add(p);
|
|
3104
3104
|
for (const y of i)
|
|
3105
3105
|
y.onsuccess = () => {
|
|
@@ -3125,19 +3125,19 @@ function Qu(t, e) {
|
|
|
3125
3125
|
return;
|
|
3126
3126
|
const r = yield new Promise((c, f) => {
|
|
3127
3127
|
const y = n.transaction(["kv"], "readonly").objectStore("kv").openCursor();
|
|
3128
|
-
y.onerror = (
|
|
3129
|
-
f(
|
|
3128
|
+
y.onerror = (g) => {
|
|
3129
|
+
f(g);
|
|
3130
3130
|
};
|
|
3131
3131
|
const b = [];
|
|
3132
3132
|
y.onsuccess = () => {
|
|
3133
|
-
const
|
|
3134
|
-
if (
|
|
3135
|
-
const T =
|
|
3136
|
-
b.push([T,
|
|
3133
|
+
const g = y.result;
|
|
3134
|
+
if (g) {
|
|
3135
|
+
const T = g.key, _ = g.value;
|
|
3136
|
+
b.push([T, _]), g.continue();
|
|
3137
3137
|
} else
|
|
3138
3138
|
c(b);
|
|
3139
|
-
}, y.onerror = (
|
|
3140
|
-
f(
|
|
3139
|
+
}, y.onerror = (g) => {
|
|
3140
|
+
f(g);
|
|
3141
3141
|
};
|
|
3142
3142
|
}), i = e.transaction(["kv", "querySubs"], "readwrite"), s = i.objectStore("kv"), o = i.objectStore("querySubs"), u = [], a = { objects: {} };
|
|
3143
3143
|
for (const [c, f] of r)
|
|
@@ -3159,7 +3159,7 @@ function Qu(t, e) {
|
|
|
3159
3159
|
break;
|
|
3160
3160
|
}
|
|
3161
3161
|
}
|
|
3162
|
-
const d = Pr(
|
|
3162
|
+
const d = Pr(it, a, s);
|
|
3163
3163
|
u.push(d), yield Promise.all(u), yield new Promise((c, f) => {
|
|
3164
3164
|
i.oncomplete = (l) => c(l), i.onerror = (l) => f(l), i.onabort = (l) => f(l);
|
|
3165
3165
|
});
|
|
@@ -3481,7 +3481,7 @@ function na(t) {
|
|
|
3481
3481
|
});
|
|
3482
3482
|
});
|
|
3483
3483
|
}
|
|
3484
|
-
var
|
|
3484
|
+
var ft = function(t, e, n, r) {
|
|
3485
3485
|
function i(s) {
|
|
3486
3486
|
return s instanceof n ? s : new n(function(o) {
|
|
3487
3487
|
o(s);
|
|
@@ -3509,7 +3509,7 @@ var dt = function(t, e, n, r) {
|
|
|
3509
3509
|
});
|
|
3510
3510
|
};
|
|
3511
3511
|
function ra(t) {
|
|
3512
|
-
return
|
|
3512
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, path: r, file: i, refreshToken: s, contentType: o, contentDisposition: u }) {
|
|
3513
3513
|
const a = {
|
|
3514
3514
|
app_id: n,
|
|
3515
3515
|
path: r,
|
|
@@ -3524,7 +3524,7 @@ function ra(t) {
|
|
|
3524
3524
|
});
|
|
3525
3525
|
}
|
|
3526
3526
|
function ia(t) {
|
|
3527
|
-
return
|
|
3527
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, path: r, refreshToken: i }) {
|
|
3528
3528
|
const { data: s } = yield ae(`${e}/storage/files?app_id=${n}&filename=${encodeURIComponent(r)}`, {
|
|
3529
3529
|
method: "DELETE",
|
|
3530
3530
|
headers: {
|
|
@@ -3536,7 +3536,7 @@ function ia(t) {
|
|
|
3536
3536
|
});
|
|
3537
3537
|
}
|
|
3538
3538
|
function sa(t) {
|
|
3539
|
-
return
|
|
3539
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, fileName: r, refreshToken: i, metadata: s = {} }) {
|
|
3540
3540
|
const { data: o } = yield ae(`${e}/storage/signed-upload-url`, {
|
|
3541
3541
|
method: "POST",
|
|
3542
3542
|
headers: {
|
|
@@ -3552,7 +3552,7 @@ function sa(t) {
|
|
|
3552
3552
|
});
|
|
3553
3553
|
}
|
|
3554
3554
|
function oa(t, e) {
|
|
3555
|
-
return
|
|
3555
|
+
return ft(this, void 0, void 0, function* () {
|
|
3556
3556
|
return (yield fetch(t, {
|
|
3557
3557
|
method: "PUT",
|
|
3558
3558
|
body: e,
|
|
@@ -3563,7 +3563,7 @@ function oa(t, e) {
|
|
|
3563
3563
|
});
|
|
3564
3564
|
}
|
|
3565
3565
|
function ua(t) {
|
|
3566
|
-
return
|
|
3566
|
+
return ft(this, arguments, void 0, function* ({ apiURI: e, appId: n, path: r, refreshToken: i }) {
|
|
3567
3567
|
const { data: s } = yield ae(`${e}/storage/signed-download-url?app_id=${n}&filename=${encodeURIComponent(r)}`, {
|
|
3568
3568
|
method: "GET",
|
|
3569
3569
|
headers: {
|
|
@@ -3650,7 +3650,7 @@ function Ur(t) {
|
|
|
3650
3650
|
}, e;
|
|
3651
3651
|
}, {});
|
|
3652
3652
|
}
|
|
3653
|
-
const Wn = "v0.22.92-experimental.
|
|
3653
|
+
const Wn = "v0.22.92-experimental.drewh-ssr.20347788876.1";
|
|
3654
3654
|
function da(t, e) {
|
|
3655
3655
|
return {
|
|
3656
3656
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -4250,7 +4250,7 @@ function Oa(t, e, n) {
|
|
|
4250
4250
|
}
|
|
4251
4251
|
return u;
|
|
4252
4252
|
}
|
|
4253
|
-
function
|
|
4253
|
+
function mt(t, e) {
|
|
4254
4254
|
return { [t.table]: e.map((n) => n.entity) };
|
|
4255
4255
|
}
|
|
4256
4256
|
function Ea(t, e) {
|
|
@@ -4264,17 +4264,17 @@ function Aa(t, e, n) {
|
|
|
4264
4264
|
const r = e;
|
|
4265
4265
|
if (t.orderField === "serverCreatedAt") {
|
|
4266
4266
|
n.sort(t.orderDirection === "asc" ? function(o, u) {
|
|
4267
|
-
return
|
|
4267
|
+
return Xe(o.entity.id, o.serverCreatedAt, u.entity.id, u.serverCreatedAt, r);
|
|
4268
4268
|
} : function(o, u) {
|
|
4269
|
-
return
|
|
4269
|
+
return Xe(u.entity.id, u.serverCreatedAt, o.entity.id, o.serverCreatedAt, r);
|
|
4270
4270
|
});
|
|
4271
4271
|
return;
|
|
4272
4272
|
}
|
|
4273
4273
|
const i = t.orderField;
|
|
4274
4274
|
n.sort(t.orderDirection === "asc" ? function(o, u) {
|
|
4275
|
-
return
|
|
4275
|
+
return Xe(o.entity.id, o.entity[i], u.entity.id, u.entity[i], r);
|
|
4276
4276
|
} : function(o, u) {
|
|
4277
|
-
return
|
|
4277
|
+
return Xe(u.entity.id, u.entity[i], o.entity.id, o.entity[i], r);
|
|
4278
4278
|
});
|
|
4279
4279
|
}
|
|
4280
4280
|
var ve;
|
|
@@ -4307,7 +4307,7 @@ class ka {
|
|
|
4307
4307
|
this.subs.flush();
|
|
4308
4308
|
}
|
|
4309
4309
|
subscribe(e, n) {
|
|
4310
|
-
const r =
|
|
4310
|
+
const r = W(e);
|
|
4311
4311
|
return this.callbacks[r] = this.callbacks[r] || [], this.callbacks[r].push(n), this.initSubscription(e, r, n), (i) => {
|
|
4312
4312
|
this.unsubscribe(r, n, i == null ? void 0 : i.keepSubscription);
|
|
4313
4313
|
};
|
|
@@ -4323,7 +4323,7 @@ class ka {
|
|
|
4323
4323
|
}
|
|
4324
4324
|
}
|
|
4325
4325
|
sendStart(e) {
|
|
4326
|
-
this.trySend(
|
|
4326
|
+
this.trySend(z(), {
|
|
4327
4327
|
op: "start-sync",
|
|
4328
4328
|
q: e
|
|
4329
4329
|
});
|
|
@@ -4337,7 +4337,7 @@ class ka {
|
|
|
4337
4337
|
});
|
|
4338
4338
|
}
|
|
4339
4339
|
sendRemove(e, n) {
|
|
4340
|
-
this.trySend(
|
|
4340
|
+
this.trySend(z(), {
|
|
4341
4341
|
op: "remove-sync",
|
|
4342
4342
|
"subscription-id": e.subscriptionId,
|
|
4343
4343
|
"keep-subscription": n
|
|
@@ -4351,7 +4351,7 @@ class ka {
|
|
|
4351
4351
|
if (a && a.state && a.state.txId) {
|
|
4352
4352
|
this.sendResync(a, a.state, a.state.txId), !((i = a.values) === null || i === void 0) && i.entities && r && r({
|
|
4353
4353
|
type: ve.LoadFromStorage,
|
|
4354
|
-
data:
|
|
4354
|
+
data: mt(a, (s = a.values) === null || s === void 0 ? void 0 : s.entities)
|
|
4355
4355
|
});
|
|
4356
4356
|
return;
|
|
4357
4357
|
}
|
|
@@ -4379,7 +4379,7 @@ class ka {
|
|
|
4379
4379
|
});
|
|
4380
4380
|
}
|
|
4381
4381
|
onStartSyncOk(e) {
|
|
4382
|
-
const n = e["subscription-id"], r = e.q, i =
|
|
4382
|
+
const n = e["subscription-id"], r = e.q, i = W(r);
|
|
4383
4383
|
this.idToHash[n] = i, this.subs.updateInPlace((s) => {
|
|
4384
4384
|
const o = s[i];
|
|
4385
4385
|
if (!o)
|
|
@@ -4424,7 +4424,7 @@ class ka {
|
|
|
4424
4424
|
c[s] = u, c[s].updatedAt = Date.now();
|
|
4425
4425
|
}), u.values && this.notifyCbs(s, {
|
|
4426
4426
|
type: ve.InitialSyncBatch,
|
|
4427
|
-
data:
|
|
4427
|
+
data: mt(u, u.values.entities),
|
|
4428
4428
|
batch: o
|
|
4429
4429
|
});
|
|
4430
4430
|
}
|
|
@@ -4449,7 +4449,7 @@ class ka {
|
|
|
4449
4449
|
const s = this.subs.currentValue[i];
|
|
4450
4450
|
s && this.notifyCbs(i, {
|
|
4451
4451
|
type: ve.InitialSyncComplete,
|
|
4452
|
-
data:
|
|
4452
|
+
data: mt(s, ((n = s.values) === null || n === void 0 ? void 0 : n.entities) || [])
|
|
4453
4453
|
});
|
|
4454
4454
|
}
|
|
4455
4455
|
onSyncUpdateTriples(e) {
|
|
@@ -4474,9 +4474,9 @@ class ka {
|
|
|
4474
4474
|
continue;
|
|
4475
4475
|
a.txId = d["tx-id"];
|
|
4476
4476
|
const c = [], f = {};
|
|
4477
|
-
for (const
|
|
4478
|
-
const m = (n = f[
|
|
4479
|
-
f[
|
|
4477
|
+
for (const _ of d.changes) {
|
|
4478
|
+
const m = (n = f[_.triple[0]]) !== null && n !== void 0 ? n : [];
|
|
4479
|
+
f[_.triple[0]] = m, m.push(_);
|
|
4480
4480
|
}
|
|
4481
4481
|
const l = (r = u.values) !== null && r !== void 0 ? r : {
|
|
4482
4482
|
entities: [],
|
|
@@ -4484,22 +4484,22 @@ class ka {
|
|
|
4484
4484
|
}, p = l.entities;
|
|
4485
4485
|
u.values = l;
|
|
4486
4486
|
const y = [];
|
|
4487
|
-
e: for (const [
|
|
4487
|
+
e: for (const [_, m] of Object.entries(f))
|
|
4488
4488
|
for (let O = 0; O < p.length; O++) {
|
|
4489
4489
|
const S = p[O];
|
|
4490
|
-
if (io(S.store,
|
|
4490
|
+
if (io(S.store, _)) {
|
|
4491
4491
|
Gr(S.store, l.attrsStore, m);
|
|
4492
|
-
const C = Jt(u, S.store, l.attrsStore), $ = Oa(S.store, l.attrsStore, m)[
|
|
4492
|
+
const C = Jt(u, S.store, l.attrsStore), $ = Oa(S.store, l.attrsStore, m)[_];
|
|
4493
4493
|
C ? (y.push({
|
|
4494
4494
|
oldEntity: S.entity,
|
|
4495
4495
|
newEntity: C,
|
|
4496
4496
|
changedFields: $ || {}
|
|
4497
|
-
}), S.entity = C) : c.push(O), delete f[
|
|
4497
|
+
}), S.entity = C) : c.push(O), delete f[_];
|
|
4498
4498
|
continue e;
|
|
4499
4499
|
}
|
|
4500
4500
|
}
|
|
4501
4501
|
const b = [];
|
|
4502
|
-
for (const [
|
|
4502
|
+
for (const [_, m] of Object.entries(f)) {
|
|
4503
4503
|
const O = this.createStore([]);
|
|
4504
4504
|
Gr(O, l.attrsStore, m);
|
|
4505
4505
|
const S = Jt(u, O, l.attrsStore);
|
|
@@ -4517,15 +4517,15 @@ class ka {
|
|
|
4517
4517
|
serverCreatedAt: Br(u, O, l.attrsStore, S.id)
|
|
4518
4518
|
}), b.push(S);
|
|
4519
4519
|
}
|
|
4520
|
-
const
|
|
4521
|
-
for (const
|
|
4522
|
-
|
|
4520
|
+
const g = [];
|
|
4521
|
+
for (const _ of c.sort().reverse())
|
|
4522
|
+
g.push(p[_].entity), p.splice(_, 1);
|
|
4523
4523
|
const T = Ea(u, this.getAttrs);
|
|
4524
4524
|
Aa(u, T, p), this.notifyCbs(o, {
|
|
4525
4525
|
type: ve.SyncTransaction,
|
|
4526
|
-
data:
|
|
4526
|
+
data: mt(u, (i = u.values) === null || i === void 0 ? void 0 : i.entities),
|
|
4527
4527
|
added: b,
|
|
4528
|
-
removed:
|
|
4528
|
+
removed: g,
|
|
4529
4529
|
updated: y
|
|
4530
4530
|
});
|
|
4531
4531
|
}
|
|
@@ -4545,7 +4545,7 @@ class ka {
|
|
|
4545
4545
|
}
|
|
4546
4546
|
}
|
|
4547
4547
|
onStartSyncError(e) {
|
|
4548
|
-
const n =
|
|
4548
|
+
const n = W(e["original-event"].q), r = {
|
|
4549
4549
|
message: e.message || "Uh-oh, something went wrong. Ping Joe & Stopa.",
|
|
4550
4550
|
status: e.status,
|
|
4551
4551
|
type: e.type,
|
|
@@ -4562,7 +4562,7 @@ class ka {
|
|
|
4562
4562
|
r && this.initSubscription(r.query, r.hash);
|
|
4563
4563
|
}
|
|
4564
4564
|
}
|
|
4565
|
-
var
|
|
4565
|
+
var U = function(t, e, n, r) {
|
|
4566
4566
|
function i(s) {
|
|
4567
4567
|
return s instanceof n ? s : new n(function(o) {
|
|
4568
4568
|
o(s);
|
|
@@ -4680,23 +4680,23 @@ class Fa {
|
|
|
4680
4680
|
var l, p;
|
|
4681
4681
|
switch (d) {
|
|
4682
4682
|
case "pendingMutations": {
|
|
4683
|
-
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 : [],
|
|
4684
|
-
return (c ? this._rewriteMutationsSorted(this.attrs, c) : []).forEach(([
|
|
4683
|
+
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 : [], g = new Map([...y, ...b]);
|
|
4684
|
+
return (c ? this._rewriteMutationsSorted(this.attrs, c) : []).forEach(([_, m]) => {
|
|
4685
4685
|
var O;
|
|
4686
|
-
!(!((O = f == null ? void 0 : f.pendingMutations) === null || O === void 0) && O.has(
|
|
4687
|
-
}),
|
|
4686
|
+
!(!((O = f == null ? void 0 : f.pendingMutations) === null || O === void 0) && O.has(_)) && !m["tx-id"] && this._sendMutation(_, m);
|
|
4687
|
+
}), g;
|
|
4688
4688
|
}
|
|
4689
4689
|
default:
|
|
4690
4690
|
return f || c;
|
|
4691
4691
|
}
|
|
4692
4692
|
}, this.getPreviousResult = (d) => {
|
|
4693
4693
|
var c;
|
|
4694
|
-
const f =
|
|
4694
|
+
const f = W(d);
|
|
4695
4695
|
return (c = this.dataForQuery(f)) === null || c === void 0 ? void 0 : c.data;
|
|
4696
4696
|
}, this.notifyOne = (d) => {
|
|
4697
4697
|
var c, f;
|
|
4698
4698
|
const l = (c = this.queryCbs[d]) !== null && c !== void 0 ? c : [], p = (f = this._dataForQueryCache[d]) === null || f === void 0 ? void 0 : f.data, y = this.dataForQuery(d);
|
|
4699
|
-
y != null && y.data && (this._dataForQueryCache[d] = y, !
|
|
4699
|
+
y != null && y.data && (this._dataForQueryCache[d] = y, !Et(y.data, p) && l.forEach((b) => b.cb(y.data)));
|
|
4700
4700
|
}, this.notifyOneQueryOnce = (d) => {
|
|
4701
4701
|
var c, f;
|
|
4702
4702
|
const l = (c = this.queryOnceDfds[d]) !== null && c !== void 0 ? c : [], p = (f = this.dataForQuery(d)) === null || f === void 0 ? void 0 : f.data;
|
|
@@ -4722,15 +4722,15 @@ class Fa {
|
|
|
4722
4722
|
return this.pushOps([], c);
|
|
4723
4723
|
}
|
|
4724
4724
|
}, this.pushOps = (d, c) => {
|
|
4725
|
-
const f =
|
|
4725
|
+
const f = z(), l = [...this._pendingMutations().values()], p = Math.max(0, ...l.map((g) => g.order || 0)) + 1, y = {
|
|
4726
4726
|
op: "transact",
|
|
4727
4727
|
"tx-steps": d,
|
|
4728
4728
|
created: Date.now(),
|
|
4729
4729
|
error: c,
|
|
4730
4730
|
order: p
|
|
4731
4731
|
};
|
|
4732
|
-
this._updatePendingMutations((
|
|
4733
|
-
|
|
4732
|
+
this._updatePendingMutations((g) => {
|
|
4733
|
+
g.set(f, y);
|
|
4734
4734
|
});
|
|
4735
4735
|
const b = new $r();
|
|
4736
4736
|
return this.mutationDeferredStore.set(f, b), this._sendMutation(f, y), this.notifyAll(), b.promise;
|
|
@@ -4742,7 +4742,7 @@ class Fa {
|
|
|
4742
4742
|
}
|
|
4743
4743
|
this._log.info("[socket][open]", this._transport.id), this._setStatus(he.OPENED), this.getCurrentUser().then((f) => {
|
|
4744
4744
|
var l;
|
|
4745
|
-
this._trySend(
|
|
4745
|
+
this._trySend(z(), {
|
|
4746
4746
|
op: "init",
|
|
4747
4747
|
"app-id": this.config.appId,
|
|
4748
4748
|
"refresh-token": (l = f.user) === null || l === void 0 ? void 0 : l.refresh_token,
|
|
@@ -4802,7 +4802,7 @@ class Fa {
|
|
|
4802
4802
|
throw new Error("Instant must be initialized with an appId.");
|
|
4803
4803
|
if (!Ne(e.appId))
|
|
4804
4804
|
throw new Error(`Instant must be initialized with a valid appId. \`${e.appId}\` is not a valid uuid.`);
|
|
4805
|
-
typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) =>
|
|
4805
|
+
typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) => U(this, void 0, void 0, function* () {
|
|
4806
4806
|
var c;
|
|
4807
4807
|
try {
|
|
4808
4808
|
if (((c = d.data) === null || c === void 0 ? void 0 : c.type) === "auth") {
|
|
@@ -4814,7 +4814,12 @@ class Fa {
|
|
|
4814
4814
|
}
|
|
4815
4815
|
}))), this._initStorage(n), this._syncTable = new ka(this._trySendAuthed.bind(this), new n(this.config.appId, "syncSubs"), {
|
|
4816
4816
|
useDateObjects: this.config.useDateObjects
|
|
4817
|
-
}, this._log, (d) =>
|
|
4817
|
+
}, this._log, (d) => Ze(this.ensureAttrs(), d, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser().then((d) => {
|
|
4818
|
+
this.syncUserToEndpoint(d.user);
|
|
4819
|
+
}), setInterval(() => U(this, void 0, void 0, function* () {
|
|
4820
|
+
const d = yield this.getCurrentUser();
|
|
4821
|
+
this.syncUserToEndpoint(d.user);
|
|
4822
|
+
}), 1e3 * 60 * 20), r.getIsOnline().then((d) => {
|
|
4818
4823
|
this._isOnline = d, this._startSocket(), r.listen((c) => {
|
|
4819
4824
|
c !== this._isOnline && (this._log.info("[network] online =", c), this._isOnline = c, this._isOnline ? this._startSocket() : (this._log.info("Changing status from", this.status, "to", he.CLOSED), this._setStatus(he.CLOSED)));
|
|
4820
4825
|
});
|
|
@@ -4916,6 +4921,30 @@ class Fa {
|
|
|
4916
4921
|
this._tryBroadcast(e, a, u, d);
|
|
4917
4922
|
}
|
|
4918
4923
|
}
|
|
4924
|
+
/**
|
|
4925
|
+
* Does the same thing as add-query-ok
|
|
4926
|
+
* but called as a result of receiving query info from ssr
|
|
4927
|
+
* @param {any} q
|
|
4928
|
+
* @param {{ triples: any; pageInfo: any; }} result
|
|
4929
|
+
* @param {boolean} enableCardinalityInference
|
|
4930
|
+
*/
|
|
4931
|
+
_addQueryData(e, n, r) {
|
|
4932
|
+
if (!this.attrs)
|
|
4933
|
+
throw new Error("Attrs in reactor have not been set");
|
|
4934
|
+
const i = W(e), s = this.ensureAttrs(), o = Ze(this.attrs, n.triples, r, this.config.useDateObjects);
|
|
4935
|
+
this.querySubs.updateInPlace((u) => {
|
|
4936
|
+
u[i] = {
|
|
4937
|
+
result: {
|
|
4938
|
+
store: o,
|
|
4939
|
+
attrsStore: s,
|
|
4940
|
+
pageInfo: n.pageInfo,
|
|
4941
|
+
processedTxId: void 0,
|
|
4942
|
+
isExternal: !0
|
|
4943
|
+
},
|
|
4944
|
+
q: e
|
|
4945
|
+
};
|
|
4946
|
+
}), this._cleanupPendingMutationsQueries(), this.notifyOne(i), this.notifyOneQueryOnce(i), this._cleanupPendingMutationsTimeout();
|
|
4947
|
+
}
|
|
4919
4948
|
_handleReceive(e, n) {
|
|
4920
4949
|
var r, i, s, o, u, a;
|
|
4921
4950
|
const d = !!this.config.schema && ("cardinalityInference" in this.config ? !!this.config.cardinalityInference : !0);
|
|
@@ -4929,14 +4958,14 @@ class Fa {
|
|
|
4929
4958
|
break;
|
|
4930
4959
|
}
|
|
4931
4960
|
case "add-query-exists": {
|
|
4932
|
-
this.notifyOneQueryOnce(
|
|
4961
|
+
this.notifyOneQueryOnce(W(n.q));
|
|
4933
4962
|
break;
|
|
4934
4963
|
}
|
|
4935
4964
|
case "add-query-ok": {
|
|
4936
|
-
const { q: l, result: p } = n, y =
|
|
4965
|
+
const { q: l, result: p } = n, y = W(l);
|
|
4937
4966
|
if (!this._hasQueryListeners() && !this.querySubs.currentValue[y])
|
|
4938
4967
|
break;
|
|
4939
|
-
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"],
|
|
4968
|
+
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"], g = (a = (u = p == null ? void 0 : p[0]) === null || u === void 0 ? void 0 : u.data) === null || a === void 0 ? void 0 : a.aggregate, T = Dr(p), _ = this.ensureAttrs(), m = Ze(_, T, d, this.config.useDateObjects);
|
|
4940
4969
|
this.querySubs.updateInPlace((O) => {
|
|
4941
4970
|
if (!O[y]) {
|
|
4942
4971
|
this._log.info("Missing value in querySubs", { hash: y, q: l });
|
|
@@ -4944,9 +4973,9 @@ class Fa {
|
|
|
4944
4973
|
}
|
|
4945
4974
|
O[y].result = {
|
|
4946
4975
|
store: m,
|
|
4947
|
-
attrsStore:
|
|
4976
|
+
attrsStore: _,
|
|
4948
4977
|
pageInfo: b,
|
|
4949
|
-
aggregate:
|
|
4978
|
+
aggregate: g,
|
|
4950
4979
|
processedTxId: n["processed-tx-id"]
|
|
4951
4980
|
};
|
|
4952
4981
|
}), this._cleanupPendingMutationsQueries(), this.notifyOne(y), this.notifyOneQueryOnce(y), this._cleanupPendingMutationsTimeout();
|
|
@@ -4972,28 +5001,28 @@ class Fa {
|
|
|
4972
5001
|
const { computations: l, attrs: p } = n, y = n["processed-tx-id"];
|
|
4973
5002
|
p && this._setAttrs(p), this._cleanupPendingMutationsTimeout();
|
|
4974
5003
|
const b = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations(), y);
|
|
4975
|
-
b !== this._pendingMutations() && this.kv.updateInPlace((
|
|
4976
|
-
|
|
5004
|
+
b !== this._pendingMutations() && this.kv.updateInPlace((_) => {
|
|
5005
|
+
_.pendingMutations = b;
|
|
4977
5006
|
});
|
|
4978
|
-
const
|
|
5007
|
+
const g = Hr(b.entries()), T = l.map((_) => {
|
|
4979
5008
|
var m, O, S, C;
|
|
4980
|
-
const $ =
|
|
5009
|
+
const $ = _["instaql-query"], D = _["instaql-result"], Ve = W($), lt = Dr(D), ht = this.ensureAttrs(), Ft = Ze(ht, lt, d, this.config.useDateObjects), { store: pt, attrsStore: ce } = this._applyOptimisticUpdates(Ft, ht, g, y), le = (O = (m = D == null ? void 0 : D[0]) === null || m === void 0 ? void 0 : m.data) === null || O === void 0 ? void 0 : O["page-info"], Te = (C = (S = D == null ? void 0 : D[0]) === null || S === void 0 ? void 0 : S.data) === null || C === void 0 ? void 0 : C.aggregate;
|
|
4981
5010
|
return {
|
|
4982
5011
|
q: $,
|
|
4983
5012
|
hash: Ve,
|
|
4984
|
-
store:
|
|
5013
|
+
store: pt,
|
|
4985
5014
|
attrsStore: ce,
|
|
4986
5015
|
pageInfo: le,
|
|
4987
5016
|
aggregate: Te
|
|
4988
5017
|
};
|
|
4989
5018
|
});
|
|
4990
|
-
T.forEach(({ hash:
|
|
5019
|
+
T.forEach(({ hash: _, q: m, store: O, attrsStore: S, pageInfo: C, aggregate: $ }) => {
|
|
4991
5020
|
this.querySubs.updateInPlace((D) => {
|
|
4992
|
-
if (!D[
|
|
4993
|
-
this._log.error("Missing value in querySubs", { hash:
|
|
5021
|
+
if (!D[_]) {
|
|
5022
|
+
this._log.error("Missing value in querySubs", { hash: _, q: m });
|
|
4994
5023
|
return;
|
|
4995
5024
|
}
|
|
4996
|
-
D[
|
|
5025
|
+
D[_].result = {
|
|
4997
5026
|
store: O,
|
|
4998
5027
|
attrsStore: S,
|
|
4999
5028
|
pageInfo: C,
|
|
@@ -5001,8 +5030,8 @@ class Fa {
|
|
|
5001
5030
|
processedTxId: y
|
|
5002
5031
|
};
|
|
5003
5032
|
});
|
|
5004
|
-
}), this._cleanupPendingMutationsQueries(), T.forEach(({ hash:
|
|
5005
|
-
this.notifyOne(
|
|
5033
|
+
}), this._cleanupPendingMutationsQueries(), T.forEach(({ hash: _ }) => {
|
|
5034
|
+
this.notifyOne(_);
|
|
5006
5035
|
});
|
|
5007
5036
|
break;
|
|
5008
5037
|
}
|
|
@@ -5015,15 +5044,15 @@ class Fa {
|
|
|
5015
5044
|
this._updatePendingMutations((T) => {
|
|
5016
5045
|
T.set(l, Object.assign(Object.assign({}, T.get(l)), { "tx-id": p, confirmed: Date.now() }));
|
|
5017
5046
|
});
|
|
5018
|
-
const
|
|
5047
|
+
const g = [];
|
|
5019
5048
|
for (const T of b["tx-steps"])
|
|
5020
5049
|
if (T[0] === "add-attr") {
|
|
5021
|
-
const
|
|
5022
|
-
|
|
5050
|
+
const _ = T[1];
|
|
5051
|
+
g.push(_);
|
|
5023
5052
|
}
|
|
5024
|
-
if (
|
|
5053
|
+
if (g.length) {
|
|
5025
5054
|
const T = Object.values(this.ensureAttrs().attrs);
|
|
5026
|
-
this._setAttrs([...T, ...
|
|
5055
|
+
this._setAttrs([...T, ...g]);
|
|
5027
5056
|
}
|
|
5028
5057
|
this._finishTransaction("synced", l), this._cleanupPendingMutationsTimeout();
|
|
5029
5058
|
break;
|
|
@@ -5109,8 +5138,8 @@ class Fa {
|
|
|
5109
5138
|
return;
|
|
5110
5139
|
}
|
|
5111
5140
|
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") {
|
|
5112
|
-
const y = (i = e["original-event"]) === null || i === void 0 ? void 0 : i.q, b =
|
|
5113
|
-
this.notifyQueryError(
|
|
5141
|
+
const y = (i = e["original-event"]) === null || i === void 0 ? void 0 : i.q, b = W(y);
|
|
5142
|
+
this.notifyQueryError(W(y), f), this.notifyQueryOnceError(y, b, d, f);
|
|
5114
5143
|
return;
|
|
5115
5144
|
}
|
|
5116
5145
|
if (((s = e["original-event"]) === null || s === void 0 ? void 0 : s.op) === "init") {
|
|
@@ -5142,7 +5171,7 @@ class Fa {
|
|
|
5142
5171
|
this.attrs = new Ae(e.reduce((n, r) => (n[r.id] = r, n), {}), this._linkIndex), this.notifyAttrsSubs();
|
|
5143
5172
|
}
|
|
5144
5173
|
_startQuerySub(e, n) {
|
|
5145
|
-
const r =
|
|
5174
|
+
const r = z();
|
|
5146
5175
|
return this.querySubs.updateInPlace((i) => {
|
|
5147
5176
|
i[n] = i[n] || { q: e, result: null, eventId: r }, i[n].lastAccessed = Date.now();
|
|
5148
5177
|
}), this._trySendAuthed(r, { op: "add-query", q: e }), r;
|
|
@@ -5163,7 +5192,7 @@ class Fa {
|
|
|
5163
5192
|
subscribeQuery(e, n, r) {
|
|
5164
5193
|
var i;
|
|
5165
5194
|
this.config.disableValidation || Fr(e, this.config.schema), r && "ruleParams" in r && (e = Object.assign({ $$ruleParams: r.ruleParams }, e));
|
|
5166
|
-
const s =
|
|
5195
|
+
const s = W(e), o = this.getPreviousResult(e);
|
|
5167
5196
|
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), () => {
|
|
5168
5197
|
this._unsubQuery(e, s, n);
|
|
5169
5198
|
};
|
|
@@ -5176,7 +5205,7 @@ class Fa {
|
|
|
5176
5205
|
return i.reject(new Error("We can't run `queryOnce`, because the device is offline.")), i.promise;
|
|
5177
5206
|
if (!this.querySubs)
|
|
5178
5207
|
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;
|
|
5179
|
-
const s =
|
|
5208
|
+
const s = W(e), o = this._startQuerySub(e, s);
|
|
5180
5209
|
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")), ja), i.promise;
|
|
5181
5210
|
}
|
|
5182
5211
|
_completeQueryOnce(e, n, r) {
|
|
@@ -5190,7 +5219,7 @@ class Fa {
|
|
|
5190
5219
|
return !!(!((n = this.queryCbs[e]) === null || n === void 0) && n.length || !((r = this.queryOnceDfds[e]) === null || r === void 0) && r.length);
|
|
5191
5220
|
}
|
|
5192
5221
|
_cleanupQuery(e, n) {
|
|
5193
|
-
this._hasQueryListeners(n) || (delete this.queryCbs[n], delete this.queryOnceDfds[n], delete this._dataForQueryCache[n], this.querySubs.unloadKey(n), this._trySendAuthed(
|
|
5222
|
+
this._hasQueryListeners(n) || (delete this.queryCbs[n], delete this.queryOnceDfds[n], delete this._dataForQueryCache[n], this.querySubs.unloadKey(n), this._trySendAuthed(z(), { op: "remove-query", q: e }));
|
|
5194
5223
|
}
|
|
5195
5224
|
// When we `pushTx`, it's possible that we don't yet have `this.attrs`
|
|
5196
5225
|
// This means that `tx-steps` in `pendingMutations` will include `add-attr`
|
|
@@ -5227,9 +5256,9 @@ class Fa {
|
|
|
5227
5256
|
for (const p of c) {
|
|
5228
5257
|
const [y] = p;
|
|
5229
5258
|
if (y === "add-attr") {
|
|
5230
|
-
const [
|
|
5231
|
-
if (
|
|
5232
|
-
o.attrIdMap[T.id] =
|
|
5259
|
+
const [g, T] = p, _ = i(T);
|
|
5260
|
+
if (_ && T.id !== _.id) {
|
|
5261
|
+
o.attrIdMap[T.id] = _.id, u = !0;
|
|
5233
5262
|
continue;
|
|
5234
5263
|
}
|
|
5235
5264
|
if (T["value-type"] === "ref") {
|
|
@@ -5281,20 +5310,25 @@ class Fa {
|
|
|
5281
5310
|
return new Ae(o, this._linkIndex);
|
|
5282
5311
|
}
|
|
5283
5312
|
/** Runs instaql on a query and a store */
|
|
5284
|
-
dataForQuery(e) {
|
|
5285
|
-
const
|
|
5286
|
-
if (
|
|
5287
|
-
return { error:
|
|
5313
|
+
dataForQuery(e, n = !0) {
|
|
5314
|
+
const r = this._errorMessage;
|
|
5315
|
+
if (r)
|
|
5316
|
+
return { error: r };
|
|
5288
5317
|
if (!this.querySubs || !this.kv.currentValue.pendingMutations)
|
|
5289
5318
|
return;
|
|
5290
|
-
const
|
|
5291
|
-
if (!
|
|
5319
|
+
const i = this.querySubs.version(), s = this.querySubs.currentValue, o = this.kv.version(), u = this._pendingMutations(), { q: a, result: d } = s[e] || {};
|
|
5320
|
+
if (!d)
|
|
5292
5321
|
return;
|
|
5293
|
-
const
|
|
5294
|
-
if (
|
|
5295
|
-
return
|
|
5296
|
-
|
|
5297
|
-
|
|
5322
|
+
const c = this._dataForQueryCache[e];
|
|
5323
|
+
if (c && i === c.querySubVersion && o === c.pendingMutationsVersion)
|
|
5324
|
+
return c;
|
|
5325
|
+
let f = d.store, l = d.attrsStore;
|
|
5326
|
+
const { pageInfo: p, aggregate: y, processedTxId: b } = d, g = this._rewriteMutationsSorted(l, u);
|
|
5327
|
+
if (n) {
|
|
5328
|
+
const _ = this._applyOptimisticUpdates(f, l, g, b);
|
|
5329
|
+
f = _.store, l = _.attrsStore;
|
|
5330
|
+
}
|
|
5331
|
+
return { data: Ri({ store: f, attrsStore: l, pageInfo: p, aggregate: y }, a), querySubVersion: i, pendingMutationsVersion: o };
|
|
5298
5332
|
}
|
|
5299
5333
|
_applyOptimisticUpdates(e, n, r, i) {
|
|
5300
5334
|
for (const [s, o] of r)
|
|
@@ -5427,14 +5461,14 @@ class Fa {
|
|
|
5427
5461
|
*
|
|
5428
5462
|
*/
|
|
5429
5463
|
getLocalId(e) {
|
|
5430
|
-
return
|
|
5464
|
+
return U(this, void 0, void 0, function* () {
|
|
5431
5465
|
const n = `localToken_${e}`;
|
|
5432
5466
|
if (this.kv.currentValue[n])
|
|
5433
5467
|
return this.kv.currentValue[n];
|
|
5434
5468
|
const r = yield this.kv.waitForKeyToLoad(n);
|
|
5435
5469
|
if (r)
|
|
5436
5470
|
return r;
|
|
5437
|
-
const i =
|
|
5471
|
+
const i = z();
|
|
5438
5472
|
return this.kv.updateInPlace((s) => {
|
|
5439
5473
|
s[n] || (s[n] = i);
|
|
5440
5474
|
}), yield this.kv.waitForKeyToLoad(n);
|
|
@@ -5468,7 +5502,7 @@ class Fa {
|
|
|
5468
5502
|
* @returns Promise<null | {error: {message: string}}>
|
|
5469
5503
|
*/
|
|
5470
5504
|
_oauthLoginInit() {
|
|
5471
|
-
return
|
|
5505
|
+
return U(this, void 0, void 0, function* () {
|
|
5472
5506
|
var e, n, r, i;
|
|
5473
5507
|
if (typeof window > "u" || typeof window.location > "u" || typeof URLSearchParams > "u")
|
|
5474
5508
|
return null;
|
|
@@ -5496,7 +5530,7 @@ class Fa {
|
|
|
5496
5530
|
});
|
|
5497
5531
|
}
|
|
5498
5532
|
_waitForOAuthCallbackResponse() {
|
|
5499
|
-
return
|
|
5533
|
+
return U(this, void 0, void 0, function* () {
|
|
5500
5534
|
return yield this._oauthCallbackResponse;
|
|
5501
5535
|
});
|
|
5502
5536
|
}
|
|
@@ -5511,13 +5545,13 @@ class Fa {
|
|
|
5511
5545
|
n.isLoading || e(this._currentUserCached);
|
|
5512
5546
|
let r = !1;
|
|
5513
5547
|
return this.getCurrentUser().then((i) => {
|
|
5514
|
-
r ||
|
|
5548
|
+
r || Et(i, n) || e(i);
|
|
5515
5549
|
}), () => {
|
|
5516
5550
|
r = !0, this.authCbs = this.authCbs.filter((i) => i !== e);
|
|
5517
5551
|
};
|
|
5518
5552
|
}
|
|
5519
5553
|
getAuth() {
|
|
5520
|
-
return
|
|
5554
|
+
return U(this, void 0, void 0, function* () {
|
|
5521
5555
|
const { user: e, error: n } = yield this.getCurrentUser();
|
|
5522
5556
|
if (n)
|
|
5523
5557
|
throw new qe("Could not get current user: " + n.message);
|
|
@@ -5550,7 +5584,7 @@ class Fa {
|
|
|
5550
5584
|
this.connectionStatusCbs.forEach((n) => n(e));
|
|
5551
5585
|
}
|
|
5552
5586
|
setCurrentUser(e) {
|
|
5553
|
-
return
|
|
5587
|
+
return U(this, void 0, void 0, function* () {
|
|
5554
5588
|
this.kv.updateInPlace((n) => {
|
|
5555
5589
|
n[Ge] = e;
|
|
5556
5590
|
}), yield this.kv.waitForKeyToLoad(Ge);
|
|
@@ -5560,13 +5594,13 @@ class Fa {
|
|
|
5560
5594
|
return this._currentUserCached;
|
|
5561
5595
|
}
|
|
5562
5596
|
_getCurrentUser() {
|
|
5563
|
-
return
|
|
5597
|
+
return U(this, void 0, void 0, function* () {
|
|
5564
5598
|
const e = yield this.kv.waitForKeyToLoad(Ge);
|
|
5565
5599
|
return typeof e == "string" ? JSON.parse(e) : e;
|
|
5566
5600
|
});
|
|
5567
5601
|
}
|
|
5568
5602
|
getCurrentUser() {
|
|
5569
|
-
return
|
|
5603
|
+
return U(this, void 0, void 0, function* () {
|
|
5570
5604
|
const e = yield this._waitForOAuthCallbackResponse();
|
|
5571
5605
|
if (e != null && e.error) {
|
|
5572
5606
|
const n = { error: e.error, user: void 0 };
|
|
@@ -5585,16 +5619,16 @@ class Fa {
|
|
|
5585
5619
|
});
|
|
5586
5620
|
}
|
|
5587
5621
|
_hasCurrentUser() {
|
|
5588
|
-
return
|
|
5622
|
+
return U(this, void 0, void 0, function* () {
|
|
5589
5623
|
const e = yield this.kv.waitForKeyToLoad(Ge);
|
|
5590
5624
|
return typeof e == "string" ? JSON.parse(e) != null : e != null;
|
|
5591
5625
|
});
|
|
5592
5626
|
}
|
|
5593
5627
|
changeCurrentUser(e) {
|
|
5594
|
-
return
|
|
5628
|
+
return U(this, void 0, void 0, function* () {
|
|
5595
5629
|
var n;
|
|
5596
5630
|
const { user: r } = yield this.getCurrentUser();
|
|
5597
|
-
if (!
|
|
5631
|
+
if (!Et(r, e)) {
|
|
5598
5632
|
yield this.setCurrentUser(e), this.updateUser(e);
|
|
5599
5633
|
try {
|
|
5600
5634
|
(n = this._broadcastChannel) === null || n === void 0 || n.postMessage({ type: "auth" });
|
|
@@ -5604,7 +5638,28 @@ class Fa {
|
|
|
5604
5638
|
}
|
|
5605
5639
|
});
|
|
5606
5640
|
}
|
|
5641
|
+
syncUserToEndpoint(e) {
|
|
5642
|
+
return U(this, void 0, void 0, function* () {
|
|
5643
|
+
if (this.config.firstPartyPath)
|
|
5644
|
+
try {
|
|
5645
|
+
fetch(this.config.firstPartyPath + "/", {
|
|
5646
|
+
method: "POST",
|
|
5647
|
+
body: JSON.stringify({
|
|
5648
|
+
type: "sync-user",
|
|
5649
|
+
appId: this.config.appId,
|
|
5650
|
+
user: e
|
|
5651
|
+
}),
|
|
5652
|
+
headers: {
|
|
5653
|
+
"Content-Type": "application/json"
|
|
5654
|
+
}
|
|
5655
|
+
});
|
|
5656
|
+
} catch (n) {
|
|
5657
|
+
console.error("Error syncing user with external endpoint", n);
|
|
5658
|
+
}
|
|
5659
|
+
});
|
|
5660
|
+
}
|
|
5607
5661
|
updateUser(e) {
|
|
5662
|
+
this.syncUserToEndpoint(e);
|
|
5608
5663
|
const n = { error: void 0, user: e };
|
|
5609
5664
|
this._currentUserCached = Object.assign({ isLoading: !1 }, n), this._dataForQueryCache = {}, this.querySubs.updateInPlace((r) => {
|
|
5610
5665
|
Object.keys(r).forEach((i) => {
|
|
@@ -5620,7 +5675,7 @@ class Fa {
|
|
|
5620
5675
|
});
|
|
5621
5676
|
}
|
|
5622
5677
|
signInWithMagicCode(e) {
|
|
5623
|
-
return
|
|
5678
|
+
return U(this, arguments, void 0, function* ({ email: n, code: r }) {
|
|
5624
5679
|
var i;
|
|
5625
5680
|
const s = yield this.getCurrentUser(), o = ((i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.type) === "guest", u = yield Zu({
|
|
5626
5681
|
apiURI: this.config.apiURI,
|
|
@@ -5633,7 +5688,7 @@ class Fa {
|
|
|
5633
5688
|
});
|
|
5634
5689
|
}
|
|
5635
5690
|
signInWithCustomToken(e) {
|
|
5636
|
-
return
|
|
5691
|
+
return U(this, void 0, void 0, function* () {
|
|
5637
5692
|
const n = yield Xu({
|
|
5638
5693
|
apiURI: this.config.apiURI,
|
|
5639
5694
|
appId: this.config.appId,
|
|
@@ -5643,7 +5698,7 @@ class Fa {
|
|
|
5643
5698
|
});
|
|
5644
5699
|
}
|
|
5645
5700
|
signInAsGuest() {
|
|
5646
|
-
return
|
|
5701
|
+
return U(this, void 0, void 0, function* () {
|
|
5647
5702
|
const e = yield ea({
|
|
5648
5703
|
apiURI: this.config.apiURI,
|
|
5649
5704
|
appId: this.config.appId
|
|
@@ -5670,7 +5725,7 @@ class Fa {
|
|
|
5670
5725
|
});
|
|
5671
5726
|
}
|
|
5672
5727
|
signOut(e) {
|
|
5673
|
-
return
|
|
5728
|
+
return U(this, void 0, void 0, function* () {
|
|
5674
5729
|
const n = yield this.getCurrentUser();
|
|
5675
5730
|
this.potentiallyInvalidateToken(n, e), yield this.changeCurrentUser(null);
|
|
5676
5731
|
});
|
|
@@ -5693,7 +5748,7 @@ class Fa {
|
|
|
5693
5748
|
* @param {string} [params.codeVerifier] - The code verifier used to generate the code challenge.
|
|
5694
5749
|
*/
|
|
5695
5750
|
exchangeCodeForToken(e) {
|
|
5696
|
-
return
|
|
5751
|
+
return U(this, arguments, void 0, function* ({ code: n, codeVerifier: r }) {
|
|
5697
5752
|
var i;
|
|
5698
5753
|
const s = yield this.getCurrentUser(), o = ((i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.type) === "guest", u = yield Rr({
|
|
5699
5754
|
apiURI: this.config.apiURI,
|
|
@@ -5716,7 +5771,7 @@ class Fa {
|
|
|
5716
5771
|
* @param {string | null | undefined} [params.nonce] - The nonce used when requesting the id_token from the external service
|
|
5717
5772
|
*/
|
|
5718
5773
|
signInWithIdToken(e) {
|
|
5719
|
-
return
|
|
5774
|
+
return U(this, arguments, void 0, function* ({ idToken: n, clientName: r, nonce: i }) {
|
|
5720
5775
|
var s;
|
|
5721
5776
|
const o = yield this.getCurrentUser(), u = (s = o == null ? void 0 : o.user) === null || s === void 0 ? void 0 : s.refresh_token, a = yield ta({
|
|
5722
5777
|
apiURI: this.config.apiURI,
|
|
@@ -5771,17 +5826,17 @@ class Fa {
|
|
|
5771
5826
|
s.result.user = o, i.isConnected && (this._trySetPresence(n, o), this._notifyPresenceSubs(n));
|
|
5772
5827
|
}
|
|
5773
5828
|
_trySetPresence(e, n) {
|
|
5774
|
-
this._trySendAuthed(
|
|
5829
|
+
this._trySendAuthed(z(), {
|
|
5775
5830
|
op: "set-presence",
|
|
5776
5831
|
"room-id": e,
|
|
5777
5832
|
data: n
|
|
5778
5833
|
});
|
|
5779
5834
|
}
|
|
5780
5835
|
_tryJoinRoom(e, n) {
|
|
5781
|
-
this._trySendAuthed(
|
|
5836
|
+
this._trySendAuthed(z(), { op: "join-room", "room-id": e, data: n }), delete this._roomsPendingLeave[e];
|
|
5782
5837
|
}
|
|
5783
5838
|
_tryLeaveRoom(e) {
|
|
5784
|
-
this._trySendAuthed(
|
|
5839
|
+
this._trySendAuthed(z(), { op: "leave-room", "room-id": e });
|
|
5785
5840
|
}
|
|
5786
5841
|
_trySetRoomConnected(e, n) {
|
|
5787
5842
|
const r = this._rooms[e];
|
|
@@ -5855,7 +5910,7 @@ class Fa {
|
|
|
5855
5910
|
}
|
|
5856
5911
|
}
|
|
5857
5912
|
_tryBroadcast(e, n, r, i) {
|
|
5858
|
-
this._trySendAuthed(
|
|
5913
|
+
this._trySendAuthed(z(), {
|
|
5859
5914
|
op: "client-broadcast",
|
|
5860
5915
|
"room-id": e,
|
|
5861
5916
|
roomType: n,
|
|
@@ -5880,14 +5935,14 @@ class Fa {
|
|
|
5880
5935
|
// --------
|
|
5881
5936
|
// Storage
|
|
5882
5937
|
uploadFile(e, n, r) {
|
|
5883
|
-
return
|
|
5938
|
+
return U(this, void 0, void 0, function* () {
|
|
5884
5939
|
var i;
|
|
5885
5940
|
const s = yield this.getCurrentUser(), o = (i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.refresh_token;
|
|
5886
5941
|
return ra(Object.assign(Object.assign({}, r), { apiURI: this.config.apiURI, appId: this.config.appId, path: e, file: n, refreshToken: o }));
|
|
5887
5942
|
});
|
|
5888
5943
|
}
|
|
5889
5944
|
deleteFile(e) {
|
|
5890
|
-
return
|
|
5945
|
+
return U(this, void 0, void 0, function* () {
|
|
5891
5946
|
var n;
|
|
5892
5947
|
const r = yield this.getCurrentUser(), i = (n = r == null ? void 0 : r.user) === null || n === void 0 ? void 0 : n.refresh_token;
|
|
5893
5948
|
return yield ia({
|
|
@@ -5901,7 +5956,7 @@ class Fa {
|
|
|
5901
5956
|
// Deprecated Storage API (Jan 2025)
|
|
5902
5957
|
// ---------------------------------
|
|
5903
5958
|
upload(e, n) {
|
|
5904
|
-
return
|
|
5959
|
+
return U(this, void 0, void 0, function* () {
|
|
5905
5960
|
var r;
|
|
5906
5961
|
const i = yield this.getCurrentUser(), s = (r = i == null ? void 0 : i.user) === null || r === void 0 ? void 0 : r.refresh_token, o = e || n.name, u = yield sa({
|
|
5907
5962
|
apiURI: this.config.apiURI,
|
|
@@ -5913,7 +5968,7 @@ class Fa {
|
|
|
5913
5968
|
});
|
|
5914
5969
|
}
|
|
5915
5970
|
getDownloadUrl(e) {
|
|
5916
|
-
return
|
|
5971
|
+
return U(this, void 0, void 0, function* () {
|
|
5917
5972
|
var n;
|
|
5918
5973
|
const r = yield this.getCurrentUser(), i = (n = r == null ? void 0 : r.user) === null || n === void 0 ? void 0 : n.refresh_token;
|
|
5919
5974
|
return yield ua({
|
|
@@ -6000,9 +6055,9 @@ const Fc = {
|
|
|
6000
6055
|
json: Ba,
|
|
6001
6056
|
any: Ga
|
|
6002
6057
|
};
|
|
6003
|
-
let
|
|
6058
|
+
let vt;
|
|
6004
6059
|
function Ha(t, e) {
|
|
6005
|
-
|
|
6060
|
+
vt == null || vt.dispose();
|
|
6006
6061
|
const n = tc(e), r = Za(e, u), i = Ja(Ya(t));
|
|
6007
6062
|
function s(c) {
|
|
6008
6063
|
var f;
|
|
@@ -6019,7 +6074,7 @@ function Ha(t, e) {
|
|
|
6019
6074
|
n.element.remove(), r.element.remove(), removeEventListener("keydown", o), removeEventListener("message", s);
|
|
6020
6075
|
}
|
|
6021
6076
|
function d() {
|
|
6022
|
-
document.body.appendChild(n.element), document.body.appendChild(r.element), addEventListener("keydown", o), addEventListener("message", s),
|
|
6077
|
+
document.body.appendChild(n.element), document.body.appendChild(r.element), addEventListener("keydown", o), addEventListener("message", s), vt = {
|
|
6023
6078
|
dispose: a
|
|
6024
6079
|
};
|
|
6025
6080
|
}
|
|
@@ -6306,7 +6361,7 @@ function Jr(t) {
|
|
|
6306
6361
|
const e = Yr.get(t);
|
|
6307
6362
|
if (e)
|
|
6308
6363
|
return e;
|
|
6309
|
-
const n =
|
|
6364
|
+
const n = W(t);
|
|
6310
6365
|
return Yr.set(t, n), n;
|
|
6311
6366
|
}
|
|
6312
6367
|
function cc(t, e) {
|
|
@@ -6365,14 +6420,14 @@ function hc() {
|
|
|
6365
6420
|
* LICENSE file in the root directory of this source tree.
|
|
6366
6421
|
*/
|
|
6367
6422
|
return t.NODE_ENV !== "production" && function() {
|
|
6368
|
-
var e = oi, 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"), u = Symbol.for("react.provider"), a = 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,
|
|
6423
|
+
var e = oi, 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"), u = Symbol.for("react.provider"), a = 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, g = "@@iterator";
|
|
6369
6424
|
function T(h) {
|
|
6370
6425
|
if (h === null || typeof h != "object")
|
|
6371
6426
|
return null;
|
|
6372
|
-
var w = b && h[b] || h[
|
|
6427
|
+
var w = b && h[b] || h[g];
|
|
6373
6428
|
return typeof w == "function" ? w : null;
|
|
6374
6429
|
}
|
|
6375
|
-
var
|
|
6430
|
+
var _ = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
6376
6431
|
function m(h) {
|
|
6377
6432
|
{
|
|
6378
6433
|
for (var w = arguments.length, v = new Array(w > 1 ? w - 1 : 0), E = 1; E < w; E++)
|
|
@@ -6382,7 +6437,7 @@ function hc() {
|
|
|
6382
6437
|
}
|
|
6383
6438
|
function O(h, w, v) {
|
|
6384
6439
|
{
|
|
6385
|
-
var E =
|
|
6440
|
+
var E = _.ReactDebugCurrentFrame, P = E.getStackAddendum();
|
|
6386
6441
|
P !== "" && (w += "%s", v = v.concat([P]));
|
|
6387
6442
|
var M = v.map(function(I) {
|
|
6388
6443
|
return String(I);
|
|
@@ -6390,14 +6445,14 @@ function hc() {
|
|
|
6390
6445
|
M.unshift("Warning: " + w), Function.prototype.apply.call(console[h], console, M);
|
|
6391
6446
|
}
|
|
6392
6447
|
}
|
|
6393
|
-
var S = !1, C = !1, $ = !1, D = !1, Ve = !1,
|
|
6394
|
-
|
|
6395
|
-
function
|
|
6448
|
+
var S = !1, C = !1, $ = !1, D = !1, Ve = !1, lt;
|
|
6449
|
+
lt = Symbol.for("react.module.reference");
|
|
6450
|
+
function ht(h) {
|
|
6396
6451
|
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o || Ve || h === s || h === c || h === f || D || h === y || S || C || $ || typeof h == "object" && h !== null && (h.$$typeof === p || h.$$typeof === l || h.$$typeof === u || h.$$typeof === a || h.$$typeof === d || // This needs to include all possible module reference object
|
|
6397
6452
|
// types supported by any Flight configuration anywhere since
|
|
6398
6453
|
// we don't know which Flight build this will end up being used
|
|
6399
6454
|
// with.
|
|
6400
|
-
h.$$typeof ===
|
|
6455
|
+
h.$$typeof === lt || h.getModuleId !== void 0));
|
|
6401
6456
|
}
|
|
6402
6457
|
function Ft(h, w, v) {
|
|
6403
6458
|
var E = h.displayName;
|
|
@@ -6406,7 +6461,7 @@ function hc() {
|
|
|
6406
6461
|
var P = w.displayName || w.name || "";
|
|
6407
6462
|
return P !== "" ? v + "(" + P + ")" : v;
|
|
6408
6463
|
}
|
|
6409
|
-
function
|
|
6464
|
+
function pt(h) {
|
|
6410
6465
|
return h.displayName || "Context";
|
|
6411
6466
|
}
|
|
6412
6467
|
function ce(h) {
|
|
@@ -6434,10 +6489,10 @@ function hc() {
|
|
|
6434
6489
|
switch (h.$$typeof) {
|
|
6435
6490
|
case a:
|
|
6436
6491
|
var w = h;
|
|
6437
|
-
return
|
|
6492
|
+
return pt(w) + ".Consumer";
|
|
6438
6493
|
case u:
|
|
6439
6494
|
var v = h;
|
|
6440
|
-
return
|
|
6495
|
+
return pt(v._context) + ".Provider";
|
|
6441
6496
|
case d:
|
|
6442
6497
|
return Ft(h, h.render, "ForwardRef");
|
|
6443
6498
|
case l:
|
|
@@ -6516,8 +6571,8 @@ function hc() {
|
|
|
6516
6571
|
Te < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
6517
6572
|
}
|
|
6518
6573
|
}
|
|
6519
|
-
var Nt =
|
|
6520
|
-
function
|
|
6574
|
+
var Nt = _.ReactCurrentDispatcher, Kt;
|
|
6575
|
+
function yt(h, w, v) {
|
|
6521
6576
|
{
|
|
6522
6577
|
if (Kt === void 0)
|
|
6523
6578
|
try {
|
|
@@ -6530,16 +6585,16 @@ function hc() {
|
|
|
6530
6585
|
` + Kt + h;
|
|
6531
6586
|
}
|
|
6532
6587
|
}
|
|
6533
|
-
var qt = !1,
|
|
6588
|
+
var qt = !1, bt;
|
|
6534
6589
|
{
|
|
6535
6590
|
var Xi = typeof WeakMap == "function" ? WeakMap : Map;
|
|
6536
|
-
|
|
6591
|
+
bt = new Xi();
|
|
6537
6592
|
}
|
|
6538
6593
|
function er(h, w) {
|
|
6539
6594
|
if (!h || qt)
|
|
6540
6595
|
return "";
|
|
6541
6596
|
{
|
|
6542
|
-
var v =
|
|
6597
|
+
var v = bt.get(h);
|
|
6543
6598
|
if (v !== void 0)
|
|
6544
6599
|
return v;
|
|
6545
6600
|
}
|
|
@@ -6585,26 +6640,26 @@ function hc() {
|
|
|
6585
6640
|
if (Y && E && typeof Y.stack == "string") {
|
|
6586
6641
|
for (var k = Y.stack.split(`
|
|
6587
6642
|
`), G = E.stack.split(`
|
|
6588
|
-
`),
|
|
6589
|
-
|
|
6590
|
-
for (;
|
|
6591
|
-
if (k[
|
|
6592
|
-
if (
|
|
6643
|
+
`), L = k.length - 1, N = G.length - 1; L >= 1 && N >= 0 && k[L] !== G[N]; )
|
|
6644
|
+
N--;
|
|
6645
|
+
for (; L >= 1 && N >= 0; L--, N--)
|
|
6646
|
+
if (k[L] !== G[N]) {
|
|
6647
|
+
if (L !== 1 || N !== 1)
|
|
6593
6648
|
do
|
|
6594
|
-
if (
|
|
6649
|
+
if (L--, N--, N < 0 || k[L] !== G[N]) {
|
|
6595
6650
|
var re = `
|
|
6596
|
-
` + k[
|
|
6597
|
-
return h.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", h.displayName)), typeof h == "function" &&
|
|
6651
|
+
` + k[L].replace(" at new ", " at ");
|
|
6652
|
+
return h.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", h.displayName)), typeof h == "function" && bt.set(h, re), re;
|
|
6598
6653
|
}
|
|
6599
|
-
while (
|
|
6654
|
+
while (L >= 1 && N >= 0);
|
|
6600
6655
|
break;
|
|
6601
6656
|
}
|
|
6602
6657
|
}
|
|
6603
6658
|
} finally {
|
|
6604
6659
|
qt = !1, Nt.current = M, Zi(), Error.prepareStackTrace = P;
|
|
6605
6660
|
}
|
|
6606
|
-
var Me = h ? h.displayName || h.name : "", me = Me ?
|
|
6607
|
-
return typeof h == "function" &&
|
|
6661
|
+
var Me = h ? h.displayName || h.name : "", me = Me ? yt(Me) : "";
|
|
6662
|
+
return typeof h == "function" && bt.set(h, me), me;
|
|
6608
6663
|
}
|
|
6609
6664
|
function es(h, w, v) {
|
|
6610
6665
|
return er(h, !1);
|
|
@@ -6613,39 +6668,39 @@ function hc() {
|
|
|
6613
6668
|
var w = h.prototype;
|
|
6614
6669
|
return !!(w && w.isReactComponent);
|
|
6615
6670
|
}
|
|
6616
|
-
function
|
|
6671
|
+
function _t(h, w, v) {
|
|
6617
6672
|
if (h == null)
|
|
6618
6673
|
return "";
|
|
6619
6674
|
if (typeof h == "function")
|
|
6620
6675
|
return er(h, ts(h));
|
|
6621
6676
|
if (typeof h == "string")
|
|
6622
|
-
return
|
|
6677
|
+
return yt(h);
|
|
6623
6678
|
switch (h) {
|
|
6624
6679
|
case c:
|
|
6625
|
-
return
|
|
6680
|
+
return yt("Suspense");
|
|
6626
6681
|
case f:
|
|
6627
|
-
return
|
|
6682
|
+
return yt("SuspenseList");
|
|
6628
6683
|
}
|
|
6629
6684
|
if (typeof h == "object")
|
|
6630
6685
|
switch (h.$$typeof) {
|
|
6631
6686
|
case d:
|
|
6632
6687
|
return es(h.render);
|
|
6633
6688
|
case l:
|
|
6634
|
-
return
|
|
6689
|
+
return _t(h.type, w, v);
|
|
6635
6690
|
case p: {
|
|
6636
6691
|
var E = h, P = E._payload, M = E._init;
|
|
6637
6692
|
try {
|
|
6638
|
-
return
|
|
6693
|
+
return _t(M(P), w, v);
|
|
6639
6694
|
} catch {
|
|
6640
6695
|
}
|
|
6641
6696
|
}
|
|
6642
6697
|
}
|
|
6643
6698
|
return "";
|
|
6644
6699
|
}
|
|
6645
|
-
var Be = Object.prototype.hasOwnProperty, tr = {}, nr =
|
|
6646
|
-
function
|
|
6700
|
+
var Be = Object.prototype.hasOwnProperty, tr = {}, nr = _.ReactDebugCurrentFrame;
|
|
6701
|
+
function gt(h) {
|
|
6647
6702
|
if (h) {
|
|
6648
|
-
var w = h._owner, v =
|
|
6703
|
+
var w = h._owner, v = _t(h.type, h._source, w ? w.type : null);
|
|
6649
6704
|
nr.setExtraStackFrame(v);
|
|
6650
6705
|
} else
|
|
6651
6706
|
nr.setExtraStackFrame(null);
|
|
@@ -6662,10 +6717,10 @@ function hc() {
|
|
|
6662
6717
|
throw G.name = "Invariant Violation", G;
|
|
6663
6718
|
}
|
|
6664
6719
|
k = h[I](w, I, E, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
6665
|
-
} catch (
|
|
6666
|
-
k =
|
|
6720
|
+
} catch (L) {
|
|
6721
|
+
k = L;
|
|
6667
6722
|
}
|
|
6668
|
-
k && !(k instanceof Error) && (
|
|
6723
|
+
k && !(k instanceof Error) && (gt(P), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", E || "React class", v, I, typeof k), gt(null)), k instanceof Error && !(k.message in tr) && (tr[k.message] = !0, gt(P), m("Failed %s type: %s", v, k.message), gt(null));
|
|
6669
6724
|
}
|
|
6670
6725
|
}
|
|
6671
6726
|
}
|
|
@@ -6693,7 +6748,7 @@ function hc() {
|
|
|
6693
6748
|
if (ss(h))
|
|
6694
6749
|
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", is(h)), rr(h);
|
|
6695
6750
|
}
|
|
6696
|
-
var sr =
|
|
6751
|
+
var sr = _.ReactCurrentOwner, os = {
|
|
6697
6752
|
key: !0,
|
|
6698
6753
|
ref: !0,
|
|
6699
6754
|
__self: !0,
|
|
@@ -6776,21 +6831,21 @@ function hc() {
|
|
|
6776
6831
|
for (M in w)
|
|
6777
6832
|
Be.call(w, M) && !os.hasOwnProperty(M) && (I[M] = w[M]);
|
|
6778
6833
|
if (h && h.defaultProps) {
|
|
6779
|
-
var
|
|
6780
|
-
for (M in
|
|
6781
|
-
I[M] === void 0 && (I[M] =
|
|
6834
|
+
var L = h.defaultProps;
|
|
6835
|
+
for (M in L)
|
|
6836
|
+
I[M] === void 0 && (I[M] = L[M]);
|
|
6782
6837
|
}
|
|
6783
6838
|
if (k || G) {
|
|
6784
|
-
var
|
|
6785
|
-
k && ds(I,
|
|
6839
|
+
var N = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
|
|
6840
|
+
k && ds(I, N), G && fs(I, N);
|
|
6786
6841
|
}
|
|
6787
6842
|
return ls(h, k, G, P, E, sr.current, I);
|
|
6788
6843
|
}
|
|
6789
6844
|
}
|
|
6790
|
-
var zt =
|
|
6845
|
+
var zt = _.ReactCurrentOwner, ar = _.ReactDebugCurrentFrame;
|
|
6791
6846
|
function Pe(h) {
|
|
6792
6847
|
if (h) {
|
|
6793
|
-
var w = h._owner, v =
|
|
6848
|
+
var w = h._owner, v = _t(h.type, h._source, w ? w.type : null);
|
|
6794
6849
|
ar.setExtraStackFrame(v);
|
|
6795
6850
|
} else
|
|
6796
6851
|
ar.setExtraStackFrame(null);
|
|
@@ -6900,18 +6955,18 @@ Check the top-level render call using <` + v + ">.");
|
|
|
6900
6955
|
var hr = {};
|
|
6901
6956
|
function pr(h, w, v, E, P, M) {
|
|
6902
6957
|
{
|
|
6903
|
-
var I =
|
|
6958
|
+
var I = ht(h);
|
|
6904
6959
|
if (!I) {
|
|
6905
6960
|
var k = "";
|
|
6906
6961
|
(h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
6907
6962
|
var G = ps();
|
|
6908
6963
|
G ? k += G : k += cr();
|
|
6909
|
-
var
|
|
6910
|
-
h === null ?
|
|
6964
|
+
var L;
|
|
6965
|
+
h === null ? L = "null" : Wt(h) ? L = "array" : h !== void 0 && h.$$typeof === n ? (L = "<" + (ce(h.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : L = 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", L, k);
|
|
6911
6966
|
}
|
|
6912
|
-
var
|
|
6913
|
-
if (
|
|
6914
|
-
return
|
|
6967
|
+
var N = hs(h, w, v, P, M);
|
|
6968
|
+
if (N == null)
|
|
6969
|
+
return N;
|
|
6915
6970
|
if (I) {
|
|
6916
6971
|
var re = w.children;
|
|
6917
6972
|
if (re !== void 0)
|
|
@@ -6939,7 +6994,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
6939
6994
|
<%s key={someKey} {...props} />`, Gt, me, vs, me), hr[me + Gt] = !0;
|
|
6940
6995
|
}
|
|
6941
6996
|
}
|
|
6942
|
-
return h === i ? _s(
|
|
6997
|
+
return h === i ? _s(N) : bs(N), N;
|
|
6943
6998
|
}
|
|
6944
6999
|
}
|
|
6945
7000
|
function gs(h, w, v) {
|
|
@@ -6954,7 +7009,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
6954
7009
|
}
|
|
6955
7010
|
var pc = {};
|
|
6956
7011
|
pc.NODE_ENV === "production" ? Tn.exports = lc() : Tn.exports = hc();
|
|
6957
|
-
var
|
|
7012
|
+
var B = Tn.exports;
|
|
6958
7013
|
const yc = {
|
|
6959
7014
|
isLoading: !0,
|
|
6960
7015
|
data: void 0,
|
|
@@ -6966,8 +7021,8 @@ function ei(t) {
|
|
|
6966
7021
|
}
|
|
6967
7022
|
function bc(t, e, n) {
|
|
6968
7023
|
e && n && "ruleParams" in n && (e = Object.assign({ $$ruleParams: n.ruleParams }, e));
|
|
6969
|
-
const r = e ? uc(e) : null, i =
|
|
6970
|
-
(a) => (s.current = ei(t._reactor.getPreviousResult(r)), r ? t.subscribeQuery(r, (c) => {
|
|
7024
|
+
const r = e ? uc(e) : null, i = W(r), s = ut(ei(t._reactor.getPreviousResult(r))), o = we(
|
|
7025
|
+
(a) => (s.current = ei(t._reactor.getPreviousResult(r)), a(), r ? t.subscribeQuery(r, (c) => {
|
|
6971
7026
|
s.current = Object.assign({
|
|
6972
7027
|
isLoading: !c,
|
|
6973
7028
|
// @ts-expect-error: ts thinks this will always be overwritten
|
|
@@ -6985,7 +7040,7 @@ function bc(t, e, n) {
|
|
|
6985
7040
|
return { state: en(o, () => s.current, () => yc), query: r };
|
|
6986
7041
|
}
|
|
6987
7042
|
function _c() {
|
|
6988
|
-
const t =
|
|
7043
|
+
const t = ut(null);
|
|
6989
7044
|
ke(() => {
|
|
6990
7045
|
n();
|
|
6991
7046
|
}, []);
|
|
@@ -6999,7 +7054,7 @@ function _c() {
|
|
|
6999
7054
|
}
|
|
7000
7055
|
const gc = 1e3;
|
|
7001
7056
|
function wc(t, e, n) {
|
|
7002
|
-
const r =
|
|
7057
|
+
const r = ut(n);
|
|
7003
7058
|
r.current = n, ke(() => t.core._reactor.subscribeTopic(t.id, e, (s, o) => {
|
|
7004
7059
|
r.current(s, o);
|
|
7005
7060
|
}), [t.id, e]);
|
|
@@ -7118,18 +7173,13 @@ class kc {
|
|
|
7118
7173
|
s(u);
|
|
7119
7174
|
});
|
|
7120
7175
|
}, [r]), i;
|
|
7121
|
-
}, this.rooms = Se, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => bc(this.core, r, i).state, this.useAuth = () => {
|
|
7122
|
-
const r = ot(this.core._reactor._currentUserCached), i = we((o) => this.core.subscribeAuth((a) => {
|
|
7123
|
-
r.current = Object.assign({ isLoading: !1 }, a), o();
|
|
7124
|
-
}), []);
|
|
7125
|
-
return en(i, () => r.current, () => Ac);
|
|
7126
|
-
}, this.useUser = () => {
|
|
7176
|
+
}, this.rooms = Se, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => bc(this.core, r, i).state, this.useAuth = () => this._useAuth(), this.useUser = () => {
|
|
7127
7177
|
const { user: r } = this.useAuth();
|
|
7128
7178
|
if (!r)
|
|
7129
7179
|
throw new qe("useUser must be used within an auth-protected route");
|
|
7130
7180
|
return r;
|
|
7131
7181
|
}, this.useConnectionStatus = () => {
|
|
7132
|
-
const r =
|
|
7182
|
+
const r = ut(this.core._reactor.status), i = we((o) => this.core.subscribeConnectionStatus((a) => {
|
|
7133
7183
|
a !== r.current && (r.current = a, o());
|
|
7134
7184
|
}), []);
|
|
7135
7185
|
return en(
|
|
@@ -7140,10 +7190,10 @@ class kc {
|
|
|
7140
7190
|
);
|
|
7141
7191
|
}, this.queryOnce = (r, i) => this.core.queryOnce(r, i), this.SignedIn = ({ children: r }) => {
|
|
7142
7192
|
const i = this.useAuth();
|
|
7143
|
-
return i.isLoading || i.error || !i.user ? null :
|
|
7193
|
+
return i.isLoading || i.error || !i.user ? null : B.jsx(B.Fragment, { children: r });
|
|
7144
7194
|
}, this.SignedOut = ({ children: r }) => {
|
|
7145
7195
|
const i = this.useAuth();
|
|
7146
|
-
return i.isLoading || i.error || i.user ? null :
|
|
7196
|
+
return i.isLoading || i.error || i.user ? null : B.jsx(B.Fragment, { children: r });
|
|
7147
7197
|
}, this.core = dc(
|
|
7148
7198
|
e,
|
|
7149
7199
|
// @ts-expect-error because TS can't resolve subclass statics
|
|
@@ -7170,6 +7220,12 @@ class kc {
|
|
|
7170
7220
|
room(e = "_defaultRoomType", n = "_defaultRoomId") {
|
|
7171
7221
|
return new Oc(this.core, e, n);
|
|
7172
7222
|
}
|
|
7223
|
+
_useAuth() {
|
|
7224
|
+
const e = ut(this.core._reactor._currentUserCached), n = we((i) => this.core.subscribeAuth((o) => {
|
|
7225
|
+
e.current = Object.assign({ isLoading: !1 }, o), i();
|
|
7226
|
+
}), []);
|
|
7227
|
+
return en(n, () => e.current, () => Ac);
|
|
7228
|
+
}
|
|
7173
7229
|
/**
|
|
7174
7230
|
* One time query for the logged in state. This is useful
|
|
7175
7231
|
* for scenarios where you want to know the current auth
|
|
@@ -7199,10 +7255,10 @@ function jc(t) {
|
|
|
7199
7255
|
const { onEvent: e = Xt, onError: n = Xt, onRetry: r = Xt, onComment: i } = t;
|
|
7200
7256
|
let s = "", o = !0, u, a = "", d = "";
|
|
7201
7257
|
function c(b) {
|
|
7202
|
-
const
|
|
7258
|
+
const g = o ? b.replace(/^\xEF\xBB\xBF/, "") : b, [T, _] = Cc(`${s}${g}`);
|
|
7203
7259
|
for (const m of T)
|
|
7204
7260
|
f(m);
|
|
7205
|
-
s =
|
|
7261
|
+
s = _, o = !1;
|
|
7206
7262
|
}
|
|
7207
7263
|
function f(b) {
|
|
7208
7264
|
if (b === "") {
|
|
@@ -7213,31 +7269,31 @@ function jc(t) {
|
|
|
7213
7269
|
i && i(b.slice(b.startsWith(": ") ? 2 : 1));
|
|
7214
7270
|
return;
|
|
7215
7271
|
}
|
|
7216
|
-
const
|
|
7217
|
-
if (
|
|
7218
|
-
const T = b.slice(0,
|
|
7272
|
+
const g = b.indexOf(":");
|
|
7273
|
+
if (g !== -1) {
|
|
7274
|
+
const T = b.slice(0, g), _ = b[g + 1] === " " ? 2 : 1, m = b.slice(g + _);
|
|
7219
7275
|
l(T, m, b);
|
|
7220
7276
|
return;
|
|
7221
7277
|
}
|
|
7222
7278
|
l(b, "", b);
|
|
7223
7279
|
}
|
|
7224
|
-
function l(b,
|
|
7280
|
+
function l(b, g, T) {
|
|
7225
7281
|
switch (b) {
|
|
7226
7282
|
case "event":
|
|
7227
|
-
d =
|
|
7283
|
+
d = g;
|
|
7228
7284
|
break;
|
|
7229
7285
|
case "data":
|
|
7230
|
-
a = `${a}${
|
|
7286
|
+
a = `${a}${g}
|
|
7231
7287
|
`;
|
|
7232
7288
|
break;
|
|
7233
7289
|
case "id":
|
|
7234
|
-
u =
|
|
7290
|
+
u = g.includes("\0") ? void 0 : g;
|
|
7235
7291
|
break;
|
|
7236
7292
|
case "retry":
|
|
7237
|
-
/^\d+$/.test(
|
|
7238
|
-
new ti(`Invalid \`retry\` value: "${
|
|
7293
|
+
/^\d+$/.test(g) ? r(parseInt(g, 10)) : n(
|
|
7294
|
+
new ti(`Invalid \`retry\` value: "${g}"`, {
|
|
7239
7295
|
type: "invalid-retry",
|
|
7240
|
-
value:
|
|
7296
|
+
value: g,
|
|
7241
7297
|
line: T
|
|
7242
7298
|
})
|
|
7243
7299
|
);
|
|
@@ -7246,7 +7302,7 @@ function jc(t) {
|
|
|
7246
7302
|
n(
|
|
7247
7303
|
new ti(
|
|
7248
7304
|
`Unknown field "${b.length > 20 ? `${b.slice(0, 20)}…` : b}"`,
|
|
7249
|
-
{ type: "unknown-field", field: b, value:
|
|
7305
|
+
{ type: "unknown-field", field: b, value: g, line: T }
|
|
7250
7306
|
)
|
|
7251
7307
|
);
|
|
7252
7308
|
break;
|
|
@@ -7346,44 +7402,44 @@ function ri(t) {
|
|
|
7346
7402
|
}
|
|
7347
7403
|
var Yi = (t) => {
|
|
7348
7404
|
throw TypeError(t);
|
|
7349
|
-
}, zn = (t, e, n) => e.has(t) || Yi("Cannot " + n), A = (t, e, n) => (zn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? Yi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), x = (t, e, n, r) => (zn(t, e, "write to private field"), e.set(t, n), n), pe = (t, e, n) => (zn(t, e, "access private method"), n), J, Oe, xe, At, Rt,
|
|
7405
|
+
}, zn = (t, e, n) => e.has(t) || Yi("Cannot " + n), A = (t, e, n) => (zn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? Yi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), x = (t, e, n, r) => (zn(t, e, "write to private field"), e.set(t, n), n), pe = (t, e, n) => (zn(t, e, "access private method"), n), J, Oe, xe, At, Rt, st, Ue, ot, ge, $e, Fe, De, et, se, vn, Sn, On, ii, En, An, tt, kn, jn;
|
|
7350
7406
|
class kt extends EventTarget {
|
|
7351
7407
|
constructor(e, n) {
|
|
7352
7408
|
var r, i;
|
|
7353
|
-
super(), q(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, q(this, J), q(this, Oe), q(this, xe), q(this, At), q(this, Rt), q(this,
|
|
7409
|
+
super(), q(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, q(this, J), q(this, Oe), q(this, xe), q(this, At), q(this, Rt), q(this, st), q(this, Ue), q(this, ot, null), q(this, ge), q(this, $e), q(this, Fe, null), q(this, De, null), q(this, et, null), q(this, Sn, async (s) => {
|
|
7354
7410
|
var o;
|
|
7355
7411
|
A(this, $e).reset();
|
|
7356
7412
|
const { body: u, redirected: a, status: d, headers: c } = s;
|
|
7357
7413
|
if (d === 204) {
|
|
7358
|
-
pe(this, se,
|
|
7414
|
+
pe(this, se, tt).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
7359
7415
|
return;
|
|
7360
7416
|
}
|
|
7361
7417
|
if (a ? x(this, xe, new URL(s.url)) : x(this, xe, void 0), d !== 200) {
|
|
7362
|
-
pe(this, se,
|
|
7418
|
+
pe(this, se, tt).call(this, `Non-200 status code (${d})`, d);
|
|
7363
7419
|
return;
|
|
7364
7420
|
}
|
|
7365
7421
|
if (!(c.get("content-type") || "").startsWith("text/event-stream")) {
|
|
7366
|
-
pe(this, se,
|
|
7422
|
+
pe(this, se, tt).call(this, 'Invalid content type, expected "text/event-stream"', d);
|
|
7367
7423
|
return;
|
|
7368
7424
|
}
|
|
7369
7425
|
if (A(this, J) === this.CLOSED)
|
|
7370
7426
|
return;
|
|
7371
7427
|
x(this, J, this.OPEN);
|
|
7372
7428
|
const f = new Event("open");
|
|
7373
|
-
if ((o = A(this,
|
|
7374
|
-
pe(this, se,
|
|
7429
|
+
if ((o = A(this, et)) == null || o.call(this, f), this.dispatchEvent(f), typeof u != "object" || !u || !("getReader" in u)) {
|
|
7430
|
+
pe(this, se, tt).call(this, "Invalid response body, expected a web ReadableStream", d), this.close();
|
|
7375
7431
|
return;
|
|
7376
7432
|
}
|
|
7377
7433
|
const l = new TextDecoder(), p = u.getReader();
|
|
7378
7434
|
let y = !0;
|
|
7379
7435
|
do {
|
|
7380
|
-
const { done: b, value:
|
|
7381
|
-
|
|
7436
|
+
const { done: b, value: g } = await p.read();
|
|
7437
|
+
g && A(this, $e).feed(l.decode(g, { stream: !b })), b && (y = !1, A(this, $e).reset(), pe(this, se, kn).call(this));
|
|
7382
7438
|
} while (y);
|
|
7383
7439
|
}), q(this, On, (s) => {
|
|
7384
7440
|
x(this, ge, void 0), !(s.name === "AbortError" || s.type === "aborted") && pe(this, se, kn).call(this, mn(s));
|
|
7385
7441
|
}), q(this, En, (s) => {
|
|
7386
|
-
typeof s.id == "string" && x(this,
|
|
7442
|
+
typeof s.id == "string" && x(this, ot, s.id);
|
|
7387
7443
|
const o = new MessageEvent(s.event || "message", {
|
|
7388
7444
|
data: s.data,
|
|
7389
7445
|
origin: A(this, xe) ? A(this, xe).origin : A(this, Oe).origin,
|
|
@@ -7391,7 +7447,7 @@ class kt extends EventTarget {
|
|
|
7391
7447
|
});
|
|
7392
7448
|
A(this, De) && (!s.event || s.event === "message") && A(this, De).call(this, o), this.dispatchEvent(o);
|
|
7393
7449
|
}), q(this, An, (s) => {
|
|
7394
|
-
x(this,
|
|
7450
|
+
x(this, st, s);
|
|
7395
7451
|
}), q(this, jn, () => {
|
|
7396
7452
|
x(this, Ue, void 0), A(this, J) === this.CONNECTING && pe(this, se, vn).call(this);
|
|
7397
7453
|
});
|
|
@@ -7408,7 +7464,7 @@ class kt extends EventTarget {
|
|
|
7408
7464
|
x(this, $e, jc({
|
|
7409
7465
|
onEvent: A(this, En),
|
|
7410
7466
|
onRetry: A(this, An)
|
|
7411
|
-
})), x(this, J, this.CONNECTING), x(this,
|
|
7467
|
+
})), x(this, J, this.CONNECTING), x(this, st, 3e3), x(this, Rt, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), x(this, At, (i = n == null ? void 0 : n.withCredentials) != null ? i : !1), pe(this, se, vn).call(this);
|
|
7412
7468
|
}
|
|
7413
7469
|
/**
|
|
7414
7470
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -7457,10 +7513,10 @@ class kt extends EventTarget {
|
|
|
7457
7513
|
}
|
|
7458
7514
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
7459
7515
|
get onopen() {
|
|
7460
|
-
return A(this,
|
|
7516
|
+
return A(this, et);
|
|
7461
7517
|
}
|
|
7462
7518
|
set onopen(e) {
|
|
7463
|
-
x(this,
|
|
7519
|
+
x(this, et, e);
|
|
7464
7520
|
}
|
|
7465
7521
|
addEventListener(e, n, r) {
|
|
7466
7522
|
const i = n;
|
|
@@ -7481,7 +7537,7 @@ class kt extends EventTarget {
|
|
|
7481
7537
|
A(this, Ue) && clearTimeout(A(this, Ue)), A(this, J) !== this.CLOSED && (A(this, ge) && A(this, ge).abort(), x(this, J, this.CLOSED), x(this, ge, void 0));
|
|
7482
7538
|
}
|
|
7483
7539
|
}
|
|
7484
|
-
J = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(),
|
|
7540
|
+
J = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakSet(), /**
|
|
7485
7541
|
* Connect to the given URL and start receiving events
|
|
7486
7542
|
*
|
|
7487
7543
|
* @internal
|
|
@@ -7501,7 +7557,7 @@ ii = function() {
|
|
|
7501
7557
|
// [spec] …will have their mode set to "cors"…
|
|
7502
7558
|
mode: "cors",
|
|
7503
7559
|
redirect: "follow",
|
|
7504
|
-
headers: { Accept: "text/event-stream", ...A(this,
|
|
7560
|
+
headers: { Accept: "text/event-stream", ...A(this, ot) ? { "Last-Event-ID": A(this, ot) } : void 0 },
|
|
7505
7561
|
cache: "no-store",
|
|
7506
7562
|
signal: (t = A(this, ge)) == null ? void 0 : t.signal
|
|
7507
7563
|
};
|
|
@@ -7513,7 +7569,7 @@ ii = function() {
|
|
|
7513
7569
|
* @param code - The HTTP status code, if available
|
|
7514
7570
|
* @internal
|
|
7515
7571
|
*/
|
|
7516
|
-
|
|
7572
|
+
tt = function(t, e) {
|
|
7517
7573
|
var n;
|
|
7518
7574
|
A(this, J) !== this.CLOSED && x(this, J, this.CLOSED);
|
|
7519
7575
|
const r = new ni("error", { code: e, message: t });
|
|
@@ -7531,7 +7587,7 @@ kn = function(t, e) {
|
|
|
7531
7587
|
return;
|
|
7532
7588
|
x(this, J, this.CONNECTING);
|
|
7533
7589
|
const r = new ni("error", { code: e, message: t });
|
|
7534
|
-
(n = A(this, Fe)) == null || n.call(this, r), this.dispatchEvent(r), x(this, Ue, setTimeout(A(this, jn), A(this,
|
|
7590
|
+
(n = A(this, Fe)) == null || n.call(this, r), this.dispatchEvent(r), x(this, Ue, setTimeout(A(this, jn), A(this, st)));
|
|
7535
7591
|
}, jn = /* @__PURE__ */ new WeakMap(), /**
|
|
7536
7592
|
* ReadyState representing an EventSource currently trying to connect
|
|
7537
7593
|
*
|
|
@@ -7581,8 +7637,8 @@ function Kc({
|
|
|
7581
7637
|
const c = e || `cursors-space-default--${String(n.type)}-${n.id}`, f = n.usePresence({
|
|
7582
7638
|
keys: [c]
|
|
7583
7639
|
}), l = n._core._reactor.getPresence(n.type, n.id);
|
|
7584
|
-
function p(
|
|
7585
|
-
const O = m.clientX, S = m.clientY, C = (O -
|
|
7640
|
+
function p(_, m) {
|
|
7641
|
+
const O = m.clientX, S = m.clientY, C = (O - _.left) / _.width * 100, $ = (S - _.top) / _.height * 100;
|
|
7586
7642
|
f.publishPresence({
|
|
7587
7643
|
[c]: {
|
|
7588
7644
|
x: O,
|
|
@@ -7593,27 +7649,27 @@ function Kc({
|
|
|
7593
7649
|
}
|
|
7594
7650
|
});
|
|
7595
7651
|
}
|
|
7596
|
-
function y(
|
|
7597
|
-
a ||
|
|
7598
|
-
const m =
|
|
7599
|
-
p(m,
|
|
7652
|
+
function y(_) {
|
|
7653
|
+
a || _.stopPropagation();
|
|
7654
|
+
const m = _.currentTarget.getBoundingClientRect();
|
|
7655
|
+
p(m, _);
|
|
7600
7656
|
}
|
|
7601
|
-
function b(
|
|
7657
|
+
function b(_) {
|
|
7602
7658
|
f.publishPresence({
|
|
7603
7659
|
[c]: void 0
|
|
7604
7660
|
});
|
|
7605
7661
|
}
|
|
7606
|
-
function _
|
|
7607
|
-
if (
|
|
7662
|
+
function g(_) {
|
|
7663
|
+
if (_.touches.length !== 1)
|
|
7608
7664
|
return;
|
|
7609
|
-
const m =
|
|
7665
|
+
const m = _.touches[0];
|
|
7610
7666
|
if (m.target instanceof Element) {
|
|
7611
|
-
a ||
|
|
7667
|
+
a || _.stopPropagation();
|
|
7612
7668
|
const O = m.target.getBoundingClientRect();
|
|
7613
7669
|
p(O, m);
|
|
7614
7670
|
}
|
|
7615
7671
|
}
|
|
7616
|
-
function T(
|
|
7672
|
+
function T(_) {
|
|
7617
7673
|
f.publishPresence({
|
|
7618
7674
|
[c]: void 0
|
|
7619
7675
|
});
|
|
@@ -7623,7 +7679,7 @@ function Kc({
|
|
|
7623
7679
|
{
|
|
7624
7680
|
onMouseMove: y,
|
|
7625
7681
|
onMouseOut: b,
|
|
7626
|
-
onTouchMove:
|
|
7682
|
+
onTouchMove: g,
|
|
7627
7683
|
onTouchEnd: T,
|
|
7628
7684
|
className: r,
|
|
7629
7685
|
style: {
|
|
@@ -7633,7 +7689,7 @@ function Kc({
|
|
|
7633
7689
|
},
|
|
7634
7690
|
[
|
|
7635
7691
|
o,
|
|
7636
|
-
/* @__PURE__ */
|
|
7692
|
+
/* @__PURE__ */ B.jsx(
|
|
7637
7693
|
"div",
|
|
7638
7694
|
{
|
|
7639
7695
|
style: {
|
|
@@ -7641,9 +7697,9 @@ function Kc({
|
|
|
7641
7697
|
...xc,
|
|
7642
7698
|
zIndex: d !== void 0 ? d : $c
|
|
7643
7699
|
},
|
|
7644
|
-
children: Object.entries(f.peers).map(([
|
|
7700
|
+
children: Object.entries(f.peers).map(([_, m]) => {
|
|
7645
7701
|
const O = m[c];
|
|
7646
|
-
return O ? /* @__PURE__ */
|
|
7702
|
+
return O ? /* @__PURE__ */ B.jsx(
|
|
7647
7703
|
"div",
|
|
7648
7704
|
{
|
|
7649
7705
|
style: {
|
|
@@ -7654,10 +7710,10 @@ function Kc({
|
|
|
7654
7710
|
},
|
|
7655
7711
|
children: u ? u({
|
|
7656
7712
|
color: O.color,
|
|
7657
|
-
presence: l == null ? void 0 : l.peers[
|
|
7658
|
-
}) : /* @__PURE__ */
|
|
7713
|
+
presence: l == null ? void 0 : l.peers[_]
|
|
7714
|
+
}) : /* @__PURE__ */ B.jsx(Rc, { ...O })
|
|
7659
7715
|
},
|
|
7660
|
-
|
|
7716
|
+
_
|
|
7661
7717
|
) : null;
|
|
7662
7718
|
})
|
|
7663
7719
|
},
|
|
@@ -7668,7 +7724,7 @@ function Kc({
|
|
|
7668
7724
|
}
|
|
7669
7725
|
function Rc({ color: t }) {
|
|
7670
7726
|
const n = t || "black";
|
|
7671
|
-
return /* @__PURE__ */
|
|
7727
|
+
return /* @__PURE__ */ B.jsxs(
|
|
7672
7728
|
"svg",
|
|
7673
7729
|
{
|
|
7674
7730
|
style: { height: 35, width: 35 },
|
|
@@ -7676,36 +7732,36 @@ function Rc({ color: t }) {
|
|
|
7676
7732
|
fill: "none",
|
|
7677
7733
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7678
7734
|
children: [
|
|
7679
|
-
/* @__PURE__ */
|
|
7735
|
+
/* @__PURE__ */ B.jsxs(
|
|
7680
7736
|
"g",
|
|
7681
7737
|
{
|
|
7682
7738
|
fill: "rgba(0,0,0,.2)",
|
|
7683
7739
|
transform: "matrix(1, 0, 0, 1, -11.999999046325684, -8.406899452209473)",
|
|
7684
7740
|
children: [
|
|
7685
|
-
/* @__PURE__ */
|
|
7686
|
-
/* @__PURE__ */
|
|
7741
|
+
/* @__PURE__ */ B.jsx("path", { d: "m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z" }),
|
|
7742
|
+
/* @__PURE__ */ B.jsx("path", { d: "m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z" })
|
|
7687
7743
|
]
|
|
7688
7744
|
}
|
|
7689
7745
|
),
|
|
7690
|
-
/* @__PURE__ */
|
|
7746
|
+
/* @__PURE__ */ B.jsxs(
|
|
7691
7747
|
"g",
|
|
7692
7748
|
{
|
|
7693
7749
|
fill: "white",
|
|
7694
7750
|
transform: "matrix(1, 0, 0, 1, -11.999999046325684, -8.406899452209473)",
|
|
7695
7751
|
children: [
|
|
7696
|
-
/* @__PURE__ */
|
|
7697
|
-
/* @__PURE__ */
|
|
7752
|
+
/* @__PURE__ */ B.jsx("path", { d: "m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z" }),
|
|
7753
|
+
/* @__PURE__ */ B.jsx("path", { d: "m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z" })
|
|
7698
7754
|
]
|
|
7699
7755
|
}
|
|
7700
7756
|
),
|
|
7701
|
-
/* @__PURE__ */
|
|
7757
|
+
/* @__PURE__ */ B.jsxs(
|
|
7702
7758
|
"g",
|
|
7703
7759
|
{
|
|
7704
7760
|
fill: n,
|
|
7705
7761
|
transform: "matrix(1, 0, 0, 1, -11.999999046325684, -8.406899452209473)",
|
|
7706
7762
|
children: [
|
|
7707
|
-
/* @__PURE__ */
|
|
7708
|
-
/* @__PURE__ */
|
|
7763
|
+
/* @__PURE__ */ B.jsx("path", { d: "m19.751 24.4155-1.844.774-3.1-7.374 1.841-.775z" }),
|
|
7764
|
+
/* @__PURE__ */ B.jsx("path", { d: "m13 10.814v11.188l2.969-2.866.428-.139h4.768z" })
|
|
7709
7765
|
]
|
|
7710
7766
|
}
|
|
7711
7767
|
)
|
|
@@ -7731,7 +7787,7 @@ export {
|
|
|
7731
7787
|
Cn as InstantReactWebDatabase,
|
|
7732
7788
|
ve as SyncTableCallbackEventType,
|
|
7733
7789
|
Fc as i,
|
|
7734
|
-
|
|
7790
|
+
z as id,
|
|
7735
7791
|
Mc as init,
|
|
7736
7792
|
Nc as init_experimental,
|
|
7737
7793
|
Uc as lookup,
|