@instantdb/react-common 0.22.105-experimental.drewh-typesafe-lookup-syntax.21149834770.1 → 0.22.105-experimental.drewh-clief.21154267631.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/index.js +625 -630
- package/dist/standalone/index.umd.cjs +10 -10
- package/package.json +3 -3
package/dist/standalone/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Ms = Object.defineProperty;
|
|
2
2
|
var js = (t, e, n) => e in t ? Ms(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var p = (t, e, n) => js(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import
|
|
5
|
-
var
|
|
4
|
+
import yr, { useRef as Ke, useCallback as le, useSyncExternalStore as It, useEffect as be, useMemo as Mt, useState as br } from "react";
|
|
5
|
+
var jt = { exports: {} }, Me = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,11 +12,11 @@ var Rt = { exports: {} }, Me = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
15
|
+
var Rn;
|
|
16
16
|
function Rs() {
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
var t =
|
|
17
|
+
if (Rn) return Me;
|
|
18
|
+
Rn = 1;
|
|
19
|
+
var t = yr, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
20
|
function o(a, c, u) {
|
|
21
21
|
var l, d = {}, h = null, y = null;
|
|
22
22
|
u !== void 0 && (h = "" + u), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (y = c.ref);
|
|
@@ -26,10 +26,10 @@ function Rs() {
|
|
|
26
26
|
}
|
|
27
27
|
return Me.Fragment = n, Me.jsx = o, Me.jsxs = o, Me;
|
|
28
28
|
}
|
|
29
|
-
var je = {},
|
|
29
|
+
var je = {}, $n;
|
|
30
30
|
function $s() {
|
|
31
|
-
if (
|
|
32
|
-
|
|
31
|
+
if ($n) return je;
|
|
32
|
+
$n = 1;
|
|
33
33
|
var t = {};
|
|
34
34
|
/**
|
|
35
35
|
* @license React
|
|
@@ -41,7 +41,7 @@ function $s() {
|
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
42
|
*/
|
|
43
43
|
return t.NODE_ENV !== "production" && function() {
|
|
44
|
-
var e =
|
|
44
|
+
var e = yr, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), g = Symbol.iterator, w = "@@iterator";
|
|
45
45
|
function m(f) {
|
|
46
46
|
if (f === null || typeof f != "object")
|
|
47
47
|
return null;
|
|
@@ -68,14 +68,14 @@ function $s() {
|
|
|
68
68
|
}
|
|
69
69
|
var A = !1, j = !1, L = !1, q = !1, Pe = !1, We;
|
|
70
70
|
We = Symbol.for("react.module.reference");
|
|
71
|
-
function
|
|
71
|
+
function dt(f) {
|
|
72
72
|
return !!(typeof f == "string" || typeof f == "function" || f === s || f === o || Pe || f === i || f === l || f === d || q || f === b || A || j || L || typeof f == "object" && f !== null && (f.$$typeof === y || f.$$typeof === h || f.$$typeof === a || f.$$typeof === c || f.$$typeof === u || // This needs to include all possible module reference object
|
|
73
73
|
// types supported by any Flight configuration anywhere since
|
|
74
74
|
// we don't know which Flight build this will end up being used
|
|
75
75
|
// with.
|
|
76
76
|
f.$$typeof === We || f.getModuleId !== void 0));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ht(f, _, S) {
|
|
79
79
|
var O = f.displayName;
|
|
80
80
|
if (O)
|
|
81
81
|
return O;
|
|
@@ -115,7 +115,7 @@ function $s() {
|
|
|
115
115
|
var S = f;
|
|
116
116
|
return Ce(S._context) + ".Provider";
|
|
117
117
|
case u:
|
|
118
|
-
return
|
|
118
|
+
return ht(f, f.render, "ForwardRef");
|
|
119
119
|
case h:
|
|
120
120
|
var O = f.displayName || null;
|
|
121
121
|
return O !== null ? O : X(f.type) || "Memo";
|
|
@@ -130,18 +130,18 @@ function $s() {
|
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
var re = Object.assign, ue = 0, fn, dn, hn, pn, yn, bn
|
|
134
|
-
function
|
|
133
|
+
var re = Object.assign, ue = 0, ln, fn, dn, hn, pn, yn, bn;
|
|
134
|
+
function _n() {
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
_n.__reactDisabledLog = !0;
|
|
137
137
|
function ss() {
|
|
138
138
|
{
|
|
139
139
|
if (ue === 0) {
|
|
140
|
-
|
|
140
|
+
ln = console.log, fn = console.info, dn = console.warn, hn = console.error, pn = console.group, yn = console.groupCollapsed, bn = console.groupEnd;
|
|
141
141
|
var f = {
|
|
142
142
|
configurable: !0,
|
|
143
143
|
enumerable: !0,
|
|
144
|
-
value:
|
|
144
|
+
value: _n,
|
|
145
145
|
writable: !0
|
|
146
146
|
};
|
|
147
147
|
Object.defineProperties(console, {
|
|
@@ -167,52 +167,52 @@ function $s() {
|
|
|
167
167
|
};
|
|
168
168
|
Object.defineProperties(console, {
|
|
169
169
|
log: re({}, f, {
|
|
170
|
-
value:
|
|
170
|
+
value: ln
|
|
171
171
|
}),
|
|
172
172
|
info: re({}, f, {
|
|
173
|
-
value:
|
|
173
|
+
value: fn
|
|
174
174
|
}),
|
|
175
175
|
warn: re({}, f, {
|
|
176
|
-
value:
|
|
176
|
+
value: dn
|
|
177
177
|
}),
|
|
178
178
|
error: re({}, f, {
|
|
179
|
-
value:
|
|
179
|
+
value: hn
|
|
180
180
|
}),
|
|
181
181
|
group: re({}, f, {
|
|
182
|
-
value:
|
|
182
|
+
value: pn
|
|
183
183
|
}),
|
|
184
184
|
groupCollapsed: re({}, f, {
|
|
185
|
-
value:
|
|
185
|
+
value: yn
|
|
186
186
|
}),
|
|
187
187
|
groupEnd: re({}, f, {
|
|
188
|
-
value:
|
|
188
|
+
value: bn
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
ue < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
var
|
|
195
|
+
var pt = T.ReactCurrentDispatcher, yt;
|
|
196
196
|
function Qe(f, _, S) {
|
|
197
197
|
{
|
|
198
|
-
if (
|
|
198
|
+
if (yt === void 0)
|
|
199
199
|
try {
|
|
200
200
|
throw Error();
|
|
201
201
|
} catch (I) {
|
|
202
202
|
var O = I.stack.trim().match(/\n( *(at )?)/);
|
|
203
|
-
|
|
203
|
+
yt = O && O[1] || "";
|
|
204
204
|
}
|
|
205
205
|
return `
|
|
206
|
-
` +
|
|
206
|
+
` + yt + f;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
var
|
|
209
|
+
var bt = !1, Be;
|
|
210
210
|
{
|
|
211
211
|
var os = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
212
|
Be = new os();
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
if (!f ||
|
|
214
|
+
function gn(f, _) {
|
|
215
|
+
if (!f || bt)
|
|
216
216
|
return "";
|
|
217
217
|
{
|
|
218
218
|
var S = Be.get(f);
|
|
@@ -220,11 +220,11 @@ function $s() {
|
|
|
220
220
|
return S;
|
|
221
221
|
}
|
|
222
222
|
var O;
|
|
223
|
-
|
|
223
|
+
bt = !0;
|
|
224
224
|
var I = Error.prepareStackTrace;
|
|
225
225
|
Error.prepareStackTrace = void 0;
|
|
226
226
|
var M;
|
|
227
|
-
M =
|
|
227
|
+
M = pt.current, pt.current = null, ss();
|
|
228
228
|
try {
|
|
229
229
|
if (_) {
|
|
230
230
|
var C = function() {
|
|
@@ -277,13 +277,13 @@ function $s() {
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
} finally {
|
|
280
|
-
|
|
280
|
+
bt = !1, pt.current = M, is(), Error.prepareStackTrace = I;
|
|
281
281
|
}
|
|
282
282
|
var me = f ? f.displayName || f.name : "", fe = me ? Qe(me) : "";
|
|
283
283
|
return typeof f == "function" && Be.set(f, fe), fe;
|
|
284
284
|
}
|
|
285
285
|
function as(f, _, S) {
|
|
286
|
-
return
|
|
286
|
+
return gn(f, !1);
|
|
287
287
|
}
|
|
288
288
|
function cs(f) {
|
|
289
289
|
var _ = f.prototype;
|
|
@@ -293,7 +293,7 @@ function $s() {
|
|
|
293
293
|
if (f == null)
|
|
294
294
|
return "";
|
|
295
295
|
if (typeof f == "function")
|
|
296
|
-
return
|
|
296
|
+
return gn(f, cs(f));
|
|
297
297
|
if (typeof f == "string")
|
|
298
298
|
return Qe(f);
|
|
299
299
|
switch (f) {
|
|
@@ -318,13 +318,13 @@ function $s() {
|
|
|
318
318
|
}
|
|
319
319
|
return "";
|
|
320
320
|
}
|
|
321
|
-
var Ie = Object.prototype.hasOwnProperty,
|
|
321
|
+
var Ie = Object.prototype.hasOwnProperty, Tn = {}, wn = T.ReactDebugCurrentFrame;
|
|
322
322
|
function He(f) {
|
|
323
323
|
if (f) {
|
|
324
324
|
var _ = f._owner, S = Ge(f.type, f._source, _ ? _.type : null);
|
|
325
|
-
|
|
325
|
+
wn.setExtraStackFrame(S);
|
|
326
326
|
} else
|
|
327
|
-
|
|
327
|
+
wn.setExtraStackFrame(null);
|
|
328
328
|
}
|
|
329
329
|
function us(f, _, S, O, I) {
|
|
330
330
|
{
|
|
@@ -341,12 +341,12 @@ function $s() {
|
|
|
341
341
|
} catch ($) {
|
|
342
342
|
k = $;
|
|
343
343
|
}
|
|
344
|
-
k && !(k instanceof Error) && (He(I), v("%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).", O || "React class", S, C, typeof k), He(null)), k instanceof Error && !(k.message in
|
|
344
|
+
k && !(k instanceof Error) && (He(I), v("%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).", O || "React class", S, C, typeof k), He(null)), k instanceof Error && !(k.message in Tn) && (Tn[k.message] = !0, He(I), v("Failed %s type: %s", S, k.message), He(null));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
var ls = Array.isArray;
|
|
349
|
-
function
|
|
349
|
+
function _t(f) {
|
|
350
350
|
return ls(f);
|
|
351
351
|
}
|
|
352
352
|
function fs(f) {
|
|
@@ -357,24 +357,24 @@ function $s() {
|
|
|
357
357
|
}
|
|
358
358
|
function ds(f) {
|
|
359
359
|
try {
|
|
360
|
-
return
|
|
360
|
+
return mn(f), !1;
|
|
361
361
|
} catch {
|
|
362
362
|
return !0;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function mn(f) {
|
|
366
366
|
return "" + f;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Sn(f) {
|
|
369
369
|
if (ds(f))
|
|
370
|
-
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fs(f)),
|
|
370
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fs(f)), mn(f);
|
|
371
371
|
}
|
|
372
|
-
var
|
|
372
|
+
var vn = T.ReactCurrentOwner, hs = {
|
|
373
373
|
key: !0,
|
|
374
374
|
ref: !0,
|
|
375
375
|
__self: !0,
|
|
376
376
|
__source: !0
|
|
377
|
-
},
|
|
377
|
+
}, An, On;
|
|
378
378
|
function ps(f) {
|
|
379
379
|
if (Ie.call(f, "ref")) {
|
|
380
380
|
var _ = Object.getOwnPropertyDescriptor(f, "ref").get;
|
|
@@ -392,12 +392,12 @@ function $s() {
|
|
|
392
392
|
return f.key !== void 0;
|
|
393
393
|
}
|
|
394
394
|
function bs(f, _) {
|
|
395
|
-
typeof f.ref == "string" &&
|
|
395
|
+
typeof f.ref == "string" && vn.current;
|
|
396
396
|
}
|
|
397
397
|
function _s(f, _) {
|
|
398
398
|
{
|
|
399
399
|
var S = function() {
|
|
400
|
-
|
|
400
|
+
An || (An = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", _));
|
|
401
401
|
};
|
|
402
402
|
S.isReactWarning = !0, Object.defineProperty(f, "key", {
|
|
403
403
|
get: S,
|
|
@@ -408,7 +408,7 @@ function $s() {
|
|
|
408
408
|
function gs(f, _) {
|
|
409
409
|
{
|
|
410
410
|
var S = function() {
|
|
411
|
-
|
|
411
|
+
On || (On = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", _));
|
|
412
412
|
};
|
|
413
413
|
S.isReactWarning = !0, Object.defineProperty(f, "ref", {
|
|
414
414
|
get: S,
|
|
@@ -448,7 +448,7 @@ function $s() {
|
|
|
448
448
|
function ws(f, _, S, O, I) {
|
|
449
449
|
{
|
|
450
450
|
var M, C = {}, k = null, z = null;
|
|
451
|
-
S !== void 0 && (
|
|
451
|
+
S !== void 0 && (Sn(S), k = "" + S), ys(_) && (Sn(_.key), k = "" + _.key), ps(_) && (z = _.ref, bs(_, I));
|
|
452
452
|
for (M in _)
|
|
453
453
|
Ie.call(_, M) && !hs.hasOwnProperty(M) && (C[M] = _[M]);
|
|
454
454
|
if (f && f.defaultProps) {
|
|
@@ -460,26 +460,26 @@ function $s() {
|
|
|
460
460
|
var x = typeof f == "function" ? f.displayName || f.name || "Unknown" : f;
|
|
461
461
|
k && _s(C, x), z && gs(C, x);
|
|
462
462
|
}
|
|
463
|
-
return Ts(f, k, z, I, O,
|
|
463
|
+
return Ts(f, k, z, I, O, vn.current, C);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
var
|
|
466
|
+
var gt = T.ReactCurrentOwner, En = T.ReactDebugCurrentFrame;
|
|
467
467
|
function we(f) {
|
|
468
468
|
if (f) {
|
|
469
469
|
var _ = f._owner, S = Ge(f.type, f._source, _ ? _.type : null);
|
|
470
|
-
|
|
470
|
+
En.setExtraStackFrame(S);
|
|
471
471
|
} else
|
|
472
|
-
|
|
472
|
+
En.setExtraStackFrame(null);
|
|
473
473
|
}
|
|
474
|
-
var
|
|
475
|
-
|
|
476
|
-
function
|
|
474
|
+
var Tt;
|
|
475
|
+
Tt = !1;
|
|
476
|
+
function wt(f) {
|
|
477
477
|
return typeof f == "object" && f !== null && f.$$typeof === n;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function kn() {
|
|
480
480
|
{
|
|
481
|
-
if (
|
|
482
|
-
var f = X(
|
|
481
|
+
if (gt.current) {
|
|
482
|
+
var f = X(gt.current.type);
|
|
483
483
|
if (f)
|
|
484
484
|
return `
|
|
485
485
|
|
|
@@ -491,10 +491,10 @@ Check the render method of \`` + f + "`.";
|
|
|
491
491
|
function ms(f) {
|
|
492
492
|
return "";
|
|
493
493
|
}
|
|
494
|
-
var
|
|
494
|
+
var Pn = {};
|
|
495
495
|
function Ss(f) {
|
|
496
496
|
{
|
|
497
|
-
var _ =
|
|
497
|
+
var _ = kn();
|
|
498
498
|
if (!_) {
|
|
499
499
|
var S = typeof f == "string" ? f : f.displayName || f.name;
|
|
500
500
|
S && (_ = `
|
|
@@ -504,35 +504,35 @@ Check the top-level render call using <` + S + ">.");
|
|
|
504
504
|
return _;
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Cn(f, _) {
|
|
508
508
|
{
|
|
509
509
|
if (!f._store || f._store.validated || f.key != null)
|
|
510
510
|
return;
|
|
511
511
|
f._store.validated = !0;
|
|
512
512
|
var S = Ss(_);
|
|
513
|
-
if (
|
|
513
|
+
if (Pn[S])
|
|
514
514
|
return;
|
|
515
|
-
|
|
515
|
+
Pn[S] = !0;
|
|
516
516
|
var O = "";
|
|
517
|
-
f && f._owner && f._owner !==
|
|
517
|
+
f && f._owner && f._owner !== gt.current && (O = " It was passed a child from " + X(f._owner.type) + "."), we(f), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', S, O), we(null);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function In(f, _) {
|
|
521
521
|
{
|
|
522
522
|
if (typeof f != "object")
|
|
523
523
|
return;
|
|
524
|
-
if (
|
|
524
|
+
if (_t(f))
|
|
525
525
|
for (var S = 0; S < f.length; S++) {
|
|
526
526
|
var O = f[S];
|
|
527
|
-
|
|
527
|
+
wt(O) && Cn(O, _);
|
|
528
528
|
}
|
|
529
|
-
else if (
|
|
529
|
+
else if (wt(f))
|
|
530
530
|
f._store && (f._store.validated = !0);
|
|
531
531
|
else if (f) {
|
|
532
532
|
var I = m(f);
|
|
533
533
|
if (typeof I == "function" && I !== f.entries)
|
|
534
534
|
for (var M = I.call(f), C; !(C = M.next()).done; )
|
|
535
|
-
|
|
535
|
+
wt(C.value) && Cn(C.value, _);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
}
|
|
@@ -553,8 +553,8 @@ Check the top-level render call using <` + S + ">.");
|
|
|
553
553
|
if (S) {
|
|
554
554
|
var O = X(_);
|
|
555
555
|
us(S, f.props, "prop", O, f);
|
|
556
|
-
} else if (_.PropTypes !== void 0 && !
|
|
557
|
-
|
|
556
|
+
} else if (_.PropTypes !== void 0 && !Tt) {
|
|
557
|
+
Tt = !0;
|
|
558
558
|
var I = X(_);
|
|
559
559
|
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", I || "Unknown");
|
|
560
560
|
}
|
|
@@ -573,17 +573,17 @@ Check the top-level render call using <` + S + ">.");
|
|
|
573
573
|
f.ref !== null && (we(f), v("Invalid attribute `ref` supplied to `React.Fragment`."), we(null));
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
var
|
|
577
|
-
function
|
|
576
|
+
var Mn = {};
|
|
577
|
+
function jn(f, _, S, O, I, M) {
|
|
578
578
|
{
|
|
579
|
-
var C =
|
|
579
|
+
var C = dt(f);
|
|
580
580
|
if (!C) {
|
|
581
581
|
var k = "";
|
|
582
582
|
(f === void 0 || typeof f == "object" && f !== null && Object.keys(f).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.");
|
|
583
583
|
var z = ms();
|
|
584
|
-
z ? k += z : k +=
|
|
584
|
+
z ? k += z : k += kn();
|
|
585
585
|
var $;
|
|
586
|
-
f === null ? $ = "null" :
|
|
586
|
+
f === null ? $ = "null" : _t(f) ? $ = "array" : f !== void 0 && f.$$typeof === n ? ($ = "<" + (X(f.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof f, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, k);
|
|
587
587
|
}
|
|
588
588
|
var x = ws(f, _, S, I, M);
|
|
589
589
|
if (x == null)
|
|
@@ -592,45 +592,45 @@ Check the top-level render call using <` + S + ">.");
|
|
|
592
592
|
var Y = _.children;
|
|
593
593
|
if (Y !== void 0)
|
|
594
594
|
if (O)
|
|
595
|
-
if (
|
|
595
|
+
if (_t(Y)) {
|
|
596
596
|
for (var me = 0; me < Y.length; me++)
|
|
597
|
-
|
|
597
|
+
In(Y[me], f);
|
|
598
598
|
Object.freeze && Object.freeze(Y);
|
|
599
599
|
} else
|
|
600
600
|
v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
601
601
|
else
|
|
602
|
-
|
|
602
|
+
In(Y, f);
|
|
603
603
|
}
|
|
604
604
|
if (Ie.call(_, "key")) {
|
|
605
605
|
var fe = X(f), W = Object.keys(_).filter(function(Is) {
|
|
606
606
|
return Is !== "key";
|
|
607
|
-
}),
|
|
608
|
-
if (!
|
|
607
|
+
}), mt = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
608
|
+
if (!Mn[fe + mt]) {
|
|
609
609
|
var Cs = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
|
|
610
610
|
v(`A props object containing a "key" prop is being spread into JSX:
|
|
611
611
|
let props = %s;
|
|
612
612
|
<%s {...props} />
|
|
613
613
|
React keys must be passed directly to JSX without using spread:
|
|
614
614
|
let props = %s;
|
|
615
|
-
<%s key={someKey} {...props} />`,
|
|
615
|
+
<%s key={someKey} {...props} />`, mt, fe, Cs, fe), Mn[fe + mt] = !0;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
return f === s ? As(x) : vs(x), x;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
function Os(f, _, S) {
|
|
622
|
-
return
|
|
622
|
+
return jn(f, _, S, !0);
|
|
623
623
|
}
|
|
624
624
|
function Es(f, _, S) {
|
|
625
|
-
return
|
|
625
|
+
return jn(f, _, S, !1);
|
|
626
626
|
}
|
|
627
627
|
var ks = Es, Ps = Os;
|
|
628
628
|
je.Fragment = s, je.jsx = ks, je.jsxs = Ps;
|
|
629
629
|
}(), je;
|
|
630
630
|
}
|
|
631
631
|
var Ds = {};
|
|
632
|
-
Ds.NODE_ENV === "production" ?
|
|
633
|
-
var Je =
|
|
632
|
+
Ds.NODE_ENV === "production" ? jt.exports = Rs() : jt.exports = $s();
|
|
633
|
+
var Je = jt.exports;
|
|
634
634
|
function F(t) {
|
|
635
635
|
if (typeof t == "number")
|
|
636
636
|
return (Math.abs(t * 2654435761) >>> 0).toString(16);
|
|
@@ -673,14 +673,14 @@ const D = {
|
|
|
673
673
|
Remove: "remove",
|
|
674
674
|
Replace: "replace",
|
|
675
675
|
Add: "add"
|
|
676
|
-
},
|
|
676
|
+
}, _r = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), xs = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), tt = Symbol.iterator, J = {
|
|
677
677
|
mutable: "mutable",
|
|
678
678
|
immutable: "immutable"
|
|
679
|
-
},
|
|
679
|
+
}, Jt = {};
|
|
680
680
|
function Le(t, e) {
|
|
681
681
|
return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function Dn(t, e) {
|
|
684
684
|
if (e in t) {
|
|
685
685
|
let n = Reflect.getPrototypeOf(t);
|
|
686
686
|
for (; n; ) {
|
|
@@ -691,10 +691,10 @@ function xn(t, e) {
|
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Yt(t) {
|
|
695
695
|
return Object.getPrototypeOf(t) === Set.prototype;
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Zt(t) {
|
|
698
698
|
return Object.getPrototypeOf(t) === Map.prototype;
|
|
699
699
|
}
|
|
700
700
|
function H(t) {
|
|
@@ -705,9 +705,9 @@ function _e(t) {
|
|
|
705
705
|
return !!P(t);
|
|
706
706
|
}
|
|
707
707
|
function P(t) {
|
|
708
|
-
return typeof t != "object" ? null : t == null ? void 0 : t[
|
|
708
|
+
return typeof t != "object" ? null : t == null ? void 0 : t[_r];
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Xt(t) {
|
|
711
711
|
var e;
|
|
712
712
|
const n = P(t);
|
|
713
713
|
return n ? (e = n.copy) !== null && e !== void 0 ? e : n.original : t;
|
|
@@ -718,7 +718,7 @@ function te(t, e) {
|
|
|
718
718
|
let n;
|
|
719
719
|
return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((n = e.mark(t, J)) === J.immutable || typeof n == "function");
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function gr(t, e = []) {
|
|
722
722
|
if (Object.hasOwnProperty.call(t, "key")) {
|
|
723
723
|
const n = t.parent.copy, r = P(ce(n, t.key));
|
|
724
724
|
if (r !== null && (r == null ? void 0 : r.original) !== t.original)
|
|
@@ -729,7 +729,7 @@ function Tr(t, e = []) {
|
|
|
729
729
|
e.push(i);
|
|
730
730
|
}
|
|
731
731
|
if (t.parent)
|
|
732
|
-
return
|
|
732
|
+
return gr(t.parent, e);
|
|
733
733
|
e.reverse();
|
|
734
734
|
try {
|
|
735
735
|
Us(t.copy, e);
|
|
@@ -747,14 +747,14 @@ function ce(t, e) {
|
|
|
747
747
|
function ze(t, e, n) {
|
|
748
748
|
ge(t) === 2 ? t.set(e, n) : t[e] = n;
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function St(t, e) {
|
|
751
751
|
const n = P(t);
|
|
752
752
|
return (n ? H(n) : t)[e];
|
|
753
753
|
}
|
|
754
754
|
function ae(t, e) {
|
|
755
755
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Rt(t) {
|
|
758
758
|
if (t)
|
|
759
759
|
for (; t.finalities.revoke.length > 0; )
|
|
760
760
|
t.finalities.revoke.pop()();
|
|
@@ -790,18 +790,18 @@ function Ls(t) {
|
|
|
790
790
|
}), e;
|
|
791
791
|
}
|
|
792
792
|
const Fs = Object.prototype.propertyIsEnumerable;
|
|
793
|
-
function
|
|
793
|
+
function Tr(t, e) {
|
|
794
794
|
let n;
|
|
795
795
|
if (Array.isArray(t))
|
|
796
796
|
return Array.prototype.concat.call(t);
|
|
797
797
|
if (t instanceof Set) {
|
|
798
|
-
if (!
|
|
798
|
+
if (!Yt(t)) {
|
|
799
799
|
const r = Object.getPrototypeOf(t).constructor;
|
|
800
800
|
return new r(t.values());
|
|
801
801
|
}
|
|
802
802
|
return Set.prototype.difference ? Set.prototype.difference.call(t, /* @__PURE__ */ new Set()) : new Set(t.values());
|
|
803
803
|
} else if (t instanceof Map) {
|
|
804
|
-
if (!
|
|
804
|
+
if (!Zt(t)) {
|
|
805
805
|
const r = Object.getPrototypeOf(t).constructor;
|
|
806
806
|
return new r(t);
|
|
807
807
|
}
|
|
@@ -826,11 +826,11 @@ function wr(t, e) {
|
|
|
826
826
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
827
827
|
}
|
|
828
828
|
function V(t) {
|
|
829
|
-
t.copy || (t.copy =
|
|
829
|
+
t.copy || (t.copy = Tr(t.original, t.options));
|
|
830
830
|
}
|
|
831
831
|
function $e(t) {
|
|
832
832
|
if (!te(t))
|
|
833
|
-
return
|
|
833
|
+
return Xt(t);
|
|
834
834
|
if (Array.isArray(t))
|
|
835
835
|
return t.map($e);
|
|
836
836
|
if (t instanceof Map) {
|
|
@@ -838,7 +838,7 @@ function $e(t) {
|
|
|
838
838
|
r,
|
|
839
839
|
$e(s)
|
|
840
840
|
]);
|
|
841
|
-
if (!
|
|
841
|
+
if (!Zt(t)) {
|
|
842
842
|
const r = Object.getPrototypeOf(t).constructor;
|
|
843
843
|
return new r(n);
|
|
844
844
|
}
|
|
@@ -846,7 +846,7 @@ function $e(t) {
|
|
|
846
846
|
}
|
|
847
847
|
if (t instanceof Set) {
|
|
848
848
|
const n = Array.from(t).map($e);
|
|
849
|
-
if (!
|
|
849
|
+
if (!Yt(t)) {
|
|
850
850
|
const r = Object.getPrototypeOf(t).constructor;
|
|
851
851
|
return new r(n);
|
|
852
852
|
}
|
|
@@ -864,7 +864,7 @@ function se(t) {
|
|
|
864
864
|
var e;
|
|
865
865
|
t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && se(t.parent));
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function xn() {
|
|
868
868
|
throw new Error("Cannot modify frozen object");
|
|
869
869
|
}
|
|
870
870
|
function Se(t, e, n, r, s) {
|
|
@@ -892,12 +892,12 @@ function Se(t, e, n, r, s) {
|
|
|
892
892
|
case 2:
|
|
893
893
|
for (const [a, c] of t)
|
|
894
894
|
Se(a, a, n, r, s), Se(c, a, n, r, s);
|
|
895
|
-
t.set = t.clear = t.delete =
|
|
895
|
+
t.set = t.clear = t.delete = xn;
|
|
896
896
|
break;
|
|
897
897
|
case 3:
|
|
898
898
|
for (const a of t)
|
|
899
899
|
Se(a, a, n, r, s);
|
|
900
|
-
t.add = t.clear = t.delete =
|
|
900
|
+
t.add = t.clear = t.delete = xn;
|
|
901
901
|
break;
|
|
902
902
|
case 1:
|
|
903
903
|
Object.freeze(t);
|
|
@@ -913,7 +913,7 @@ function Se(t, e, n, r, s) {
|
|
|
913
913
|
}
|
|
914
914
|
r.pop(), s.pop();
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function en(t, e) {
|
|
917
917
|
const n = ge(t);
|
|
918
918
|
if (n === 0)
|
|
919
919
|
Reflect.ownKeys(t).forEach((r) => {
|
|
@@ -926,11 +926,11 @@ function tn(t, e) {
|
|
|
926
926
|
} else
|
|
927
927
|
t.forEach((r, s) => e(s, r, t));
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function wr(t, e, n) {
|
|
930
930
|
if (_e(t) || !te(t, n) || e.has(t) || Object.isFrozen(t))
|
|
931
931
|
return;
|
|
932
932
|
const r = t instanceof Set, s = r ? /* @__PURE__ */ new Map() : void 0;
|
|
933
|
-
if (e.add(t),
|
|
933
|
+
if (e.add(t), en(t, (i, o) => {
|
|
934
934
|
var a;
|
|
935
935
|
if (_e(o)) {
|
|
936
936
|
const c = P(o);
|
|
@@ -938,7 +938,7 @@ function mr(t, e, n) {
|
|
|
938
938
|
const u = !((a = c.assignedMap) === null || a === void 0) && a.size || c.operated ? c.copy : c.original;
|
|
939
939
|
ze(r ? s : t, i, u);
|
|
940
940
|
} else
|
|
941
|
-
|
|
941
|
+
wr(o, e, n);
|
|
942
942
|
}), s) {
|
|
943
943
|
const i = t, o = Array.from(i);
|
|
944
944
|
i.clear(), o.forEach((a) => {
|
|
@@ -948,30 +948,30 @@ function mr(t, e, n) {
|
|
|
948
948
|
}
|
|
949
949
|
function Ns(t, e) {
|
|
950
950
|
const n = t.type === 3 ? t.setMap : t.copy;
|
|
951
|
-
t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n &&
|
|
951
|
+
t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && wr(ce(n, e), t.finalities.handledSet, t.options);
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function $t(t) {
|
|
954
954
|
t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
|
|
955
|
-
t.copy.add(
|
|
955
|
+
t.copy.add(Xt(e));
|
|
956
956
|
}));
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Dt(t, e, n, r) {
|
|
959
959
|
if (t.operated && t.assignedMap && t.assignedMap.size > 0 && !t.finalized) {
|
|
960
960
|
if (n && r) {
|
|
961
|
-
const i =
|
|
961
|
+
const i = gr(t);
|
|
962
962
|
i && e(t, i, n, r);
|
|
963
963
|
}
|
|
964
964
|
t.finalized = !0;
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function tn(t, e, n, r) {
|
|
968
968
|
const s = P(n);
|
|
969
969
|
s && (s.callbacks || (s.callbacks = []), s.callbacks.push((i, o) => {
|
|
970
970
|
var a;
|
|
971
971
|
const c = t.type === 3 ? t.setMap : t.copy;
|
|
972
972
|
if (ae(ce(c, e), n)) {
|
|
973
973
|
let u = s.original;
|
|
974
|
-
s.copy && (u = s.copy),
|
|
974
|
+
s.copy && (u = s.copy), $t(t), Dt(t, r, i, o), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(u, s.original)), ze(c, e, u);
|
|
975
975
|
}
|
|
976
976
|
}), t.options.enableAutoFreeze && s.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), te(n, t.options) && t.finalities.draft.push(() => {
|
|
977
977
|
const i = t.type === 3 ? t.setMap : t.copy;
|
|
@@ -1077,10 +1077,10 @@ function qe(t, e, n, r) {
|
|
|
1077
1077
|
return zs(t, e, n, r, s);
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
const
|
|
1080
|
+
const st = (t, e, n = !1) => {
|
|
1081
1081
|
if (typeof t == "object" && t !== null && (!te(t, e) || n))
|
|
1082
1082
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
1083
|
-
},
|
|
1083
|
+
}, xt = {
|
|
1084
1084
|
get size() {
|
|
1085
1085
|
return H(P(this)).size;
|
|
1086
1086
|
},
|
|
@@ -1089,7 +1089,7 @@ const it = (t, e, n = !1) => {
|
|
|
1089
1089
|
},
|
|
1090
1090
|
set(t, e) {
|
|
1091
1091
|
const n = P(this), r = H(n);
|
|
1092
|
-
return (!r.has(t) || !ae(r.get(t), e)) && (V(n), se(n), n.assignedMap.set(t, !0), n.copy.set(t, e),
|
|
1092
|
+
return (!r.has(t) || !ae(r.get(t), e)) && (V(n), se(n), n.assignedMap.set(t, !0), n.copy.set(t, e), tn(n, t, e, qe)), this;
|
|
1093
1093
|
},
|
|
1094
1094
|
delete(t) {
|
|
1095
1095
|
if (!this.has(t))
|
|
@@ -1115,9 +1115,9 @@ const it = (t, e, n = !1) => {
|
|
|
1115
1115
|
get(t) {
|
|
1116
1116
|
var e, n;
|
|
1117
1117
|
const r = P(this), s = H(r).get(t), i = ((n = (e = r.options).mark) === null || n === void 0 ? void 0 : n.call(e, s, J)) === J.mutable;
|
|
1118
|
-
if (r.options.strict &&
|
|
1118
|
+
if (r.options.strict && st(s, r.options, i), i || r.finalized || !te(s, r.options) || s !== r.original.get(t))
|
|
1119
1119
|
return s;
|
|
1120
|
-
const o =
|
|
1120
|
+
const o = Jt.createDraft({
|
|
1121
1121
|
original: s,
|
|
1122
1122
|
parentDraft: r,
|
|
1123
1123
|
key: t,
|
|
@@ -1161,7 +1161,7 @@ const it = (t, e, n = !1) => {
|
|
|
1161
1161
|
[tt]() {
|
|
1162
1162
|
return this.entries();
|
|
1163
1163
|
}
|
|
1164
|
-
}, Vs = Reflect.ownKeys(
|
|
1164
|
+
}, Vs = Reflect.ownKeys(xt), Un = (t, e, { isValuesIterator: n }) => () => {
|
|
1165
1165
|
var r, s;
|
|
1166
1166
|
const i = e.next();
|
|
1167
1167
|
if (i.done)
|
|
@@ -1169,8 +1169,8 @@ const it = (t, e, n = !1) => {
|
|
|
1169
1169
|
const o = i.value;
|
|
1170
1170
|
let a = t.setMap.get(o);
|
|
1171
1171
|
const c = P(a), u = ((s = (r = t.options).mark) === null || s === void 0 ? void 0 : s.call(r, a, J)) === J.mutable;
|
|
1172
|
-
if (t.options.strict &&
|
|
1173
|
-
const l =
|
|
1172
|
+
if (t.options.strict && st(o, t.options, u), !u && !c && te(o, t.options) && !t.finalized && t.original.has(o)) {
|
|
1173
|
+
const l = Jt.createDraft({
|
|
1174
1174
|
original: o,
|
|
1175
1175
|
parentDraft: t,
|
|
1176
1176
|
key: o,
|
|
@@ -1183,7 +1183,7 @@ const it = (t, e, n = !1) => {
|
|
|
1183
1183
|
done: !1,
|
|
1184
1184
|
value: n ? a : [a, a]
|
|
1185
1185
|
};
|
|
1186
|
-
},
|
|
1186
|
+
}, it = {
|
|
1187
1187
|
get size() {
|
|
1188
1188
|
return P(this).setMap.size;
|
|
1189
1189
|
},
|
|
@@ -1197,7 +1197,7 @@ const it = (t, e, n = !1) => {
|
|
|
1197
1197
|
},
|
|
1198
1198
|
add(t) {
|
|
1199
1199
|
const e = P(this);
|
|
1200
|
-
return this.has(t) || (V(e), se(e), e.assignedMap.set(t, !0), e.setMap.set(t, t),
|
|
1200
|
+
return this.has(t) || (V(e), se(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), tn(e, t, t, qe)), this;
|
|
1201
1201
|
},
|
|
1202
1202
|
delete(t) {
|
|
1203
1203
|
if (!this.has(t))
|
|
@@ -1222,7 +1222,7 @@ const it = (t, e, n = !1) => {
|
|
|
1222
1222
|
const e = t.setMap.keys();
|
|
1223
1223
|
return {
|
|
1224
1224
|
[Symbol.iterator]: () => this.values(),
|
|
1225
|
-
next:
|
|
1225
|
+
next: Un(t, e, { isValuesIterator: !0 })
|
|
1226
1226
|
};
|
|
1227
1227
|
},
|
|
1228
1228
|
entries() {
|
|
@@ -1231,7 +1231,7 @@ const it = (t, e, n = !1) => {
|
|
|
1231
1231
|
const e = t.setMap.keys();
|
|
1232
1232
|
return {
|
|
1233
1233
|
[Symbol.iterator]: () => this.entries(),
|
|
1234
|
-
next:
|
|
1234
|
+
next: Un(t, e, {
|
|
1235
1235
|
isValuesIterator: !1
|
|
1236
1236
|
})
|
|
1237
1237
|
};
|
|
@@ -1249,7 +1249,7 @@ const it = (t, e, n = !1) => {
|
|
|
1249
1249
|
t.call(e, r.value, r.value, this), r = n.next();
|
|
1250
1250
|
}
|
|
1251
1251
|
};
|
|
1252
|
-
Set.prototype.difference && Object.assign(
|
|
1252
|
+
Set.prototype.difference && Object.assign(it, {
|
|
1253
1253
|
intersection(t) {
|
|
1254
1254
|
return Set.prototype.intersection.call(new Set(this.values()), t);
|
|
1255
1255
|
},
|
|
@@ -1272,47 +1272,47 @@ Set.prototype.difference && Object.assign(ot, {
|
|
|
1272
1272
|
return Set.prototype.isDisjointFrom.call(new Set(this.values()), t);
|
|
1273
1273
|
}
|
|
1274
1274
|
});
|
|
1275
|
-
const Ws = Reflect.ownKeys(
|
|
1275
|
+
const Ws = Reflect.ownKeys(it), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
1276
1276
|
get(t, e, n) {
|
|
1277
1277
|
var r, s;
|
|
1278
1278
|
const i = (r = t.copy) === null || r === void 0 ? void 0 : r[e];
|
|
1279
|
-
if (i &&
|
|
1279
|
+
if (i && mr.has(i))
|
|
1280
1280
|
return i;
|
|
1281
|
-
if (e ===
|
|
1281
|
+
if (e === _r)
|
|
1282
1282
|
return t;
|
|
1283
1283
|
let o;
|
|
1284
1284
|
if (t.options.mark) {
|
|
1285
1285
|
const u = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e, n);
|
|
1286
1286
|
if (o = t.options.mark(u, J), o === J.mutable)
|
|
1287
|
-
return t.options.strict &&
|
|
1287
|
+
return t.options.strict && st(u, t.options, !0), u;
|
|
1288
1288
|
}
|
|
1289
1289
|
const a = H(t);
|
|
1290
1290
|
if (a instanceof Map && Vs.includes(e)) {
|
|
1291
1291
|
if (e === "size")
|
|
1292
|
-
return Object.getOwnPropertyDescriptor(
|
|
1293
|
-
const u =
|
|
1292
|
+
return Object.getOwnPropertyDescriptor(xt, "size").get.call(t.proxy);
|
|
1293
|
+
const u = xt[e];
|
|
1294
1294
|
if (u)
|
|
1295
1295
|
return u.bind(t.proxy);
|
|
1296
1296
|
}
|
|
1297
1297
|
if (a instanceof Set && Ws.includes(e)) {
|
|
1298
1298
|
if (e === "size")
|
|
1299
|
-
return Object.getOwnPropertyDescriptor(
|
|
1300
|
-
const u =
|
|
1299
|
+
return Object.getOwnPropertyDescriptor(it, "size").get.call(t.proxy);
|
|
1300
|
+
const u = it[e];
|
|
1301
1301
|
if (u)
|
|
1302
1302
|
return u.bind(t.proxy);
|
|
1303
1303
|
}
|
|
1304
1304
|
if (!Le(a, e)) {
|
|
1305
|
-
const u =
|
|
1305
|
+
const u = Dn(a, e);
|
|
1306
1306
|
return u ? "value" in u ? u.value : (
|
|
1307
1307
|
// !case: support for getter
|
|
1308
1308
|
(s = u.get) === null || s === void 0 ? void 0 : s.call(t.proxy)
|
|
1309
1309
|
) : void 0;
|
|
1310
1310
|
}
|
|
1311
1311
|
const c = a[e];
|
|
1312
|
-
if (t.options.strict &&
|
|
1312
|
+
if (t.options.strict && st(c, t.options), t.finalized || !te(c, t.options))
|
|
1313
1313
|
return c;
|
|
1314
|
-
if (c ===
|
|
1315
|
-
if (V(t), t.copy[e] =
|
|
1314
|
+
if (c === St(t.original, e)) {
|
|
1315
|
+
if (V(t), t.copy[e] = nn({
|
|
1316
1316
|
original: t.original[e],
|
|
1317
1317
|
parentDraft: t,
|
|
1318
1318
|
key: t.type === 1 ? Number(e) : e,
|
|
@@ -1333,11 +1333,11 @@ const Ws = Reflect.ownKeys(ot), Sr = /* @__PURE__ */ new WeakSet(), vr = {
|
|
|
1333
1333
|
let s;
|
|
1334
1334
|
if (t.type === 1 && e !== "length" && !(Number.isInteger(s = Number(e)) && s >= 0 && (e === 0 || s === 0 || String(s) === String(e))))
|
|
1335
1335
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
1336
|
-
const i =
|
|
1336
|
+
const i = Dn(H(t), e);
|
|
1337
1337
|
if (i != null && i.set)
|
|
1338
1338
|
return i.set.call(t.proxy, n), !0;
|
|
1339
|
-
const o =
|
|
1340
|
-
return a && ae(a.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (ae(n, o) && (n !== void 0 || Le(t.original, e)) || (V(t), se(t), Le(t.original, e) && ae(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n,
|
|
1339
|
+
const o = St(H(t), e), a = P(o);
|
|
1340
|
+
return a && ae(a.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (ae(n, o) && (n !== void 0 || Le(t.original, e)) || (V(t), se(t), Le(t.original, e) && ae(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, tn(t, e, n, qe)), !0);
|
|
1341
1341
|
},
|
|
1342
1342
|
has(t, e) {
|
|
1343
1343
|
return e in H(t);
|
|
@@ -1365,10 +1365,10 @@ const Ws = Reflect.ownKeys(ot), Sr = /* @__PURE__ */ new WeakSet(), vr = {
|
|
|
1365
1365
|
},
|
|
1366
1366
|
deleteProperty(t, e) {
|
|
1367
1367
|
var n;
|
|
1368
|
-
return t.type === 1 ?
|
|
1368
|
+
return t.type === 1 ? Sr.set.call(this, t, e, void 0, t.proxy) : (St(t.original, e) !== void 0 || e in t.original ? (V(t), se(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
|
|
1369
1369
|
}
|
|
1370
1370
|
};
|
|
1371
|
-
function
|
|
1371
|
+
function nn(t) {
|
|
1372
1372
|
const { original: e, parentDraft: n, key: r, finalities: s, options: i } = t, o = ge(e), a = {
|
|
1373
1373
|
type: o,
|
|
1374
1374
|
finalized: !1,
|
|
@@ -1382,8 +1382,8 @@ function rn(t) {
|
|
|
1382
1382
|
setMap: o === 3 ? new Map(e.entries()) : void 0
|
|
1383
1383
|
};
|
|
1384
1384
|
(r || "key" in t) && (a.key = r);
|
|
1385
|
-
const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a,
|
|
1386
|
-
if (s.revoke.push(u),
|
|
1385
|
+
const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a, Sr);
|
|
1386
|
+
if (s.revoke.push(u), mr.add(c), a.proxy = c, n) {
|
|
1387
1387
|
const l = n;
|
|
1388
1388
|
l.finalities.draft.push((d, h) => {
|
|
1389
1389
|
var y, b;
|
|
@@ -1392,7 +1392,7 @@ function rn(t) {
|
|
|
1392
1392
|
const m = ce(w, r), T = P(m);
|
|
1393
1393
|
if (T) {
|
|
1394
1394
|
let v = T.original;
|
|
1395
|
-
T.operated && (v =
|
|
1395
|
+
T.operated && (v = Xt(m)), $t(T), Dt(T, qe, d, h), l.options.enableAutoFreeze && (l.options.updatedValues = (y = l.options.updatedValues) !== null && y !== void 0 ? y : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(v, T.original)), ze(w, r, v);
|
|
1396
1396
|
}
|
|
1397
1397
|
(b = g.callbacks) === null || b === void 0 || b.forEach((v) => {
|
|
1398
1398
|
v(d, h);
|
|
@@ -1401,12 +1401,12 @@ function rn(t) {
|
|
|
1401
1401
|
} else {
|
|
1402
1402
|
const l = P(c);
|
|
1403
1403
|
l.finalities.draft.push((d, h) => {
|
|
1404
|
-
|
|
1404
|
+
$t(l), Dt(l, qe, d, h);
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
1407
1407
|
return c;
|
|
1408
1408
|
}
|
|
1409
|
-
|
|
1409
|
+
Jt.createDraft = nn;
|
|
1410
1410
|
function Qs(t, e, n, r, s) {
|
|
1411
1411
|
var i;
|
|
1412
1412
|
const o = P(t), a = (i = o == null ? void 0 : o.original) !== null && i !== void 0 ? i : t, c = !!e.length;
|
|
@@ -1414,7 +1414,7 @@ function Qs(t, e, n, r, s) {
|
|
|
1414
1414
|
for (; o.finalities.draft.length > 0; )
|
|
1415
1415
|
o.finalities.draft.pop()(n, r);
|
|
1416
1416
|
const u = c ? e[0] : o ? o.operated ? o.copy : o.original : t;
|
|
1417
|
-
return o &&
|
|
1417
|
+
return o && Rt(o), s && Se(u, u, o == null ? void 0 : o.options.updatedValues), [
|
|
1418
1418
|
u,
|
|
1419
1419
|
n && c ? [{ op: D.Replace, path: [], value: e[0] }] : n,
|
|
1420
1420
|
r && c ? [{ op: D.Replace, path: [], value: a }] : r
|
|
@@ -1429,7 +1429,7 @@ function Bs(t, e) {
|
|
|
1429
1429
|
};
|
|
1430
1430
|
let s, i;
|
|
1431
1431
|
e.enablePatches && (s = [], i = []);
|
|
1432
|
-
const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, J)) === J.mutable || !te(t, e) ? t :
|
|
1432
|
+
const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, J)) === J.mutable || !te(t, e) ? t : nn({
|
|
1433
1433
|
original: t,
|
|
1434
1434
|
parentDraft: null,
|
|
1435
1435
|
finalities: r,
|
|
@@ -1443,9 +1443,9 @@ function Bs(t, e) {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
];
|
|
1445
1445
|
}
|
|
1446
|
-
function
|
|
1446
|
+
function Ut(t) {
|
|
1447
1447
|
const { rootDraft: e, value: n, useRawReturn: r = !1, isRoot: s = !0 } = t;
|
|
1448
|
-
|
|
1448
|
+
en(n, (i, o, a) => {
|
|
1449
1449
|
const c = P(o);
|
|
1450
1450
|
if (c && e && c.finalities === e.finalities) {
|
|
1451
1451
|
t.isContainDraft = !0;
|
|
@@ -1455,10 +1455,10 @@ function Lt(t) {
|
|
|
1455
1455
|
a.clear(), l.forEach((d) => a.add(i === d ? u : d));
|
|
1456
1456
|
} else
|
|
1457
1457
|
ze(a, i, u);
|
|
1458
|
-
} else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1,
|
|
1458
|
+
} else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1, Ut(t));
|
|
1459
1459
|
}), s && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
1460
1460
|
}
|
|
1461
|
-
function
|
|
1461
|
+
function vr(t) {
|
|
1462
1462
|
var e;
|
|
1463
1463
|
const n = P(t);
|
|
1464
1464
|
if (!te(t, n == null ? void 0 : n.options))
|
|
@@ -1468,7 +1468,7 @@ function Ar(t) {
|
|
|
1468
1468
|
return n.original;
|
|
1469
1469
|
let s;
|
|
1470
1470
|
function i() {
|
|
1471
|
-
s = r === 2 ?
|
|
1471
|
+
s = r === 2 ? Zt(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : Tr(t, n == null ? void 0 : n.options);
|
|
1472
1472
|
}
|
|
1473
1473
|
if (n) {
|
|
1474
1474
|
n.finalized = !0;
|
|
@@ -1479,21 +1479,21 @@ function Ar(t) {
|
|
|
1479
1479
|
}
|
|
1480
1480
|
} else
|
|
1481
1481
|
s = t;
|
|
1482
|
-
if (
|
|
1482
|
+
if (en(s, (o, a) => {
|
|
1483
1483
|
if (n && ae(ce(n.original, o), a))
|
|
1484
1484
|
return;
|
|
1485
|
-
const c =
|
|
1485
|
+
const c = vr(a);
|
|
1486
1486
|
c !== a && (s === t && i(), ze(s, o, c));
|
|
1487
1487
|
}), r === 3) {
|
|
1488
1488
|
const o = (e = n == null ? void 0 : n.original) !== null && e !== void 0 ? e : s;
|
|
1489
|
-
return
|
|
1489
|
+
return Yt(o) ? new Set(s) : new (Object.getPrototypeOf(o)).constructor(s);
|
|
1490
1490
|
}
|
|
1491
1491
|
return s;
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function Ln(t) {
|
|
1494
1494
|
if (!_e(t))
|
|
1495
1495
|
throw new Error(`current() is only used for Draft, parameter: ${t}`);
|
|
1496
|
-
return
|
|
1496
|
+
return vr(t);
|
|
1497
1497
|
}
|
|
1498
1498
|
const Gs = (t) => function e(n, r, s) {
|
|
1499
1499
|
var i, o, a;
|
|
@@ -1506,7 +1506,7 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1506
1506
|
if (typeof r != "function" && (l = r), l !== void 0 && Object.prototype.toString.call(l) !== "[object Object]")
|
|
1507
1507
|
throw new Error(`Invalid options: ${l}, 'options' should be an object.`);
|
|
1508
1508
|
l = Object.assign(Object.assign({}, t), l);
|
|
1509
|
-
const d = _e(c) ?
|
|
1509
|
+
const d = _e(c) ? Ln(c) : c, h = Array.isArray(l.mark) ? (A, j) => {
|
|
1510
1510
|
for (const L of l.mark) {
|
|
1511
1511
|
if (typeof L != "function")
|
|
1512
1512
|
throw new Error(`Invalid mark: ${L}, 'mark' should be a function.`);
|
|
@@ -1532,7 +1532,7 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1532
1532
|
try {
|
|
1533
1533
|
v = u(m);
|
|
1534
1534
|
} catch (A) {
|
|
1535
|
-
throw
|
|
1535
|
+
throw Rt(P(m)), A;
|
|
1536
1536
|
}
|
|
1537
1537
|
const E = (A) => {
|
|
1538
1538
|
const j = P(m);
|
|
@@ -1542,14 +1542,14 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1542
1542
|
const q = A == null ? void 0 : A[xs];
|
|
1543
1543
|
if (q) {
|
|
1544
1544
|
const Pe = q[0];
|
|
1545
|
-
return w.strict && typeof A == "object" && A !== null &&
|
|
1545
|
+
return w.strict && typeof A == "object" && A !== null && Ut({
|
|
1546
1546
|
rootDraft: j,
|
|
1547
1547
|
value: A,
|
|
1548
1548
|
useRawReturn: !0
|
|
1549
1549
|
}), T([Pe]);
|
|
1550
1550
|
}
|
|
1551
1551
|
if (A !== void 0)
|
|
1552
|
-
return typeof A == "object" && A !== null &&
|
|
1552
|
+
return typeof A == "object" && A !== null && Ut({ rootDraft: j, value: A }), T([A]);
|
|
1553
1553
|
}
|
|
1554
1554
|
if (A === m || A === void 0)
|
|
1555
1555
|
return T([]);
|
|
@@ -1557,26 +1557,26 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1557
1557
|
if (w === L.options) {
|
|
1558
1558
|
if (L.operated)
|
|
1559
1559
|
throw new Error("Cannot return a modified child draft.");
|
|
1560
|
-
return T([
|
|
1560
|
+
return T([Ln(A)]);
|
|
1561
1561
|
}
|
|
1562
1562
|
return T([A]);
|
|
1563
1563
|
};
|
|
1564
1564
|
return v instanceof Promise ? v.then(E, (A) => {
|
|
1565
|
-
throw
|
|
1565
|
+
throw Rt(P(m)), A;
|
|
1566
1566
|
}) : E(v);
|
|
1567
|
-
},
|
|
1567
|
+
}, ot = Gs();
|
|
1568
1568
|
Object.prototype.constructor.toString();
|
|
1569
|
-
function
|
|
1569
|
+
function Ar(t, e) {
|
|
1570
1570
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1571
1571
|
return n.length === r.length && Object.keys(t).every((s) => e.hasOwnProperty(s));
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function Fn(t, e) {
|
|
1574
1574
|
return Object.keys(t).length === Object.keys(e).length && Object.keys(t).every((n) => e.hasOwnProperty(n) && t[n] === e[n]);
|
|
1575
1575
|
}
|
|
1576
1576
|
function rt(t, e) {
|
|
1577
|
-
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e :
|
|
1577
|
+
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : Ar(t, e) ? Object.keys(t).every((n) => rt(t[n], e[n])) : !1;
|
|
1578
1578
|
}
|
|
1579
|
-
function
|
|
1579
|
+
function rn(t) {
|
|
1580
1580
|
if (!De(t))
|
|
1581
1581
|
return t;
|
|
1582
1582
|
const e = {};
|
|
@@ -1584,7 +1584,7 @@ function sn(t) {
|
|
|
1584
1584
|
r !== void 0 && (e[n] = r);
|
|
1585
1585
|
return e;
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1587
|
+
function Or(t, e) {
|
|
1588
1588
|
if (!De(t) || !De(e))
|
|
1589
1589
|
return e;
|
|
1590
1590
|
const n = { ...t };
|
|
@@ -1596,7 +1596,7 @@ function Er(t, e) {
|
|
|
1596
1596
|
continue;
|
|
1597
1597
|
}
|
|
1598
1598
|
const s = De(t[r]) && De(e[r]);
|
|
1599
|
-
n[r] = s ?
|
|
1599
|
+
n[r] = s ? Or(t[r], e[r]) : e[r];
|
|
1600
1600
|
}
|
|
1601
1601
|
return n;
|
|
1602
1602
|
}
|
|
@@ -1614,7 +1614,7 @@ function Hs(t, e, n) {
|
|
|
1614
1614
|
const s = e[e.length - 1];
|
|
1615
1615
|
Array.isArray(r) && typeof s == "number" ? r.splice(s, 0, n) : r[s] = n;
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function Nn(t, e, n) {
|
|
1618
1618
|
if (!t || e.length === 0)
|
|
1619
1619
|
return;
|
|
1620
1620
|
let r = t || {};
|
|
@@ -1624,7 +1624,7 @@ function Kn(t, e, n) {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
r[e[e.length - 1]] = n;
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function Er(t, e) {
|
|
1628
1628
|
if (!t || e.length === 0)
|
|
1629
1629
|
return;
|
|
1630
1630
|
const [n, ...r] = e;
|
|
@@ -1633,13 +1633,13 @@ function kr(t, e) {
|
|
|
1633
1633
|
Array.isArray(t) ? t.splice(n, 1) : delete t[n];
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
|
-
|
|
1636
|
+
Er(t[n], r), Js(t[n]) && delete t[n];
|
|
1637
1637
|
}
|
|
1638
1638
|
}
|
|
1639
1639
|
function Js(t) {
|
|
1640
1640
|
return t && Object.keys(t).length === 0;
|
|
1641
1641
|
}
|
|
1642
|
-
const
|
|
1642
|
+
const Kn = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|WAST|WAKT|WADT|VUT|VOLT|VLAT|VLAST|VET|UZT|UZST|UYT|UYST|UTC|UT|ULAT|ULAST|UCT|TVT|TRUT|TOT|TMT|TKT|TJT|TFT|TAHT|SGT|SCT|SAST|SADT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PKST|PHT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZT|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|MYT|MVT|MUT|MUST|MST|MSK|MSD|MPT|MMT|MHT|MEZ|METDST|MET|MESZ|MEST|MDT|MAWT|MART|MAGT|MAGST|LKT|LINT|LIGT|LHST|LHDT|KST|KRAT|KRAST|KOST|KGT|KGST|KDT|JST|JAYT|IST|IRT|IRKT|IRKST|IOT|IDT|ICT|HST|HKT|GYT|GMT|GILT|GFT|GET|GEST|GAMT|GALT|FNT|FNST|FKT|FKST|FJT|FJST|FET|EST|EGT|EGST|EETDST|EET|EEST|EDT|EAT|EAST|EASST|DDUT|DAVT|CXT|CST|COT|CLT|CLST|CKT|CHUT|CHAST|CHADT|CETDST|CET|CEST|CDT|CCT|CAST|CADT|BTT|BST|BRT|BRST|BRA|BOT|BORT|BNT|BDT|BDST|AZT|AZST|AZOT|AZOST|AWST|AWSST|AST|ART|ARST|ANAT|ANAST|AMT|AMST|ALMT|ALMST|AKST|AKDT|AFT|AEST|AESST|AEDT|ADT|ACWST|ACT|ACST|ACSST|ACDT$/, Ys = {
|
|
1643
1643
|
ZULU: 0,
|
|
1644
1644
|
YEKT: 18e3,
|
|
1645
1645
|
YEKST: 21600,
|
|
@@ -1903,10 +1903,10 @@ function ui(t) {
|
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
function li(t) {
|
|
1906
|
-
const e = t.match(
|
|
1906
|
+
const e = t.match(Kn);
|
|
1907
1907
|
if (!e)
|
|
1908
1908
|
return null;
|
|
1909
|
-
const [n] = e, r = Ys[n], s = new Date(t.replace(
|
|
1909
|
+
const [n] = e, r = Ys[n], s = new Date(t.replace(Kn, "Z"));
|
|
1910
1910
|
return new Date(s.getTime() - r * 1e3);
|
|
1911
1911
|
}
|
|
1912
1912
|
const fi = [
|
|
@@ -1931,7 +1931,7 @@ function di(t, e) {
|
|
|
1931
1931
|
return null;
|
|
1932
1932
|
}
|
|
1933
1933
|
}
|
|
1934
|
-
function
|
|
1934
|
+
function Lt(t) {
|
|
1935
1935
|
for (const e of fi) {
|
|
1936
1936
|
const n = di(e, t);
|
|
1937
1937
|
if (n)
|
|
@@ -1942,19 +1942,19 @@ function Ft(t) {
|
|
|
1942
1942
|
function hi(t) {
|
|
1943
1943
|
try {
|
|
1944
1944
|
const e = JSON.parse(t);
|
|
1945
|
-
return typeof e == "string" ?
|
|
1945
|
+
return typeof e == "string" ? Lt(e) : null;
|
|
1946
1946
|
} catch {
|
|
1947
1947
|
return null;
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
|
-
function
|
|
1950
|
+
function ut(t) {
|
|
1951
1951
|
if (t !== void 0) {
|
|
1952
1952
|
if (t === null)
|
|
1953
1953
|
return null;
|
|
1954
1954
|
if (t instanceof Date)
|
|
1955
1955
|
return t;
|
|
1956
1956
|
if (typeof t == "string") {
|
|
1957
|
-
const e =
|
|
1957
|
+
const e = Lt(t) || hi(t) || Lt(t.trim());
|
|
1958
1958
|
if (!e)
|
|
1959
1959
|
throw new Error(`Unable to parse \`${t}\` as a date.`);
|
|
1960
1960
|
return e;
|
|
@@ -1994,7 +1994,7 @@ class ye {
|
|
|
1994
1994
|
return this._blobAttrs;
|
|
1995
1995
|
this._blobAttrs = /* @__PURE__ */ new Map();
|
|
1996
1996
|
for (const e of Object.values(this.attrs))
|
|
1997
|
-
if (
|
|
1997
|
+
if (on(e)) {
|
|
1998
1998
|
const [n, r, s] = e["forward-identity"];
|
|
1999
1999
|
Q(this.blobAttrs, [r, s], e);
|
|
2000
2000
|
}
|
|
@@ -2041,10 +2041,10 @@ class ye {
|
|
|
2041
2041
|
function pi(t) {
|
|
2042
2042
|
return t.cardinality === "one";
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function sn(t) {
|
|
2045
2045
|
return t["value-type"] === "ref";
|
|
2046
2046
|
}
|
|
2047
|
-
function
|
|
2047
|
+
function on(t) {
|
|
2048
2048
|
return t["value-type"] === "blob";
|
|
2049
2049
|
}
|
|
2050
2050
|
function ke(t, e) {
|
|
@@ -2070,7 +2070,7 @@ function Q(t, e, n) {
|
|
|
2070
2070
|
}
|
|
2071
2071
|
s > -1 && r.set(e[s], n);
|
|
2072
2072
|
}
|
|
2073
|
-
function
|
|
2073
|
+
function kr(t, e, n) {
|
|
2074
2074
|
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
2075
2075
|
for (const o of e) {
|
|
2076
2076
|
let [a, c, u] = o;
|
|
@@ -2079,11 +2079,11 @@ function Pr(t, e, n) {
|
|
|
2079
2079
|
console.warn("no such attr", c, a);
|
|
2080
2080
|
continue;
|
|
2081
2081
|
}
|
|
2082
|
-
l["checked-data-type"] === "date" && n && (u =
|
|
2082
|
+
l["checked-data-type"] === "date" && n && (u = ut(u), o[2] = u), sn(l) && Q(i, [u, c, a], o), Q(r, [a, c, u], o), Q(s, [c, a, u], o);
|
|
2083
2083
|
}
|
|
2084
2084
|
return { eav: r, aev: s, vae: i };
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2086
|
+
function Pr(t) {
|
|
2087
2087
|
return {
|
|
2088
2088
|
triples: B(t.eav, 3),
|
|
2089
2089
|
cardinalityInference: t.cardinalityInference,
|
|
@@ -2091,10 +2091,10 @@ function Cr(t) {
|
|
|
2091
2091
|
version: 1
|
|
2092
2092
|
};
|
|
2093
2093
|
}
|
|
2094
|
-
function
|
|
2094
|
+
function Cr(t, e) {
|
|
2095
2095
|
return xe(t, e.triples, e.cardinalityInference, e.useDateObjects);
|
|
2096
2096
|
}
|
|
2097
|
-
function
|
|
2097
|
+
function Ir(t, e) {
|
|
2098
2098
|
if (t)
|
|
2099
2099
|
return new ye(t.attrs, t.linkIndex);
|
|
2100
2100
|
if (e && "__type" in e)
|
|
@@ -2104,7 +2104,7 @@ function yi(t, e) {
|
|
|
2104
2104
|
return ke(t.eav, [e]) !== void 0;
|
|
2105
2105
|
}
|
|
2106
2106
|
function xe(t, e, n, r) {
|
|
2107
|
-
const s =
|
|
2107
|
+
const s = kr(t, e, r);
|
|
2108
2108
|
return s.cardinalityInference = n, s.useDateObjects = r, s;
|
|
2109
2109
|
}
|
|
2110
2110
|
function Ve(t, e) {
|
|
@@ -2134,21 +2134,21 @@ function Ve(t, e) {
|
|
|
2134
2134
|
return [n, ...a];
|
|
2135
2135
|
}
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function Mr(t, e, n) {
|
|
2138
2138
|
const r = Ve(t, n);
|
|
2139
2139
|
if (!r)
|
|
2140
2140
|
return;
|
|
2141
2141
|
const [s, i, o] = r, a = e.getAttr(i);
|
|
2142
|
-
a && (ee(t.eav, [s, i, o]), ee(t.aev, [i, s, o]),
|
|
2142
|
+
a && (ee(t.eav, [s, i, o]), ee(t.aev, [i, s, o]), sn(a) && ee(t.vae, [o, i, s]));
|
|
2143
2143
|
}
|
|
2144
2144
|
let bi = 0;
|
|
2145
|
-
function
|
|
2145
|
+
function jr(t, e, n) {
|
|
2146
2146
|
const [r, s, i] = n;
|
|
2147
2147
|
let o;
|
|
2148
2148
|
const a = ke(t.eav, [r, s, i]);
|
|
2149
2149
|
return a && (o = a[3]), o || Date.now() * 10 + bi++;
|
|
2150
2150
|
}
|
|
2151
|
-
function
|
|
2151
|
+
function Rr(t, e, n) {
|
|
2152
2152
|
const r = Ve(t, n);
|
|
2153
2153
|
if (!r)
|
|
2154
2154
|
return;
|
|
@@ -2156,9 +2156,9 @@ function $r(t, e, n) {
|
|
|
2156
2156
|
const a = e.getAttr(i);
|
|
2157
2157
|
if (!a)
|
|
2158
2158
|
return;
|
|
2159
|
-
a["checked-data-type"] === "date" && t.useDateObjects && (o =
|
|
2160
|
-
const c = ke(t.eav, [s, i, o]), u = (c == null ? void 0 : c[3]) ??
|
|
2161
|
-
pi(a) ? (Q(t.eav, [s, i], /* @__PURE__ */ new Map([[o, l]])), Q(t.aev, [i, s], /* @__PURE__ */ new Map([[o, l]]))) : (Q(t.eav, [s, i, o], l), Q(t.aev, [i, s, o], l)),
|
|
2159
|
+
a["checked-data-type"] === "date" && t.useDateObjects && (o = ut(o));
|
|
2160
|
+
const c = ke(t.eav, [s, i, o]), u = (c == null ? void 0 : c[3]) ?? jr(t, a, r), l = [s, i, o, u];
|
|
2161
|
+
pi(a) ? (Q(t.eav, [s, i], /* @__PURE__ */ new Map([[o, l]])), Q(t.aev, [i, s], /* @__PURE__ */ new Map([[o, l]]))) : (Q(t.eav, [s, i, o], l), Q(t.aev, [i, s, o], l)), sn(a) && Q(t.vae, [o, i, s], l);
|
|
2162
2162
|
}
|
|
2163
2163
|
function _i(t, e, n) {
|
|
2164
2164
|
var y;
|
|
@@ -2168,7 +2168,7 @@ function _i(t, e, n) {
|
|
|
2168
2168
|
const [s, i, o] = r, a = e.getAttr(i);
|
|
2169
2169
|
if (!a)
|
|
2170
2170
|
return;
|
|
2171
|
-
if (!
|
|
2171
|
+
if (!on(a))
|
|
2172
2172
|
throw new Error("merge operation is not supported for links");
|
|
2173
2173
|
const c = ke(t.eav, [s, i]);
|
|
2174
2174
|
if (!c)
|
|
@@ -2176,15 +2176,15 @@ function _i(t, e, n) {
|
|
|
2176
2176
|
const u = (y = c.values().next()) == null ? void 0 : y.value;
|
|
2177
2177
|
if (!u)
|
|
2178
2178
|
return;
|
|
2179
|
-
const l = u[2], d =
|
|
2179
|
+
const l = u[2], d = Or(l, o), h = [
|
|
2180
2180
|
s,
|
|
2181
2181
|
i,
|
|
2182
2182
|
d,
|
|
2183
|
-
|
|
2183
|
+
jr(t, a, u)
|
|
2184
2184
|
];
|
|
2185
2185
|
Q(t.eav, [s, i], /* @__PURE__ */ new Map([[d, h]])), Q(t.aev, [i, s], /* @__PURE__ */ new Map([[d, h]]));
|
|
2186
2186
|
}
|
|
2187
|
-
function
|
|
2187
|
+
function Ft(t, e, n) {
|
|
2188
2188
|
var u, l;
|
|
2189
2189
|
const [r, s] = n, i = Ve(t, [r]);
|
|
2190
2190
|
if (!i)
|
|
@@ -2195,7 +2195,7 @@ function Nt(t, e, n) {
|
|
|
2195
2195
|
const h = e.getAttr(d);
|
|
2196
2196
|
h && h["on-delete-reverse"] === "cascade" && B(a.get(d), 1).forEach(([y, b, g]) => {
|
|
2197
2197
|
var w;
|
|
2198
|
-
return
|
|
2198
|
+
return Ft(t, e, [g, (w = h["reverse-identity"]) == null ? void 0 : w[1]]);
|
|
2199
2199
|
}), // Fall back to deleting everything if we've rehydrated tx-steps from
|
|
2200
2200
|
// the store that didn't set `etype` in deleteEntity
|
|
2201
2201
|
(!s || // If we don't know about the attr, let's just get rid of it
|
|
@@ -2208,11 +2208,11 @@ function Nt(t, e, n) {
|
|
|
2208
2208
|
c && c.forEach((d) => {
|
|
2209
2209
|
var w, m, T;
|
|
2210
2210
|
const [h, y, b] = d, g = e.getAttr(y);
|
|
2211
|
-
(!s || !g || ((w = g["reverse-identity"]) == null ? void 0 : w[1]) === s) && (ee(t.eav, [h, y, b]), ee(t.aev, [y, h, b]), ee(t.vae, [b, y, h])), g && g["on-delete"] === "cascade" && ((m = g["reverse-identity"]) == null ? void 0 : m[1]) === s &&
|
|
2211
|
+
(!s || !g || ((w = g["reverse-identity"]) == null ? void 0 : w[1]) === s) && (ee(t.eav, [h, y, b]), ee(t.aev, [y, h, b]), ee(t.vae, [b, y, h])), g && g["on-delete"] === "cascade" && ((m = g["reverse-identity"]) == null ? void 0 : m[1]) === s && Ft(t, e, [h, (T = g["forward-identity"]) == null ? void 0 : T[1]]);
|
|
2212
2212
|
}), ((l = t.vae.get(o)) == null ? void 0 : l.size) === 0 && ee(t.vae, [o]);
|
|
2213
2213
|
}
|
|
2214
|
-
function
|
|
2215
|
-
const r =
|
|
2214
|
+
function $r(t, e, n) {
|
|
2215
|
+
const r = kr(e, n, t.useDateObjects);
|
|
2216
2216
|
Object.keys(r).forEach((s) => {
|
|
2217
2217
|
t[s] = r[s];
|
|
2218
2218
|
});
|
|
@@ -2220,32 +2220,32 @@ function Dr(t, e, n) {
|
|
|
2220
2220
|
function gi(t, [e]) {
|
|
2221
2221
|
t.addAttr(e);
|
|
2222
2222
|
}
|
|
2223
|
-
function
|
|
2223
|
+
function Dr(t) {
|
|
2224
2224
|
return B(t.eav, 3);
|
|
2225
2225
|
}
|
|
2226
2226
|
function Ti(t, e, [n]) {
|
|
2227
2227
|
if (!e.getAttr(n))
|
|
2228
2228
|
return;
|
|
2229
|
-
const r =
|
|
2230
|
-
e.deleteAttr(n),
|
|
2229
|
+
const r = Dr(t).filter(([s, i]) => i !== n);
|
|
2230
|
+
e.deleteAttr(n), $r(t, e, r);
|
|
2231
2231
|
}
|
|
2232
2232
|
function wi(t, e, [n]) {
|
|
2233
|
-
e.getAttr(n.id) && (e.updateAttr(n),
|
|
2233
|
+
e.getAttr(n.id) && (e.updateAttr(n), $r(t, e, Dr(t)));
|
|
2234
2234
|
}
|
|
2235
2235
|
function mi(t, e, n) {
|
|
2236
2236
|
const [r, ...s] = n;
|
|
2237
2237
|
switch (r) {
|
|
2238
2238
|
case "add-triple":
|
|
2239
|
-
|
|
2239
|
+
Rr(t, e, s);
|
|
2240
2240
|
break;
|
|
2241
2241
|
case "deep-merge-triple":
|
|
2242
2242
|
_i(t, e, s);
|
|
2243
2243
|
break;
|
|
2244
2244
|
case "retract-triple":
|
|
2245
|
-
|
|
2245
|
+
Mr(t, e, s);
|
|
2246
2246
|
break;
|
|
2247
2247
|
case "delete-entity":
|
|
2248
|
-
|
|
2248
|
+
Ft(t, e, s);
|
|
2249
2249
|
break;
|
|
2250
2250
|
case "add-attr":
|
|
2251
2251
|
gi(e, s);
|
|
@@ -2384,7 +2384,7 @@ function Te(t, e, n) {
|
|
|
2384
2384
|
function Oi(t, e) {
|
|
2385
2385
|
return t.blobAttrs.get(e);
|
|
2386
2386
|
}
|
|
2387
|
-
function
|
|
2387
|
+
function xr(t, e) {
|
|
2388
2388
|
var r;
|
|
2389
2389
|
const n = t.primaryKeys.get(e);
|
|
2390
2390
|
return n || ((r = t.forwardIdents.get(e)) == null ? void 0 : r.get("id"));
|
|
@@ -2407,7 +2407,7 @@ function ki(t, e, n) {
|
|
|
2407
2407
|
let l = !1;
|
|
2408
2408
|
const d = e.getAttr(o);
|
|
2409
2409
|
if (d) {
|
|
2410
|
-
const h =
|
|
2410
|
+
const h = xr(e, d["forward-identity"][1]);
|
|
2411
2411
|
l = !!Ei(t, e, [
|
|
2412
2412
|
i,
|
|
2413
2413
|
h == null ? void 0 : h.id,
|
|
@@ -2416,7 +2416,7 @@ function ki(t, e, n) {
|
|
|
2416
2416
|
}
|
|
2417
2417
|
return !(u === "create" && l || u === "update" && !l);
|
|
2418
2418
|
});
|
|
2419
|
-
return
|
|
2419
|
+
return ot({ store: t, attrsStore: e }, (s) => {
|
|
2420
2420
|
r.forEach((i) => {
|
|
2421
2421
|
mi(s.store, s.attrsStore, i);
|
|
2422
2422
|
});
|
|
@@ -2433,19 +2433,19 @@ function Pi(t) {
|
|
|
2433
2433
|
function Ci(t, e, n) {
|
|
2434
2434
|
if (n.hasOwnProperty(t)) {
|
|
2435
2435
|
const r = n[t];
|
|
2436
|
-
return
|
|
2436
|
+
return Ur(r, e, n);
|
|
2437
2437
|
}
|
|
2438
2438
|
return { ...n, [t]: e };
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2440
|
+
function qn(t, e, n) {
|
|
2441
2441
|
return t === e ? n : null;
|
|
2442
2442
|
}
|
|
2443
2443
|
function Ii(t) {
|
|
2444
2444
|
switch (typeof t) {
|
|
2445
2445
|
case "string":
|
|
2446
|
-
return t.startsWith("?") ? Ci :
|
|
2446
|
+
return t.startsWith("?") ? Ci : qn;
|
|
2447
2447
|
default:
|
|
2448
|
-
return
|
|
2448
|
+
return qn;
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
2451
|
const Mi = [
|
|
@@ -2462,32 +2462,32 @@ function ji(t) {
|
|
|
2462
2462
|
return !0;
|
|
2463
2463
|
return !1;
|
|
2464
2464
|
}
|
|
2465
|
-
function
|
|
2465
|
+
function Ur(t, e, n) {
|
|
2466
2466
|
return n ? typeof t == "object" ? ji(t) ? n : null : Ii(t)(t, e, n) : null;
|
|
2467
2467
|
}
|
|
2468
2468
|
function Ri(t, e, n) {
|
|
2469
2469
|
return t.reduce((r, s, i) => {
|
|
2470
2470
|
const o = e[i];
|
|
2471
|
-
return
|
|
2471
|
+
return Ur(s, o, r);
|
|
2472
2472
|
}, n);
|
|
2473
2473
|
}
|
|
2474
2474
|
function $i(t, e, n) {
|
|
2475
2475
|
return Ui(t, e, n).map((r) => Ri(e, r, n)).filter((r) => r);
|
|
2476
2476
|
}
|
|
2477
2477
|
function Di(t, e, n) {
|
|
2478
|
-
return e.or ? e.or.patterns.flatMap((r) =>
|
|
2478
|
+
return e.or ? e.or.patterns.flatMap((r) => Nt(t, r, n)) : e.and ? e.and.patterns.reduce((r, s) => Nt(t, s, r), n) : n.flatMap((r) => $i(t, e, r));
|
|
2479
2479
|
}
|
|
2480
|
-
function
|
|
2480
|
+
function Nt(t, e, n = [{}]) {
|
|
2481
2481
|
return e.reduce((r, s) => Di(t, s, r), n);
|
|
2482
2482
|
}
|
|
2483
|
-
function
|
|
2484
|
-
return Array.isArray(e) ? e.map((n) =>
|
|
2483
|
+
function an(t, e) {
|
|
2484
|
+
return Array.isArray(e) ? e.map((n) => an(t, n)) : Pi(e) ? t[e] : e;
|
|
2485
2485
|
}
|
|
2486
2486
|
function xi(t, { find: e, where: n }) {
|
|
2487
|
-
return
|
|
2487
|
+
return Nt(t, n).map((s) => an(s, e));
|
|
2488
2488
|
}
|
|
2489
2489
|
function Ui(t, e, n) {
|
|
2490
|
-
return vi(t,
|
|
2490
|
+
return vi(t, an(n, e));
|
|
2491
2491
|
}
|
|
2492
2492
|
const Li = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
2493
2493
|
function Ae(t) {
|
|
@@ -2499,28 +2499,28 @@ for (let t = 0; t < 256; ++t)
|
|
|
2499
2499
|
function Fi(t, e = 0) {
|
|
2500
2500
|
return (K[t[e + 0]] + K[t[e + 1]] + K[t[e + 2]] + K[t[e + 3]] + "-" + K[t[e + 4]] + K[t[e + 5]] + "-" + K[t[e + 6]] + K[t[e + 7]] + "-" + K[t[e + 8]] + K[t[e + 9]] + "-" + K[t[e + 10]] + K[t[e + 11]] + K[t[e + 12]] + K[t[e + 13]] + K[t[e + 14]] + K[t[e + 15]]).toLowerCase();
|
|
2501
2501
|
}
|
|
2502
|
-
let
|
|
2502
|
+
let vt;
|
|
2503
2503
|
const Ni = new Uint8Array(16);
|
|
2504
2504
|
function Ki() {
|
|
2505
|
-
if (!
|
|
2505
|
+
if (!vt) {
|
|
2506
2506
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2507
2507
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2508
|
-
|
|
2508
|
+
vt = crypto.getRandomValues.bind(crypto);
|
|
2509
2509
|
}
|
|
2510
|
-
return
|
|
2510
|
+
return vt(Ni);
|
|
2511
2511
|
}
|
|
2512
|
-
const qi = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
2512
|
+
const qi = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), zn = { randomUUID: qi };
|
|
2513
2513
|
function zi(t, e, n) {
|
|
2514
2514
|
var s;
|
|
2515
|
-
if (
|
|
2516
|
-
return
|
|
2515
|
+
if (zn.randomUUID && !t)
|
|
2516
|
+
return zn.randomUUID();
|
|
2517
2517
|
t = t || {};
|
|
2518
2518
|
const r = t.random ?? ((s = t.rng) == null ? void 0 : s.call(t)) ?? Ki();
|
|
2519
2519
|
if (r.length < 16)
|
|
2520
2520
|
throw new Error("Random bytes length must be >= 16");
|
|
2521
2521
|
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Fi(r);
|
|
2522
2522
|
}
|
|
2523
|
-
function
|
|
2523
|
+
function Vn(t) {
|
|
2524
2524
|
const e = t.replace(/-/g, ""), n = [];
|
|
2525
2525
|
for (let r = 0; r < e.length; r += 2)
|
|
2526
2526
|
n.push(parseInt(e.substring(r, r + 2), 16));
|
|
@@ -2536,7 +2536,7 @@ function Vi(t, e) {
|
|
|
2536
2536
|
return 0;
|
|
2537
2537
|
}
|
|
2538
2538
|
function Wi(t, e) {
|
|
2539
|
-
return Vi(
|
|
2539
|
+
return Vi(Vn(t), Vn(e));
|
|
2540
2540
|
}
|
|
2541
2541
|
function N() {
|
|
2542
2542
|
return zi();
|
|
@@ -2556,9 +2556,9 @@ function Bi() {
|
|
|
2556
2556
|
const Gi = Bi();
|
|
2557
2557
|
let Hi = 0;
|
|
2558
2558
|
function Fe(t) {
|
|
2559
|
-
return
|
|
2559
|
+
return lt(`_${t}`, Hi++);
|
|
2560
2560
|
}
|
|
2561
|
-
function
|
|
2561
|
+
function lt(t, e) {
|
|
2562
2562
|
return `?${t}-${e}`;
|
|
2563
2563
|
}
|
|
2564
2564
|
class Oe extends Error {
|
|
@@ -2567,12 +2567,12 @@ class Oe extends Error {
|
|
|
2567
2567
|
}
|
|
2568
2568
|
}
|
|
2569
2569
|
function Ji(t, e) {
|
|
2570
|
-
const n =
|
|
2570
|
+
const n = xr(t, e);
|
|
2571
2571
|
if (!n)
|
|
2572
2572
|
throw new Oe(`Could not find id attr for ${e}`);
|
|
2573
2573
|
return n;
|
|
2574
2574
|
}
|
|
2575
|
-
function
|
|
2575
|
+
function Wn(t, e, n, r) {
|
|
2576
2576
|
return [Yi(t, e, n, r)];
|
|
2577
2577
|
}
|
|
2578
2578
|
function Yi(t, e, n, r) {
|
|
@@ -2586,7 +2586,7 @@ function Yi(t, e, n, r) {
|
|
|
2586
2586
|
function Zi(t, e, n) {
|
|
2587
2587
|
return t.map((r) => r === e ? n : r);
|
|
2588
2588
|
}
|
|
2589
|
-
function
|
|
2589
|
+
function Lr(t, e, n, r, s) {
|
|
2590
2590
|
const i = U(e, n, s), o = Te(e, n, s), a = i || o;
|
|
2591
2591
|
if (!a)
|
|
2592
2592
|
throw new Oe(`Could not find attr for ${[n, s]}`);
|
|
@@ -2605,7 +2605,7 @@ function Fr(t, e, n, r, s) {
|
|
|
2605
2605
|
];
|
|
2606
2606
|
return [i ? d : u, h, y, a, !!i];
|
|
2607
2607
|
}
|
|
2608
|
-
function
|
|
2608
|
+
function Qn(t, e) {
|
|
2609
2609
|
if (typeof e != "string")
|
|
2610
2610
|
return function(o) {
|
|
2611
2611
|
return !1;
|
|
@@ -2656,7 +2656,7 @@ function Xi(t, e) {
|
|
|
2656
2656
|
}
|
|
2657
2657
|
};
|
|
2658
2658
|
if (e.hasOwnProperty("$like")) {
|
|
2659
|
-
const r =
|
|
2659
|
+
const r = Qn(!0, e.$like);
|
|
2660
2660
|
return {
|
|
2661
2661
|
$comparator: !0,
|
|
2662
2662
|
$op: function(i) {
|
|
@@ -2665,7 +2665,7 @@ function Xi(t, e) {
|
|
|
2665
2665
|
};
|
|
2666
2666
|
}
|
|
2667
2667
|
if (e.hasOwnProperty("$ilike")) {
|
|
2668
|
-
const r =
|
|
2668
|
+
const r = Qn(!1, e.$ilike);
|
|
2669
2669
|
return {
|
|
2670
2670
|
$comparator: !0,
|
|
2671
2671
|
$op: function(i) {
|
|
@@ -2699,12 +2699,12 @@ function eo(t, e, n, r, s, i) {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
function to(t, e, n, r, s) {
|
|
2701
2701
|
const [i, o, a] = s.reduce((c, u) => {
|
|
2702
|
-
const [l, d, h] = c, [y, b, g] =
|
|
2702
|
+
const [l, d, h] = c, [y, b, g] = Lr(t, e, l, d, u);
|
|
2703
2703
|
return [y, b, [...h, g]];
|
|
2704
2704
|
}, [n, r, []]);
|
|
2705
2705
|
return [i, o, a];
|
|
2706
2706
|
}
|
|
2707
|
-
function
|
|
2707
|
+
function Kt(t, e, n, r, s, i) {
|
|
2708
2708
|
const o = s.slice(0, s.length - 1), a = s[s.length - 1], [c, u, l] = to(t, e, n, r, o), d = eo(t, e, c, u, a, i);
|
|
2709
2709
|
return l.concat([d]);
|
|
2710
2710
|
}
|
|
@@ -2723,10 +2723,10 @@ function io(t, e, n) {
|
|
|
2723
2723
|
return e == i ? i : `${i}-${n}`;
|
|
2724
2724
|
};
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2726
|
+
function Bn(t, e, n, r, s, i) {
|
|
2727
2727
|
const o = t(r, s), a = i.map((c, u) => {
|
|
2728
2728
|
const l = io(t, o, u);
|
|
2729
|
-
return
|
|
2729
|
+
return Fr(l, n, r, s, c);
|
|
2730
2730
|
});
|
|
2731
2731
|
return { [e]: { patterns: a, joinSym: o } };
|
|
2732
2732
|
}
|
|
@@ -2736,22 +2736,22 @@ function oo(t) {
|
|
|
2736
2736
|
e.push(t.slice(0, n));
|
|
2737
2737
|
return e;
|
|
2738
2738
|
}
|
|
2739
|
-
function
|
|
2740
|
-
return oo(s).map((i) =>
|
|
2739
|
+
function Gn(t, e, n, r, s) {
|
|
2740
|
+
return oo(s).map((i) => Kt(t, e, n, r, i, {
|
|
2741
2741
|
$isNull: !0
|
|
2742
2742
|
}));
|
|
2743
2743
|
}
|
|
2744
|
-
function
|
|
2744
|
+
function Fr(t, e, n, r, s) {
|
|
2745
2745
|
return Object.entries(s).flatMap(([i, o]) => {
|
|
2746
2746
|
if (ro([i, o]))
|
|
2747
|
-
return
|
|
2747
|
+
return Bn(t, "or", e, n, r, o);
|
|
2748
2748
|
if (so([i, o]))
|
|
2749
|
-
return
|
|
2749
|
+
return Bn(t, "and", e, n, r, o);
|
|
2750
2750
|
if (i === "$entityIdStartsWith")
|
|
2751
2751
|
return [];
|
|
2752
2752
|
const a = i.split(".");
|
|
2753
2753
|
if (o != null && o.hasOwnProperty("$ne") && (o = { ...o, $not: o.$ne }, delete o.$ne), o != null && o.hasOwnProperty("$not")) {
|
|
2754
|
-
const c =
|
|
2754
|
+
const c = Kt(t, e, n, r, a, o), u = Gn(t, e, n, r, a);
|
|
2755
2755
|
return [
|
|
2756
2756
|
{
|
|
2757
2757
|
or: {
|
|
@@ -2764,22 +2764,22 @@ function Nr(t, e, n, r, s) {
|
|
|
2764
2764
|
return o != null && o.hasOwnProperty("$isNull") && o.$isNull === !0 && a.length > 1 ? [
|
|
2765
2765
|
{
|
|
2766
2766
|
or: {
|
|
2767
|
-
patterns:
|
|
2767
|
+
patterns: Gn(t, e, n, r, a),
|
|
2768
2768
|
joinSym: t(n, r)
|
|
2769
2769
|
}
|
|
2770
2770
|
}
|
|
2771
|
-
] :
|
|
2771
|
+
] : Kt(t, e, n, r, a, o);
|
|
2772
2772
|
});
|
|
2773
2773
|
}
|
|
2774
2774
|
function ao(t, e, n, r) {
|
|
2775
|
-
const s =
|
|
2776
|
-
return r ?
|
|
2775
|
+
const s = lt;
|
|
2776
|
+
return r ? Fr(s, t, e, n, r).concat(Wn(s, t, e, n)) : Wn(s, t, e, n);
|
|
2777
2777
|
}
|
|
2778
2778
|
function co(t, e, n) {
|
|
2779
2779
|
return [t(e, n), t("time", n)];
|
|
2780
2780
|
}
|
|
2781
2781
|
function uo(t, e, n, r, s, i) {
|
|
2782
|
-
const [o, a, c, u, l] =
|
|
2782
|
+
const [o, a, c, u, l] = Lr(t, e, n, r, s), d = Zi(c, t(n, r), i);
|
|
2783
2783
|
return [o, a, d, u, l];
|
|
2784
2784
|
}
|
|
2785
2785
|
function lo(t, e, n, { etype: r, level: s, form: i }, o) {
|
|
@@ -2789,7 +2789,7 @@ function lo(t, e, n, { etype: r, level: s, form: i }, o) {
|
|
|
2789
2789
|
var g, w, m;
|
|
2790
2790
|
const b = !!(e.cardinalityInference && ((m = (w = (g = n.linkIndex) == null ? void 0 : g[r]) == null ? void 0 : w[y]) != null && m.isSingular));
|
|
2791
2791
|
try {
|
|
2792
|
-
const [T, v, E] = uo(t, n, r, s, y, u), A =
|
|
2792
|
+
const [T, v, E] = uo(t, n, r, s, y, u), A = Kr(e, n, {
|
|
2793
2793
|
etype: T,
|
|
2794
2794
|
level: v,
|
|
2795
2795
|
form: i[y],
|
|
@@ -2812,19 +2812,19 @@ function fo(t, e, n) {
|
|
|
2812
2812
|
function Ue(t, e, n, r, s) {
|
|
2813
2813
|
return e === r || e == null && r == null ? Wi(t, n) : r == null ? 1 : e == null ? -1 : fo(e, r, s);
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2815
|
+
function at([t, e], [n, r], s) {
|
|
2816
2816
|
return Ue(t, e, n, r, s);
|
|
2817
2817
|
}
|
|
2818
|
-
function
|
|
2818
|
+
function qt(t) {
|
|
2819
2819
|
return t == null ? t : new Date(t).getTime();
|
|
2820
2820
|
}
|
|
2821
2821
|
function ho(t, e, n, r) {
|
|
2822
2822
|
var b;
|
|
2823
2823
|
const [s, i, o, a] = t, c = n === "desc" ? 1 : -1;
|
|
2824
2824
|
if (((b = e["forward-identity"]) == null ? void 0 : b[2]) === "id")
|
|
2825
|
-
return
|
|
2826
|
-
const [u, l] = r, d = e["checked-data-type"], h = d === "date" ?
|
|
2827
|
-
return
|
|
2825
|
+
return at(r, [s, a], null) === c;
|
|
2826
|
+
const [u, l] = r, d = e["checked-data-type"], h = d === "date" ? qt(l) : l, y = d === "date" ? qt(o) : o;
|
|
2827
|
+
return at([u, h], [s, y], d) === c;
|
|
2828
2828
|
}
|
|
2829
2829
|
function po(t, e) {
|
|
2830
2830
|
const n = e[1];
|
|
@@ -2847,7 +2847,7 @@ function _o(t, e, n) {
|
|
|
2847
2847
|
const r = /* @__PURE__ */ new Map();
|
|
2848
2848
|
for (const o of n.fields) {
|
|
2849
2849
|
const a = U(t, e, o), c = (s = a == null ? void 0 : a["forward-identity"]) == null ? void 0 : s[2];
|
|
2850
|
-
c &&
|
|
2850
|
+
c && on(a) && r.set(c, a);
|
|
2851
2851
|
}
|
|
2852
2852
|
if (!r.has("id")) {
|
|
2853
2853
|
const o = U(t, e, "id"), a = (i = o == null ? void 0 : o["forward-identity"]) == null ? void 0 : i[2];
|
|
@@ -2857,7 +2857,7 @@ function _o(t, e, n) {
|
|
|
2857
2857
|
}
|
|
2858
2858
|
function go(t, e, { etype: n, pageInfo: r, dq: s, form: i }) {
|
|
2859
2859
|
var b, g;
|
|
2860
|
-
const o = (b = i == null ? void 0 : i.$) == null ? void 0 : b.order, a =
|
|
2860
|
+
const o = (b = i == null ? void 0 : i.$) == null ? void 0 : b.order, a = Nr(i), c = To(i);
|
|
2861
2861
|
let u = xi(t, s);
|
|
2862
2862
|
const l = r == null ? void 0 : r["start-cursor"], d = bo(e, n, l, o);
|
|
2863
2863
|
if (d && ((g = d == null ? void 0 : d["forward-identity"]) == null ? void 0 : g[2]) !== "id") {
|
|
@@ -2865,13 +2865,13 @@ function go(t, e, { etype: n, pageInfo: r, dq: s, form: i }) {
|
|
|
2865
2865
|
u = u.map(([T]) => {
|
|
2866
2866
|
var E, A, j, L, q;
|
|
2867
2867
|
let v = (q = (L = (j = (A = (E = t.eav.get(T)) == null ? void 0 : E.get(m)) == null ? void 0 : A.values()) == null ? void 0 : j.next()) == null ? void 0 : L.value) == null ? void 0 : q[2];
|
|
2868
|
-
return w && (v =
|
|
2868
|
+
return w && (v = qt(v)), [T, v];
|
|
2869
2869
|
});
|
|
2870
2870
|
}
|
|
2871
2871
|
u.sort(c === "asc" ? function(m, T) {
|
|
2872
|
-
return
|
|
2872
|
+
return at(m, T, d == null ? void 0 : d["checked-data-type"]);
|
|
2873
2873
|
} : function(m, T) {
|
|
2874
|
-
return
|
|
2874
|
+
return at(T, m, d == null ? void 0 : d["checked-data-type"]);
|
|
2875
2875
|
});
|
|
2876
2876
|
let h = {};
|
|
2877
2877
|
const y = _o(e, n, s);
|
|
@@ -2889,16 +2889,16 @@ function To(t) {
|
|
|
2889
2889
|
const e = (n = t.$) == null ? void 0 : n.order;
|
|
2890
2890
|
return e && e[Object.keys(e)[0]] || "asc";
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2892
|
+
function Nr(t) {
|
|
2893
2893
|
var s, i, o;
|
|
2894
2894
|
const e = (s = t.$) == null ? void 0 : s.offset, n = (i = t.$) == null ? void 0 : i.before, r = (o = t.$) == null ? void 0 : o.after;
|
|
2895
2895
|
return !e && !n && !r;
|
|
2896
2896
|
}
|
|
2897
2897
|
function wo(t, e, { etype: n, level: r, form: s, join: i, pageInfo: o }) {
|
|
2898
2898
|
var h, y, b, g, w;
|
|
2899
|
-
if (!
|
|
2899
|
+
if (!Nr(s) && (!o || !o["start-cursor"]))
|
|
2900
2900
|
return [];
|
|
2901
|
-
const a = no(ao(e, n, r, (h = s.$) == null ? void 0 : h.where), i), c = co(
|
|
2901
|
+
const a = no(ao(e, n, r, (h = s.$) == null ? void 0 : h.where), i), c = co(lt, n, r), u = (y = s.$) == null ? void 0 : y.fields, l = go(t, e, {
|
|
2902
2902
|
etype: n,
|
|
2903
2903
|
pageInfo: o,
|
|
2904
2904
|
form: s,
|
|
@@ -2920,9 +2920,9 @@ function mo(t, e, n) {
|
|
|
2920
2920
|
throw r;
|
|
2921
2921
|
}
|
|
2922
2922
|
}
|
|
2923
|
-
function
|
|
2923
|
+
function Kr(t, e, n) {
|
|
2924
2924
|
const r = mo(t, e, n);
|
|
2925
|
-
return lo(
|
|
2925
|
+
return lo(lt, t, e, n, r);
|
|
2926
2926
|
}
|
|
2927
2927
|
function So(t) {
|
|
2928
2928
|
const e = {};
|
|
@@ -2935,9 +2935,9 @@ function So(t) {
|
|
|
2935
2935
|
};
|
|
2936
2936
|
return e;
|
|
2937
2937
|
}
|
|
2938
|
-
function
|
|
2938
|
+
function qr({ store: t, attrsStore: e, pageInfo: n, aggregate: r }, s) {
|
|
2939
2939
|
const o = { data: Object.keys(s).reduce(function(c, u) {
|
|
2940
|
-
return r != null && r[u] || u === "$$ruleParams" || (c[u] =
|
|
2940
|
+
return r != null && r[u] || u === "$$ruleParams" || (c[u] = Kr(t, e, {
|
|
2941
2941
|
etype: u,
|
|
2942
2942
|
form: s[u],
|
|
2943
2943
|
level: 0,
|
|
@@ -2961,7 +2961,7 @@ function vo() {
|
|
|
2961
2961
|
return new Set(Object.keys(e));
|
|
2962
2962
|
}
|
|
2963
2963
|
const Ao = vo();
|
|
2964
|
-
function
|
|
2964
|
+
function zt(t, e, n) {
|
|
2965
2965
|
const r = {
|
|
2966
2966
|
__etype: t,
|
|
2967
2967
|
__ops: n
|
|
@@ -2973,49 +2973,44 @@ function st(t, e, n) {
|
|
|
2973
2973
|
if (i === "__etype")
|
|
2974
2974
|
return t;
|
|
2975
2975
|
if (Ao.has(i))
|
|
2976
|
-
return (o, a) =>
|
|
2976
|
+
return (o, a) => zt(t, e, [
|
|
2977
2977
|
...n,
|
|
2978
2978
|
a ? [i, t, e, o, a] : [i, t, e, o]
|
|
2979
2979
|
]);
|
|
2980
2980
|
}
|
|
2981
2981
|
});
|
|
2982
2982
|
}
|
|
2983
|
-
function
|
|
2984
|
-
return `lookup__${t}__${JSON.stringify(e)}`;
|
|
2985
|
-
}
|
|
2986
|
-
function ut(t) {
|
|
2983
|
+
function ct(t) {
|
|
2987
2984
|
return t.startsWith("lookup__");
|
|
2988
2985
|
}
|
|
2989
|
-
function
|
|
2986
|
+
function zr(t) {
|
|
2990
2987
|
const [e, n, ...r] = t.split("__");
|
|
2991
2988
|
return [n, JSON.parse(r.join("__"))];
|
|
2992
2989
|
}
|
|
2993
|
-
function
|
|
2990
|
+
function Oo(t) {
|
|
2994
2991
|
return new Proxy({
|
|
2995
2992
|
__etype: t
|
|
2996
2993
|
}, {
|
|
2997
2994
|
get(e, n) {
|
|
2998
|
-
if (n === "lookup")
|
|
2999
|
-
return (s, i) => st(t, Vt(Oo(s, i)), []);
|
|
3000
2995
|
if (n === "__etype")
|
|
3001
2996
|
return t;
|
|
3002
2997
|
const r = n;
|
|
3003
|
-
return
|
|
2998
|
+
return ct(r) ? zt(t, zr(r), []) : zt(t, r, []);
|
|
3004
2999
|
}
|
|
3005
3000
|
});
|
|
3006
3001
|
}
|
|
3007
|
-
function
|
|
3002
|
+
function cn() {
|
|
3008
3003
|
return new Proxy({}, {
|
|
3009
3004
|
get(t, e) {
|
|
3010
|
-
return
|
|
3005
|
+
return Oo(e);
|
|
3011
3006
|
}
|
|
3012
3007
|
});
|
|
3013
3008
|
}
|
|
3014
|
-
|
|
3015
|
-
function
|
|
3009
|
+
cn();
|
|
3010
|
+
function Eo(t) {
|
|
3016
3011
|
return t.__ops;
|
|
3017
3012
|
}
|
|
3018
|
-
function
|
|
3013
|
+
function ko(t, e) {
|
|
3019
3014
|
const { attrIdMap: n, refSwapAttrIds: r } = t, s = [];
|
|
3020
3015
|
for (const o of e) {
|
|
3021
3016
|
const a = n[o];
|
|
@@ -3034,7 +3029,7 @@ function Po(t, e) {
|
|
|
3034
3029
|
}
|
|
3035
3030
|
return s;
|
|
3036
3031
|
}
|
|
3037
|
-
function
|
|
3032
|
+
function Po(t) {
|
|
3038
3033
|
if (Array.isArray(t))
|
|
3039
3034
|
return t;
|
|
3040
3035
|
const e = Object.entries(t);
|
|
@@ -3042,33 +3037,33 @@ function Co(t) {
|
|
|
3042
3037
|
throw new Error("lookup must be an object with a single unique attr and value.");
|
|
3043
3038
|
return e[0];
|
|
3044
3039
|
}
|
|
3045
|
-
function
|
|
3040
|
+
function Co(t, e, n) {
|
|
3046
3041
|
return n.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
|
|
3047
3042
|
// before assuming it's a ref lookup.
|
|
3048
3043
|
!U(t, e, n);
|
|
3049
3044
|
}
|
|
3050
|
-
function
|
|
3045
|
+
function Vt(t) {
|
|
3051
3046
|
const [e, n, ...r] = t.split(".");
|
|
3052
3047
|
if (r.length > 0 || n !== "id")
|
|
3053
3048
|
throw new Error(`${t} is not a valid lookup attribute.`);
|
|
3054
3049
|
return e;
|
|
3055
3050
|
}
|
|
3056
|
-
function
|
|
3057
|
-
if (!
|
|
3051
|
+
function Io(t, e, n) {
|
|
3052
|
+
if (!Co(t, e, n))
|
|
3058
3053
|
return U(t, e, n);
|
|
3059
|
-
const r =
|
|
3054
|
+
const r = Vt(n), s = U(t, e, r) || Te(t, e, r);
|
|
3060
3055
|
if (s && s["value-type"] !== "ref")
|
|
3061
3056
|
throw new Error(`${n} does not reference a valid link attribute.`);
|
|
3062
3057
|
return s;
|
|
3063
3058
|
}
|
|
3064
|
-
function
|
|
3065
|
-
return typeof t == "string" && !
|
|
3059
|
+
function Wt(t) {
|
|
3060
|
+
return typeof t == "string" && !ct(t) ? null : typeof t == "string" && ct(t) ? zr(t) : Po(t);
|
|
3066
3061
|
}
|
|
3067
3062
|
function G(t, e, n) {
|
|
3068
|
-
const r =
|
|
3063
|
+
const r = Wt(n);
|
|
3069
3064
|
if (r === null)
|
|
3070
3065
|
return n;
|
|
3071
|
-
const [s, i] = r, o =
|
|
3066
|
+
const [s, i] = r, o = Io(t, e, s);
|
|
3072
3067
|
if (!o || !o["unique?"])
|
|
3073
3068
|
throw new Error(`${s} is not a unique attribute.`);
|
|
3074
3069
|
return [o.id, i];
|
|
@@ -3083,7 +3078,7 @@ function Vr(t, e, n, r) {
|
|
|
3083
3078
|
s
|
|
3084
3079
|
]].concat(r) : r;
|
|
3085
3080
|
}
|
|
3086
|
-
function
|
|
3081
|
+
function Mo({ attrsStore: t }, [e, n, r]) {
|
|
3087
3082
|
const s = Object.entries(r).flatMap(([i, o]) => {
|
|
3088
3083
|
const a = Array.isArray(o) ? o : [o], c = U(t, e, i), u = Te(t, e, i);
|
|
3089
3084
|
return a.map((l) => c ? [
|
|
@@ -3104,7 +3099,7 @@ function jo({ attrsStore: t }, [e, n, r]) {
|
|
|
3104
3099
|
});
|
|
3105
3100
|
return Vr(t, e, n, s);
|
|
3106
3101
|
}
|
|
3107
|
-
function
|
|
3102
|
+
function jo({ attrsStore: t }, [e, n, r]) {
|
|
3108
3103
|
const s = Object.entries(r).flatMap(([i, o]) => {
|
|
3109
3104
|
const a = Array.isArray(o) ? o : [o], c = U(t, e, i), u = Te(t, e, i);
|
|
3110
3105
|
return a.map((l) => c ? [
|
|
@@ -3125,7 +3120,7 @@ function Ro({ attrsStore: t }, [e, n, r]) {
|
|
|
3125
3120
|
});
|
|
3126
3121
|
return Vr(t, e, n, s);
|
|
3127
3122
|
}
|
|
3128
|
-
function
|
|
3123
|
+
function Ro(t, e, n, r) {
|
|
3129
3124
|
var s;
|
|
3130
3125
|
if (Array.isArray(r)) {
|
|
3131
3126
|
const [i, o] = r;
|
|
@@ -3149,20 +3144,20 @@ function $o(t, e, n, r) {
|
|
|
3149
3144
|
return !1;
|
|
3150
3145
|
}
|
|
3151
3146
|
function Wr({ stores: t, attrsStore: e }, [n, r, s, i]) {
|
|
3152
|
-
return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null :
|
|
3147
|
+
return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null : Ro(t, e, n, r) ? { mode: "update" } : null;
|
|
3153
3148
|
}
|
|
3154
|
-
function
|
|
3155
|
-
const { attrsStore: n } = t, [r, s, i, o] = e, a =
|
|
3149
|
+
function $o(t, e) {
|
|
3150
|
+
const { attrsStore: n } = t, [r, s, i, o] = e, a = rn(i), c = G(n, r, s);
|
|
3156
3151
|
return [["id", c]].concat(Object.entries(a)).map(([l, d]) => {
|
|
3157
3152
|
const h = U(n, r, l);
|
|
3158
|
-
return h["checked-data-type"] === "date" && t.useDateObjects && (d =
|
|
3153
|
+
return h["checked-data-type"] === "date" && t.useDateObjects && (d = ut(d)), ["add-triple", c, h.id, d, { mode: "create" }];
|
|
3159
3154
|
});
|
|
3160
3155
|
}
|
|
3161
|
-
function
|
|
3162
|
-
const { attrsStore: n } = t, [r, s, i, o] = e, a =
|
|
3156
|
+
function Do(t, e) {
|
|
3157
|
+
const { attrsStore: n } = t, [r, s, i, o] = e, a = rn(i), c = G(n, r, s), u = Wr(t, [r, c, i, o]);
|
|
3163
3158
|
return [["id", c]].concat(Object.entries(a)).map(([d, h]) => {
|
|
3164
3159
|
const y = U(n, r, d);
|
|
3165
|
-
return y["checked-data-type"] === "date" && t.useDateObjects && (h =
|
|
3160
|
+
return y["checked-data-type"] === "date" && t.useDateObjects && (h = ut(h)), [
|
|
3166
3161
|
"add-triple",
|
|
3167
3162
|
c,
|
|
3168
3163
|
y.id,
|
|
@@ -3171,11 +3166,11 @@ function xo(t, e) {
|
|
|
3171
3166
|
];
|
|
3172
3167
|
});
|
|
3173
3168
|
}
|
|
3174
|
-
function
|
|
3169
|
+
function xo({ attrsStore: t }, [e, n]) {
|
|
3175
3170
|
return [["delete-entity", G(t, e, n), e]];
|
|
3176
3171
|
}
|
|
3177
|
-
function
|
|
3178
|
-
const { attrsStore: n } = t, [r, s, i, o] = e, a =
|
|
3172
|
+
function Uo(t, e) {
|
|
3173
|
+
const { attrsStore: n } = t, [r, s, i, o] = e, a = rn(i), c = G(n, r, s), u = Wr(t, [r, c, i, o]), l = Object.entries(a).map(([h, y]) => {
|
|
3179
3174
|
const b = U(n, r, h);
|
|
3180
3175
|
return [
|
|
3181
3176
|
"deep-merge-triple",
|
|
@@ -3193,38 +3188,38 @@ function Lo(t, e) {
|
|
|
3193
3188
|
...u ? [u] : []
|
|
3194
3189
|
]].concat(l);
|
|
3195
3190
|
}
|
|
3196
|
-
function
|
|
3191
|
+
function Lo({ attrsStore: t }, [e, n, r]) {
|
|
3197
3192
|
return [["rule-params", G(t, e, n), e, r]];
|
|
3198
3193
|
}
|
|
3199
|
-
function
|
|
3194
|
+
function Fo(t) {
|
|
3200
3195
|
const [e, n, r, s, i] = t;
|
|
3201
3196
|
if (!s)
|
|
3202
3197
|
return t;
|
|
3203
3198
|
const o = { ...s };
|
|
3204
3199
|
return delete o.id, [e, n, r, o, ...i ? [i] : []];
|
|
3205
3200
|
}
|
|
3206
|
-
function
|
|
3207
|
-
const [n, ...r] =
|
|
3201
|
+
function No(t, e) {
|
|
3202
|
+
const [n, ...r] = Fo(e);
|
|
3208
3203
|
switch (n) {
|
|
3209
3204
|
case "merge":
|
|
3210
|
-
return
|
|
3205
|
+
return Uo(t, r);
|
|
3211
3206
|
case "create":
|
|
3212
|
-
return
|
|
3207
|
+
return $o(t, r);
|
|
3213
3208
|
case "update":
|
|
3214
|
-
return
|
|
3209
|
+
return Do(t, r);
|
|
3215
3210
|
case "link":
|
|
3216
|
-
return
|
|
3211
|
+
return Mo(t, r);
|
|
3217
3212
|
case "unlink":
|
|
3218
|
-
return
|
|
3213
|
+
return jo(t, r);
|
|
3219
3214
|
case "delete":
|
|
3220
|
-
return
|
|
3215
|
+
return xo(t, r);
|
|
3221
3216
|
case "ruleParams":
|
|
3222
|
-
return
|
|
3217
|
+
return Lo(t, r);
|
|
3223
3218
|
default:
|
|
3224
3219
|
throw new Error(`unsupported action ${n}`);
|
|
3225
3220
|
}
|
|
3226
3221
|
}
|
|
3227
|
-
function
|
|
3222
|
+
function Ko(t) {
|
|
3228
3223
|
switch (t) {
|
|
3229
3224
|
case "string":
|
|
3230
3225
|
case "date":
|
|
@@ -3235,14 +3230,14 @@ function qo(t) {
|
|
|
3235
3230
|
return;
|
|
3236
3231
|
}
|
|
3237
3232
|
}
|
|
3238
|
-
function
|
|
3233
|
+
function qo(t, e, n) {
|
|
3239
3234
|
var a, c;
|
|
3240
3235
|
const r = (c = (a = t.entities[e]) == null ? void 0 : a.attrs) == null ? void 0 : c[n];
|
|
3241
3236
|
if (n === "id")
|
|
3242
3237
|
return null;
|
|
3243
3238
|
if (!r)
|
|
3244
3239
|
throw new Error(`${e}.${n} does not exist in your schema`);
|
|
3245
|
-
const { unique: s, indexed: i } = r == null ? void 0 : r.config, o =
|
|
3240
|
+
const { unique: s, indexed: i } = r == null ? void 0 : r.config, o = Ko(r == null ? void 0 : r.valueType);
|
|
3246
3241
|
return {
|
|
3247
3242
|
"index?": i,
|
|
3248
3243
|
"unique?": s,
|
|
@@ -3250,7 +3245,7 @@ function zo(t, e, n) {
|
|
|
3250
3245
|
};
|
|
3251
3246
|
}
|
|
3252
3247
|
function Ze(t, e, n, r) {
|
|
3253
|
-
const s = t ?
|
|
3248
|
+
const s = t ? qo(t, e, n) : null, i = N(), a = [N(), e, n];
|
|
3254
3249
|
return {
|
|
3255
3250
|
id: i,
|
|
3256
3251
|
"forward-identity": a,
|
|
@@ -3263,11 +3258,11 @@ function Ze(t, e, n, r) {
|
|
|
3263
3258
|
...r || {}
|
|
3264
3259
|
};
|
|
3265
3260
|
}
|
|
3266
|
-
function
|
|
3261
|
+
function zo(t, e, n) {
|
|
3267
3262
|
return Object.values(t.links).find((i) => i.forward.on === e && i.forward.label === n || i.reverse.on === e && i.reverse.label === n);
|
|
3268
3263
|
}
|
|
3269
|
-
function
|
|
3270
|
-
const r =
|
|
3264
|
+
function Vo(t, e, n) {
|
|
3265
|
+
const r = zo(t, e, n);
|
|
3271
3266
|
if (!r)
|
|
3272
3267
|
throw new Error(`Couldn't find the link ${e}.${n} in your schema`);
|
|
3273
3268
|
const { forward: s, reverse: i } = r;
|
|
@@ -3280,8 +3275,8 @@ function Wo(t, e, n) {
|
|
|
3280
3275
|
"on-delete-reverse": i.onDelete
|
|
3281
3276
|
};
|
|
3282
3277
|
}
|
|
3283
|
-
function
|
|
3284
|
-
const s = t ?
|
|
3278
|
+
function Hn(t, e, n, r) {
|
|
3279
|
+
const s = t ? Vo(t, e, n) : null, i = N(), o = [N(), e, n], a = [N(), n, e];
|
|
3285
3280
|
return {
|
|
3286
3281
|
id: i,
|
|
3287
3282
|
// @ts-ignore: ts thinks it's any[]
|
|
@@ -3298,7 +3293,7 @@ function Jn(t, e, n, r) {
|
|
|
3298
3293
|
...r || {}
|
|
3299
3294
|
};
|
|
3300
3295
|
}
|
|
3301
|
-
const
|
|
3296
|
+
const Wo = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink"]), Qo = /* @__PURE__ */ new Set(["link", "unlink"]), Bo = /* @__PURE__ */ new Set(["create", "update", "merge"]), Go = /* @__PURE__ */ new Set([
|
|
3302
3297
|
"link",
|
|
3303
3298
|
"unlink",
|
|
3304
3299
|
"create",
|
|
@@ -3306,20 +3301,20 @@ const Qo = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink
|
|
|
3306
3301
|
"merge",
|
|
3307
3302
|
"delete",
|
|
3308
3303
|
"ruleParams"
|
|
3309
|
-
]),
|
|
3310
|
-
...
|
|
3304
|
+
]), Qt = { "unique?": !0, "index?": !0 }, Ho = {
|
|
3305
|
+
...Qt,
|
|
3311
3306
|
cardinality: "one"
|
|
3312
3307
|
};
|
|
3313
|
-
function
|
|
3308
|
+
function Jo(t) {
|
|
3314
3309
|
const e = [], [n, r, s, i] = t;
|
|
3315
|
-
if (!
|
|
3310
|
+
if (!Go.has(n))
|
|
3316
3311
|
return e;
|
|
3317
|
-
const o =
|
|
3312
|
+
const o = Wt(s);
|
|
3318
3313
|
if (o && e.push({ etype: r, lookupPair: o }), n === "link")
|
|
3319
3314
|
for (const [a, c] of Object.entries(i)) {
|
|
3320
3315
|
const u = Array.isArray(c) ? c : [c];
|
|
3321
3316
|
for (const l of u) {
|
|
3322
|
-
const d =
|
|
3317
|
+
const d = Wt(l);
|
|
3323
3318
|
d && e.push({
|
|
3324
3319
|
etype: r,
|
|
3325
3320
|
lookupPair: d,
|
|
@@ -3329,7 +3324,7 @@ function Yo(t) {
|
|
|
3329
3324
|
}
|
|
3330
3325
|
return e;
|
|
3331
3326
|
}
|
|
3332
|
-
function
|
|
3327
|
+
function Yo({ attrsStore: t, schema: e }, n) {
|
|
3333
3328
|
var h, y;
|
|
3334
3329
|
const r = /* @__PURE__ */ new Set(), s = [], i = [];
|
|
3335
3330
|
function o(b, g) {
|
|
@@ -3354,10 +3349,10 @@ function Zo({ attrsStore: t, schema: e }, n) {
|
|
|
3354
3349
|
}
|
|
3355
3350
|
function d(b, g) {
|
|
3356
3351
|
const w = o(b, g), m = a(b, g);
|
|
3357
|
-
u(w), u(m), !w && !m && c(
|
|
3352
|
+
u(w), u(m), !w && !m && c(Hn(e, b, g, Ho));
|
|
3358
3353
|
}
|
|
3359
3354
|
for (const b of n)
|
|
3360
|
-
for (const { etype: g, lookupPair: w, linkLabel: m } of
|
|
3355
|
+
for (const { etype: g, lookupPair: w, linkLabel: m } of Jo(b)) {
|
|
3361
3356
|
const T = w[0];
|
|
3362
3357
|
if (m) {
|
|
3363
3358
|
d(g, m);
|
|
@@ -3365,28 +3360,28 @@ function Zo({ attrsStore: t, schema: e }, n) {
|
|
|
3365
3360
|
u(v), u(E);
|
|
3366
3361
|
const A = ((h = v == null ? void 0 : v["reverse-identity"]) == null ? void 0 : h[1]) || ((y = E == null ? void 0 : E["forward-identity"]) == null ? void 0 : y[1]) || m;
|
|
3367
3362
|
if (l(A, T))
|
|
3368
|
-
d(A,
|
|
3363
|
+
d(A, Vt(T));
|
|
3369
3364
|
else {
|
|
3370
3365
|
const j = o(A, T);
|
|
3371
|
-
j || c(Ze(e, A, T,
|
|
3366
|
+
j || c(Ze(e, A, T, Qt)), u(j);
|
|
3372
3367
|
}
|
|
3373
3368
|
} else if (l(g, T))
|
|
3374
|
-
d(g,
|
|
3369
|
+
d(g, Vt(T));
|
|
3375
3370
|
else {
|
|
3376
3371
|
const v = o(g, T);
|
|
3377
|
-
v || c(Ze(e, g, T,
|
|
3372
|
+
v || c(Ze(e, g, T, Qt)), u(v);
|
|
3378
3373
|
}
|
|
3379
3374
|
}
|
|
3380
3375
|
for (const b of n) {
|
|
3381
3376
|
const [g, w, m, T] = b;
|
|
3382
|
-
if (
|
|
3377
|
+
if (Wo.has(g)) {
|
|
3383
3378
|
const v = o(w, "id");
|
|
3384
3379
|
u(v), v || c(Ze(e, w, "id", { "unique?": !0 }));
|
|
3385
3380
|
for (const E of Object.keys(T)) {
|
|
3386
3381
|
const A = o(w, E);
|
|
3387
|
-
if (u(A),
|
|
3382
|
+
if (u(A), Bo.has(g) && (A || c(Ze(e, w, E, E === "id" ? { "unique?": !0 } : null))), Qo.has(g)) {
|
|
3388
3383
|
const j = a(w, E);
|
|
3389
|
-
!A && !j && c(
|
|
3384
|
+
!A && !j && c(Hn(e, w, E)), u(j);
|
|
3390
3385
|
}
|
|
3391
3386
|
}
|
|
3392
3387
|
}
|
|
@@ -3399,19 +3394,19 @@ function Zo({ attrsStore: t, schema: e }, n) {
|
|
|
3399
3394
|
}
|
|
3400
3395
|
return [t, i];
|
|
3401
3396
|
}
|
|
3402
|
-
function
|
|
3403
|
-
const r = (Array.isArray(e) ? e : [e]).flatMap((c) =>
|
|
3397
|
+
function Zo(t, e) {
|
|
3398
|
+
const r = (Array.isArray(e) ? e : [e]).flatMap((c) => Eo(c)), [s, i] = Yo(t, r), o = { ...t, attrsStore: s }, a = r.flatMap((c) => No(o, c));
|
|
3404
3399
|
return [...i, ...a];
|
|
3405
3400
|
}
|
|
3406
|
-
function
|
|
3401
|
+
function Jn(t, e) {
|
|
3407
3402
|
typeof requestIdleCallback > "u" ? t() : requestIdleCallback(t, { timeout: e });
|
|
3408
3403
|
}
|
|
3409
3404
|
const Ne = "__meta";
|
|
3410
|
-
class
|
|
3405
|
+
class Xo {
|
|
3411
3406
|
constructor(e, n) {
|
|
3412
3407
|
}
|
|
3413
3408
|
}
|
|
3414
|
-
class
|
|
3409
|
+
class Bt {
|
|
3415
3410
|
constructor(e) {
|
|
3416
3411
|
p(this, "currentValue");
|
|
3417
3412
|
p(this, "_subs", []);
|
|
@@ -3604,7 +3599,7 @@ class Gt {
|
|
|
3604
3599
|
gc() {
|
|
3605
3600
|
this._nextGc || (this._nextGc = setTimeout(
|
|
3606
3601
|
() => {
|
|
3607
|
-
|
|
3602
|
+
Jn(() => {
|
|
3608
3603
|
this._nextGc = null, this._gc();
|
|
3609
3604
|
}, 30 * 1e3);
|
|
3610
3605
|
},
|
|
@@ -3619,7 +3614,7 @@ class Gt {
|
|
|
3619
3614
|
return;
|
|
3620
3615
|
}
|
|
3621
3616
|
this._nextSave = setTimeout(() => {
|
|
3622
|
-
|
|
3617
|
+
Jn(() => {
|
|
3623
3618
|
this._nextSave = null, this._writeToStorage(e).then(n).catch(r);
|
|
3624
3619
|
}, this._idleCallbackMaxWaitMs);
|
|
3625
3620
|
}, this._saveThrottleMs);
|
|
@@ -3633,7 +3628,7 @@ class Gt {
|
|
|
3633
3628
|
// so that we know which entries we need to persist to the store.
|
|
3634
3629
|
updateInPlace(e) {
|
|
3635
3630
|
this._version++;
|
|
3636
|
-
const [n, r] =
|
|
3631
|
+
const [n, r] = ot(this.currentValue, e, {
|
|
3637
3632
|
enablePatches: !0
|
|
3638
3633
|
});
|
|
3639
3634
|
for (const s of r) {
|
|
@@ -3651,13 +3646,13 @@ class Gt {
|
|
|
3651
3646
|
};
|
|
3652
3647
|
}
|
|
3653
3648
|
}
|
|
3654
|
-
const
|
|
3655
|
-
function
|
|
3649
|
+
const ea = 6, ta = ["kv", "querySubs", "syncSubs"];
|
|
3650
|
+
function na(t) {
|
|
3656
3651
|
return function(n) {
|
|
3657
3652
|
console.error("Error in IndexedDB event", { source: t, event: n });
|
|
3658
3653
|
};
|
|
3659
3654
|
}
|
|
3660
|
-
async function
|
|
3655
|
+
async function ra(t) {
|
|
3661
3656
|
return new Promise((e) => {
|
|
3662
3657
|
const n = indexedDB.open(t);
|
|
3663
3658
|
n.onerror = (r) => {
|
|
@@ -3671,7 +3666,7 @@ async function sa(t) {
|
|
|
3671
3666
|
};
|
|
3672
3667
|
});
|
|
3673
3668
|
}
|
|
3674
|
-
async function
|
|
3669
|
+
async function sa(t, e, n) {
|
|
3675
3670
|
const r = (
|
|
3676
3671
|
// Backwards compatibility for older versions where we JSON.stringified before storing
|
|
3677
3672
|
typeof e == "string" ? JSON.parse(e) : e
|
|
@@ -3705,14 +3700,14 @@ async function ia(t, e, n) {
|
|
|
3705
3700
|
};
|
|
3706
3701
|
});
|
|
3707
3702
|
}
|
|
3708
|
-
async function
|
|
3703
|
+
async function Yn(t, e, n) {
|
|
3709
3704
|
const r = n.put(e, t);
|
|
3710
3705
|
return new Promise((s, i) => {
|
|
3711
3706
|
r.onsuccess = () => s(), r.onerror = (o) => i(o);
|
|
3712
3707
|
});
|
|
3713
3708
|
}
|
|
3714
|
-
async function
|
|
3715
|
-
const n = await
|
|
3709
|
+
async function ia(t, e) {
|
|
3710
|
+
const n = await ra(`instant_${t}_5`);
|
|
3716
3711
|
if (!n)
|
|
3717
3712
|
return;
|
|
3718
3713
|
const r = await new Promise((l, d) => {
|
|
@@ -3735,12 +3730,12 @@ async function oa(t, e) {
|
|
|
3735
3730
|
for (const [l, d] of r)
|
|
3736
3731
|
switch (l) {
|
|
3737
3732
|
case "querySubs": {
|
|
3738
|
-
const h =
|
|
3733
|
+
const h = sa(l, d, o);
|
|
3739
3734
|
a.push(h);
|
|
3740
3735
|
break;
|
|
3741
3736
|
}
|
|
3742
3737
|
default: {
|
|
3743
|
-
const h =
|
|
3738
|
+
const h = Yn(l, d, i);
|
|
3744
3739
|
a.push(h);
|
|
3745
3740
|
const y = {
|
|
3746
3741
|
createdAt: Date.now(),
|
|
@@ -3751,13 +3746,13 @@ async function oa(t, e) {
|
|
|
3751
3746
|
break;
|
|
3752
3747
|
}
|
|
3753
3748
|
}
|
|
3754
|
-
const u =
|
|
3749
|
+
const u = Yn(Ne, c, i);
|
|
3755
3750
|
a.push(u), await Promise.all(a), await new Promise((l, d) => {
|
|
3756
3751
|
s.oncomplete = (h) => l(h), s.onerror = (h) => d(h), s.onabort = (h) => d(h);
|
|
3757
3752
|
});
|
|
3758
3753
|
}
|
|
3759
|
-
const
|
|
3760
|
-
class Qr extends
|
|
3754
|
+
const Zn = /* @__PURE__ */ new Map();
|
|
3755
|
+
class Qr extends Xo {
|
|
3761
3756
|
constructor(n, r) {
|
|
3762
3757
|
super(n, r);
|
|
3763
3758
|
p(this, "dbName");
|
|
@@ -3765,7 +3760,7 @@ class Qr extends ea {
|
|
|
3765
3760
|
p(this, "_appId");
|
|
3766
3761
|
p(this, "_prefix");
|
|
3767
3762
|
p(this, "_dbPromise");
|
|
3768
|
-
this.dbName = `instant_${n}_${
|
|
3763
|
+
this.dbName = `instant_${n}_${ea}`, this._storeName = r, this._appId = n, this._dbPromise = this._init();
|
|
3769
3764
|
}
|
|
3770
3765
|
_init() {
|
|
3771
3766
|
return new Promise((n, r) => {
|
|
@@ -3776,12 +3771,12 @@ class Qr extends ea {
|
|
|
3776
3771
|
}, i.onsuccess = (o) => {
|
|
3777
3772
|
const c = o.target.result;
|
|
3778
3773
|
if (s) {
|
|
3779
|
-
const u =
|
|
3780
|
-
|
|
3774
|
+
const u = ia(this._appId, c).catch((l) => {
|
|
3775
|
+
na("Error upgrading store from version 5 to 6.")(l);
|
|
3781
3776
|
});
|
|
3782
|
-
|
|
3777
|
+
Zn.set(this.dbName, u), u.then(() => n(c)).catch(() => n(c));
|
|
3783
3778
|
} else {
|
|
3784
|
-
const u =
|
|
3779
|
+
const u = Zn.get(this.dbName);
|
|
3785
3780
|
u ? u.then(() => n(c)).catch(() => n(c)) : n(c);
|
|
3786
3781
|
}
|
|
3787
3782
|
}, i.onupgradeneeded = (o) => {
|
|
@@ -3791,7 +3786,7 @@ class Qr extends ea {
|
|
|
3791
3786
|
}
|
|
3792
3787
|
_upgradeStore(n) {
|
|
3793
3788
|
const s = n.target.result;
|
|
3794
|
-
for (const i of
|
|
3789
|
+
for (const i of ta)
|
|
3795
3790
|
s.objectStoreNames.contains(i) || s.createObjectStore(i);
|
|
3796
3791
|
}
|
|
3797
3792
|
async getItem(n) {
|
|
@@ -3883,7 +3878,7 @@ class Ee extends Error {
|
|
|
3883
3878
|
return "InstantError";
|
|
3884
3879
|
}
|
|
3885
3880
|
}
|
|
3886
|
-
class
|
|
3881
|
+
class ft extends Ee {
|
|
3887
3882
|
constructor(n) {
|
|
3888
3883
|
var i;
|
|
3889
3884
|
const r = ((i = n.body) == null ? void 0 : i.message) || `API Error (${n.status})`;
|
|
@@ -3891,7 +3886,7 @@ class dt extends Ee {
|
|
|
3891
3886
|
p(this, "body");
|
|
3892
3887
|
p(this, "status");
|
|
3893
3888
|
const s = new.target.prototype;
|
|
3894
|
-
Object.setPrototypeOf && Object.setPrototypeOf(this, s), Error.captureStackTrace && Error.captureStackTrace(this,
|
|
3889
|
+
Object.setPrototypeOf && Object.setPrototypeOf(this, s), Error.captureStackTrace && Error.captureStackTrace(this, ft), this.name = "InstantAPIError", this.status = n.status, this.body = n.body;
|
|
3895
3890
|
}
|
|
3896
3891
|
get [Symbol.toStringTag]() {
|
|
3897
3892
|
return "InstantAPIError";
|
|
@@ -3899,16 +3894,16 @@ class dt extends Ee {
|
|
|
3899
3894
|
}
|
|
3900
3895
|
async function ne(t, e) {
|
|
3901
3896
|
const n = await fetch(t, e), r = await n.json();
|
|
3902
|
-
return n.status === 200 ? Promise.resolve(r) : Promise.reject(new
|
|
3897
|
+
return n.status === 200 ? Promise.resolve(r) : Promise.reject(new ft({ status: n.status, body: r }));
|
|
3903
3898
|
}
|
|
3904
|
-
function
|
|
3899
|
+
function oa({ apiURI: t, appId: e, email: n }) {
|
|
3905
3900
|
return ne(`${t}/runtime/auth/send_magic_code`, {
|
|
3906
3901
|
method: "POST",
|
|
3907
3902
|
headers: { "content-type": "application/json" },
|
|
3908
3903
|
body: JSON.stringify({ "app-id": e, email: n })
|
|
3909
3904
|
});
|
|
3910
3905
|
}
|
|
3911
|
-
async function
|
|
3906
|
+
async function aa({ apiURI: t, appId: e, email: n, code: r, refreshToken: s }) {
|
|
3912
3907
|
return await ne(`${t}/runtime/auth/verify_magic_code`, {
|
|
3913
3908
|
method: "POST",
|
|
3914
3909
|
headers: { "content-type": "application/json" },
|
|
@@ -3920,7 +3915,7 @@ async function ca({ apiURI: t, appId: e, email: n, code: r, refreshToken: s }) {
|
|
|
3920
3915
|
})
|
|
3921
3916
|
});
|
|
3922
3917
|
}
|
|
3923
|
-
async function
|
|
3918
|
+
async function ca({ apiURI: t, appId: e, refreshToken: n }) {
|
|
3924
3919
|
return await ne(`${t}/runtime/auth/verify_refresh_token`, {
|
|
3925
3920
|
method: "POST",
|
|
3926
3921
|
headers: { "content-type": "application/json" },
|
|
@@ -3930,7 +3925,7 @@ async function ua({ apiURI: t, appId: e, refreshToken: n }) {
|
|
|
3930
3925
|
})
|
|
3931
3926
|
});
|
|
3932
3927
|
}
|
|
3933
|
-
async function
|
|
3928
|
+
async function ua({ apiURI: t, appId: e }) {
|
|
3934
3929
|
return await ne(`${t}/runtime/auth/sign_in_guest`, {
|
|
3935
3930
|
method: "POST",
|
|
3936
3931
|
headers: { "content-type": "application/json" },
|
|
@@ -3939,7 +3934,7 @@ async function la({ apiURI: t, appId: e }) {
|
|
|
3939
3934
|
})
|
|
3940
3935
|
});
|
|
3941
3936
|
}
|
|
3942
|
-
async function
|
|
3937
|
+
async function Xn({ apiURI: t, appId: e, code: n, codeVerifier: r, refreshToken: s }) {
|
|
3943
3938
|
return await ne(`${t}/runtime/oauth/token`, {
|
|
3944
3939
|
method: "POST",
|
|
3945
3940
|
headers: { "content-type": "application/json" },
|
|
@@ -3951,7 +3946,7 @@ async function er({ apiURI: t, appId: e, code: n, codeVerifier: r, refreshToken:
|
|
|
3951
3946
|
})
|
|
3952
3947
|
});
|
|
3953
3948
|
}
|
|
3954
|
-
async function
|
|
3949
|
+
async function la({ apiURI: t, appId: e, nonce: n, idToken: r, clientName: s, refreshToken: i }) {
|
|
3955
3950
|
return await ne(`${t}/runtime/oauth/id_token`, {
|
|
3956
3951
|
method: "POST",
|
|
3957
3952
|
headers: { "content-type": "application/json" },
|
|
@@ -3964,7 +3959,7 @@ async function fa({ apiURI: t, appId: e, nonce: n, idToken: r, clientName: s, re
|
|
|
3964
3959
|
})
|
|
3965
3960
|
});
|
|
3966
3961
|
}
|
|
3967
|
-
async function
|
|
3962
|
+
async function fa({ apiURI: t, appId: e, refreshToken: n }) {
|
|
3968
3963
|
return await ne(`${t}/runtime/signout`, {
|
|
3969
3964
|
method: "POST",
|
|
3970
3965
|
headers: {
|
|
@@ -3976,7 +3971,7 @@ async function da({ apiURI: t, appId: e, refreshToken: n }) {
|
|
|
3976
3971
|
})
|
|
3977
3972
|
});
|
|
3978
3973
|
}
|
|
3979
|
-
async function
|
|
3974
|
+
async function da({ apiURI: t, appId: e, path: n, file: r, refreshToken: s, contentType: i, contentDisposition: o }) {
|
|
3980
3975
|
const a = {
|
|
3981
3976
|
app_id: e,
|
|
3982
3977
|
path: n,
|
|
@@ -3989,7 +3984,7 @@ async function ha({ apiURI: t, appId: e, path: n, file: r, refreshToken: s, cont
|
|
|
3989
3984
|
body: r
|
|
3990
3985
|
});
|
|
3991
3986
|
}
|
|
3992
|
-
async function
|
|
3987
|
+
async function ha({ apiURI: t, appId: e, path: n, refreshToken: r }) {
|
|
3993
3988
|
const { data: s } = await ne(`${t}/storage/files?app_id=${e}&filename=${encodeURIComponent(n)}`, {
|
|
3994
3989
|
method: "DELETE",
|
|
3995
3990
|
headers: {
|
|
@@ -3999,7 +3994,7 @@ async function pa({ apiURI: t, appId: e, path: n, refreshToken: r }) {
|
|
|
3999
3994
|
});
|
|
4000
3995
|
return s;
|
|
4001
3996
|
}
|
|
4002
|
-
async function
|
|
3997
|
+
async function pa({ apiURI: t, appId: e, fileName: n, refreshToken: r, metadata: s = {} }) {
|
|
4003
3998
|
const { data: i } = await ne(`${t}/storage/signed-upload-url`, {
|
|
4004
3999
|
method: "POST",
|
|
4005
4000
|
headers: {
|
|
@@ -4013,7 +4008,7 @@ async function ya({ apiURI: t, appId: e, fileName: n, refreshToken: r, metadata:
|
|
|
4013
4008
|
});
|
|
4014
4009
|
return i;
|
|
4015
4010
|
}
|
|
4016
|
-
async function
|
|
4011
|
+
async function ya(t, e) {
|
|
4017
4012
|
return (await fetch(t, {
|
|
4018
4013
|
method: "PUT",
|
|
4019
4014
|
body: e,
|
|
@@ -4022,7 +4017,7 @@ async function ba(t, e) {
|
|
|
4022
4017
|
}
|
|
4023
4018
|
})).ok;
|
|
4024
4019
|
}
|
|
4025
|
-
async function
|
|
4020
|
+
async function ba({ apiURI: t, appId: e, path: n, refreshToken: r }) {
|
|
4026
4021
|
const { data: s } = await ne(`${t}/storage/signed-download-url?app_id=${e}&filename=${encodeURIComponent(n)}`, {
|
|
4027
4022
|
method: "GET",
|
|
4028
4023
|
headers: {
|
|
@@ -4032,9 +4027,9 @@ async function _a({ apiURI: t, appId: e, path: n, refreshToken: r }) {
|
|
|
4032
4027
|
});
|
|
4033
4028
|
return s;
|
|
4034
4029
|
}
|
|
4035
|
-
let
|
|
4036
|
-
typeof window < "u" && typeof window.localStorage < "u" && (
|
|
4037
|
-
function
|
|
4030
|
+
let un = !1, Gr = !1, Hr = !1;
|
|
4031
|
+
typeof window < "u" && typeof window.localStorage < "u" && (un = !!window.localStorage.getItem("devBackend"), Gr = !!window.localStorage.getItem("__instantLogging"), Hr = !!window.localStorage.getItem("__devtoolLocalDash"));
|
|
4032
|
+
function er(t, e) {
|
|
4038
4033
|
if (!e)
|
|
4039
4034
|
return t;
|
|
4040
4035
|
const n = {};
|
|
@@ -4042,32 +4037,32 @@ function tr(t, e) {
|
|
|
4042
4037
|
n[r] = t[r];
|
|
4043
4038
|
}), n;
|
|
4044
4039
|
}
|
|
4045
|
-
function
|
|
4040
|
+
function _a(t, e, n) {
|
|
4046
4041
|
const r = {
|
|
4047
4042
|
peers: {}
|
|
4048
4043
|
};
|
|
4049
4044
|
if (e && "user" in e ? e.user : !0) {
|
|
4050
|
-
const i =
|
|
4045
|
+
const i = er(t.user ?? {}, e == null ? void 0 : e.keys);
|
|
4051
4046
|
r.user = { ...i, peerId: n };
|
|
4052
4047
|
}
|
|
4053
4048
|
for (const i of Object.keys(t.peers ?? {})) {
|
|
4054
4049
|
const o = (e == null ? void 0 : e.peers) === void 0, a = Array.isArray(e == null ? void 0 : e.peers) && (e == null ? void 0 : e.peers.includes(i));
|
|
4055
4050
|
if (o || a) {
|
|
4056
|
-
const c =
|
|
4051
|
+
const c = er(t.peers[i], e == null ? void 0 : e.keys);
|
|
4057
4052
|
r.peers[i] = { ...c, peerId: i };
|
|
4058
4053
|
}
|
|
4059
4054
|
}
|
|
4060
4055
|
return r;
|
|
4061
4056
|
}
|
|
4062
|
-
function
|
|
4063
|
-
if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !
|
|
4057
|
+
function ga(t, e) {
|
|
4058
|
+
if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !Fn(t.user, e.user)) || !Ar(t.peers, e.peers))
|
|
4064
4059
|
return !0;
|
|
4065
4060
|
for (const r of Object.keys(t.peers))
|
|
4066
|
-
if (!
|
|
4061
|
+
if (!Fn(t.peers[r], e.peers[r]))
|
|
4067
4062
|
return !0;
|
|
4068
4063
|
return !1;
|
|
4069
4064
|
}
|
|
4070
|
-
class
|
|
4065
|
+
class tr {
|
|
4071
4066
|
constructor() {
|
|
4072
4067
|
p(this, "promise");
|
|
4073
4068
|
p(this, "_resolve");
|
|
@@ -4092,11 +4087,11 @@ function Jr(t, e = []) {
|
|
|
4092
4087
|
Jr(n["child-nodes"], e);
|
|
4093
4088
|
});
|
|
4094
4089
|
}
|
|
4095
|
-
function
|
|
4090
|
+
function nr(t) {
|
|
4096
4091
|
const e = [];
|
|
4097
4092
|
return Jr(t, e), e;
|
|
4098
4093
|
}
|
|
4099
|
-
function
|
|
4094
|
+
function rr(t) {
|
|
4100
4095
|
return Object.values(t.links).reduce((e, n) => {
|
|
4101
4096
|
var r, s;
|
|
4102
4097
|
return e[r = n.forward.on] ?? (e[r] = {}), e[n.forward.on][n.forward.label] = {
|
|
@@ -4110,8 +4105,8 @@ function sr(t) {
|
|
|
4110
4105
|
}, e;
|
|
4111
4106
|
}, {});
|
|
4112
4107
|
}
|
|
4113
|
-
const Yr = "v0.22.105-experimental.drewh-
|
|
4114
|
-
function
|
|
4108
|
+
const Yr = "v0.22.105-experimental.drewh-clief.21154267631.1";
|
|
4109
|
+
function Ta(t, e) {
|
|
4115
4110
|
return {
|
|
4116
4111
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
4117
4112
|
},
|
|
@@ -4160,7 +4155,7 @@ class R extends Error {
|
|
|
4160
4155
|
super(r), this.name = "QueryValidationError";
|
|
4161
4156
|
}
|
|
4162
4157
|
}
|
|
4163
|
-
const
|
|
4158
|
+
const sr = [
|
|
4164
4159
|
"where",
|
|
4165
4160
|
"order",
|
|
4166
4161
|
"limit",
|
|
@@ -4171,7 +4166,7 @@ const ir = [
|
|
|
4171
4166
|
"before",
|
|
4172
4167
|
"fields",
|
|
4173
4168
|
"aggregate"
|
|
4174
|
-
],
|
|
4169
|
+
], wa = (t) => t.valueType || "unknown", Zr = (t, e, n = !1) => {
|
|
4175
4170
|
if (n || t == null)
|
|
4176
4171
|
return !0;
|
|
4177
4172
|
switch (e) {
|
|
@@ -4186,7 +4181,7 @@ const ir = [
|
|
|
4186
4181
|
default:
|
|
4187
4182
|
return !0;
|
|
4188
4183
|
}
|
|
4189
|
-
},
|
|
4184
|
+
}, ma = (t, e, n, r, s, i, o) => {
|
|
4190
4185
|
const a = i.valueType === "json", c = (u, l, d) => {
|
|
4191
4186
|
if (!Zr(d, l, a))
|
|
4192
4187
|
throw new R(`Invalid value for operator '${u}' on attribute '${r}' in entity '${s}'. Expected ${l}, but received: ${typeof d}`, o);
|
|
@@ -4219,16 +4214,16 @@ const ir = [
|
|
|
4219
4214
|
throw new R(`Unknown operator '${t}' for attribute '${r}' in entity '${s}'`, o);
|
|
4220
4215
|
}
|
|
4221
4216
|
}, ve = (t, e, n, r, s) => {
|
|
4222
|
-
const i =
|
|
4217
|
+
const i = wa(n), o = n.valueType === "json";
|
|
4223
4218
|
if (typeof t == "object" && t !== null && !Array.isArray(t)) {
|
|
4224
4219
|
if (o)
|
|
4225
4220
|
return;
|
|
4226
4221
|
const c = t;
|
|
4227
4222
|
for (const [u, l] of Object.entries(c))
|
|
4228
|
-
|
|
4223
|
+
ma(u, l, i, e, r, n, `${s}.${u}`);
|
|
4229
4224
|
} else if (!Zr(t, i, o))
|
|
4230
4225
|
throw new R(`Invalid value for attribute '${e}' in entity '${r}'. Expected ${i}, but received: ${typeof t}`, s);
|
|
4231
|
-
},
|
|
4226
|
+
}, Sa = (t, e, n, r, s) => {
|
|
4232
4227
|
const i = t.split(".");
|
|
4233
4228
|
if (i.length < 2)
|
|
4234
4229
|
throw new R(`Invalid dot notation path '${t}'. Must contain at least one dot.`, s);
|
|
@@ -4278,7 +4273,7 @@ const ir = [
|
|
|
4278
4273
|
continue;
|
|
4279
4274
|
}
|
|
4280
4275
|
if (s.includes(".")) {
|
|
4281
|
-
|
|
4276
|
+
Sa(s, i, e, n, `${r}.${s}`);
|
|
4282
4277
|
continue;
|
|
4283
4278
|
}
|
|
4284
4279
|
const o = n.entities[e];
|
|
@@ -4298,10 +4293,10 @@ const ir = [
|
|
|
4298
4293
|
ve(i, s, u, e, `${r}.${s}`);
|
|
4299
4294
|
}
|
|
4300
4295
|
}
|
|
4301
|
-
},
|
|
4296
|
+
}, va = (t, e, n, r, s = 0) => {
|
|
4302
4297
|
for (const o of Object.keys(t))
|
|
4303
|
-
if (!
|
|
4304
|
-
throw new R(`Invalid query parameter '${o}' in $ object. Valid parameters are: ${
|
|
4298
|
+
if (!sr.includes(o))
|
|
4299
|
+
throw new R(`Invalid query parameter '${o}' in $ object. Valid parameters are: ${sr.join(", ")}. Found: ${o}`, r);
|
|
4305
4300
|
const i = [
|
|
4306
4301
|
// 'limit', // only supported client side
|
|
4307
4302
|
"offset",
|
|
@@ -4337,9 +4332,9 @@ const ir = [
|
|
|
4337
4332
|
const a = t[o];
|
|
4338
4333
|
if (typeof a != "object" || a === null)
|
|
4339
4334
|
throw new R(`Query parameter '$' must be an object in entity '${e}', but received: ${typeof a}`, `${r}.$`);
|
|
4340
|
-
|
|
4335
|
+
va(a, e, n, `${r}.$`, s);
|
|
4341
4336
|
}
|
|
4342
|
-
},
|
|
4337
|
+
}, ir = (t, e) => {
|
|
4343
4338
|
if (typeof t != "object" || t === null)
|
|
4344
4339
|
throw new R(`Query must be an object, but received: ${typeof t}${t === null ? " (null)" : ""}`);
|
|
4345
4340
|
if (Array.isArray(t))
|
|
@@ -4358,27 +4353,27 @@ const ir = [
|
|
|
4358
4353
|
es(n[r], r, e, r, 0);
|
|
4359
4354
|
}
|
|
4360
4355
|
}
|
|
4361
|
-
},
|
|
4356
|
+
}, or = (t) => typeof t != "string" ? !1 : ct(t) ? !0 : Ae(t);
|
|
4362
4357
|
class Z extends Error {
|
|
4363
4358
|
constructor(e) {
|
|
4364
4359
|
super(e), this.name = "TransactionValidationError";
|
|
4365
4360
|
}
|
|
4366
4361
|
}
|
|
4367
|
-
const ts = (t) => t.length > 0 ? t.join(", ") : "none",
|
|
4362
|
+
const ts = (t) => t.length > 0 ? t.join(", ") : "none", Aa = (t, e) => new Z(`Entity '${t}' does not exist in schema. Available entities: ${ts(e)}`), At = {
|
|
4368
4363
|
string: (t) => typeof t == "string",
|
|
4369
4364
|
number: (t) => typeof t == "number" && !isNaN(t),
|
|
4370
4365
|
boolean: (t) => typeof t == "boolean",
|
|
4371
4366
|
date: (t) => t instanceof Date || typeof t == "string" || typeof t == "number",
|
|
4372
4367
|
json: () => !0
|
|
4373
|
-
},
|
|
4368
|
+
}, Oa = (t, e) => {
|
|
4374
4369
|
var n;
|
|
4375
|
-
return t == null ? !0 : ((n =
|
|
4370
|
+
return t == null ? !0 : ((n = At[e.valueType]) == null ? void 0 : n.call(At, t)) ?? !1;
|
|
4376
4371
|
}, ns = (t, e) => {
|
|
4377
4372
|
const n = e.entities[t];
|
|
4378
4373
|
if (!n)
|
|
4379
|
-
throw
|
|
4374
|
+
throw Aa(t, Object.keys(e.entities));
|
|
4380
4375
|
return n;
|
|
4381
|
-
},
|
|
4376
|
+
}, Ot = (t, e, n) => {
|
|
4382
4377
|
const r = ns(t, n);
|
|
4383
4378
|
if (typeof e != "object" || e === null)
|
|
4384
4379
|
throw new Z(`Arguments for data operation on entity '${t}' must be an object, but received: ${typeof e}`);
|
|
@@ -4386,10 +4381,10 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Oa = (t, e) => new Z(`En
|
|
|
4386
4381
|
if (s === "id")
|
|
4387
4382
|
continue;
|
|
4388
4383
|
const o = r.attrs[s];
|
|
4389
|
-
if (o && !
|
|
4384
|
+
if (o && !Oa(i, o))
|
|
4390
4385
|
throw new Z(`Invalid value for attribute '${s}' in entity '${t}'. Expected ${o.valueType}, but received: ${typeof i}`);
|
|
4391
4386
|
}
|
|
4392
|
-
},
|
|
4387
|
+
}, ar = (t, e, n) => {
|
|
4393
4388
|
const r = ns(t, n);
|
|
4394
4389
|
if (typeof e != "object" || e === null)
|
|
4395
4390
|
throw new Z(`Arguments for link operation on entity '${t}' must be an object, but received: ${typeof e}`);
|
|
@@ -4401,21 +4396,21 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Oa = (t, e) => new Z(`En
|
|
|
4401
4396
|
if (i != null) {
|
|
4402
4397
|
if (Array.isArray(i)) {
|
|
4403
4398
|
for (const a of i)
|
|
4404
|
-
if (!
|
|
4399
|
+
if (!or(a))
|
|
4405
4400
|
throw new Z(`Invalid entity ID in link '${s}' for entity '${t}'. Expected a UUID or a lookup, but received: ${a}`);
|
|
4406
|
-
} else if (!
|
|
4401
|
+
} else if (!or(i))
|
|
4407
4402
|
throw new Z(`Invalid UUID in link '${s}' for entity '${t}'. Expected a UUID, but received: ${i}`);
|
|
4408
4403
|
}
|
|
4409
4404
|
}
|
|
4410
|
-
},
|
|
4411
|
-
create:
|
|
4412
|
-
update:
|
|
4413
|
-
merge:
|
|
4414
|
-
link:
|
|
4415
|
-
unlink:
|
|
4405
|
+
}, Ea = {
|
|
4406
|
+
create: Ot,
|
|
4407
|
+
update: Ot,
|
|
4408
|
+
merge: Ot,
|
|
4409
|
+
link: ar,
|
|
4410
|
+
unlink: ar,
|
|
4416
4411
|
delete: () => {
|
|
4417
4412
|
}
|
|
4418
|
-
},
|
|
4413
|
+
}, ka = (t, e) => {
|
|
4419
4414
|
if (!e)
|
|
4420
4415
|
return;
|
|
4421
4416
|
const [n, r, s, i] = t;
|
|
@@ -4423,9 +4418,9 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Oa = (t, e) => new Z(`En
|
|
|
4423
4418
|
throw new Z(`Invalid id for entity '${r}'. Expected a UUID, but received: ${s}`);
|
|
4424
4419
|
if (typeof r != "string")
|
|
4425
4420
|
throw new Z(`Entity name must be a string, but received: ${typeof r}`);
|
|
4426
|
-
const o =
|
|
4421
|
+
const o = Ea[n];
|
|
4427
4422
|
o && i !== void 0 && o(r, i, e);
|
|
4428
|
-
},
|
|
4423
|
+
}, Pa = (t, e) => {
|
|
4429
4424
|
const n = Array.isArray(t) ? t : [t];
|
|
4430
4425
|
for (const r of n) {
|
|
4431
4426
|
if (!r || typeof r != "object")
|
|
@@ -4435,12 +4430,12 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Oa = (t, e) => new Z(`En
|
|
|
4435
4430
|
for (const s of r.__ops) {
|
|
4436
4431
|
if (!Array.isArray(s))
|
|
4437
4432
|
throw new Z(`Transaction operation must be an array, but received: ${typeof s}`);
|
|
4438
|
-
|
|
4433
|
+
ka(s, e);
|
|
4439
4434
|
}
|
|
4440
4435
|
}
|
|
4441
4436
|
};
|
|
4442
4437
|
let rs = 0;
|
|
4443
|
-
class
|
|
4438
|
+
class cr {
|
|
4444
4439
|
constructor(e) {
|
|
4445
4440
|
p(this, "type", "ws");
|
|
4446
4441
|
p(this, "conn");
|
|
@@ -4475,7 +4470,7 @@ class ur {
|
|
|
4475
4470
|
return this.conn.send(JSON.stringify(e));
|
|
4476
4471
|
}
|
|
4477
4472
|
}
|
|
4478
|
-
class
|
|
4473
|
+
class Ca {
|
|
4479
4474
|
constructor(e, n) {
|
|
4480
4475
|
p(this, "type", "sse");
|
|
4481
4476
|
p(this, "initParams", null);
|
|
@@ -4571,24 +4566,24 @@ class Ia {
|
|
|
4571
4566
|
this.handleClose();
|
|
4572
4567
|
}
|
|
4573
4568
|
}
|
|
4574
|
-
function
|
|
4569
|
+
function Ia(t, e) {
|
|
4575
4570
|
const n = t.values;
|
|
4576
4571
|
if (n) {
|
|
4577
|
-
const r =
|
|
4572
|
+
const r = Ir(n.attrsStore, null);
|
|
4578
4573
|
if (r) {
|
|
4579
4574
|
for (const s of n.entities || [])
|
|
4580
|
-
s.store.useDateObjects = e, s.store =
|
|
4575
|
+
s.store.useDateObjects = e, s.store = Cr(r, s.store);
|
|
4581
4576
|
n.attrsStore = r;
|
|
4582
4577
|
}
|
|
4583
4578
|
}
|
|
4584
4579
|
return t;
|
|
4585
4580
|
}
|
|
4586
|
-
function
|
|
4581
|
+
function Ma(t, e) {
|
|
4587
4582
|
var n;
|
|
4588
4583
|
if (e.values) {
|
|
4589
4584
|
const r = [];
|
|
4590
4585
|
for (const s of (n = e.values) == null ? void 0 : n.entities) {
|
|
4591
|
-
const i =
|
|
4586
|
+
const i = Pr(s.store);
|
|
4592
4587
|
r.push({ ...s, store: i });
|
|
4593
4588
|
}
|
|
4594
4589
|
return {
|
|
@@ -4598,15 +4593,15 @@ function ja(t, e) {
|
|
|
4598
4593
|
} else
|
|
4599
4594
|
return e;
|
|
4600
4595
|
}
|
|
4601
|
-
function
|
|
4596
|
+
function ja(t, e, n) {
|
|
4602
4597
|
var i, o;
|
|
4603
4598
|
const r = (i = e == null ? void 0 : e.state) == null ? void 0 : i.txId, s = (o = n == null ? void 0 : n.state) == null ? void 0 : o.txId;
|
|
4604
4599
|
return r && (!s || r > s) ? e : s && (!r || s > r) ? n : e || n;
|
|
4605
4600
|
}
|
|
4606
|
-
function
|
|
4607
|
-
return
|
|
4601
|
+
function Et(t, e, n) {
|
|
4602
|
+
return qr({ store: e, attrsStore: n, pageInfo: null, aggregate: null }, t.query).data[t.table][0];
|
|
4608
4603
|
}
|
|
4609
|
-
function
|
|
4604
|
+
function ur(t, e, n, r) {
|
|
4610
4605
|
var o;
|
|
4611
4606
|
const s = (o = U(n, t.table, "id")) == null ? void 0 : o.id;
|
|
4612
4607
|
if (!s)
|
|
@@ -4614,18 +4609,18 @@ function lr(t, e, n, r) {
|
|
|
4614
4609
|
const i = ke(e.eav, [r, s, r]);
|
|
4615
4610
|
return i ? i[3] : -1;
|
|
4616
4611
|
}
|
|
4617
|
-
function
|
|
4612
|
+
function lr(t, e, n) {
|
|
4618
4613
|
for (const { action: r, triple: s } of n)
|
|
4619
4614
|
switch (r) {
|
|
4620
4615
|
case "added":
|
|
4621
|
-
|
|
4616
|
+
Rr(t, e, s);
|
|
4622
4617
|
break;
|
|
4623
4618
|
case "removed":
|
|
4624
|
-
|
|
4619
|
+
Mr(t, e, s);
|
|
4625
4620
|
break;
|
|
4626
4621
|
}
|
|
4627
4622
|
}
|
|
4628
|
-
function
|
|
4623
|
+
function Ra(t, e, n) {
|
|
4629
4624
|
var s, i;
|
|
4630
4625
|
const r = {};
|
|
4631
4626
|
for (const { action: o, triple: a } of n) {
|
|
@@ -4653,14 +4648,14 @@ function $a(t, e, n) {
|
|
|
4653
4648
|
function Xe(t, e) {
|
|
4654
4649
|
return { [t.table]: e.map((n) => n.entity) };
|
|
4655
4650
|
}
|
|
4656
|
-
function
|
|
4651
|
+
function $a(t, e) {
|
|
4657
4652
|
var r;
|
|
4658
4653
|
if (t.orderFieldType)
|
|
4659
4654
|
return t.orderFieldType;
|
|
4660
4655
|
const n = t.orderField === "serverCreatedAt" ? "number" : (r = U(e(), t.table, t.orderField)) == null ? void 0 : r["checked-data-type"];
|
|
4661
4656
|
return t.orderFieldType = n, n;
|
|
4662
4657
|
}
|
|
4663
|
-
function
|
|
4658
|
+
function Da(t, e, n) {
|
|
4664
4659
|
const r = e;
|
|
4665
4660
|
if (t.orderField === "serverCreatedAt") {
|
|
4666
4661
|
n.sort(t.orderDirection === "asc" ? function(o, a) {
|
|
@@ -4681,7 +4676,7 @@ var de;
|
|
|
4681
4676
|
(function(t) {
|
|
4682
4677
|
t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error";
|
|
4683
4678
|
})(de || (de = {}));
|
|
4684
|
-
class
|
|
4679
|
+
class xa {
|
|
4685
4680
|
constructor(e, n, r, s, i, o) {
|
|
4686
4681
|
p(this, "trySend");
|
|
4687
4682
|
p(this, "subs");
|
|
@@ -4692,11 +4687,11 @@ class Ua {
|
|
|
4692
4687
|
p(this, "log");
|
|
4693
4688
|
p(this, "createStore");
|
|
4694
4689
|
p(this, "getAttrs");
|
|
4695
|
-
this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.getAttrs = o, this.subs = new
|
|
4690
|
+
this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.getAttrs = o, this.subs = new Bt({
|
|
4696
4691
|
persister: n,
|
|
4697
|
-
merge:
|
|
4698
|
-
serialize:
|
|
4699
|
-
parse: (a, c) =>
|
|
4692
|
+
merge: ja,
|
|
4693
|
+
serialize: Ma,
|
|
4694
|
+
parse: (a, c) => Ia(c, this.config.useDateObjects),
|
|
4700
4695
|
objectSize: (a) => {
|
|
4701
4696
|
var c;
|
|
4702
4697
|
return ((c = a.values) == null ? void 0 : c.entities.length) || 0;
|
|
@@ -4817,11 +4812,11 @@ class Ua {
|
|
|
4817
4812
|
o.values = a;
|
|
4818
4813
|
const c = a.entities;
|
|
4819
4814
|
for (const u of r) {
|
|
4820
|
-
const l = this.createStore(u), d =
|
|
4815
|
+
const l = this.createStore(u), d = Et(o, l, a.attrsStore);
|
|
4821
4816
|
c.push({
|
|
4822
4817
|
store: l,
|
|
4823
4818
|
entity: d,
|
|
4824
|
-
serverCreatedAt:
|
|
4819
|
+
serverCreatedAt: ur(o, l, a.attrsStore, d.id)
|
|
4825
4820
|
}), i.push(d);
|
|
4826
4821
|
}
|
|
4827
4822
|
this.subs.updateInPlace((u) => {
|
|
@@ -4892,8 +4887,8 @@ class Ua {
|
|
|
4892
4887
|
for (let T = 0; T < d.length; T++) {
|
|
4893
4888
|
const v = d[T];
|
|
4894
4889
|
if (yi(v.store, w)) {
|
|
4895
|
-
|
|
4896
|
-
const E =
|
|
4890
|
+
lr(v.store, l.attrsStore, m);
|
|
4891
|
+
const E = Et(s, v.store, l.attrsStore), A = Ra(v.store, l.attrsStore, m)[w];
|
|
4897
4892
|
E ? (h.push({
|
|
4898
4893
|
oldEntity: v.entity,
|
|
4899
4894
|
newEntity: E,
|
|
@@ -4905,8 +4900,8 @@ class Ua {
|
|
|
4905
4900
|
const y = [];
|
|
4906
4901
|
for (const [w, m] of Object.entries(u)) {
|
|
4907
4902
|
const T = this.createStore([]);
|
|
4908
|
-
|
|
4909
|
-
const v =
|
|
4903
|
+
lr(T, l.attrsStore, m);
|
|
4904
|
+
const v = Et(s, T, l.attrsStore);
|
|
4910
4905
|
if (!v) {
|
|
4911
4906
|
this.log.error("No entity found after applying change", {
|
|
4912
4907
|
sub: s,
|
|
@@ -4918,14 +4913,14 @@ class Ua {
|
|
|
4918
4913
|
d.push({
|
|
4919
4914
|
store: T,
|
|
4920
4915
|
entity: v,
|
|
4921
|
-
serverCreatedAt:
|
|
4916
|
+
serverCreatedAt: ur(s, T, l.attrsStore, v.id)
|
|
4922
4917
|
}), y.push(v);
|
|
4923
4918
|
}
|
|
4924
4919
|
const b = [];
|
|
4925
4920
|
for (const w of c.sort().reverse())
|
|
4926
4921
|
b.push(d[w].entity), d.splice(w, 1);
|
|
4927
|
-
const g =
|
|
4928
|
-
|
|
4922
|
+
const g = $a(s, this.getAttrs);
|
|
4923
|
+
Da(s, g, d), this.notifyCbs(r, {
|
|
4929
4924
|
type: de.SyncTransaction,
|
|
4930
4925
|
data: Xe(s, (o = s.values) == null ? void 0 : o.entities),
|
|
4931
4926
|
added: y,
|
|
@@ -4972,39 +4967,39 @@ const ie = {
|
|
|
4972
4967
|
AUTHENTICATED: "authenticated",
|
|
4973
4968
|
CLOSED: "closed",
|
|
4974
4969
|
ERRORED: "errored"
|
|
4975
|
-
},
|
|
4970
|
+
}, Ua = 3e4, La = 3e4, Fa = 200, Na = 1e3 * 60, Ka = {
|
|
4976
4971
|
apiURI: "https://api.instantdb.com",
|
|
4977
4972
|
websocketURI: "wss://api.instantdb.com/runtime/session"
|
|
4978
|
-
},
|
|
4979
|
-
function
|
|
4973
|
+
}, kt = "_instant_oauth_redirect", Re = "currentUser";
|
|
4974
|
+
function qa({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl: s }) {
|
|
4980
4975
|
if (!s)
|
|
4981
|
-
return new
|
|
4976
|
+
return new cr(`${r}?app_id=${e}`);
|
|
4982
4977
|
switch (t) {
|
|
4983
4978
|
case "ws":
|
|
4984
|
-
return new
|
|
4979
|
+
return new cr(`${r}?app_id=${e}`);
|
|
4985
4980
|
case "sse":
|
|
4986
|
-
return new
|
|
4981
|
+
return new Ca(s, `${n}/runtime/sse?app_id=${e}`);
|
|
4987
4982
|
default:
|
|
4988
4983
|
throw new Error("Unknown transport type " + t);
|
|
4989
4984
|
}
|
|
4990
4985
|
}
|
|
4991
|
-
function
|
|
4986
|
+
function za() {
|
|
4992
4987
|
return typeof window < "u" || typeof chrome < "u";
|
|
4993
4988
|
}
|
|
4994
|
-
const
|
|
4989
|
+
const fr = {
|
|
4995
4990
|
"set-presence": !0,
|
|
4996
4991
|
"set-presence-ok": !0,
|
|
4997
4992
|
"refresh-presence": !0,
|
|
4998
4993
|
"patch-presence": !0
|
|
4999
4994
|
};
|
|
5000
|
-
function
|
|
4995
|
+
function Va(t, e) {
|
|
5001
4996
|
var r;
|
|
5002
4997
|
const n = typeof t == "string" ? JSON.parse(t) : t;
|
|
5003
4998
|
if ((r = n == null ? void 0 : n.result) != null && r.store) {
|
|
5004
|
-
const s =
|
|
4999
|
+
const s = Ir(n.result.attrsStore, n.result.store);
|
|
5005
5000
|
if (s) {
|
|
5006
5001
|
const i = n.result.store;
|
|
5007
|
-
n.result.store =
|
|
5002
|
+
n.result.store = Cr(s, {
|
|
5008
5003
|
...i,
|
|
5009
5004
|
useDateObjects: e
|
|
5010
5005
|
}), n.result.attrsStore = s;
|
|
@@ -5012,7 +5007,7 @@ function Wa(t, e) {
|
|
|
5012
5007
|
}
|
|
5013
5008
|
return n;
|
|
5014
5009
|
}
|
|
5015
|
-
function
|
|
5010
|
+
function Wa(t, e) {
|
|
5016
5011
|
const { result: n, ...r } = e, s = (
|
|
5017
5012
|
/** @type {import('./reactorTypes.ts').QuerySubInStorage} */
|
|
5018
5013
|
r
|
|
@@ -5020,14 +5015,14 @@ function Qa(t, e) {
|
|
|
5020
5015
|
if (n) {
|
|
5021
5016
|
const i = {
|
|
5022
5017
|
...n,
|
|
5023
|
-
store:
|
|
5018
|
+
store: Pr(n.store),
|
|
5024
5019
|
attrsStore: n.attrsStore.toJSON()
|
|
5025
5020
|
};
|
|
5026
5021
|
s.result = i;
|
|
5027
5022
|
}
|
|
5028
5023
|
return s;
|
|
5029
5024
|
}
|
|
5030
|
-
function
|
|
5025
|
+
function Qa(t, e) {
|
|
5031
5026
|
switch (t) {
|
|
5032
5027
|
case "pendingMutations":
|
|
5033
5028
|
return new Map(typeof e == "string" ? JSON.parse(e) : e);
|
|
@@ -5035,7 +5030,7 @@ function Ba(t, e) {
|
|
|
5035
5030
|
return e;
|
|
5036
5031
|
}
|
|
5037
5032
|
}
|
|
5038
|
-
function
|
|
5033
|
+
function Ba(t, e) {
|
|
5039
5034
|
switch (t) {
|
|
5040
5035
|
case "pendingMutations":
|
|
5041
5036
|
return [...e.entries()];
|
|
@@ -5043,17 +5038,17 @@ function Ga(t, e) {
|
|
|
5043
5038
|
return e;
|
|
5044
5039
|
}
|
|
5045
5040
|
}
|
|
5046
|
-
function
|
|
5041
|
+
function Ga(t, e, n) {
|
|
5047
5042
|
const r = e == null ? void 0 : e.result, s = n == null ? void 0 : n.result;
|
|
5048
5043
|
return r && !s && n && (n.result = r), n || e;
|
|
5049
5044
|
}
|
|
5050
|
-
function
|
|
5045
|
+
function Pt(t) {
|
|
5051
5046
|
return [...t].sort((e, n) => {
|
|
5052
5047
|
const [r, s] = e, [i, o] = n, a = s.order || 0, c = o.order || 0;
|
|
5053
5048
|
return a == c ? r < i ? -1 : r > i ? 1 : 0 : a - c;
|
|
5054
5049
|
});
|
|
5055
5050
|
}
|
|
5056
|
-
class
|
|
5051
|
+
class Ha {
|
|
5057
5052
|
constructor(e, n = Qr, r = Br, s, i) {
|
|
5058
5053
|
/** @type {s.AttrsStore | undefined} */
|
|
5059
5054
|
p(this, "attrs");
|
|
@@ -5148,9 +5143,9 @@ class Ja {
|
|
|
5148
5143
|
});
|
|
5149
5144
|
/** Applies transactions locally and sends transact message to server */
|
|
5150
5145
|
p(this, "pushTx", (e) => {
|
|
5151
|
-
this.config.disableValidation ||
|
|
5146
|
+
this.config.disableValidation || Pa(e, this.config.schema);
|
|
5152
5147
|
try {
|
|
5153
|
-
const n =
|
|
5148
|
+
const n = Zo({
|
|
5154
5149
|
attrsStore: this.optimisticAttrs(),
|
|
5155
5150
|
schema: this.config.schema,
|
|
5156
5151
|
stores: Object.values(this.querySubs.currentValue).map((r) => {
|
|
@@ -5180,7 +5175,7 @@ class Ja {
|
|
|
5180
5175
|
this._updatePendingMutations((c) => {
|
|
5181
5176
|
c.set(r, o);
|
|
5182
5177
|
});
|
|
5183
|
-
const a = new
|
|
5178
|
+
const a = new tr();
|
|
5184
5179
|
return this.mutationDeferredStore.set(r, a), this._sendMutation(r, o), this.notifyAll(), a.promise;
|
|
5185
5180
|
});
|
|
5186
5181
|
p(this, "_transportOnOpen", (e) => {
|
|
@@ -5251,7 +5246,7 @@ class Ja {
|
|
|
5251
5246
|
}
|
|
5252
5247
|
this._log.info("[socket][close]", n.id, "schedule reconnect, ms =", this._reconnectTimeoutMs), this._scheduleReconnect();
|
|
5253
5248
|
});
|
|
5254
|
-
if (this._EventSource = i, this.config = { ...
|
|
5249
|
+
if (this._EventSource = i, this.config = { ...Ka, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? La, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Fa, this._log = Ta(e.verbose || un || Gr, () => this._reactorStats()), this.versions = { ...s || {}, "@instantdb/core": Yr }, this.config.schema && (this._linkIndex = rr(this.config.schema)), !!za()) {
|
|
5255
5250
|
if (!e.appId)
|
|
5256
5251
|
throw new Error("Instant must be initialized with an appId.");
|
|
5257
5252
|
if (!Ae(e.appId))
|
|
@@ -5266,14 +5261,14 @@ class Ja {
|
|
|
5266
5261
|
} catch (c) {
|
|
5267
5262
|
this._log.error("[error] handle broadcast channel", c);
|
|
5268
5263
|
}
|
|
5269
|
-
})), this._initStorage(n), this._syncTable = new
|
|
5264
|
+
})), this._initStorage(n), this._syncTable = new xa(this._trySendAuthed.bind(this), new n(this.config.appId, "syncSubs"), {
|
|
5270
5265
|
useDateObjects: this.config.useDateObjects
|
|
5271
5266
|
}, this._log, (o) => xe(this.ensureAttrs(), o, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser().then((o) => {
|
|
5272
5267
|
this.syncUserToEndpoint(o.user);
|
|
5273
5268
|
}), setInterval(async () => {
|
|
5274
5269
|
const o = await this.getCurrentUser();
|
|
5275
5270
|
this.syncUserToEndpoint(o.user);
|
|
5276
|
-
},
|
|
5271
|
+
}, Na), r.getIsOnline().then((o) => {
|
|
5277
5272
|
this._isOnline = o, this._startSocket(), r.listen((a) => {
|
|
5278
5273
|
a !== this._isOnline && (this._log.info("[network] online =", a), this._isOnline = a, this._isOnline ? this._startSocket() : (this._log.info("Changing status from", this.status, "to", ie.CLOSED), this._setStatus(ie.CLOSED)));
|
|
5279
5274
|
});
|
|
@@ -5290,7 +5285,7 @@ class Ja {
|
|
|
5290
5285
|
...this.config,
|
|
5291
5286
|
schema: e,
|
|
5292
5287
|
cardinalityInference: !!e
|
|
5293
|
-
}, this._linkIndex = e ?
|
|
5288
|
+
}, this._linkIndex = e ? rr(this.config.schema) : null;
|
|
5294
5289
|
}
|
|
5295
5290
|
_reactorStats() {
|
|
5296
5291
|
return {
|
|
@@ -5303,11 +5298,11 @@ class Ja {
|
|
|
5303
5298
|
this.kv.waitForKeyToLoad("pendingMutations").then(() => this.notifyOne(e));
|
|
5304
5299
|
}
|
|
5305
5300
|
_initStorage(e) {
|
|
5306
|
-
this.querySubs = new
|
|
5301
|
+
this.querySubs = new Bt({
|
|
5307
5302
|
persister: new e(this.config.appId, "querySubs"),
|
|
5308
|
-
merge:
|
|
5309
|
-
serialize:
|
|
5310
|
-
parse: (n, r) =>
|
|
5303
|
+
merge: Ga,
|
|
5304
|
+
serialize: Wa,
|
|
5305
|
+
parse: (n, r) => Va(r, this.config.useDateObjects),
|
|
5311
5306
|
// objectSize
|
|
5312
5307
|
objectSize: (n) => {
|
|
5313
5308
|
var r, s, i;
|
|
@@ -5323,11 +5318,11 @@ class Ja {
|
|
|
5323
5318
|
maxSize: 1e6
|
|
5324
5319
|
// 1 million triples
|
|
5325
5320
|
}
|
|
5326
|
-
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new
|
|
5321
|
+
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new Bt({
|
|
5327
5322
|
persister: new e(this.config.appId, "kv"),
|
|
5328
5323
|
merge: this._onMergeKv,
|
|
5329
|
-
serialize:
|
|
5330
|
-
parse:
|
|
5324
|
+
serialize: Ba,
|
|
5325
|
+
parse: Qa,
|
|
5331
5326
|
objectSize: () => 0,
|
|
5332
5327
|
logger: this._log,
|
|
5333
5328
|
saveThrottleMs: 100,
|
|
@@ -5359,7 +5354,7 @@ class Ja {
|
|
|
5359
5354
|
s.resolve({ status: e, eventId: n });
|
|
5360
5355
|
else if (r != null && r.type) {
|
|
5361
5356
|
const { status: o, ...a } = r;
|
|
5362
|
-
s.reject(new
|
|
5357
|
+
s.reject(new ft({
|
|
5363
5358
|
// @ts-expect-error body.type is not constant typed
|
|
5364
5359
|
body: a,
|
|
5365
5360
|
status: o ?? 0
|
|
@@ -5406,7 +5401,7 @@ class Ja {
|
|
|
5406
5401
|
_handleReceive(e, n) {
|
|
5407
5402
|
var s, i, o, a, c, u;
|
|
5408
5403
|
const r = !!this.config.schema && ("cardinalityInference" in this.config ? !!this.config.cardinalityInference : !0);
|
|
5409
|
-
switch (
|
|
5404
|
+
switch (fr[n.op] || this._log.info("[receive]", e, n.op, n), n.op) {
|
|
5410
5405
|
case "init-ok": {
|
|
5411
5406
|
this._setStatus(ie.AUTHENTICATED), this._reconnectTimeoutMs = 0, this._setAttrs(n.attrs), this._flushPendingMessages(), this._sessionId = n["session-id"];
|
|
5412
5407
|
for (const h of Object.keys(this._rooms)) {
|
|
@@ -5423,7 +5418,7 @@ class Ja {
|
|
|
5423
5418
|
const { q: h, result: y } = n, b = F(h);
|
|
5424
5419
|
if (!this._hasQueryListeners() && !this.querySubs.currentValue[b])
|
|
5425
5420
|
break;
|
|
5426
|
-
const g = (a = (o = y == null ? void 0 : y[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], w = (u = (c = y == null ? void 0 : y[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, m =
|
|
5421
|
+
const g = (a = (o = y == null ? void 0 : y[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], w = (u = (c = y == null ? void 0 : y[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, m = nr(y), T = this.ensureAttrs(), v = xe(T, m, r, this.config.useDateObjects);
|
|
5427
5422
|
this.querySubs.updateInPlace((E) => {
|
|
5428
5423
|
if (!E[b]) {
|
|
5429
5424
|
this._log.info("Missing value in querySubs", { hash: b, q: h });
|
|
@@ -5462,16 +5457,16 @@ class Ja {
|
|
|
5462
5457
|
g !== this._pendingMutations() && this.kv.updateInPlace((T) => {
|
|
5463
5458
|
T.pendingMutations = g;
|
|
5464
5459
|
});
|
|
5465
|
-
const w =
|
|
5460
|
+
const w = Pt(g.entries()), m = h.map((T) => {
|
|
5466
5461
|
var Ce, X, re, ue;
|
|
5467
|
-
const v = T["instaql-query"], E = T["instaql-result"], A = F(v), j =
|
|
5462
|
+
const v = T["instaql-query"], E = T["instaql-result"], A = F(v), j = nr(E), L = this.ensureAttrs(), q = xe(L, j, r, this.config.useDateObjects), { store: Pe, attrsStore: We } = this._applyOptimisticUpdates(q, L, w, b), dt = (X = (Ce = E == null ? void 0 : E[0]) == null ? void 0 : Ce.data) == null ? void 0 : X["page-info"], ht = (ue = (re = E == null ? void 0 : E[0]) == null ? void 0 : re.data) == null ? void 0 : ue.aggregate;
|
|
5468
5463
|
return {
|
|
5469
5464
|
q: v,
|
|
5470
5465
|
hash: A,
|
|
5471
5466
|
store: Pe,
|
|
5472
5467
|
attrsStore: We,
|
|
5473
|
-
pageInfo:
|
|
5474
|
-
aggregate:
|
|
5468
|
+
pageInfo: dt,
|
|
5469
|
+
aggregate: ht
|
|
5475
5470
|
};
|
|
5476
5471
|
});
|
|
5477
5472
|
m.forEach(({ hash: T, q: v, store: E, attrsStore: A, pageInfo: j, aggregate: L }) => {
|
|
@@ -5650,21 +5645,21 @@ class Ja {
|
|
|
5650
5645
|
* Returns an unsubscribe function
|
|
5651
5646
|
*/
|
|
5652
5647
|
subscribeQuery(e, n, r) {
|
|
5653
|
-
this.config.disableValidation ||
|
|
5648
|
+
this.config.disableValidation || ir(e, this.config.schema), r && "ruleParams" in r && (e = { $$ruleParams: r.ruleParams, ...e });
|
|
5654
5649
|
const s = F(e), i = this.getPreviousResult(e);
|
|
5655
5650
|
return i && n(i), this.queryCbs[s] = this.queryCbs[s] ?? [], this.queryCbs[s].push({ q: e, cb: n }), this._startQuerySub(e, s), () => {
|
|
5656
5651
|
this._unsubQuery(e, s, n);
|
|
5657
5652
|
};
|
|
5658
5653
|
}
|
|
5659
5654
|
queryOnce(e, n) {
|
|
5660
|
-
this.config.disableValidation ||
|
|
5661
|
-
const r = new
|
|
5655
|
+
this.config.disableValidation || ir(e, this.config.schema), n && "ruleParams" in n && (e = { $$ruleParams: n.ruleParams, ...e });
|
|
5656
|
+
const r = new tr();
|
|
5662
5657
|
if (!this._isOnline)
|
|
5663
5658
|
return r.reject(new Error("We can't run `queryOnce`, because the device is offline.")), r.promise;
|
|
5664
5659
|
if (!this.querySubs)
|
|
5665
5660
|
return r.reject(new Error("We can't run `queryOnce` on the backend. Use adminAPI.query instead: https://www.instantdb.com/docs/backend#query")), r.promise;
|
|
5666
5661
|
const s = F(e), i = this._startQuerySub(e, s);
|
|
5667
|
-
return this.queryOnceDfds[s] = this.queryOnceDfds[s] ?? [], this.queryOnceDfds[s].push({ q: e, dfd: r, eventId: i }), setTimeout(() => r.reject(new Error("Query timed out")),
|
|
5662
|
+
return this.queryOnceDfds[s] = this.queryOnceDfds[s] ?? [], this.queryOnceDfds[s].push({ q: e, dfd: r, eventId: i }), setTimeout(() => r.reject(new Error("Query timed out")), Ua), r.promise;
|
|
5668
5663
|
}
|
|
5669
5664
|
_completeQueryOnce(e, n, r) {
|
|
5670
5665
|
this.queryOnceDfds[n] && (this.queryOnceDfds[n] = this.queryOnceDfds[n].filter((s) => s.dfd !== r), this._cleanupQuery(e, n));
|
|
@@ -5731,7 +5726,7 @@ class Ja {
|
|
|
5731
5726
|
a = !0;
|
|
5732
5727
|
continue;
|
|
5733
5728
|
}
|
|
5734
|
-
const g = a ?
|
|
5729
|
+
const g = a ? ko(o, y) : y;
|
|
5735
5730
|
h.push(g);
|
|
5736
5731
|
}
|
|
5737
5732
|
return a ? h : l;
|
|
@@ -5744,7 +5739,7 @@ class Ja {
|
|
|
5744
5739
|
return a ? u : n;
|
|
5745
5740
|
}
|
|
5746
5741
|
_rewriteMutationsSorted(e, n) {
|
|
5747
|
-
return
|
|
5742
|
+
return Pt(this._rewriteMutations(e, n).entries());
|
|
5748
5743
|
}
|
|
5749
5744
|
// ---------------------------
|
|
5750
5745
|
// Transact
|
|
@@ -5789,7 +5784,7 @@ class Ja {
|
|
|
5789
5784
|
const T = this._applyOptimisticUpdates(d, h, w, g);
|
|
5790
5785
|
d = T.store, h = T.attrsStore;
|
|
5791
5786
|
}
|
|
5792
|
-
return { data:
|
|
5787
|
+
return { data: qr({ store: d, attrsStore: h, pageInfo: y, aggregate: b }, c), querySubVersion: s, pendingMutationsVersion: o };
|
|
5793
5788
|
}
|
|
5794
5789
|
_applyOptimisticUpdates(e, n, r, s) {
|
|
5795
5790
|
for (const [i, o] of r)
|
|
@@ -5853,7 +5848,7 @@ class Ja {
|
|
|
5853
5848
|
const r = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations());
|
|
5854
5849
|
r !== this._pendingMutations() && this.kv.updateInPlace((i) => {
|
|
5855
5850
|
i.pendingMutations = r;
|
|
5856
|
-
}),
|
|
5851
|
+
}), Pt(r.entries()).forEach(([i, o]) => {
|
|
5857
5852
|
o["tx-id"] || this._sendMutation(i, o);
|
|
5858
5853
|
}), this._syncTable.flushPending();
|
|
5859
5854
|
}
|
|
@@ -5888,7 +5883,7 @@ class Ja {
|
|
|
5888
5883
|
}
|
|
5889
5884
|
_trySend(e, n, r) {
|
|
5890
5885
|
if (this._transport.isOpen()) {
|
|
5891
|
-
switch (
|
|
5886
|
+
switch (fr[n.op] || this._log.info("[send]", this._transport.id, n.op, n), n.op) {
|
|
5892
5887
|
case "transact": {
|
|
5893
5888
|
this._inFlightMutationEventIds.add(e);
|
|
5894
5889
|
break;
|
|
@@ -5909,7 +5904,7 @@ class Ja {
|
|
|
5909
5904
|
return;
|
|
5910
5905
|
}
|
|
5911
5906
|
const e = this._transport;
|
|
5912
|
-
this._transport =
|
|
5907
|
+
this._transport = qa({
|
|
5913
5908
|
transportType: this._transportType,
|
|
5914
5909
|
appId: this.config.appId,
|
|
5915
5910
|
apiURI: this.config.apiURI,
|
|
@@ -5943,9 +5938,9 @@ class Ja {
|
|
|
5943
5938
|
if (typeof URL > "u")
|
|
5944
5939
|
return;
|
|
5945
5940
|
const e = new URL(window.location.href);
|
|
5946
|
-
if (e.searchParams.get(
|
|
5941
|
+
if (e.searchParams.get(kt)) {
|
|
5947
5942
|
const n = e.toString();
|
|
5948
|
-
e.searchParams.delete(
|
|
5943
|
+
e.searchParams.delete(kt), e.searchParams.delete("code"), e.searchParams.delete("error");
|
|
5949
5944
|
const r = e.pathname + (e.searchParams.size ? "?" + e.searchParams : "") + e.hash;
|
|
5950
5945
|
if (history.replaceState(history.state, "", r), // @ts-ignore (waiting for ts support)
|
|
5951
5946
|
typeof navigation == "object" && // @ts-ignore (waiting for ts support)
|
|
@@ -5969,7 +5964,7 @@ class Ja {
|
|
|
5969
5964
|
if (typeof window > "u" || typeof window.location > "u" || typeof URLSearchParams > "u")
|
|
5970
5965
|
return null;
|
|
5971
5966
|
const e = new URLSearchParams(window.location.search);
|
|
5972
|
-
if (!e.get(
|
|
5967
|
+
if (!e.get(kt))
|
|
5973
5968
|
return null;
|
|
5974
5969
|
const n = e.get("error");
|
|
5975
5970
|
if (n)
|
|
@@ -5979,7 +5974,7 @@ class Ja {
|
|
|
5979
5974
|
return null;
|
|
5980
5975
|
this._replaceUrlAfterOAuth();
|
|
5981
5976
|
try {
|
|
5982
|
-
const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await
|
|
5977
|
+
const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await Xn({
|
|
5983
5978
|
apiURI: this.config.apiURI,
|
|
5984
5979
|
appId: this.config.appId,
|
|
5985
5980
|
code: r,
|
|
@@ -6116,7 +6111,7 @@ class Ja {
|
|
|
6116
6111
|
}), this._reconnectTimeoutMs = 0, this._transport.close(), this._oauthCallbackResponse = null, this.notifyAuthSubs(n);
|
|
6117
6112
|
}
|
|
6118
6113
|
sendMagicCode({ email: e }) {
|
|
6119
|
-
return
|
|
6114
|
+
return oa({
|
|
6120
6115
|
apiURI: this.config.apiURI,
|
|
6121
6116
|
appId: this.config.appId,
|
|
6122
6117
|
email: e
|
|
@@ -6124,7 +6119,7 @@ class Ja {
|
|
|
6124
6119
|
}
|
|
6125
6120
|
async signInWithMagicCode({ email: e, code: n }) {
|
|
6126
6121
|
var o;
|
|
6127
|
-
const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await
|
|
6122
|
+
const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await aa({
|
|
6128
6123
|
apiURI: this.config.apiURI,
|
|
6129
6124
|
appId: this.config.appId,
|
|
6130
6125
|
email: e,
|
|
@@ -6134,7 +6129,7 @@ class Ja {
|
|
|
6134
6129
|
return await this.changeCurrentUser(i.user), i;
|
|
6135
6130
|
}
|
|
6136
6131
|
async signInWithCustomToken(e) {
|
|
6137
|
-
const n = await
|
|
6132
|
+
const n = await ca({
|
|
6138
6133
|
apiURI: this.config.apiURI,
|
|
6139
6134
|
appId: this.config.appId,
|
|
6140
6135
|
refreshToken: e
|
|
@@ -6142,7 +6137,7 @@ class Ja {
|
|
|
6142
6137
|
return await this.changeCurrentUser(n.user), n;
|
|
6143
6138
|
}
|
|
6144
6139
|
async signInAsGuest() {
|
|
6145
|
-
const e = await
|
|
6140
|
+
const e = await ua({
|
|
6146
6141
|
apiURI: this.config.apiURI,
|
|
6147
6142
|
appId: this.config.appId
|
|
6148
6143
|
});
|
|
@@ -6157,7 +6152,7 @@ class Ja {
|
|
|
6157
6152
|
this._log.info("[auth-invalidate] skipped invalidateToken");
|
|
6158
6153
|
return;
|
|
6159
6154
|
}
|
|
6160
|
-
|
|
6155
|
+
fa({
|
|
6161
6156
|
apiURI: this.config.apiURI,
|
|
6162
6157
|
appId: this.config.appId,
|
|
6163
6158
|
refreshToken: r
|
|
@@ -6189,7 +6184,7 @@ class Ja {
|
|
|
6189
6184
|
*/
|
|
6190
6185
|
async exchangeCodeForToken({ code: e, codeVerifier: n }) {
|
|
6191
6186
|
var o;
|
|
6192
|
-
const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await
|
|
6187
|
+
const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await Xn({
|
|
6193
6188
|
apiURI: this.config.apiURI,
|
|
6194
6189
|
appId: this.config.appId,
|
|
6195
6190
|
code: e,
|
|
@@ -6210,7 +6205,7 @@ class Ja {
|
|
|
6210
6205
|
*/
|
|
6211
6206
|
async signInWithIdToken({ idToken: e, clientName: n, nonce: r }) {
|
|
6212
6207
|
var a;
|
|
6213
|
-
const s = await this.getCurrentUser(), i = (a = s == null ? void 0 : s.user) == null ? void 0 : a.refresh_token, o = await
|
|
6208
|
+
const s = await this.getCurrentUser(), i = (a = s == null ? void 0 : s.user) == null ? void 0 : a.refresh_token, o = await la({
|
|
6214
6209
|
apiURI: this.config.apiURI,
|
|
6215
6210
|
appId: this.config.appId,
|
|
6216
6211
|
idToken: e,
|
|
@@ -6251,7 +6246,7 @@ class Ja {
|
|
|
6251
6246
|
getPresence(e, n, r = {}) {
|
|
6252
6247
|
const s = this._rooms[n], i = this._presence[n];
|
|
6253
6248
|
return !s || !i || !i.result ? null : {
|
|
6254
|
-
...
|
|
6249
|
+
..._a(i.result, r, this._sessionId),
|
|
6255
6250
|
isLoading: !s.isConnected,
|
|
6256
6251
|
error: s.error
|
|
6257
6252
|
};
|
|
@@ -6307,24 +6302,24 @@ class Ja {
|
|
|
6307
6302
|
}
|
|
6308
6303
|
_notifyPresenceSub(e, n) {
|
|
6309
6304
|
const r = this.getPresence("", e, n);
|
|
6310
|
-
r && (n.prev && !
|
|
6305
|
+
r && (n.prev && !ga(r, n.prev) || (n.prev = r, n.cb(r)));
|
|
6311
6306
|
}
|
|
6312
6307
|
_patchPresencePeers(e, n) {
|
|
6313
6308
|
var o, a, c;
|
|
6314
6309
|
const r = ((a = (o = this._presence[e]) == null ? void 0 : o.result) == null ? void 0 : a.peers) || {};
|
|
6315
6310
|
let s = Object.fromEntries(Object.entries(r).map(([u, l]) => [u, { data: l }]));
|
|
6316
6311
|
(c = this._presence[e]) == null || c.result;
|
|
6317
|
-
const i =
|
|
6312
|
+
const i = ot(s, (u) => {
|
|
6318
6313
|
for (let [l, d, h] of n)
|
|
6319
6314
|
switch (d) {
|
|
6320
6315
|
case "+":
|
|
6321
6316
|
Hs(u, l, h);
|
|
6322
6317
|
break;
|
|
6323
6318
|
case "r":
|
|
6324
|
-
|
|
6319
|
+
Nn(u, l, h);
|
|
6325
6320
|
break;
|
|
6326
6321
|
case "-":
|
|
6327
|
-
|
|
6322
|
+
Er(u, l);
|
|
6328
6323
|
break;
|
|
6329
6324
|
}
|
|
6330
6325
|
delete u[this._sessionId];
|
|
@@ -6335,8 +6330,8 @@ class Ja {
|
|
|
6335
6330
|
const r = { ...n };
|
|
6336
6331
|
delete r[this._sessionId];
|
|
6337
6332
|
const s = Object.fromEntries(Object.entries(r).map(([i, o]) => [i, o.data]));
|
|
6338
|
-
this._presence =
|
|
6339
|
-
|
|
6333
|
+
this._presence = ot(this._presence, (i) => {
|
|
6334
|
+
Nn(i, [e, "result", "peers"], s);
|
|
6340
6335
|
});
|
|
6341
6336
|
}
|
|
6342
6337
|
// --------
|
|
@@ -6379,7 +6374,7 @@ class Ja {
|
|
|
6379
6374
|
async uploadFile(e, n, r) {
|
|
6380
6375
|
var o;
|
|
6381
6376
|
const s = await this.getCurrentUser(), i = (o = s == null ? void 0 : s.user) == null ? void 0 : o.refresh_token;
|
|
6382
|
-
return
|
|
6377
|
+
return da({
|
|
6383
6378
|
...r,
|
|
6384
6379
|
apiURI: this.config.apiURI,
|
|
6385
6380
|
appId: this.config.appId,
|
|
@@ -6391,7 +6386,7 @@ class Ja {
|
|
|
6391
6386
|
async deleteFile(e) {
|
|
6392
6387
|
var i;
|
|
6393
6388
|
const n = await this.getCurrentUser(), r = (i = n == null ? void 0 : n.user) == null ? void 0 : i.refresh_token;
|
|
6394
|
-
return await
|
|
6389
|
+
return await ha({
|
|
6395
6390
|
apiURI: this.config.apiURI,
|
|
6396
6391
|
appId: this.config.appId,
|
|
6397
6392
|
path: e,
|
|
@@ -6402,18 +6397,18 @@ class Ja {
|
|
|
6402
6397
|
// ---------------------------------
|
|
6403
6398
|
async upload(e, n) {
|
|
6404
6399
|
var c;
|
|
6405
|
-
const r = await this.getCurrentUser(), s = (c = r == null ? void 0 : r.user) == null ? void 0 : c.refresh_token, i = e || n.name, o = await
|
|
6400
|
+
const r = await this.getCurrentUser(), s = (c = r == null ? void 0 : r.user) == null ? void 0 : c.refresh_token, i = e || n.name, o = await pa({
|
|
6406
6401
|
apiURI: this.config.apiURI,
|
|
6407
6402
|
appId: this.config.appId,
|
|
6408
6403
|
fileName: i,
|
|
6409
6404
|
refreshToken: s
|
|
6410
6405
|
});
|
|
6411
|
-
return await
|
|
6406
|
+
return await ya(o, n);
|
|
6412
6407
|
}
|
|
6413
6408
|
async getDownloadUrl(e) {
|
|
6414
6409
|
var i;
|
|
6415
6410
|
const n = await this.getCurrentUser(), r = (i = n == null ? void 0 : n.user) == null ? void 0 : i.refresh_token;
|
|
6416
|
-
return await
|
|
6411
|
+
return await ba({
|
|
6417
6412
|
apiURI: this.config.apiURI,
|
|
6418
6413
|
appId: this.config.appId,
|
|
6419
6414
|
path: e,
|
|
@@ -6422,9 +6417,9 @@ class Ja {
|
|
|
6422
6417
|
}
|
|
6423
6418
|
}
|
|
6424
6419
|
let et;
|
|
6425
|
-
function
|
|
6420
|
+
function Ja(t, e) {
|
|
6426
6421
|
et == null || et.dispose();
|
|
6427
|
-
const n =
|
|
6422
|
+
const n = nc(e), r = Xa(e, a), s = Za(Ya(t));
|
|
6428
6423
|
function i(l) {
|
|
6429
6424
|
var d;
|
|
6430
6425
|
l.source === s.element.contentWindow && ((d = l.data) == null ? void 0 : d.type) === "close" && n.isVisible() && a();
|
|
@@ -6446,10 +6441,10 @@ function Ya(t, e) {
|
|
|
6446
6441
|
}
|
|
6447
6442
|
return u();
|
|
6448
6443
|
}
|
|
6449
|
-
function
|
|
6450
|
-
return `${
|
|
6444
|
+
function Ya(t) {
|
|
6445
|
+
return `${un || Hr ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
|
|
6451
6446
|
}
|
|
6452
|
-
function
|
|
6447
|
+
function Za(t) {
|
|
6453
6448
|
const e = document.createElement("iframe");
|
|
6454
6449
|
return e.src = t, e.className = "instant-devtool-iframe", Object.assign(e.style, {
|
|
6455
6450
|
width: "100%",
|
|
@@ -6458,7 +6453,7 @@ function Xa(t) {
|
|
|
6458
6453
|
border: "none"
|
|
6459
6454
|
}), { element: e };
|
|
6460
6455
|
}
|
|
6461
|
-
function
|
|
6456
|
+
function Xa(t, e) {
|
|
6462
6457
|
const n = `
|
|
6463
6458
|
<svg width="32" height="32" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6464
6459
|
<rect width="512" height="512" fill="black"/>
|
|
@@ -6468,7 +6463,7 @@ function ec(t, e) {
|
|
|
6468
6463
|
return r.innerHTML = n, r.className = "instant-devtool-toggler", Object.assign(r.style, {
|
|
6469
6464
|
// pos
|
|
6470
6465
|
position: "fixed",
|
|
6471
|
-
...
|
|
6466
|
+
...ec(t.position),
|
|
6472
6467
|
height: "32px",
|
|
6473
6468
|
width: "32px",
|
|
6474
6469
|
// layout
|
|
@@ -6483,7 +6478,7 @@ function ec(t, e) {
|
|
|
6483
6478
|
cursor: "pointer"
|
|
6484
6479
|
}), r.addEventListener("click", e), { element: r };
|
|
6485
6480
|
}
|
|
6486
|
-
function
|
|
6481
|
+
function ec(t) {
|
|
6487
6482
|
switch (t) {
|
|
6488
6483
|
case "bottom-left":
|
|
6489
6484
|
return { bottom: "24px", left: "24px" };
|
|
@@ -6495,7 +6490,7 @@ function tc(t) {
|
|
|
6495
6490
|
return { top: "24px", left: "24px" };
|
|
6496
6491
|
}
|
|
6497
6492
|
}
|
|
6498
|
-
function
|
|
6493
|
+
function tc(t) {
|
|
6499
6494
|
switch (t) {
|
|
6500
6495
|
case "bottom-left":
|
|
6501
6496
|
return { bottom: "24px", right: "24px", left: "60px", top: "72px" };
|
|
@@ -6507,11 +6502,11 @@ function nc(t) {
|
|
|
6507
6502
|
return { top: "24px", right: "24px", left: "60px", bottom: "72px" };
|
|
6508
6503
|
}
|
|
6509
6504
|
}
|
|
6510
|
-
function
|
|
6505
|
+
function nc(t) {
|
|
6511
6506
|
const e = document.createElement("div");
|
|
6512
6507
|
Object.assign(e.style, {
|
|
6513
6508
|
position: "fixed",
|
|
6514
|
-
...
|
|
6509
|
+
...tc(t.position),
|
|
6515
6510
|
display: "block",
|
|
6516
6511
|
borderRadius: "4px",
|
|
6517
6512
|
border: "1px #ccc solid",
|
|
@@ -6524,22 +6519,22 @@ function rc(t) {
|
|
|
6524
6519
|
}
|
|
6525
6520
|
return { element: e, isVisible: n };
|
|
6526
6521
|
}
|
|
6527
|
-
const
|
|
6522
|
+
const rc = {
|
|
6528
6523
|
apiURI: "https://api.instantdb.com",
|
|
6529
6524
|
websocketURI: "wss://api.instantdb.com/runtime/session"
|
|
6530
6525
|
};
|
|
6531
|
-
function
|
|
6526
|
+
function sc() {
|
|
6532
6527
|
return globalThis.__instantDbSchemaHashStore = globalThis.__instantDbSchemaHashStore ?? /* @__PURE__ */ new WeakMap(), globalThis.__instantDbSchemaHashStore;
|
|
6533
6528
|
}
|
|
6534
|
-
function
|
|
6529
|
+
function ic() {
|
|
6535
6530
|
return globalThis.__instantDbStore = globalThis.__instantDbStore ?? {}, globalThis.__instantDbStore;
|
|
6536
6531
|
}
|
|
6537
|
-
function
|
|
6532
|
+
function Gt(t) {
|
|
6538
6533
|
const e = t.__adminToken;
|
|
6539
6534
|
return t.appId + "_" + (t.websocketURI || "default_ws_uri") + "_" + (t.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + t.useDateObjects;
|
|
6540
6535
|
}
|
|
6541
|
-
const
|
|
6542
|
-
class
|
|
6536
|
+
const Ht = ic(), dr = sc();
|
|
6537
|
+
class oc {
|
|
6543
6538
|
constructor(e) {
|
|
6544
6539
|
p(this, "db");
|
|
6545
6540
|
/**
|
|
@@ -6656,7 +6651,7 @@ class ac {
|
|
|
6656
6651
|
this.db = e;
|
|
6657
6652
|
}
|
|
6658
6653
|
}
|
|
6659
|
-
class
|
|
6654
|
+
class ac {
|
|
6660
6655
|
constructor(e) {
|
|
6661
6656
|
p(this, "db");
|
|
6662
6657
|
/**
|
|
@@ -6705,16 +6700,16 @@ class cc {
|
|
|
6705
6700
|
this.db = e;
|
|
6706
6701
|
}
|
|
6707
6702
|
}
|
|
6708
|
-
function
|
|
6703
|
+
function cc(t) {
|
|
6709
6704
|
return JSON.parse(JSON.stringify(t));
|
|
6710
6705
|
}
|
|
6711
|
-
class
|
|
6706
|
+
class uc {
|
|
6712
6707
|
constructor(e) {
|
|
6713
6708
|
p(this, "_reactor");
|
|
6714
6709
|
p(this, "auth");
|
|
6715
6710
|
p(this, "storage");
|
|
6716
|
-
p(this, "tx",
|
|
6717
|
-
this._reactor = e, this.auth = new
|
|
6711
|
+
p(this, "tx", cn());
|
|
6712
|
+
this._reactor = e, this.auth = new oc(this._reactor), this.storage = new ac(this._reactor);
|
|
6718
6713
|
}
|
|
6719
6714
|
/**
|
|
6720
6715
|
* Use this to write data! You can create, update, delete, and link objects
|
|
@@ -6855,7 +6850,7 @@ class lc {
|
|
|
6855
6850
|
};
|
|
6856
6851
|
}
|
|
6857
6852
|
shutdown() {
|
|
6858
|
-
delete
|
|
6853
|
+
delete Ht[Gt(this._reactor.config)], this._reactor.shutdown();
|
|
6859
6854
|
}
|
|
6860
6855
|
/**
|
|
6861
6856
|
* Use this for one-off queries.
|
|
@@ -6888,35 +6883,35 @@ class lc {
|
|
|
6888
6883
|
return this._reactor.subscribeTable(e, n);
|
|
6889
6884
|
}
|
|
6890
6885
|
}
|
|
6891
|
-
function
|
|
6886
|
+
function hr(t) {
|
|
6892
6887
|
if (!t)
|
|
6893
6888
|
return "0";
|
|
6894
|
-
const e =
|
|
6889
|
+
const e = dr.get(t);
|
|
6895
6890
|
if (e)
|
|
6896
6891
|
return e;
|
|
6897
6892
|
const n = F(t);
|
|
6898
|
-
return
|
|
6893
|
+
return dr.set(t, n), n;
|
|
6899
6894
|
}
|
|
6900
|
-
function
|
|
6901
|
-
return
|
|
6895
|
+
function lc(t, e) {
|
|
6896
|
+
return hr(t._reactor.config.schema) !== hr(e);
|
|
6902
6897
|
}
|
|
6903
|
-
function
|
|
6898
|
+
function fc(t, e, n, r, s) {
|
|
6904
6899
|
var u;
|
|
6905
6900
|
const i = {
|
|
6906
6901
|
...t,
|
|
6907
6902
|
appId: (u = t.appId) == null ? void 0 : u.trim(),
|
|
6908
6903
|
useDateObjects: t.useDateObjects ?? !1
|
|
6909
|
-
}, o =
|
|
6904
|
+
}, o = Ht[Gt(i)];
|
|
6910
6905
|
if (o)
|
|
6911
|
-
return
|
|
6912
|
-
const a = new
|
|
6913
|
-
...
|
|
6906
|
+
return lc(o, i.schema) && o._reactor.updateSchema(i.schema), o;
|
|
6907
|
+
const a = new Ha({
|
|
6908
|
+
...rc,
|
|
6914
6909
|
...i,
|
|
6915
6910
|
cardinalityInference: !!i.schema
|
|
6916
|
-
}, e || Qr, n || Br, { ...r || {}, "@instantdb/core": Yr }, s), c = new
|
|
6917
|
-
return
|
|
6911
|
+
}, e || Qr, n || Br, { ...r || {}, "@instantdb/core": Yr }, s), c = new uc(a);
|
|
6912
|
+
return Ht[Gt(i)] = c, dc(i.appId, i.devtool), c;
|
|
6918
6913
|
}
|
|
6919
|
-
function
|
|
6914
|
+
function dc(t, e) {
|
|
6920
6915
|
if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
|
|
6921
6916
|
return;
|
|
6922
6917
|
const n = {
|
|
@@ -6924,15 +6919,15 @@ function hc(t, e) {
|
|
|
6924
6919
|
allowedHosts: ["localhost"],
|
|
6925
6920
|
...typeof e == "object" ? e : {}
|
|
6926
6921
|
};
|
|
6927
|
-
n.allowedHosts.includes(window.location.hostname) &&
|
|
6922
|
+
n.allowedHosts.includes(window.location.hostname) && Ja(t, n);
|
|
6928
6923
|
}
|
|
6929
|
-
const
|
|
6924
|
+
const hc = {
|
|
6930
6925
|
isLoading: !0,
|
|
6931
6926
|
data: void 0,
|
|
6932
6927
|
pageInfo: void 0,
|
|
6933
6928
|
error: void 0
|
|
6934
6929
|
};
|
|
6935
|
-
function
|
|
6930
|
+
function pr(t) {
|
|
6936
6931
|
return {
|
|
6937
6932
|
isLoading: !t,
|
|
6938
6933
|
data: void 0,
|
|
@@ -6941,12 +6936,12 @@ function yr(t) {
|
|
|
6941
6936
|
...t || {}
|
|
6942
6937
|
};
|
|
6943
6938
|
}
|
|
6944
|
-
function
|
|
6939
|
+
function pc(t, e, n) {
|
|
6945
6940
|
e && n && "ruleParams" in n && (e = { $$ruleParams: n.ruleParams, ...e });
|
|
6946
|
-
const r = e ?
|
|
6947
|
-
|
|
6941
|
+
const r = e ? cc(e) : null, s = F(r), i = Ke(
|
|
6942
|
+
pr(t._reactor.getPreviousResult(r))
|
|
6948
6943
|
), o = le(
|
|
6949
|
-
(c) => (i.current =
|
|
6944
|
+
(c) => (i.current = pr(
|
|
6950
6945
|
t._reactor.getPreviousResult(r)
|
|
6951
6946
|
), c(), r ? t.subscribeQuery(r, (l) => {
|
|
6952
6947
|
i.current = {
|
|
@@ -6964,13 +6959,13 @@ function yc(t, e, n) {
|
|
|
6964
6959
|
// Build a new subscribe function if the query changes
|
|
6965
6960
|
[s]
|
|
6966
6961
|
);
|
|
6967
|
-
return { state:
|
|
6962
|
+
return { state: It(
|
|
6968
6963
|
o,
|
|
6969
6964
|
() => i.current,
|
|
6970
|
-
() =>
|
|
6965
|
+
() => hc
|
|
6971
6966
|
), query: r };
|
|
6972
6967
|
}
|
|
6973
|
-
function
|
|
6968
|
+
function yc() {
|
|
6974
6969
|
const t = Ke(null);
|
|
6975
6970
|
be(() => {
|
|
6976
6971
|
n();
|
|
@@ -6983,8 +6978,8 @@ function bc() {
|
|
|
6983
6978
|
}
|
|
6984
6979
|
return { set: e, clear: n };
|
|
6985
6980
|
}
|
|
6986
|
-
const
|
|
6987
|
-
function
|
|
6981
|
+
const bc = 1e3;
|
|
6982
|
+
function _c(t, e, n) {
|
|
6988
6983
|
const r = Ke(n);
|
|
6989
6984
|
r.current = n, be(() => t.core._reactor.subscribeTopic(
|
|
6990
6985
|
t.id,
|
|
@@ -6994,7 +6989,7 @@ function gc(t, e, n) {
|
|
|
6994
6989
|
}
|
|
6995
6990
|
), [t.id, e]);
|
|
6996
6991
|
}
|
|
6997
|
-
function
|
|
6992
|
+
function gc(t, e) {
|
|
6998
6993
|
return be(() => t.core._reactor.joinRoom(t.id), [t.id]), le(
|
|
6999
6994
|
(r) => {
|
|
7000
6995
|
t.core._reactor.publishTopic({
|
|
@@ -7007,9 +7002,9 @@ function Tc(t, e) {
|
|
|
7007
7002
|
[t.id, e]
|
|
7008
7003
|
);
|
|
7009
7004
|
}
|
|
7010
|
-
function
|
|
7005
|
+
function Tc(t, e = {}) {
|
|
7011
7006
|
var o, a;
|
|
7012
|
-
const [n, r] =
|
|
7007
|
+
const [n, r] = br(() => t.core._reactor.getPresence(t.type, t.id, e) ?? {
|
|
7013
7008
|
peers: {},
|
|
7014
7009
|
isLoading: !0
|
|
7015
7010
|
});
|
|
@@ -7027,18 +7022,18 @@ function wc(t, e = {}) {
|
|
|
7027
7022
|
},
|
|
7028
7023
|
[t.type, t.id]
|
|
7029
7024
|
);
|
|
7030
|
-
return
|
|
7025
|
+
return Mt(() => ({
|
|
7031
7026
|
...n,
|
|
7032
7027
|
publishPresence: s
|
|
7033
7028
|
}), [n, s]);
|
|
7034
7029
|
}
|
|
7035
|
-
function
|
|
7030
|
+
function wc(t, e, n) {
|
|
7036
7031
|
be(() => t.core._reactor.joinRoom(t.id, e), [t.id]), be(() => t.core._reactor.publishPresence(t.type, t.id, e), [t.type, t.id, n ?? JSON.stringify(e)]);
|
|
7037
7032
|
}
|
|
7038
|
-
function
|
|
7039
|
-
const r =
|
|
7033
|
+
function mc(t, e, n = {}) {
|
|
7034
|
+
const r = yc(), s = he.usePresence(t, {
|
|
7040
7035
|
keys: [e]
|
|
7041
|
-
}), i =
|
|
7036
|
+
}), i = Mt(() => {
|
|
7042
7037
|
const l = t._core._reactor.getPresence(
|
|
7043
7038
|
t.type,
|
|
7044
7039
|
t.id
|
|
@@ -7050,7 +7045,7 @@ function Sc(t, e, n = {}) {
|
|
|
7050
7045
|
(l) => {
|
|
7051
7046
|
t.core._reactor.publishPresence(t.type, t.id, {
|
|
7052
7047
|
[e]: l
|
|
7053
|
-
}), l && ((n == null ? void 0 : n.timeout) === null || (n == null ? void 0 : n.timeout) === 0 || r.set((n == null ? void 0 : n.timeout) ??
|
|
7048
|
+
}), l && ((n == null ? void 0 : n.timeout) === null || (n == null ? void 0 : n.timeout) === 0 || r.set((n == null ? void 0 : n.timeout) ?? bc, () => {
|
|
7054
7049
|
t.core._reactor.publishPresence(t.type, t.id, {
|
|
7055
7050
|
[e]: null
|
|
7056
7051
|
});
|
|
@@ -7065,7 +7060,7 @@ function Sc(t, e, n = {}) {
|
|
|
7065
7060
|
[n.stopOnEnter, o]
|
|
7066
7061
|
), c = le(() => {
|
|
7067
7062
|
o(!1);
|
|
7068
|
-
}, [o]), u =
|
|
7063
|
+
}, [o]), u = Mt(() => ({ onKeyDown: a, onBlur: c }), [a, c]);
|
|
7069
7064
|
return {
|
|
7070
7065
|
active: i,
|
|
7071
7066
|
setActive: o,
|
|
@@ -7073,13 +7068,13 @@ function Sc(t, e, n = {}) {
|
|
|
7073
7068
|
};
|
|
7074
7069
|
}
|
|
7075
7070
|
const he = {
|
|
7076
|
-
useTopicEffect:
|
|
7077
|
-
usePublishTopic:
|
|
7078
|
-
usePresence:
|
|
7079
|
-
useSyncPresence:
|
|
7080
|
-
useTypingIndicator:
|
|
7071
|
+
useTopicEffect: _c,
|
|
7072
|
+
usePublishTopic: gc,
|
|
7073
|
+
usePresence: Tc,
|
|
7074
|
+
useSyncPresence: wc,
|
|
7075
|
+
useTypingIndicator: mc
|
|
7081
7076
|
};
|
|
7082
|
-
class
|
|
7077
|
+
class Sc {
|
|
7083
7078
|
constructor(e, n, r) {
|
|
7084
7079
|
p(this, "core");
|
|
7085
7080
|
/** @deprecated use `core` instead */
|
|
@@ -7166,14 +7161,14 @@ class vc {
|
|
|
7166
7161
|
this.core = e, this._core = this.core, this.type = n, this.id = r;
|
|
7167
7162
|
}
|
|
7168
7163
|
}
|
|
7169
|
-
const
|
|
7164
|
+
const vc = {
|
|
7170
7165
|
isLoading: !0,
|
|
7171
7166
|
user: void 0,
|
|
7172
7167
|
error: void 0
|
|
7173
7168
|
};
|
|
7174
|
-
class
|
|
7169
|
+
class Ct {
|
|
7175
7170
|
constructor(e, n) {
|
|
7176
|
-
p(this, "tx",
|
|
7171
|
+
p(this, "tx", cn());
|
|
7177
7172
|
p(this, "auth");
|
|
7178
7173
|
p(this, "storage");
|
|
7179
7174
|
p(this, "core");
|
|
@@ -7201,7 +7196,7 @@ class It {
|
|
|
7201
7196
|
* console.log('Device ID:', deviceId)
|
|
7202
7197
|
*/
|
|
7203
7198
|
p(this, "useLocalId", (e) => {
|
|
7204
|
-
const [n, r] =
|
|
7199
|
+
const [n, r] = br(null);
|
|
7205
7200
|
return be(() => {
|
|
7206
7201
|
(async () => {
|
|
7207
7202
|
const i = await this.getLocalId(e);
|
|
@@ -7269,7 +7264,7 @@ class It {
|
|
|
7269
7264
|
* auth.user ? { goals: {} } : null,
|
|
7270
7265
|
* );
|
|
7271
7266
|
*/
|
|
7272
|
-
p(this, "useQuery", (e, n) =>
|
|
7267
|
+
p(this, "useQuery", (e, n) => pc(this.core, e, n).state);
|
|
7273
7268
|
/**
|
|
7274
7269
|
* Listen for the logged in state. This is useful
|
|
7275
7270
|
* for deciding when to show a login screen.
|
|
@@ -7349,7 +7344,7 @@ class It {
|
|
|
7349
7344
|
), n = le((s) => this.core.subscribeConnectionStatus((o) => {
|
|
7350
7345
|
o !== e.current && (e.current = o, s());
|
|
7351
7346
|
}), []);
|
|
7352
|
-
return
|
|
7347
|
+
return It(
|
|
7353
7348
|
n,
|
|
7354
7349
|
() => e.current,
|
|
7355
7350
|
// For SSR, always return 'connecting' as the initial state
|
|
@@ -7398,7 +7393,7 @@ class It {
|
|
|
7398
7393
|
const n = this.useAuth();
|
|
7399
7394
|
return n.isLoading || n.error || n.user ? null : /* @__PURE__ */ Je.jsx(Je.Fragment, { children: e });
|
|
7400
7395
|
});
|
|
7401
|
-
this.core =
|
|
7396
|
+
this.core = fc(
|
|
7402
7397
|
e,
|
|
7403
7398
|
// @ts-expect-error because TS can't resolve subclass statics
|
|
7404
7399
|
this.constructor.Storage,
|
|
@@ -7422,7 +7417,7 @@ class It {
|
|
|
7422
7417
|
* const { peers } = db.rooms.usePresence(room);
|
|
7423
7418
|
*/
|
|
7424
7419
|
room(e = "_defaultRoomType", n = "_defaultRoomId") {
|
|
7425
|
-
return new
|
|
7420
|
+
return new Sc(this.core, e, n);
|
|
7426
7421
|
}
|
|
7427
7422
|
_useAuth() {
|
|
7428
7423
|
const e = Ke(
|
|
@@ -7430,10 +7425,10 @@ class It {
|
|
|
7430
7425
|
), n = le((s) => this.core.subscribeAuth((o) => {
|
|
7431
7426
|
e.current = { isLoading: !1, ...o }, s();
|
|
7432
7427
|
}), []);
|
|
7433
|
-
return
|
|
7428
|
+
return It(
|
|
7434
7429
|
n,
|
|
7435
7430
|
() => e.current,
|
|
7436
|
-
() =>
|
|
7431
|
+
() => vc
|
|
7437
7432
|
);
|
|
7438
7433
|
}
|
|
7439
7434
|
/**
|
|
@@ -7450,7 +7445,7 @@ class It {
|
|
|
7450
7445
|
return this.core.getAuth();
|
|
7451
7446
|
}
|
|
7452
7447
|
}
|
|
7453
|
-
p(
|
|
7448
|
+
p(Ct, "Storage"), p(Ct, "NetworkListener"), p(Ct, "EventSourceImpl");
|
|
7454
7449
|
export {
|
|
7455
|
-
|
|
7450
|
+
Ct as InstantReactAbstractDatabase
|
|
7456
7451
|
};
|