@stoker-platform/web-client 0.5.89 → 0.5.91
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/bundle.js +845 -841
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { getApp as it, registerVersion as Pm, initializeApp as Hn, setLogLevel as en, onLog as Mm } from "firebase/app";
|
|
2
2
|
import { isSupported as qm, initializeAnalytics as Lm, setConsent as $m } from "firebase/analytics";
|
|
3
|
-
import { getAuth as hr, validatePassword as
|
|
4
|
-
import { getDatabase as
|
|
5
|
-
import { where as ye, query as he, collection as $r, and as tn, or as Ac, onSnapshot as mr, doc as Ae, Timestamp as zt, setDoc as Jm, getDoc as
|
|
6
|
-
import { connectStorageEmulator as
|
|
3
|
+
import { getAuth as hr, validatePassword as Ef, initializeAuth as Sc, indexedDBLocalPersistence as jm, browserLocalPersistence as Vm, browserSessionPersistence as Tc, inMemoryPersistence as Rc, beforeAuthStateChanged as Um, connectAuthEmulator as Wm, onAuthStateChanged as Kn, getIdTokenResult as zm, signOut as Sf, signInWithEmailAndPassword as Bm, getMultiFactorResolver as Zm, TotpMultiFactorGenerator as ro, signInWithCustomToken as Gm, multiFactor as Cc } from "firebase/auth";
|
|
4
|
+
import { getDatabase as Tf, onValue as Hm, ref as Km, connectDatabaseEmulator as Ym } from "firebase/database";
|
|
5
|
+
import { where as ye, query as he, collection as $r, and as tn, or as Ac, onSnapshot as mr, doc as Ae, Timestamp as zt, setDoc as Jm, getDoc as Rf, orderBy as rt, limit as er, startAfter as no, endBefore as so, limitToLast as Dr, getDocsFromCache as Cf, getDocsFromServer as Qm, getDocs as Xm, getCountFromServer as Af, getDocFromCache as ep, getDocFromServer as tp, writeBatch as xo, serverTimestamp as jr, deleteField as xn, arrayRemove as No, arrayUnion as Fo, collectionGroup as rp, getFirestore as kc, initializeFirestore as rn, connectFirestoreEmulator as Ic, persistentLocalCache as xc, persistentSingleTabManager as Nc, persistentMultipleTabManager as Fc, memoryEagerGarbageCollector as np, memoryLruGarbageCollector as sp, memoryLocalCache as ip, getPersistentCacheIndexManager as ap, enablePersistentCacheIndexAutoCreation as op, terminate as cp, clearIndexedDbPersistence as Dc, waitForPendingWrites as lp, onSnapshotsInSync as kf, startAt as up, endAt as dp, addDoc as If } from "firebase/firestore";
|
|
6
|
+
import { connectStorageEmulator as fp, getStorage as hp } from "firebase/storage";
|
|
7
7
|
import { getFunctions as Ue, httpsCallable as Je, connectFunctionsEmulator as mp } from "firebase/functions";
|
|
8
8
|
import { ReCaptchaEnterpriseProvider as pp, initializeAppCheck as Yn, onTokenChanged as Jn } from "firebase/app-check";
|
|
9
9
|
import { getPerformance as gp } from "firebase/performance";
|
|
10
10
|
import { getRemoteConfig as yp, fetchAndActivate as _p } from "firebase/remote-config";
|
|
11
|
-
const vp = "0.5.
|
|
11
|
+
const vp = "0.5.90", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(t);
|
|
14
|
-
}, Nn = (t, e) => e ? e.Role ? t.access?.includes(e.Role) : !1 : !0, bp = (t, e) => e ? !e.Role || t.restrictCreate === !0 ? !1 : typeof t.restrictCreate == "object" ? t.restrictCreate?.includes(e.Role) : !0 : !0, Op = (t, e) => e ? !e.Role || t.restrictUpdate === !0 ? !1 : typeof t.restrictUpdate == "object" ? t.restrictUpdate?.includes(e.Role) : !0 : !0, te = (t, e) => t.filter((r) => r.name === e)[0],
|
|
14
|
+
}, Nn = (t, e) => e ? e.Role ? t.access?.includes(e.Role) : !1 : !0, bp = (t, e) => e ? !e.Role || t.restrictCreate === !0 ? !1 : typeof t.restrictCreate == "object" ? t.restrictCreate?.includes(e.Role) : !0 : !0, Op = (t, e) => e ? !e.Role || t.restrictUpdate === !0 ? !1 : typeof t.restrictUpdate == "object" ? t.restrictUpdate?.includes(e.Role) : !0 : !0, te = (t, e) => t.filter((r) => r.name === e)[0], we = (t) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(t.type), xf = (t, e) => {
|
|
15
15
|
const r = {
|
|
16
16
|
Record_Owner: "recordOwner",
|
|
17
17
|
Record_User: "recordUser",
|
|
@@ -30,22 +30,22 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
30
30
|
c.role === e.Role && (!i.assignable?.includes(e.Role) || a?.restrictEntities) && r.push(o);
|
|
31
31
|
});
|
|
32
32
|
}), r;
|
|
33
|
-
},
|
|
33
|
+
}, Nf = (t, e, r) => {
|
|
34
34
|
const n = [], { access: s } = t, { entityRestrictions: i } = s;
|
|
35
35
|
return i?.parentFilters?.forEach((a) => {
|
|
36
36
|
if (!a.roles.some((h) => h.role === r.Role))
|
|
37
37
|
return;
|
|
38
38
|
const o = a.collectionField, c = te(t.fields, o);
|
|
39
|
-
if (!
|
|
39
|
+
if (!we(c))
|
|
40
40
|
throw new Error("PERMISSION_DENIED");
|
|
41
|
-
const l = r.collections?.[c.collection],
|
|
42
|
-
if (!f)
|
|
43
|
-
throw new Error("PERMISSION_DENIED");
|
|
44
|
-
const d = f.restrictions?.find((h) => h.type === a.type && h.roles.some((p) => p.role === r.Role));
|
|
41
|
+
const l = r.collections?.[c.collection], d = e.collections[c.collection].access.entityRestrictions;
|
|
45
42
|
if (!d)
|
|
46
43
|
throw new Error("PERMISSION_DENIED");
|
|
47
|
-
d.roles.
|
|
48
|
-
|
|
44
|
+
const f = d.restrictions?.find((h) => h.type === a.type && h.roles.some((p) => p.role === r.Role));
|
|
45
|
+
if (!f)
|
|
46
|
+
throw new Error("PERMISSION_DENIED");
|
|
47
|
+
f.roles.forEach((h) => {
|
|
48
|
+
h.role === r.Role && (!d.assignable?.includes(r.Role) || l?.restrictEntities) && n.push({ parentFilter: a, parentRestriction: f });
|
|
49
49
|
});
|
|
50
50
|
}), n;
|
|
51
51
|
}, Fn = (t, e, r) => {
|
|
@@ -53,9 +53,9 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
53
53
|
for (const a of n) {
|
|
54
54
|
const { fields: o } = a;
|
|
55
55
|
for (const c of o)
|
|
56
|
-
if (!(c.access && !Nn(c, r)) && r.Role &&
|
|
56
|
+
if (!(c.access && !Nn(c, r)) && r.Role && we(c) && c.collection === s.collection && c.dependencyFields)
|
|
57
57
|
for (const l of c.dependencyFields)
|
|
58
|
-
!i.find((
|
|
58
|
+
!i.find((d) => d.field === l.field) && l.roles.includes(r.Role) && i.push(l);
|
|
59
59
|
}
|
|
60
60
|
return i;
|
|
61
61
|
}, Ep = (t, e, r, n, s, i, a) => {
|
|
@@ -65,7 +65,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
65
65
|
l = !1;
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
const u =
|
|
68
|
+
const u = xf(e, s), d = Do(e, s), f = Nf(e, r, s);
|
|
69
69
|
u?.filter((y) => y.type === "Record_Owner").forEach((y) => {
|
|
70
70
|
"operations" in y && y.operations && !y.operations.includes(t) || i.Created_By !== n && (l = !1);
|
|
71
71
|
}), u?.filter((y) => y.type === "Record_User").forEach((y) => {
|
|
@@ -80,15 +80,15 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
80
80
|
E.type === "Array" ? R.values?.some((_) => i[E.name].includes(_)) || (l = !1) : R.values?.includes(i[E.name]) || (l = !1);
|
|
81
81
|
});
|
|
82
82
|
let h = !0, p = !1;
|
|
83
|
-
|
|
83
|
+
d?.filter((y) => y.type === "Individual").forEach(() => {
|
|
84
84
|
p = !0, c?.individualEntities?.includes(i.id) || (h = !1);
|
|
85
85
|
});
|
|
86
86
|
let b = !0, g = !1;
|
|
87
|
-
if (
|
|
87
|
+
if (d?.filter((y) => y.type === "Parent").forEach((y) => {
|
|
88
88
|
g = !0;
|
|
89
89
|
const E = te(o, y.collectionField);
|
|
90
90
|
c?.parentEntities?.some((R) => i[`${E.name}_Array`].includes(R)) || (b = !1);
|
|
91
|
-
}),
|
|
91
|
+
}), d?.filter((y) => y.type === "Parent_Property").forEach((y) => {
|
|
92
92
|
g = !0;
|
|
93
93
|
const E = te(o, y.collectionField), R = te(o, y.propertyField);
|
|
94
94
|
Object.entries(c?.parentPropertyEntities || {}).some((_) => {
|
|
@@ -105,7 +105,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
let O = !0, S = !1;
|
|
108
|
-
|
|
108
|
+
f?.filter((y) => y.parentFilter.type === "Individual").forEach((y) => {
|
|
109
109
|
S = !0;
|
|
110
110
|
const { parentFilter: E } = y, R = te(o, E.collectionField), _ = s.collections?.[R.collection];
|
|
111
111
|
if (!_) {
|
|
@@ -115,7 +115,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
115
115
|
_.individualEntities?.some((N) => i[`${R.name}_Array`].includes(N)) || (O = !1);
|
|
116
116
|
});
|
|
117
117
|
let C = !0, x = !1;
|
|
118
|
-
if (
|
|
118
|
+
if (f?.filter((y) => y.parentFilter.type === "Parent").forEach((y) => {
|
|
119
119
|
x = !0;
|
|
120
120
|
const { parentFilter: E } = y, R = te(o, E.collectionField), _ = te(o, E.parentCollectionField), N = s.collections?.[R.collection];
|
|
121
121
|
if (!N) {
|
|
@@ -123,7 +123,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
N.parentEntities?.some((v) => i[`${_.name}_Array`].includes(v)) || (C = !1);
|
|
126
|
-
}),
|
|
126
|
+
}), f?.filter((y) => y.parentFilter.type === "Parent_Property").forEach((y) => {
|
|
127
127
|
x = !0;
|
|
128
128
|
const { parentFilter: E } = y, R = te(o, E.collectionField), _ = te(o, E.parentPropertyField), N = te(o, E.parentCollectionField), v = s.collections?.[R.collection];
|
|
129
129
|
if (!v) {
|
|
@@ -150,12 +150,12 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
150
150
|
if (!o || !s.Role)
|
|
151
151
|
return c = !1, c;
|
|
152
152
|
ct(t, o) || (c = !1);
|
|
153
|
-
const u = Do(e, s)?.filter((
|
|
153
|
+
const u = Do(e, s)?.filter((d) => d.type === "Individual").length > 0;
|
|
154
154
|
return t === "Create" && u && (c = !1), Ep(t, e, r, n, s, i) || (c = !1), c;
|
|
155
155
|
}, $t = (t, e, r) => {
|
|
156
156
|
const n = [];
|
|
157
157
|
for (const s of t.fields)
|
|
158
|
-
if (
|
|
158
|
+
if (we(s)) {
|
|
159
159
|
if (s.access && (!r || !Nn(s, r)) || !e.collections[s.collection])
|
|
160
160
|
continue;
|
|
161
161
|
const a = r?.collections?.[s.collection];
|
|
@@ -164,7 +164,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
|
164
164
|
(!r || ct("Read", a) || Fn(t, e, r)) && n.push(s.collection);
|
|
165
165
|
}
|
|
166
166
|
return Array.from(new Set(n));
|
|
167
|
-
},
|
|
167
|
+
}, Ff = (t, e, r) => {
|
|
168
168
|
const { labels: n } = t, s = [];
|
|
169
169
|
for (const i of Object.values(e.collections)) {
|
|
170
170
|
const a = r?.collections?.[i.labels.collection];
|
|
@@ -306,25 +306,25 @@ function Np() {
|
|
|
306
306
|
return ls = t, ls;
|
|
307
307
|
}
|
|
308
308
|
var us, Gc;
|
|
309
|
-
function
|
|
309
|
+
function Df() {
|
|
310
310
|
if (Gc) return us;
|
|
311
311
|
Gc = 1;
|
|
312
312
|
var t = typeof nn == "object" && nn && nn.Object === Object && nn;
|
|
313
313
|
return us = t, us;
|
|
314
314
|
}
|
|
315
|
-
var
|
|
315
|
+
var ds, Hc;
|
|
316
316
|
function ut() {
|
|
317
|
-
if (Hc) return
|
|
317
|
+
if (Hc) return ds;
|
|
318
318
|
Hc = 1;
|
|
319
|
-
var t =
|
|
320
|
-
return
|
|
319
|
+
var t = Df(), e = typeof self == "object" && self && self.Object === Object && self, r = t || e || Function("return this")();
|
|
320
|
+
return ds = r, ds;
|
|
321
321
|
}
|
|
322
|
-
var
|
|
322
|
+
var fs, Kc;
|
|
323
323
|
function Br() {
|
|
324
|
-
if (Kc) return
|
|
324
|
+
if (Kc) return fs;
|
|
325
325
|
Kc = 1;
|
|
326
326
|
var t = ut(), e = t.Symbol;
|
|
327
|
-
return
|
|
327
|
+
return fs = e, fs;
|
|
328
328
|
}
|
|
329
329
|
var hs, Yc;
|
|
330
330
|
function Fp() {
|
|
@@ -407,7 +407,7 @@ function Mp() {
|
|
|
407
407
|
return vs = r, vs;
|
|
408
408
|
}
|
|
409
409
|
var ws, nl;
|
|
410
|
-
function
|
|
410
|
+
function Pf() {
|
|
411
411
|
if (nl) return ws;
|
|
412
412
|
nl = 1;
|
|
413
413
|
var t = Function.prototype, e = t.toString;
|
|
@@ -430,16 +430,16 @@ var bs, sl;
|
|
|
430
430
|
function qp() {
|
|
431
431
|
if (sl) return bs;
|
|
432
432
|
sl = 1;
|
|
433
|
-
var t = Po(), e = Mp(), r = vt(), n =
|
|
433
|
+
var t = Po(), e = Mp(), r = vt(), n = Pf(), s = /[\\^$.*+?()[\]{}|]/g, i = /^\[object .+?Constructor\]$/, a = Function.prototype, o = Object.prototype, c = a.toString, l = o.hasOwnProperty, u = RegExp(
|
|
434
434
|
"^" + c.call(l).replace(s, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
435
435
|
);
|
|
436
|
-
function f
|
|
437
|
-
if (!r(
|
|
436
|
+
function d(f) {
|
|
437
|
+
if (!r(f) || e(f))
|
|
438
438
|
return !1;
|
|
439
|
-
var h = t(
|
|
440
|
-
return h.test(n(
|
|
439
|
+
var h = t(f) ? u : i;
|
|
440
|
+
return h.test(n(f));
|
|
441
441
|
}
|
|
442
|
-
return bs =
|
|
442
|
+
return bs = d, bs;
|
|
443
443
|
}
|
|
444
444
|
var Os, il;
|
|
445
445
|
function Lp() {
|
|
@@ -495,10 +495,10 @@ function jp() {
|
|
|
495
495
|
}
|
|
496
496
|
return Cs = t, Cs;
|
|
497
497
|
}
|
|
498
|
-
var As,
|
|
498
|
+
var As, dl;
|
|
499
499
|
function Vp() {
|
|
500
|
-
if (
|
|
501
|
-
|
|
500
|
+
if (dl) return As;
|
|
501
|
+
dl = 1;
|
|
502
502
|
var t = qn(), e = "__lodash_hash_undefined__", r = Object.prototype, n = r.hasOwnProperty;
|
|
503
503
|
function s(i) {
|
|
504
504
|
var a = this.__data__;
|
|
@@ -510,10 +510,10 @@ function Vp() {
|
|
|
510
510
|
}
|
|
511
511
|
return As = s, As;
|
|
512
512
|
}
|
|
513
|
-
var ks,
|
|
513
|
+
var ks, fl;
|
|
514
514
|
function Up() {
|
|
515
|
-
if (
|
|
516
|
-
|
|
515
|
+
if (fl) return ks;
|
|
516
|
+
fl = 1;
|
|
517
517
|
var t = qn(), e = Object.prototype, r = e.hasOwnProperty;
|
|
518
518
|
function n(s) {
|
|
519
519
|
var i = this.__data__;
|
|
@@ -718,22 +718,22 @@ function rg() {
|
|
|
718
718
|
return Zs = t, Zs;
|
|
719
719
|
}
|
|
720
720
|
var Gs, Il;
|
|
721
|
-
function
|
|
721
|
+
function Mf() {
|
|
722
722
|
if (Il) return Gs;
|
|
723
723
|
Il = 1;
|
|
724
724
|
var t = eg(), e = tg(), r = rg(), n = 1, s = 2;
|
|
725
|
-
function i(a, o, c, l, u,
|
|
726
|
-
var
|
|
727
|
-
if (h != p && !(
|
|
725
|
+
function i(a, o, c, l, u, d) {
|
|
726
|
+
var f = c & n, h = a.length, p = o.length;
|
|
727
|
+
if (h != p && !(f && p > h))
|
|
728
728
|
return !1;
|
|
729
|
-
var b =
|
|
729
|
+
var b = d.get(a), g = d.get(o);
|
|
730
730
|
if (b && g)
|
|
731
731
|
return b == o && g == a;
|
|
732
732
|
var O = -1, S = !0, C = c & s ? new t() : void 0;
|
|
733
|
-
for (
|
|
733
|
+
for (d.set(a, o), d.set(o, a); ++O < h; ) {
|
|
734
734
|
var x = a[O], y = o[O];
|
|
735
735
|
if (l)
|
|
736
|
-
var E =
|
|
736
|
+
var E = f ? l(y, x, O, o, a, d) : l(x, y, O, a, o, d);
|
|
737
737
|
if (E !== void 0) {
|
|
738
738
|
if (E)
|
|
739
739
|
continue;
|
|
@@ -742,23 +742,23 @@ function Md() {
|
|
|
742
742
|
}
|
|
743
743
|
if (C) {
|
|
744
744
|
if (!e(o, function(R, _) {
|
|
745
|
-
if (!r(C, _) && (x === R || u(x, R, c, l,
|
|
745
|
+
if (!r(C, _) && (x === R || u(x, R, c, l, d)))
|
|
746
746
|
return C.push(_);
|
|
747
747
|
})) {
|
|
748
748
|
S = !1;
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
|
-
} else if (!(x === y || u(x, y, c, l,
|
|
751
|
+
} else if (!(x === y || u(x, y, c, l, d))) {
|
|
752
752
|
S = !1;
|
|
753
753
|
break;
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
|
-
return
|
|
756
|
+
return d.delete(a), d.delete(o), S;
|
|
757
757
|
}
|
|
758
758
|
return Gs = i, Gs;
|
|
759
759
|
}
|
|
760
760
|
var Hs, xl;
|
|
761
|
-
function
|
|
761
|
+
function qf() {
|
|
762
762
|
if (xl) return Hs;
|
|
763
763
|
xl = 1;
|
|
764
764
|
var t = ut(), e = t.Uint8Array;
|
|
@@ -792,7 +792,7 @@ var Js, Dl;
|
|
|
792
792
|
function ig() {
|
|
793
793
|
if (Dl) return Js;
|
|
794
794
|
Dl = 1;
|
|
795
|
-
var t = Br(), e =
|
|
795
|
+
var t = Br(), e = qf(), r = zr(), n = Mf(), s = ng(), i = sg(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", d = "[object Map]", f = "[object Number]", h = "[object RegExp]", p = "[object Set]", b = "[object String]", g = "[object Symbol]", O = "[object ArrayBuffer]", S = "[object DataView]", C = t ? t.prototype : void 0, x = C ? C.valueOf : void 0;
|
|
796
796
|
function y(E, R, _, N, v, w, I) {
|
|
797
797
|
switch (_) {
|
|
798
798
|
case S:
|
|
@@ -803,14 +803,14 @@ function ig() {
|
|
|
803
803
|
return !(E.byteLength != R.byteLength || !w(new e(E), new e(R)));
|
|
804
804
|
case c:
|
|
805
805
|
case l:
|
|
806
|
-
case
|
|
806
|
+
case f:
|
|
807
807
|
return r(+E, +R);
|
|
808
808
|
case u:
|
|
809
809
|
return E.name == R.name && E.message == R.message;
|
|
810
810
|
case h:
|
|
811
811
|
case b:
|
|
812
812
|
return E == R + "";
|
|
813
|
-
case
|
|
813
|
+
case d:
|
|
814
814
|
var m = s;
|
|
815
815
|
case p:
|
|
816
816
|
var T = N & a;
|
|
@@ -831,7 +831,7 @@ function ig() {
|
|
|
831
831
|
return Js = y, Js;
|
|
832
832
|
}
|
|
833
833
|
var Qs, Pl;
|
|
834
|
-
function
|
|
834
|
+
function Lf() {
|
|
835
835
|
if (Pl) return Qs;
|
|
836
836
|
Pl = 1;
|
|
837
837
|
function t(e, r) {
|
|
@@ -849,10 +849,10 @@ function Ft() {
|
|
|
849
849
|
return Xs = t, Xs;
|
|
850
850
|
}
|
|
851
851
|
var ei, ql;
|
|
852
|
-
function $
|
|
852
|
+
function $f() {
|
|
853
853
|
if (ql) return ei;
|
|
854
854
|
ql = 1;
|
|
855
|
-
var t =
|
|
855
|
+
var t = Lf(), e = Ft();
|
|
856
856
|
function r(n, s, i) {
|
|
857
857
|
var a = s(n);
|
|
858
858
|
return e(n) ? a : t(a, i(n));
|
|
@@ -873,7 +873,7 @@ function ag() {
|
|
|
873
873
|
return ti = t, ti;
|
|
874
874
|
}
|
|
875
875
|
var ri, $l;
|
|
876
|
-
function
|
|
876
|
+
function jf() {
|
|
877
877
|
if ($l) return ri;
|
|
878
878
|
$l = 1;
|
|
879
879
|
function t() {
|
|
@@ -885,7 +885,7 @@ var ni, jl;
|
|
|
885
885
|
function $o() {
|
|
886
886
|
if (jl) return ni;
|
|
887
887
|
jl = 1;
|
|
888
|
-
var t = ag(), e =
|
|
888
|
+
var t = ag(), e = jf(), r = Object.prototype, n = r.propertyIsEnumerable, s = Object.getOwnPropertySymbols, i = s ? function(a) {
|
|
889
889
|
return a == null ? [] : (a = Object(a), t(s(a), function(o) {
|
|
890
890
|
return n.call(a, o);
|
|
891
891
|
}));
|
|
@@ -923,7 +923,7 @@ function cg() {
|
|
|
923
923
|
return ai = n, ai;
|
|
924
924
|
}
|
|
925
925
|
var oi, zl;
|
|
926
|
-
function
|
|
926
|
+
function Vf() {
|
|
927
927
|
if (zl) return oi;
|
|
928
928
|
zl = 1;
|
|
929
929
|
var t = cg(), e = wt(), r = Object.prototype, n = r.hasOwnProperty, s = r.propertyIsEnumerable, i = t(/* @__PURE__ */ (function() {
|
|
@@ -962,7 +962,7 @@ function jo() {
|
|
|
962
962
|
return li = r, li;
|
|
963
963
|
}
|
|
964
964
|
var ui, Hl;
|
|
965
|
-
function
|
|
965
|
+
function Uf() {
|
|
966
966
|
if (Hl) return ui;
|
|
967
967
|
Hl = 1;
|
|
968
968
|
var t = 9007199254740991;
|
|
@@ -971,34 +971,34 @@ function Ud() {
|
|
|
971
971
|
}
|
|
972
972
|
return ui = e, ui;
|
|
973
973
|
}
|
|
974
|
-
var
|
|
974
|
+
var di, Kl;
|
|
975
975
|
function ug() {
|
|
976
|
-
if (Kl) return
|
|
976
|
+
if (Kl) return di;
|
|
977
977
|
Kl = 1;
|
|
978
|
-
var t = pr(), e =
|
|
979
|
-
w[S] = w[C] = w[x] = w[y] = w[E] = w[R] = w[_] = w[N] = w[v] = !0, w[n] = w[s] = w[g] = w[i] = w[O] = w[a] = w[o] = w[c] = w[l] = w[u] = w[
|
|
978
|
+
var t = pr(), e = Uf(), r = wt(), n = "[object Arguments]", s = "[object Array]", i = "[object Boolean]", a = "[object Date]", o = "[object Error]", c = "[object Function]", l = "[object Map]", u = "[object Number]", d = "[object Object]", f = "[object RegExp]", h = "[object Set]", p = "[object String]", b = "[object WeakMap]", g = "[object ArrayBuffer]", O = "[object DataView]", S = "[object Float32Array]", C = "[object Float64Array]", x = "[object Int8Array]", y = "[object Int16Array]", E = "[object Int32Array]", R = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", N = "[object Uint16Array]", v = "[object Uint32Array]", w = {};
|
|
979
|
+
w[S] = w[C] = w[x] = w[y] = w[E] = w[R] = w[_] = w[N] = w[v] = !0, w[n] = w[s] = w[g] = w[i] = w[O] = w[a] = w[o] = w[c] = w[l] = w[u] = w[d] = w[f] = w[h] = w[p] = w[b] = !1;
|
|
980
980
|
function I(m) {
|
|
981
981
|
return r(m) && e(m.length) && !!w[t(m)];
|
|
982
982
|
}
|
|
983
|
-
return
|
|
983
|
+
return di = I, di;
|
|
984
984
|
}
|
|
985
|
-
var
|
|
985
|
+
var fi, Yl;
|
|
986
986
|
function Vo() {
|
|
987
|
-
if (Yl) return
|
|
987
|
+
if (Yl) return fi;
|
|
988
988
|
Yl = 1;
|
|
989
989
|
function t(e) {
|
|
990
990
|
return function(r) {
|
|
991
991
|
return e(r);
|
|
992
992
|
};
|
|
993
993
|
}
|
|
994
|
-
return
|
|
994
|
+
return fi = t, fi;
|
|
995
995
|
}
|
|
996
996
|
var Rr = { exports: {} };
|
|
997
997
|
Rr.exports;
|
|
998
998
|
var Jl;
|
|
999
999
|
function Uo() {
|
|
1000
1000
|
return Jl || (Jl = 1, (function(t, e) {
|
|
1001
|
-
var r =
|
|
1001
|
+
var r = Df(), n = e && !e.nodeType && e, s = n && !0 && t && !t.nodeType && t, i = s && s.exports === n, a = i && r.process, o = (function() {
|
|
1002
1002
|
try {
|
|
1003
1003
|
var c = s && s.require && s.require("util").types;
|
|
1004
1004
|
return c || a && a.binding && a.binding("util");
|
|
@@ -1016,12 +1016,12 @@ function Wo() {
|
|
|
1016
1016
|
return hi = s, hi;
|
|
1017
1017
|
}
|
|
1018
1018
|
var mi, Xl;
|
|
1019
|
-
function
|
|
1019
|
+
function Wf() {
|
|
1020
1020
|
if (Xl) return mi;
|
|
1021
1021
|
Xl = 1;
|
|
1022
|
-
var t = og(), e =
|
|
1022
|
+
var t = og(), e = Vf(), r = Ft(), n = $n(), s = jo(), i = Wo(), a = Object.prototype, o = a.hasOwnProperty;
|
|
1023
1023
|
function c(l, u) {
|
|
1024
|
-
var
|
|
1024
|
+
var d = r(l), f = !d && e(l), h = !d && !f && n(l), p = !d && !f && !h && i(l), b = d || f || h || p, g = b ? t(l.length, String) : [], O = g.length;
|
|
1025
1025
|
for (var S in l)
|
|
1026
1026
|
(u || o.call(l, S)) && !(b && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1027
1027
|
(S == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
@@ -1044,7 +1044,7 @@ function zo() {
|
|
|
1044
1044
|
return pi = e, pi;
|
|
1045
1045
|
}
|
|
1046
1046
|
var gi, tu;
|
|
1047
|
-
function
|
|
1047
|
+
function zf() {
|
|
1048
1048
|
if (tu) return gi;
|
|
1049
1049
|
tu = 1;
|
|
1050
1050
|
function t(e, r) {
|
|
@@ -1055,17 +1055,17 @@ function zd() {
|
|
|
1055
1055
|
return gi = t, gi;
|
|
1056
1056
|
}
|
|
1057
1057
|
var yi, ru;
|
|
1058
|
-
function
|
|
1058
|
+
function dg() {
|
|
1059
1059
|
if (ru) return yi;
|
|
1060
1060
|
ru = 1;
|
|
1061
|
-
var t =
|
|
1061
|
+
var t = zf(), e = t(Object.keys, Object);
|
|
1062
1062
|
return yi = e, yi;
|
|
1063
1063
|
}
|
|
1064
1064
|
var _i, nu;
|
|
1065
|
-
function
|
|
1065
|
+
function fg() {
|
|
1066
1066
|
if (nu) return _i;
|
|
1067
1067
|
nu = 1;
|
|
1068
|
-
var t = zo(), e =
|
|
1068
|
+
var t = zo(), e = dg(), r = Object.prototype, n = r.hasOwnProperty;
|
|
1069
1069
|
function s(i) {
|
|
1070
1070
|
if (!t(i))
|
|
1071
1071
|
return e(i);
|
|
@@ -1080,7 +1080,7 @@ var vi, su;
|
|
|
1080
1080
|
function jn() {
|
|
1081
1081
|
if (su) return vi;
|
|
1082
1082
|
su = 1;
|
|
1083
|
-
var t = Po(), e =
|
|
1083
|
+
var t = Po(), e = Uf();
|
|
1084
1084
|
function r(n) {
|
|
1085
1085
|
return n != null && e(n.length) && !t(n);
|
|
1086
1086
|
}
|
|
@@ -1090,17 +1090,17 @@ var wi, iu;
|
|
|
1090
1090
|
function Bo() {
|
|
1091
1091
|
if (iu) return wi;
|
|
1092
1092
|
iu = 1;
|
|
1093
|
-
var t =
|
|
1093
|
+
var t = Wf(), e = fg(), r = jn();
|
|
1094
1094
|
function n(s) {
|
|
1095
1095
|
return r(s) ? t(s) : e(s);
|
|
1096
1096
|
}
|
|
1097
1097
|
return wi = n, wi;
|
|
1098
1098
|
}
|
|
1099
1099
|
var bi, au;
|
|
1100
|
-
function
|
|
1100
|
+
function Bf() {
|
|
1101
1101
|
if (au) return bi;
|
|
1102
1102
|
au = 1;
|
|
1103
|
-
var t = $
|
|
1103
|
+
var t = $f(), e = $o(), r = Bo();
|
|
1104
1104
|
function n(s) {
|
|
1105
1105
|
return t(s, r, e);
|
|
1106
1106
|
}
|
|
@@ -1110,14 +1110,14 @@ var Oi, ou;
|
|
|
1110
1110
|
function hg() {
|
|
1111
1111
|
if (ou) return Oi;
|
|
1112
1112
|
ou = 1;
|
|
1113
|
-
var t =
|
|
1113
|
+
var t = Bf(), e = 1, r = Object.prototype, n = r.hasOwnProperty;
|
|
1114
1114
|
function s(i, a, o, c, l, u) {
|
|
1115
|
-
var
|
|
1116
|
-
if (h != b && !
|
|
1115
|
+
var d = o & e, f = t(i), h = f.length, p = t(a), b = p.length;
|
|
1116
|
+
if (h != b && !d)
|
|
1117
1117
|
return !1;
|
|
1118
1118
|
for (var g = h; g--; ) {
|
|
1119
|
-
var O =
|
|
1120
|
-
if (!(
|
|
1119
|
+
var O = f[g];
|
|
1120
|
+
if (!(d ? O in a : n.call(a, O)))
|
|
1121
1121
|
return !1;
|
|
1122
1122
|
}
|
|
1123
1123
|
var S = u.get(i), C = u.get(a);
|
|
@@ -1125,11 +1125,11 @@ function hg() {
|
|
|
1125
1125
|
return S == a && C == i;
|
|
1126
1126
|
var x = !0;
|
|
1127
1127
|
u.set(i, a), u.set(a, i);
|
|
1128
|
-
for (var y =
|
|
1129
|
-
O =
|
|
1128
|
+
for (var y = d; ++g < h; ) {
|
|
1129
|
+
O = f[g];
|
|
1130
1130
|
var E = i[O], R = a[O];
|
|
1131
1131
|
if (c)
|
|
1132
|
-
var _ =
|
|
1132
|
+
var _ = d ? c(R, E, O, a, i, u) : c(E, R, O, i, a, u);
|
|
1133
1133
|
if (!(_ === void 0 ? E === R || l(E, R, o, c, u) : _)) {
|
|
1134
1134
|
x = !1;
|
|
1135
1135
|
break;
|
|
@@ -1165,24 +1165,24 @@ function gg() {
|
|
|
1165
1165
|
var t = Bt(), e = ut(), r = t(e, "Set");
|
|
1166
1166
|
return Ti = r, Ti;
|
|
1167
1167
|
}
|
|
1168
|
-
var Ri,
|
|
1168
|
+
var Ri, du;
|
|
1169
1169
|
function yg() {
|
|
1170
|
-
if (
|
|
1171
|
-
|
|
1170
|
+
if (du) return Ri;
|
|
1171
|
+
du = 1;
|
|
1172
1172
|
var t = Bt(), e = ut(), r = t(e, "WeakMap");
|
|
1173
1173
|
return Ri = r, Ri;
|
|
1174
1174
|
}
|
|
1175
|
-
var Ci,
|
|
1175
|
+
var Ci, fu;
|
|
1176
1176
|
function Vn() {
|
|
1177
|
-
if (
|
|
1178
|
-
|
|
1179
|
-
var t = mg(), e = Mo(), r = pg(), n = gg(), s = yg(), i = pr(), a =
|
|
1180
|
-
return (t && S(new t(new ArrayBuffer(1))) !=
|
|
1177
|
+
if (fu) return Ci;
|
|
1178
|
+
fu = 1;
|
|
1179
|
+
var t = mg(), e = Mo(), r = pg(), n = gg(), s = yg(), i = pr(), a = Pf(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", d = "[object WeakMap]", f = "[object DataView]", h = a(t), p = a(e), b = a(r), g = a(n), O = a(s), S = i;
|
|
1180
|
+
return (t && S(new t(new ArrayBuffer(1))) != f || e && S(new e()) != o || r && S(r.resolve()) != l || n && S(new n()) != u || s && S(new s()) != d) && (S = function(C) {
|
|
1181
1181
|
var x = i(C), y = x == c ? C.constructor : void 0, E = y ? a(y) : "";
|
|
1182
1182
|
if (E)
|
|
1183
1183
|
switch (E) {
|
|
1184
1184
|
case h:
|
|
1185
|
-
return
|
|
1185
|
+
return f;
|
|
1186
1186
|
case p:
|
|
1187
1187
|
return o;
|
|
1188
1188
|
case b:
|
|
@@ -1190,7 +1190,7 @@ function Vn() {
|
|
|
1190
1190
|
case g:
|
|
1191
1191
|
return u;
|
|
1192
1192
|
case O:
|
|
1193
|
-
return
|
|
1193
|
+
return d;
|
|
1194
1194
|
}
|
|
1195
1195
|
return x;
|
|
1196
1196
|
}), Ci = S, Ci;
|
|
@@ -1199,11 +1199,11 @@ var Ai, hu;
|
|
|
1199
1199
|
function _g() {
|
|
1200
1200
|
if (hu) return Ai;
|
|
1201
1201
|
hu = 1;
|
|
1202
|
-
var t = Lo(), e =
|
|
1202
|
+
var t = Lo(), e = Mf(), r = ig(), n = hg(), s = Vn(), i = Ft(), a = $n(), o = Wo(), c = 1, l = "[object Arguments]", u = "[object Array]", d = "[object Object]", f = Object.prototype, h = f.hasOwnProperty;
|
|
1203
1203
|
function p(b, g, O, S, C, x) {
|
|
1204
1204
|
var y = i(b), E = i(g), R = y ? u : s(b), _ = E ? u : s(g);
|
|
1205
|
-
R = R == l ?
|
|
1206
|
-
var N = R ==
|
|
1205
|
+
R = R == l ? d : R, _ = _ == l ? d : _;
|
|
1206
|
+
var N = R == d, v = _ == d, w = R == _;
|
|
1207
1207
|
if (w && a(b)) {
|
|
1208
1208
|
if (!a(g))
|
|
1209
1209
|
return !1;
|
|
@@ -1245,15 +1245,15 @@ function wg() {
|
|
|
1245
1245
|
var bg = wg();
|
|
1246
1246
|
const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
|
|
1247
1247
|
const { access: l } = e, { permissionWriteRestrictions: u } = l;
|
|
1248
|
-
let
|
|
1248
|
+
let d = !0, f = "";
|
|
1249
1249
|
const h = u?.filter((p) => n === p.userRole);
|
|
1250
|
-
return h?.length && !h.some((p) => p.recordRole === s) ? (
|
|
1250
|
+
return h?.length && !h.some((p) => p.recordRole === s) ? (f = `User ${n} does not have write access to record with role ${s}`, d = !1, d) : (u?.forEach((p) => {
|
|
1251
1251
|
n === p.userRole && p.recordRole;
|
|
1252
|
-
}),
|
|
1252
|
+
}), f && console.error(`PERMISSION_DENIED: ${f}`), d);
|
|
1253
1253
|
}, Sg = (t, e, r, n, s, i, a, o, c, l, u) => {
|
|
1254
|
-
const { labels:
|
|
1255
|
-
let
|
|
1256
|
-
return (!e.Role || i && (!a?.Role || !Eg(t, n, s, a.Role, e.Role) || i === e.User_ID)) && (
|
|
1254
|
+
const { labels: d } = n;
|
|
1255
|
+
let f = !0;
|
|
1256
|
+
return (!e.Role || i && (!a?.Role || !Eg(t, n, s, a.Role, e.Role) || i === e.User_ID)) && (f = !1), f;
|
|
1257
1257
|
}, Tg = (t, e, r, n, s, i, a) => {
|
|
1258
1258
|
const { labels: o, fields: c } = r, l = i?.collections?.[o.collection];
|
|
1259
1259
|
let u = !0;
|
|
@@ -1261,9 +1261,9 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
|
|
|
1261
1261
|
throw new Error("PERMISSION_DENIED");
|
|
1262
1262
|
s && !ct("Create", l) && (u = !1), s && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1263
1263
|
!pn("Create", r, n, s, i, t) && (u = !1), r.auth;
|
|
1264
|
-
for (const
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1264
|
+
for (const d of c) {
|
|
1265
|
+
const f = t[d.name];
|
|
1266
|
+
d.access && !Nn(d, i) && f !== void 0 && (u = !1), f !== void 0 && !bp(d, i) && (u = !1);
|
|
1267
1267
|
}
|
|
1268
1268
|
if (!u)
|
|
1269
1269
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -1271,16 +1271,16 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
|
|
|
1271
1271
|
for (const e in t)
|
|
1272
1272
|
Object.prototype.hasOwnProperty.call(t, e) && (ar(t[e]) ? delete t[e] : typeof t[e] == "object" && t[e] !== null && rr(t[e]));
|
|
1273
1273
|
}, Rg = (t, e, r, n, s, i, a, o, c, l) => {
|
|
1274
|
-
const { labels: u, fields:
|
|
1274
|
+
const { labels: u, fields: d } = n, f = a?.collections?.[u.collection], h = { ...e, ...t };
|
|
1275
1275
|
rr(h);
|
|
1276
1276
|
let p = !0, b = "";
|
|
1277
|
-
if (i && !
|
|
1277
|
+
if (i && !f)
|
|
1278
1278
|
throw new Error("PERMISSION_DENIED");
|
|
1279
|
-
i && !ct("Update",
|
|
1279
|
+
i && !ct("Update", f) && (p = !1, b = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1280
1280
|
(!pn("Update", n, s, i, a, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1281
1281
|
!pn("Update", n, s, i, a, h)) && (p = !1, b = "Authenticated user does not have Update access to this document"), i && n.softDelete && h[n.softDelete.archivedField] !== e[n.softDelete.archivedField] && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1282
|
-
!ct("Delete",
|
|
1283
|
-
for (const g of
|
|
1282
|
+
!ct("Delete", f) && (p = !1, b = "Authenticated user does not have Delete or Restore access to this document");
|
|
1283
|
+
for (const g of d) {
|
|
1284
1284
|
const O = t[g.name];
|
|
1285
1285
|
g.access && !Nn(g, a) && O !== void 0 && (b = `Authenticated user does not have access to field ${g.name}`, p = !1), O !== void 0 && !Op(g, a) && (b = `Authenticated user does not have Update access to field ${g.name}`, p = !1);
|
|
1286
1286
|
}
|
|
@@ -1293,7 +1293,7 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
|
|
|
1293
1293
|
throw new Error("PERMISSION_DENIED");
|
|
1294
1294
|
if (ct("Delete", o) || (c = !1), pn("Delete", r, n, s, i, t) || (c = !1), r.auth && t.User_ID && (wp(o) || (c = !1), Sg("delete", t, e, r, n, s, i) || (c = !1)), !c)
|
|
1295
1295
|
throw new Error("PERMISSION_DENIED");
|
|
1296
|
-
},
|
|
1296
|
+
}, Zf = (t, e, r) => {
|
|
1297
1297
|
const { access: n } = e, { entityRestrictions: s } = n;
|
|
1298
1298
|
if (s?.restrictions) {
|
|
1299
1299
|
for (const i of s.restrictions)
|
|
@@ -1305,7 +1305,7 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
|
|
|
1305
1305
|
if (!i.roles.some((l) => l.role === t))
|
|
1306
1306
|
continue;
|
|
1307
1307
|
const a = te(e.fields, i.collectionField);
|
|
1308
|
-
if (!
|
|
1308
|
+
if (!we(a))
|
|
1309
1309
|
throw new Error("PERMISSION_DENIED");
|
|
1310
1310
|
const c = r.collections[a.collection].access.entityRestrictions?.restrictions?.find((l) => l.type === i.type && l.roles.some((u) => u.role === t));
|
|
1311
1311
|
if (!c)
|
|
@@ -1330,7 +1330,7 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
|
|
|
1330
1330
|
return i;
|
|
1331
1331
|
}, kg = (t, e) => e.fields.filter((r) => r.name === t.name)[0];
|
|
1332
1332
|
var xi, gu;
|
|
1333
|
-
function
|
|
1333
|
+
function Gf() {
|
|
1334
1334
|
if (gu) return xi;
|
|
1335
1335
|
gu = 1;
|
|
1336
1336
|
var t = Bt(), e = (function() {
|
|
@@ -1346,7 +1346,7 @@ var Ni, yu;
|
|
|
1346
1346
|
function Zo() {
|
|
1347
1347
|
if (yu) return Ni;
|
|
1348
1348
|
yu = 1;
|
|
1349
|
-
var t =
|
|
1349
|
+
var t = Gf();
|
|
1350
1350
|
function e(r, n, s) {
|
|
1351
1351
|
n == "__proto__" && t ? t(r, n, {
|
|
1352
1352
|
configurable: !0,
|
|
@@ -1358,7 +1358,7 @@ function Zo() {
|
|
|
1358
1358
|
return Ni = e, Ni;
|
|
1359
1359
|
}
|
|
1360
1360
|
var Fi, _u;
|
|
1361
|
-
function
|
|
1361
|
+
function Hf() {
|
|
1362
1362
|
if (_u) return Fi;
|
|
1363
1363
|
_u = 1;
|
|
1364
1364
|
var t = Zo(), e = zr();
|
|
@@ -1393,14 +1393,14 @@ function xg() {
|
|
|
1393
1393
|
var Cr = { exports: {} };
|
|
1394
1394
|
Cr.exports;
|
|
1395
1395
|
var bu;
|
|
1396
|
-
function
|
|
1396
|
+
function Kf() {
|
|
1397
1397
|
return bu || (bu = 1, (function(t, e) {
|
|
1398
1398
|
var r = ut(), n = e && !e.nodeType && e, s = n && !0 && t && !t.nodeType && t, i = s && s.exports === n, a = i ? r.Buffer : void 0, o = a ? a.allocUnsafe : void 0;
|
|
1399
1399
|
function c(l, u) {
|
|
1400
1400
|
if (u)
|
|
1401
1401
|
return l.slice();
|
|
1402
|
-
var
|
|
1403
|
-
return l.copy(
|
|
1402
|
+
var d = l.length, f = o ? o(d) : new l.constructor(d);
|
|
1403
|
+
return l.copy(f), f;
|
|
1404
1404
|
}
|
|
1405
1405
|
t.exports = c;
|
|
1406
1406
|
})(Cr, Cr.exports)), Cr.exports;
|
|
@@ -1409,7 +1409,7 @@ var Mi, Ou;
|
|
|
1409
1409
|
function Go() {
|
|
1410
1410
|
if (Ou) return Mi;
|
|
1411
1411
|
Ou = 1;
|
|
1412
|
-
var t =
|
|
1412
|
+
var t = qf();
|
|
1413
1413
|
function e(r) {
|
|
1414
1414
|
var n = new r.constructor(r.byteLength);
|
|
1415
1415
|
return new t(n).set(new t(r)), n;
|
|
@@ -1417,7 +1417,7 @@ function Go() {
|
|
|
1417
1417
|
return Mi = e, Mi;
|
|
1418
1418
|
}
|
|
1419
1419
|
var qi, Eu;
|
|
1420
|
-
function
|
|
1420
|
+
function Yf() {
|
|
1421
1421
|
if (Eu) return qi;
|
|
1422
1422
|
Eu = 1;
|
|
1423
1423
|
var t = Go();
|
|
@@ -1428,7 +1428,7 @@ function Yd() {
|
|
|
1428
1428
|
return qi = e, qi;
|
|
1429
1429
|
}
|
|
1430
1430
|
var Li, Su;
|
|
1431
|
-
function
|
|
1431
|
+
function Jf() {
|
|
1432
1432
|
if (Su) return Li;
|
|
1433
1433
|
Su = 1;
|
|
1434
1434
|
function t(e, r) {
|
|
@@ -1462,11 +1462,11 @@ var ji, Ru;
|
|
|
1462
1462
|
function Ho() {
|
|
1463
1463
|
if (Ru) return ji;
|
|
1464
1464
|
Ru = 1;
|
|
1465
|
-
var t =
|
|
1465
|
+
var t = zf(), e = t(Object.getPrototypeOf, Object);
|
|
1466
1466
|
return ji = e, ji;
|
|
1467
1467
|
}
|
|
1468
1468
|
var Vi, Cu;
|
|
1469
|
-
function
|
|
1469
|
+
function Qf() {
|
|
1470
1470
|
if (Cu) return Vi;
|
|
1471
1471
|
Cu = 1;
|
|
1472
1472
|
var t = Ng(), e = Ho(), r = zo();
|
|
@@ -1493,16 +1493,16 @@ function Dg() {
|
|
|
1493
1493
|
function l(u) {
|
|
1494
1494
|
if (!r(u) || t(u) != n)
|
|
1495
1495
|
return !1;
|
|
1496
|
-
var
|
|
1497
|
-
if (
|
|
1496
|
+
var d = e(u);
|
|
1497
|
+
if (d === null)
|
|
1498
1498
|
return !0;
|
|
1499
|
-
var
|
|
1500
|
-
return typeof
|
|
1499
|
+
var f = o.call(d, "constructor") && d.constructor;
|
|
1500
|
+
return typeof f == "function" && f instanceof f && a.call(f) == c;
|
|
1501
1501
|
}
|
|
1502
1502
|
return Wi = l, Wi;
|
|
1503
1503
|
}
|
|
1504
1504
|
var zi, Iu;
|
|
1505
|
-
function
|
|
1505
|
+
function Xf() {
|
|
1506
1506
|
if (Iu) return zi;
|
|
1507
1507
|
Iu = 1;
|
|
1508
1508
|
function t(e, r) {
|
|
@@ -1531,8 +1531,8 @@ function Zr() {
|
|
|
1531
1531
|
var o = !i;
|
|
1532
1532
|
i || (i = {});
|
|
1533
1533
|
for (var c = -1, l = s.length; ++c < l; ) {
|
|
1534
|
-
var u = s[c],
|
|
1535
|
-
|
|
1534
|
+
var u = s[c], d = a ? a(i[u], n[u], u, i, n) : void 0;
|
|
1535
|
+
d === void 0 && (d = n[u]), o ? e(i, u, d) : t(i, u, d);
|
|
1536
1536
|
}
|
|
1537
1537
|
return i;
|
|
1538
1538
|
}
|
|
@@ -1570,7 +1570,7 @@ var Ki, Pu;
|
|
|
1570
1570
|
function Gr() {
|
|
1571
1571
|
if (Pu) return Ki;
|
|
1572
1572
|
Pu = 1;
|
|
1573
|
-
var t =
|
|
1573
|
+
var t = Wf(), e = Mg(), r = jn();
|
|
1574
1574
|
function n(s) {
|
|
1575
1575
|
return r(s) ? t(s, !0) : e(s);
|
|
1576
1576
|
}
|
|
@@ -1590,7 +1590,7 @@ var Ji, qu;
|
|
|
1590
1590
|
function Lg() {
|
|
1591
1591
|
if (qu) return Ji;
|
|
1592
1592
|
qu = 1;
|
|
1593
|
-
var t =
|
|
1593
|
+
var t = Hf(), e = Kf(), r = Yf(), n = Jf(), s = Qf(), i = Vf(), a = Ft(), o = Fg(), c = $n(), l = Po(), u = vt(), d = Dg(), f = Wo(), h = Xf(), p = qg();
|
|
1594
1594
|
function b(g, O, S, C, x, y, E) {
|
|
1595
1595
|
var R = h(g, S), _ = h(O, S), N = E.get(_);
|
|
1596
1596
|
if (N) {
|
|
@@ -1599,8 +1599,8 @@ function Lg() {
|
|
|
1599
1599
|
}
|
|
1600
1600
|
var v = y ? y(R, _, S + "", g, O, E) : void 0, w = v === void 0;
|
|
1601
1601
|
if (w) {
|
|
1602
|
-
var I = a(_), m = !I && c(_), T = !I && !m &&
|
|
1603
|
-
v = _, I || m || T ? a(R) ? v = R : o(R) ? v = n(R) : m ? (w = !1, v = e(_, !0)) : T ? (w = !1, v = r(_, !0)) : v = [] :
|
|
1602
|
+
var I = a(_), m = !I && c(_), T = !I && !m && f(_);
|
|
1603
|
+
v = _, I || m || T ? a(R) ? v = R : o(R) ? v = n(R) : m ? (w = !1, v = e(_, !0)) : T ? (w = !1, v = r(_, !0)) : v = [] : d(_) || i(_) ? (v = R, i(R) ? v = p(R) : (!u(R) || l(R)) && (v = s(_))) : w = !1;
|
|
1604
1604
|
}
|
|
1605
1605
|
w && (E.set(_, v), x(v, _, C, y, E), E.delete(_)), t(g, S, v);
|
|
1606
1606
|
}
|
|
@@ -1610,13 +1610,13 @@ var Qi, Lu;
|
|
|
1610
1610
|
function $g() {
|
|
1611
1611
|
if (Lu) return Qi;
|
|
1612
1612
|
Lu = 1;
|
|
1613
|
-
var t = Lo(), e =
|
|
1614
|
-
function o(c, l, u,
|
|
1613
|
+
var t = Lo(), e = Hf(), r = xg(), n = Lg(), s = vt(), i = Gr(), a = Xf();
|
|
1614
|
+
function o(c, l, u, d, f) {
|
|
1615
1615
|
c !== l && r(l, function(h, p) {
|
|
1616
|
-
if (
|
|
1617
|
-
n(c, l, p, u, o,
|
|
1616
|
+
if (f || (f = new t()), s(h))
|
|
1617
|
+
n(c, l, p, u, o, d, f);
|
|
1618
1618
|
else {
|
|
1619
|
-
var b =
|
|
1619
|
+
var b = d ? d(a(c, p), h, p + "", c, l, f) : void 0;
|
|
1620
1620
|
b === void 0 && (b = h), e(c, p, b);
|
|
1621
1621
|
}
|
|
1622
1622
|
}, i);
|
|
@@ -1683,7 +1683,7 @@ var na, Wu;
|
|
|
1683
1683
|
function Wg() {
|
|
1684
1684
|
if (Wu) return na;
|
|
1685
1685
|
Wu = 1;
|
|
1686
|
-
var t = Ug(), e =
|
|
1686
|
+
var t = Ug(), e = Gf(), r = eh(), n = e ? function(s, i) {
|
|
1687
1687
|
return e(s, "toString", {
|
|
1688
1688
|
configurable: !0,
|
|
1689
1689
|
enumerable: !1,
|
|
@@ -1780,9 +1780,9 @@ function Yo() {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
return ua = n, ua;
|
|
1782
1782
|
}
|
|
1783
|
-
var
|
|
1783
|
+
var da, Ju;
|
|
1784
1784
|
function Qg() {
|
|
1785
|
-
if (Ju) return
|
|
1785
|
+
if (Ju) return da;
|
|
1786
1786
|
Ju = 1;
|
|
1787
1787
|
var t = Ft(), e = Yo(), r = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/;
|
|
1788
1788
|
function s(i, a) {
|
|
@@ -1791,11 +1791,11 @@ function Qg() {
|
|
|
1791
1791
|
var o = typeof i;
|
|
1792
1792
|
return o == "number" || o == "symbol" || o == "boolean" || i == null || e(i) ? !0 : n.test(i) || !r.test(i) || a != null && i in Object(a);
|
|
1793
1793
|
}
|
|
1794
|
-
return
|
|
1794
|
+
return da = s, da;
|
|
1795
1795
|
}
|
|
1796
|
-
var
|
|
1796
|
+
var fa, Qu;
|
|
1797
1797
|
function Xg() {
|
|
1798
|
-
if (Qu) return
|
|
1798
|
+
if (Qu) return fa;
|
|
1799
1799
|
Qu = 1;
|
|
1800
1800
|
var t = qo(), e = "Expected a function";
|
|
1801
1801
|
function r(n, s) {
|
|
@@ -1810,7 +1810,7 @@ function Xg() {
|
|
|
1810
1810
|
};
|
|
1811
1811
|
return i.cache = new (r.Cache || t)(), i;
|
|
1812
1812
|
}
|
|
1813
|
-
return r.Cache = t,
|
|
1813
|
+
return r.Cache = t, fa = r, fa;
|
|
1814
1814
|
}
|
|
1815
1815
|
var ha, Xu;
|
|
1816
1816
|
function ey() {
|
|
@@ -1825,10 +1825,10 @@ function ey() {
|
|
|
1825
1825
|
}
|
|
1826
1826
|
return ha = r, ha;
|
|
1827
1827
|
}
|
|
1828
|
-
var ma,
|
|
1828
|
+
var ma, ed;
|
|
1829
1829
|
function ty() {
|
|
1830
|
-
if (
|
|
1831
|
-
|
|
1830
|
+
if (ed) return ma;
|
|
1831
|
+
ed = 1;
|
|
1832
1832
|
var t = ey(), e = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, r = /\\(\\)?/g, n = t(function(s) {
|
|
1833
1833
|
var i = [];
|
|
1834
1834
|
return s.charCodeAt(0) === 46 && i.push(""), s.replace(e, function(a, o, c, l) {
|
|
@@ -1837,10 +1837,10 @@ function ty() {
|
|
|
1837
1837
|
});
|
|
1838
1838
|
return ma = n, ma;
|
|
1839
1839
|
}
|
|
1840
|
-
var pa,
|
|
1840
|
+
var pa, td;
|
|
1841
1841
|
function ry() {
|
|
1842
|
-
if (
|
|
1843
|
-
|
|
1842
|
+
if (td) return pa;
|
|
1843
|
+
td = 1;
|
|
1844
1844
|
function t(e, r) {
|
|
1845
1845
|
for (var n = -1, s = e == null ? 0 : e.length, i = Array(s); ++n < s; )
|
|
1846
1846
|
i[n] = r(e[n], n, e);
|
|
@@ -1848,10 +1848,10 @@ function ry() {
|
|
|
1848
1848
|
}
|
|
1849
1849
|
return pa = t, pa;
|
|
1850
1850
|
}
|
|
1851
|
-
var ga,
|
|
1851
|
+
var ga, rd;
|
|
1852
1852
|
function ny() {
|
|
1853
|
-
if (
|
|
1854
|
-
|
|
1853
|
+
if (rd) return ga;
|
|
1854
|
+
rd = 1;
|
|
1855
1855
|
var t = Br(), e = ry(), r = Ft(), n = Yo(), s = t ? t.prototype : void 0, i = s ? s.toString : void 0;
|
|
1856
1856
|
function a(o) {
|
|
1857
1857
|
if (typeof o == "string")
|
|
@@ -1865,30 +1865,30 @@ function ny() {
|
|
|
1865
1865
|
}
|
|
1866
1866
|
return ga = a, ga;
|
|
1867
1867
|
}
|
|
1868
|
-
var ya,
|
|
1868
|
+
var ya, nd;
|
|
1869
1869
|
function sy() {
|
|
1870
|
-
if (
|
|
1871
|
-
|
|
1870
|
+
if (nd) return ya;
|
|
1871
|
+
nd = 1;
|
|
1872
1872
|
var t = ny();
|
|
1873
1873
|
function e(r) {
|
|
1874
1874
|
return r == null ? "" : t(r);
|
|
1875
1875
|
}
|
|
1876
1876
|
return ya = e, ya;
|
|
1877
1877
|
}
|
|
1878
|
-
var _a,
|
|
1878
|
+
var _a, sd;
|
|
1879
1879
|
function iy() {
|
|
1880
|
-
if (
|
|
1881
|
-
|
|
1880
|
+
if (sd) return _a;
|
|
1881
|
+
sd = 1;
|
|
1882
1882
|
var t = Ft(), e = Qg(), r = ty(), n = sy();
|
|
1883
1883
|
function s(i, a) {
|
|
1884
1884
|
return t(i) ? i : e(i, a) ? [i] : r(n(i));
|
|
1885
1885
|
}
|
|
1886
1886
|
return _a = s, _a;
|
|
1887
1887
|
}
|
|
1888
|
-
var va,
|
|
1888
|
+
var va, id;
|
|
1889
1889
|
function ay() {
|
|
1890
|
-
if (
|
|
1891
|
-
|
|
1890
|
+
if (id) return va;
|
|
1891
|
+
id = 1;
|
|
1892
1892
|
var t = Yo();
|
|
1893
1893
|
function e(r) {
|
|
1894
1894
|
if (typeof r == "string" || t(r))
|
|
@@ -1898,20 +1898,20 @@ function ay() {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
return va = e, va;
|
|
1900
1900
|
}
|
|
1901
|
-
var wa,
|
|
1901
|
+
var wa, ad;
|
|
1902
1902
|
function oy() {
|
|
1903
|
-
if (
|
|
1904
|
-
|
|
1903
|
+
if (ad) return wa;
|
|
1904
|
+
ad = 1;
|
|
1905
1905
|
var t = Ko(), e = iy(), r = jo(), n = vt(), s = ay();
|
|
1906
1906
|
function i(a, o, c, l) {
|
|
1907
1907
|
if (!n(a))
|
|
1908
1908
|
return a;
|
|
1909
1909
|
o = e(o, a);
|
|
1910
|
-
for (var u = -1,
|
|
1910
|
+
for (var u = -1, d = o.length, f = d - 1, h = a; h != null && ++u < d; ) {
|
|
1911
1911
|
var p = s(o[u]), b = c;
|
|
1912
1912
|
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
1913
1913
|
return a;
|
|
1914
|
-
if (u !=
|
|
1914
|
+
if (u != f) {
|
|
1915
1915
|
var g = h[p];
|
|
1916
1916
|
b = l ? l(g, p, h) : void 0, b === void 0 && (b = n(g) ? g : r(o[u + 1]) ? [] : {});
|
|
1917
1917
|
}
|
|
@@ -1921,10 +1921,10 @@ function oy() {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
return wa = i, wa;
|
|
1923
1923
|
}
|
|
1924
|
-
var ba,
|
|
1924
|
+
var ba, od;
|
|
1925
1925
|
function cy() {
|
|
1926
|
-
if (
|
|
1927
|
-
|
|
1926
|
+
if (od) return ba;
|
|
1927
|
+
od = 1;
|
|
1928
1928
|
var t = oy();
|
|
1929
1929
|
function e(r, n, s) {
|
|
1930
1930
|
return r == null ? r : t(r, n, s);
|
|
@@ -1935,9 +1935,9 @@ var ly = cy();
|
|
|
1935
1935
|
const uy = /* @__PURE__ */ Dn(ly), Pr = {
|
|
1936
1936
|
global: {},
|
|
1937
1937
|
collections: {}
|
|
1938
|
-
},
|
|
1938
|
+
}, dy = () => {
|
|
1939
1939
|
Pr.global = {}, Pr.collections = {};
|
|
1940
|
-
},
|
|
1940
|
+
}, be = async (t, e) => {
|
|
1941
1941
|
let r = t;
|
|
1942
1942
|
return t && (typeof t == "function" || typeof t.then == "function") && (e ? r = await t(...e) : r = await t()), r;
|
|
1943
1943
|
}, ne = async (t, e, r, n) => {
|
|
@@ -1964,27 +1964,27 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
|
|
|
1964
1964
|
o = o[u];
|
|
1965
1965
|
}
|
|
1966
1966
|
let l;
|
|
1967
|
-
if (c && (l = await
|
|
1967
|
+
if (c && (l = await be(o, r)), l) {
|
|
1968
1968
|
let u = Pr;
|
|
1969
|
-
const
|
|
1970
|
-
for (let
|
|
1971
|
-
const h = e[
|
|
1969
|
+
const d = {};
|
|
1970
|
+
for (let f = 0; f < e.length; f++) {
|
|
1971
|
+
const h = e[f];
|
|
1972
1972
|
if (h !== void 0) {
|
|
1973
1973
|
if (h === "__proto__" || h === "constructor" || h === "prototype")
|
|
1974
1974
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
1975
|
-
|
|
1975
|
+
f === e.length - 1 ? uy(d, e.join("."), l) : (u[h] ||= {}, u = u[h]);
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
|
-
Jg(Pr,
|
|
1978
|
+
Jg(Pr, d);
|
|
1979
1979
|
}
|
|
1980
1980
|
return l;
|
|
1981
|
-
},
|
|
1981
|
+
}, fy = (t, e, r) => {
|
|
1982
1982
|
const n = Object.values(r.collections), { labels: s } = e;
|
|
1983
1983
|
let i = !1;
|
|
1984
1984
|
for (const a of n) {
|
|
1985
1985
|
const { fields: o } = a;
|
|
1986
1986
|
for (const c of o)
|
|
1987
|
-
if (
|
|
1987
|
+
if (we(c) && c.collection === s.collection && c.dependencyFields)
|
|
1988
1988
|
for (const l of c.dependencyFields)
|
|
1989
1989
|
l.field === t.name && (i = !0);
|
|
1990
1990
|
}
|
|
@@ -1994,7 +1994,7 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
|
|
|
1994
1994
|
return r.forEach((i) => {
|
|
1995
1995
|
const { labels: a, fields: o } = i;
|
|
1996
1996
|
o.forEach((c) => {
|
|
1997
|
-
|
|
1997
|
+
we(c) && c.collection === n.collection && c.dependencyFields && c.dependencyFields.forEach((l) => {
|
|
1998
1998
|
s[l.field] ||= {}, s[l.field][a.collection] ||= [], s[l.field][a.collection] = s[l.field][a.collection].concat(l.roles), s[l.field][a.collection] = [
|
|
1999
1999
|
...new Set(s[l.field][a.collection])
|
|
2000
2000
|
];
|
|
@@ -2105,9 +2105,9 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
|
|
|
2105
2105
|
});
|
|
2106
2106
|
const o = /* @__PURE__ */ new Set(), c = th(e, r);
|
|
2107
2107
|
return Object.entries(c).map(([l, u]) => {
|
|
2108
|
-
t.name === l && Object.values(u).forEach((
|
|
2109
|
-
|
|
2110
|
-
o.add(
|
|
2108
|
+
t.name === l && Object.values(u).forEach((d) => {
|
|
2109
|
+
d.forEach((f) => {
|
|
2110
|
+
o.add(f);
|
|
2111
2111
|
});
|
|
2112
2112
|
});
|
|
2113
2113
|
}), o.forEach((l) => {
|
|
@@ -2127,9 +2127,9 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
|
|
|
2127
2127
|
const a = [], o = th(e, r);
|
|
2128
2128
|
if (Object.values(o).forEach((c) => {
|
|
2129
2129
|
Object.keys(c).forEach((l) => {
|
|
2130
|
-
r.collections[l].fields.forEach((
|
|
2131
|
-
|
|
2132
|
-
a.push(
|
|
2130
|
+
r.collections[l].fields.forEach((d) => {
|
|
2131
|
+
we(d) && d.collection === e.labels.collection && d.dependencyFields?.some((f) => f.field === t.name) && d.constraints && d.constraints.forEach((f) => {
|
|
2132
|
+
a.push(f[0]);
|
|
2133
2133
|
});
|
|
2134
2134
|
});
|
|
2135
2135
|
});
|
|
@@ -2147,7 +2147,7 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
|
|
|
2147
2147
|
}), s;
|
|
2148
2148
|
}, Oa = async (t, e, r) => {
|
|
2149
2149
|
if (e) {
|
|
2150
|
-
const n = await
|
|
2150
|
+
const n = await be(e, [r]);
|
|
2151
2151
|
if (n === !1)
|
|
2152
2152
|
throw new Error(`CANCELLED: Operation cancelled by ${t}`);
|
|
2153
2153
|
return n;
|
|
@@ -2165,10 +2165,10 @@ const Qo = (t, e, r, n, s, i, a, o, c, l) => (t === "create" && (r.Collection_Pa
|
|
|
2165
2165
|
if (n)
|
|
2166
2166
|
for (const a of n) {
|
|
2167
2167
|
const o = te(e, a.field);
|
|
2168
|
-
e.find((c) => c.name === a.field) &&
|
|
2168
|
+
e.find((c) => c.name === a.field) && we(o) && ["OneToOne", "OneToMany"].includes(o.type) && i.add(o);
|
|
2169
2169
|
}
|
|
2170
2170
|
return e.forEach((a) => {
|
|
2171
|
-
|
|
2171
|
+
we(a) && ["OneToOne", "OneToMany"].includes(a.type) && a.sorting && (typeof a.sorting == "boolean" || !a.sorting.roles?.every((o) => s?.includes(o))) && i.add(a);
|
|
2172
2172
|
}), i;
|
|
2173
2173
|
}, Hr = (t, e) => {
|
|
2174
2174
|
const { access: r, recordTitleField: n } = t, { serverReadOnly: s } = r, i = /* @__PURE__ */ new Set();
|
|
@@ -2186,7 +2186,7 @@ const Qo = (t, e, r, n, s, i, a, o, c, l) => (t === "create" && (r.Collection_Pa
|
|
|
2186
2186
|
}, Mr = (t, e, r) => {
|
|
2187
2187
|
const { fields: n } = t;
|
|
2188
2188
|
n.forEach((i) => {
|
|
2189
|
-
if (
|
|
2189
|
+
if (we(i))
|
|
2190
2190
|
if (e[i.name]) {
|
|
2191
2191
|
if (ar(e[i.name]))
|
|
2192
2192
|
e[`${i.name}_Array`] = e[i.name];
|
|
@@ -2222,12 +2222,12 @@ const Qo = (t, e, r, n, s, i, a, o, c, l) => (t === "create" && (r.Collection_Pa
|
|
|
2222
2222
|
const { fields: s } = e;
|
|
2223
2223
|
for (const i of r.fields) {
|
|
2224
2224
|
const a = te(s, i.name);
|
|
2225
|
-
i.custom?.initialValue !== void 0 && !(n && a.access && !a.access.includes(n)) && (t[i.name] = await
|
|
2225
|
+
i.custom?.initialValue !== void 0 && !(n && a.access && !a.access.includes(n)) && (t[i.name] = await be(i.custom.initialValue, [t]), Hr(e, [a]).size === 1 && (t[`${i.name}_Lowercase`] = t[i.name].toLowerCase()));
|
|
2226
2226
|
}
|
|
2227
2227
|
for (const i of s)
|
|
2228
|
-
n && i.access && !i.access.includes(n) || ("autoIncrement" in i && i.autoIncrement && !t[i.name] && (t[i.name] = "Pending"), !
|
|
2228
|
+
n && i.access && !i.access.includes(n) || ("autoIncrement" in i && i.autoIncrement && !t[i.name] && (t[i.name] = "Pending"), !we(i) && i.nullable && t[i.name] === void 0 && (t[i.name] = null));
|
|
2229
2229
|
};
|
|
2230
|
-
var
|
|
2230
|
+
var de;
|
|
2231
2231
|
(function(t) {
|
|
2232
2232
|
t.assertEqual = (s) => {
|
|
2233
2233
|
};
|
|
@@ -2263,16 +2263,16 @@ var fe;
|
|
|
2263
2263
|
return s.map((a) => typeof a == "string" ? `'${a}'` : a).join(i);
|
|
2264
2264
|
}
|
|
2265
2265
|
t.joinValues = n, t.jsonStringifyReplacer = (s, i) => typeof i == "bigint" ? i.toString() : i;
|
|
2266
|
-
})(
|
|
2267
|
-
var
|
|
2266
|
+
})(de || (de = {}));
|
|
2267
|
+
var cd;
|
|
2268
2268
|
(function(t) {
|
|
2269
2269
|
t.mergeShapes = (e, r) => ({
|
|
2270
2270
|
...e,
|
|
2271
2271
|
...r
|
|
2272
2272
|
// second overwrites first
|
|
2273
2273
|
});
|
|
2274
|
-
})(
|
|
2275
|
-
const W =
|
|
2274
|
+
})(cd || (cd = {}));
|
|
2275
|
+
const W = de.arrayToEnum([
|
|
2276
2276
|
"string",
|
|
2277
2277
|
"nan",
|
|
2278
2278
|
"number",
|
|
@@ -2314,7 +2314,7 @@ const W = fe.arrayToEnum([
|
|
|
2314
2314
|
default:
|
|
2315
2315
|
return W.unknown;
|
|
2316
2316
|
}
|
|
2317
|
-
}, P =
|
|
2317
|
+
}, P = de.arrayToEnum([
|
|
2318
2318
|
"invalid_type",
|
|
2319
2319
|
"invalid_literal",
|
|
2320
2320
|
"custom",
|
|
@@ -2376,7 +2376,7 @@ class yt extends Error {
|
|
|
2376
2376
|
return this.message;
|
|
2377
2377
|
}
|
|
2378
2378
|
get message() {
|
|
2379
|
-
return JSON.stringify(this.issues,
|
|
2379
|
+
return JSON.stringify(this.issues, de.jsonStringifyReplacer, 2);
|
|
2380
2380
|
}
|
|
2381
2381
|
get isEmpty() {
|
|
2382
2382
|
return this.issues.length === 0;
|
|
@@ -2403,19 +2403,19 @@ const io = (t, e) => {
|
|
|
2403
2403
|
t.received === W.undefined ? r = "Required" : r = `Expected ${t.expected}, received ${t.received}`;
|
|
2404
2404
|
break;
|
|
2405
2405
|
case P.invalid_literal:
|
|
2406
|
-
r = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
2406
|
+
r = `Invalid literal value, expected ${JSON.stringify(t.expected, de.jsonStringifyReplacer)}`;
|
|
2407
2407
|
break;
|
|
2408
2408
|
case P.unrecognized_keys:
|
|
2409
|
-
r = `Unrecognized key(s) in object: ${
|
|
2409
|
+
r = `Unrecognized key(s) in object: ${de.joinValues(t.keys, ", ")}`;
|
|
2410
2410
|
break;
|
|
2411
2411
|
case P.invalid_union:
|
|
2412
2412
|
r = "Invalid input";
|
|
2413
2413
|
break;
|
|
2414
2414
|
case P.invalid_union_discriminator:
|
|
2415
|
-
r = `Invalid discriminator value. Expected ${
|
|
2415
|
+
r = `Invalid discriminator value. Expected ${de.joinValues(t.options)}`;
|
|
2416
2416
|
break;
|
|
2417
2417
|
case P.invalid_enum_value:
|
|
2418
|
-
r = `Invalid enum value. Expected ${
|
|
2418
|
+
r = `Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;
|
|
2419
2419
|
break;
|
|
2420
2420
|
case P.invalid_arguments:
|
|
2421
2421
|
r = "Invalid function arguments";
|
|
@@ -2427,7 +2427,7 @@ const io = (t, e) => {
|
|
|
2427
2427
|
r = "Invalid date";
|
|
2428
2428
|
break;
|
|
2429
2429
|
case P.invalid_string:
|
|
2430
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
2430
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` : de.assertNever(t.validation) : t.validation !== "regex" ? r = `Invalid ${t.validation}` : r = "Invalid";
|
|
2431
2431
|
break;
|
|
2432
2432
|
case P.too_small:
|
|
2433
2433
|
t.type === "array" ? r = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "bigint" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? r = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : r = "Invalid input";
|
|
@@ -2448,7 +2448,7 @@ const io = (t, e) => {
|
|
|
2448
2448
|
r = "Number must be finite";
|
|
2449
2449
|
break;
|
|
2450
2450
|
default:
|
|
2451
|
-
r = e.defaultError,
|
|
2451
|
+
r = e.defaultError, de.assertNever(t);
|
|
2452
2452
|
}
|
|
2453
2453
|
return { message: r };
|
|
2454
2454
|
};
|
|
@@ -2495,7 +2495,7 @@ function j(t, e) {
|
|
|
2495
2495
|
});
|
|
2496
2496
|
t.common.issues.push(n);
|
|
2497
2497
|
}
|
|
2498
|
-
class
|
|
2498
|
+
class Le {
|
|
2499
2499
|
constructor() {
|
|
2500
2500
|
this.value = "valid";
|
|
2501
2501
|
}
|
|
@@ -2523,7 +2523,7 @@ class qe {
|
|
|
2523
2523
|
value: a
|
|
2524
2524
|
});
|
|
2525
2525
|
}
|
|
2526
|
-
return
|
|
2526
|
+
return Le.mergeObjectSync(e, n);
|
|
2527
2527
|
}
|
|
2528
2528
|
static mergeObjectSync(e, r) {
|
|
2529
2529
|
const n = {};
|
|
@@ -2538,7 +2538,7 @@ class qe {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
const ee = Object.freeze({
|
|
2540
2540
|
status: "aborted"
|
|
2541
|
-
}), Ar = (t) => ({ status: "dirty", value: t }), Qe = (t) => ({ status: "valid", value: t }),
|
|
2541
|
+
}), Ar = (t) => ({ status: "dirty", value: t }), Qe = (t) => ({ status: "valid", value: t }), ld = (t) => t.status === "aborted", ud = (t) => t.status === "dirty", or = (t) => t.status === "valid", gn = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
2542
2542
|
var B;
|
|
2543
2543
|
(function(t) {
|
|
2544
2544
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
@@ -2551,7 +2551,7 @@ class lt {
|
|
|
2551
2551
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
2552
2552
|
}
|
|
2553
2553
|
}
|
|
2554
|
-
const
|
|
2554
|
+
const dd = (t, e) => {
|
|
2555
2555
|
if (or(e))
|
|
2556
2556
|
return { success: !0, data: e.value };
|
|
2557
2557
|
if (!t.common.issues.length)
|
|
@@ -2596,7 +2596,7 @@ class ce {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
_processInputParams(e) {
|
|
2598
2598
|
return {
|
|
2599
|
-
status: new
|
|
2599
|
+
status: new Le(),
|
|
2600
2600
|
ctx: {
|
|
2601
2601
|
common: e.parent.common,
|
|
2602
2602
|
data: e.data,
|
|
@@ -2636,7 +2636,7 @@ class ce {
|
|
|
2636
2636
|
data: e,
|
|
2637
2637
|
parsedType: Tt(e)
|
|
2638
2638
|
}, s = this._parseSync({ data: e, path: n.path, parent: n });
|
|
2639
|
-
return
|
|
2639
|
+
return dd(n, s);
|
|
2640
2640
|
}
|
|
2641
2641
|
"~validate"(e) {
|
|
2642
2642
|
const r = {
|
|
@@ -2689,7 +2689,7 @@ class ce {
|
|
|
2689
2689
|
data: e,
|
|
2690
2690
|
parsedType: Tt(e)
|
|
2691
2691
|
}, s = this._parse({ data: e, path: n.path, parent: n }), i = await (gn(s) ? s : Promise.resolve(s));
|
|
2692
|
-
return
|
|
2692
|
+
return dd(n, i);
|
|
2693
2693
|
}
|
|
2694
2694
|
refine(e, r) {
|
|
2695
2695
|
const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
|
|
@@ -2725,7 +2725,7 @@ class ce {
|
|
|
2725
2725
|
return kt.create(this, this._def);
|
|
2726
2726
|
}
|
|
2727
2727
|
nullable() {
|
|
2728
|
-
return
|
|
2728
|
+
return dr.create(this, this._def);
|
|
2729
2729
|
}
|
|
2730
2730
|
nullish() {
|
|
2731
2731
|
return this.nullable().optional();
|
|
@@ -2841,7 +2841,7 @@ class gt extends ce {
|
|
|
2841
2841
|
received: i.parsedType
|
|
2842
2842
|
}), ee;
|
|
2843
2843
|
}
|
|
2844
|
-
const n = new
|
|
2844
|
+
const n = new Le();
|
|
2845
2845
|
let s;
|
|
2846
2846
|
for (const i of this._def.checks)
|
|
2847
2847
|
if (i.kind === "min")
|
|
@@ -2983,7 +2983,7 @@ class gt extends ce {
|
|
|
2983
2983
|
validation: "base64url",
|
|
2984
2984
|
code: P.invalid_string,
|
|
2985
2985
|
message: i.message
|
|
2986
|
-
}), n.dirty()) :
|
|
2986
|
+
}), n.dirty()) : de.assertNever(i);
|
|
2987
2987
|
return { status: n.value, value: e.data };
|
|
2988
2988
|
}
|
|
2989
2989
|
_regex(e, r, n) {
|
|
@@ -3232,9 +3232,9 @@ class cr extends ce {
|
|
|
3232
3232
|
}), ee;
|
|
3233
3233
|
}
|
|
3234
3234
|
let n;
|
|
3235
|
-
const s = new
|
|
3235
|
+
const s = new Le();
|
|
3236
3236
|
for (const i of this._def.checks)
|
|
3237
|
-
i.kind === "int" ?
|
|
3237
|
+
i.kind === "int" ? de.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), j(n, {
|
|
3238
3238
|
code: P.invalid_type,
|
|
3239
3239
|
expected: "integer",
|
|
3240
3240
|
received: "float",
|
|
@@ -3260,7 +3260,7 @@ class cr extends ce {
|
|
|
3260
3260
|
}), s.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), j(n, {
|
|
3261
3261
|
code: P.not_finite,
|
|
3262
3262
|
message: i.message
|
|
3263
|
-
}), s.dirty()) :
|
|
3263
|
+
}), s.dirty()) : de.assertNever(i);
|
|
3264
3264
|
return { status: s.value, value: e.data };
|
|
3265
3265
|
}
|
|
3266
3266
|
gte(e, r) {
|
|
@@ -3372,7 +3372,7 @@ class cr extends ce {
|
|
|
3372
3372
|
return e;
|
|
3373
3373
|
}
|
|
3374
3374
|
get isInt() {
|
|
3375
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
3375
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && de.isInteger(e.value));
|
|
3376
3376
|
}
|
|
3377
3377
|
get isFinite() {
|
|
3378
3378
|
let e = null, r = null;
|
|
@@ -3404,7 +3404,7 @@ class Vr extends ce {
|
|
|
3404
3404
|
if (this._getType(e) !== W.bigint)
|
|
3405
3405
|
return this._getInvalidInput(e);
|
|
3406
3406
|
let n;
|
|
3407
|
-
const s = new
|
|
3407
|
+
const s = new Le();
|
|
3408
3408
|
for (const i of this._def.checks)
|
|
3409
3409
|
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), j(n, {
|
|
3410
3410
|
code: P.too_small,
|
|
@@ -3422,7 +3422,7 @@ class Vr extends ce {
|
|
|
3422
3422
|
code: P.not_multiple_of,
|
|
3423
3423
|
multipleOf: i.value,
|
|
3424
3424
|
message: i.message
|
|
3425
|
-
}), s.dirty()) :
|
|
3425
|
+
}), s.dirty()) : de.assertNever(i);
|
|
3426
3426
|
return { status: s.value, value: e.data };
|
|
3427
3427
|
}
|
|
3428
3428
|
_getInvalidInput(e) {
|
|
@@ -3557,7 +3557,7 @@ class yn extends ce {
|
|
|
3557
3557
|
code: P.invalid_date
|
|
3558
3558
|
}), ee;
|
|
3559
3559
|
}
|
|
3560
|
-
const n = new
|
|
3560
|
+
const n = new Le();
|
|
3561
3561
|
let s;
|
|
3562
3562
|
for (const i of this._def.checks)
|
|
3563
3563
|
i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), j(s, {
|
|
@@ -3574,7 +3574,7 @@ class yn extends ce {
|
|
|
3574
3574
|
exact: !1,
|
|
3575
3575
|
maximum: i.value,
|
|
3576
3576
|
type: "date"
|
|
3577
|
-
}), n.dirty()) :
|
|
3577
|
+
}), n.dirty()) : de.assertNever(i);
|
|
3578
3578
|
return {
|
|
3579
3579
|
status: n.value,
|
|
3580
3580
|
value: new Date(e.data.getTime())
|
|
@@ -3619,7 +3619,7 @@ yn.create = (t) => new yn({
|
|
|
3619
3619
|
typeName: Q.ZodDate,
|
|
3620
3620
|
...se(t)
|
|
3621
3621
|
});
|
|
3622
|
-
class
|
|
3622
|
+
class fd extends ce {
|
|
3623
3623
|
_parse(e) {
|
|
3624
3624
|
if (this._getType(e) !== W.symbol) {
|
|
3625
3625
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3632,11 +3632,11 @@ class hf extends ce {
|
|
|
3632
3632
|
return Qe(e.data);
|
|
3633
3633
|
}
|
|
3634
3634
|
}
|
|
3635
|
-
|
|
3635
|
+
fd.create = (t) => new fd({
|
|
3636
3636
|
typeName: Q.ZodSymbol,
|
|
3637
3637
|
...se(t)
|
|
3638
3638
|
});
|
|
3639
|
-
class
|
|
3639
|
+
class hd extends ce {
|
|
3640
3640
|
_parse(e) {
|
|
3641
3641
|
if (this._getType(e) !== W.undefined) {
|
|
3642
3642
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3649,11 +3649,11 @@ class mf extends ce {
|
|
|
3649
3649
|
return Qe(e.data);
|
|
3650
3650
|
}
|
|
3651
3651
|
}
|
|
3652
|
-
|
|
3652
|
+
hd.create = (t) => new hd({
|
|
3653
3653
|
typeName: Q.ZodUndefined,
|
|
3654
3654
|
...se(t)
|
|
3655
3655
|
});
|
|
3656
|
-
class
|
|
3656
|
+
class md extends ce {
|
|
3657
3657
|
_parse(e) {
|
|
3658
3658
|
if (this._getType(e) !== W.null) {
|
|
3659
3659
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3666,7 +3666,7 @@ class pf extends ce {
|
|
|
3666
3666
|
return Qe(e.data);
|
|
3667
3667
|
}
|
|
3668
3668
|
}
|
|
3669
|
-
|
|
3669
|
+
md.create = (t) => new md({
|
|
3670
3670
|
typeName: Q.ZodNull,
|
|
3671
3671
|
...se(t)
|
|
3672
3672
|
});
|
|
@@ -3682,7 +3682,7 @@ oo.create = (t) => new oo({
|
|
|
3682
3682
|
typeName: Q.ZodAny,
|
|
3683
3683
|
...se(t)
|
|
3684
3684
|
});
|
|
3685
|
-
class
|
|
3685
|
+
class pd extends ce {
|
|
3686
3686
|
constructor() {
|
|
3687
3687
|
super(...arguments), this._unknown = !0;
|
|
3688
3688
|
}
|
|
@@ -3690,7 +3690,7 @@ class gf extends ce {
|
|
|
3690
3690
|
return Qe(e.data);
|
|
3691
3691
|
}
|
|
3692
3692
|
}
|
|
3693
|
-
|
|
3693
|
+
pd.create = (t) => new pd({
|
|
3694
3694
|
typeName: Q.ZodUnknown,
|
|
3695
3695
|
...se(t)
|
|
3696
3696
|
});
|
|
@@ -3708,7 +3708,7 @@ Nt.create = (t) => new Nt({
|
|
|
3708
3708
|
typeName: Q.ZodNever,
|
|
3709
3709
|
...se(t)
|
|
3710
3710
|
});
|
|
3711
|
-
class
|
|
3711
|
+
class gd extends ce {
|
|
3712
3712
|
_parse(e) {
|
|
3713
3713
|
if (this._getType(e) !== W.undefined) {
|
|
3714
3714
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3721,7 +3721,7 @@ class yf extends ce {
|
|
|
3721
3721
|
return Qe(e.data);
|
|
3722
3722
|
}
|
|
3723
3723
|
}
|
|
3724
|
-
|
|
3724
|
+
gd.create = (t) => new gd({
|
|
3725
3725
|
typeName: Q.ZodVoid,
|
|
3726
3726
|
...se(t)
|
|
3727
3727
|
});
|
|
@@ -3761,9 +3761,9 @@ class ot extends ce {
|
|
|
3761
3761
|
exact: !1,
|
|
3762
3762
|
message: s.maxLength.message
|
|
3763
3763
|
}), n.dirty()), r.common.async)
|
|
3764
|
-
return Promise.all([...r.data].map((a, o) => s.type._parseAsync(new lt(r, a, r.path, o)))).then((a) =>
|
|
3764
|
+
return Promise.all([...r.data].map((a, o) => s.type._parseAsync(new lt(r, a, r.path, o)))).then((a) => Le.mergeArray(n, a));
|
|
3765
3765
|
const i = [...r.data].map((a, o) => s.type._parseSync(new lt(r, a, r.path, o)));
|
|
3766
|
-
return
|
|
3766
|
+
return Le.mergeArray(n, i);
|
|
3767
3767
|
}
|
|
3768
3768
|
get element() {
|
|
3769
3769
|
return this._def.type;
|
|
@@ -3812,7 +3812,7 @@ function Xt(t) {
|
|
|
3812
3812
|
} else return t instanceof ot ? new ot({
|
|
3813
3813
|
...t._def,
|
|
3814
3814
|
type: Xt(t.element)
|
|
3815
|
-
}) : t instanceof kt ? kt.create(Xt(t.unwrap())) : t instanceof
|
|
3815
|
+
}) : t instanceof kt ? kt.create(Xt(t.unwrap())) : t instanceof dr ? dr.create(Xt(t.unwrap())) : t instanceof Ut ? Ut.create(t.items.map((e) => Xt(e))) : t;
|
|
3816
3816
|
}
|
|
3817
3817
|
class Re extends ce {
|
|
3818
3818
|
constructor() {
|
|
@@ -3821,7 +3821,7 @@ class Re extends ce {
|
|
|
3821
3821
|
_getCached() {
|
|
3822
3822
|
if (this._cached !== null)
|
|
3823
3823
|
return this._cached;
|
|
3824
|
-
const e = this._def.shape(), r =
|
|
3824
|
+
const e = this._def.shape(), r = de.objectKeys(e);
|
|
3825
3825
|
return this._cached = { shape: e, keys: r }, this._cached;
|
|
3826
3826
|
}
|
|
3827
3827
|
_parse(e) {
|
|
@@ -3839,10 +3839,10 @@ class Re extends ce {
|
|
|
3839
3839
|
a.includes(l) || o.push(l);
|
|
3840
3840
|
const c = [];
|
|
3841
3841
|
for (const l of a) {
|
|
3842
|
-
const u = i[l],
|
|
3842
|
+
const u = i[l], d = s.data[l];
|
|
3843
3843
|
c.push({
|
|
3844
3844
|
key: { status: "valid", value: l },
|
|
3845
|
-
value: u._parse(new lt(s,
|
|
3845
|
+
value: u._parse(new lt(s, d, s.path, l)),
|
|
3846
3846
|
alwaysSet: l in s.data
|
|
3847
3847
|
});
|
|
3848
3848
|
}
|
|
@@ -3863,11 +3863,11 @@ class Re extends ce {
|
|
|
3863
3863
|
} else {
|
|
3864
3864
|
const l = this._def.catchall;
|
|
3865
3865
|
for (const u of o) {
|
|
3866
|
-
const
|
|
3866
|
+
const d = s.data[u];
|
|
3867
3867
|
c.push({
|
|
3868
3868
|
key: { status: "valid", value: u },
|
|
3869
3869
|
value: l._parse(
|
|
3870
|
-
new lt(s,
|
|
3870
|
+
new lt(s, d, s.path, u)
|
|
3871
3871
|
//, ctx.child(key), value, getParsedType(value)
|
|
3872
3872
|
),
|
|
3873
3873
|
alwaysSet: u in s.data
|
|
@@ -3877,15 +3877,15 @@ class Re extends ce {
|
|
|
3877
3877
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
3878
3878
|
const l = [];
|
|
3879
3879
|
for (const u of c) {
|
|
3880
|
-
const
|
|
3880
|
+
const d = await u.key, f = await u.value;
|
|
3881
3881
|
l.push({
|
|
3882
|
-
key:
|
|
3883
|
-
value:
|
|
3882
|
+
key: d,
|
|
3883
|
+
value: f,
|
|
3884
3884
|
alwaysSet: u.alwaysSet
|
|
3885
3885
|
});
|
|
3886
3886
|
}
|
|
3887
3887
|
return l;
|
|
3888
|
-
}).then((l) =>
|
|
3888
|
+
}).then((l) => Le.mergeObjectSync(n, l)) : Le.mergeObjectSync(n, c);
|
|
3889
3889
|
}
|
|
3890
3890
|
get shape() {
|
|
3891
3891
|
return this._def.shape();
|
|
@@ -4027,7 +4027,7 @@ class Re extends ce {
|
|
|
4027
4027
|
}
|
|
4028
4028
|
pick(e) {
|
|
4029
4029
|
const r = {};
|
|
4030
|
-
for (const n of
|
|
4030
|
+
for (const n of de.objectKeys(e))
|
|
4031
4031
|
e[n] && this.shape[n] && (r[n] = this.shape[n]);
|
|
4032
4032
|
return new Re({
|
|
4033
4033
|
...this._def,
|
|
@@ -4036,7 +4036,7 @@ class Re extends ce {
|
|
|
4036
4036
|
}
|
|
4037
4037
|
omit(e) {
|
|
4038
4038
|
const r = {};
|
|
4039
|
-
for (const n of
|
|
4039
|
+
for (const n of de.objectKeys(this.shape))
|
|
4040
4040
|
e[n] || (r[n] = this.shape[n]);
|
|
4041
4041
|
return new Re({
|
|
4042
4042
|
...this._def,
|
|
@@ -4051,7 +4051,7 @@ class Re extends ce {
|
|
|
4051
4051
|
}
|
|
4052
4052
|
partial(e) {
|
|
4053
4053
|
const r = {};
|
|
4054
|
-
for (const n of
|
|
4054
|
+
for (const n of de.objectKeys(this.shape)) {
|
|
4055
4055
|
const s = this.shape[n];
|
|
4056
4056
|
e && !e[n] ? r[n] = s : r[n] = s.optional();
|
|
4057
4057
|
}
|
|
@@ -4062,7 +4062,7 @@ class Re extends ce {
|
|
|
4062
4062
|
}
|
|
4063
4063
|
required(e) {
|
|
4064
4064
|
const r = {};
|
|
4065
|
-
for (const n of
|
|
4065
|
+
for (const n of de.objectKeys(this.shape))
|
|
4066
4066
|
if (e && !e[n])
|
|
4067
4067
|
r[n] = this.shape[n];
|
|
4068
4068
|
else {
|
|
@@ -4077,7 +4077,7 @@ class Re extends ce {
|
|
|
4077
4077
|
});
|
|
4078
4078
|
}
|
|
4079
4079
|
keyof() {
|
|
4080
|
-
return oh(
|
|
4080
|
+
return oh(de.objectKeys(this.shape));
|
|
4081
4081
|
}
|
|
4082
4082
|
}
|
|
4083
4083
|
Re.create = (t, e) => new Re({
|
|
@@ -4179,7 +4179,7 @@ function co(t, e) {
|
|
|
4179
4179
|
if (t === e)
|
|
4180
4180
|
return { valid: !0, data: t };
|
|
4181
4181
|
if (r === W.object && n === W.object) {
|
|
4182
|
-
const s =
|
|
4182
|
+
const s = de.objectKeys(e), i = de.objectKeys(t).filter((o) => s.indexOf(o) !== -1), a = { ...t, ...e };
|
|
4183
4183
|
for (const o of i) {
|
|
4184
4184
|
const c = co(t[o], e[o]);
|
|
4185
4185
|
if (!c.valid)
|
|
@@ -4203,10 +4203,10 @@ function co(t, e) {
|
|
|
4203
4203
|
class vn extends ce {
|
|
4204
4204
|
_parse(e) {
|
|
4205
4205
|
const { status: r, ctx: n } = this._processInputParams(e), s = (i, a) => {
|
|
4206
|
-
if (
|
|
4206
|
+
if (ld(i) || ld(a))
|
|
4207
4207
|
return ee;
|
|
4208
4208
|
const o = co(i.value, a.value);
|
|
4209
|
-
return o.valid ? ((
|
|
4209
|
+
return o.valid ? ((ud(i) || ud(a)) && r.dirty(), { status: r.value, value: o.data }) : (j(n, {
|
|
4210
4210
|
code: P.invalid_intersection_types
|
|
4211
4211
|
}), ee);
|
|
4212
4212
|
};
|
|
@@ -4266,7 +4266,7 @@ class Ut extends ce {
|
|
|
4266
4266
|
const c = this._def.items[o] || this._def.rest;
|
|
4267
4267
|
return c ? c._parse(new lt(n, a, n.path, o)) : null;
|
|
4268
4268
|
}).filter((a) => !!a);
|
|
4269
|
-
return n.common.async ? Promise.all(i).then((a) =>
|
|
4269
|
+
return n.common.async ? Promise.all(i).then((a) => Le.mergeArray(r, a)) : Le.mergeArray(r, i);
|
|
4270
4270
|
}
|
|
4271
4271
|
get items() {
|
|
4272
4272
|
return this._def.items;
|
|
@@ -4310,7 +4310,7 @@ class wn extends ce {
|
|
|
4310
4310
|
value: a._parse(new lt(n, n.data[o], n.path, o)),
|
|
4311
4311
|
alwaysSet: o in n.data
|
|
4312
4312
|
});
|
|
4313
|
-
return n.common.async ?
|
|
4313
|
+
return n.common.async ? Le.mergeObjectAsync(r, s) : Le.mergeObjectSync(r, s);
|
|
4314
4314
|
}
|
|
4315
4315
|
get element() {
|
|
4316
4316
|
return this._def.valueType;
|
|
@@ -4329,7 +4329,7 @@ class wn extends ce {
|
|
|
4329
4329
|
});
|
|
4330
4330
|
}
|
|
4331
4331
|
}
|
|
4332
|
-
class
|
|
4332
|
+
class yd extends ce {
|
|
4333
4333
|
get keySchema() {
|
|
4334
4334
|
return this._def.keyType;
|
|
4335
4335
|
}
|
|
@@ -4371,7 +4371,7 @@ class _f extends ce {
|
|
|
4371
4371
|
}
|
|
4372
4372
|
}
|
|
4373
4373
|
}
|
|
4374
|
-
|
|
4374
|
+
yd.create = (t, e, r) => new yd({
|
|
4375
4375
|
valueType: e,
|
|
4376
4376
|
keyType: t,
|
|
4377
4377
|
typeName: Q.ZodMap,
|
|
@@ -4441,7 +4441,7 @@ Ur.create = (t, e) => new Ur({
|
|
|
4441
4441
|
typeName: Q.ZodSet,
|
|
4442
4442
|
...se(e)
|
|
4443
4443
|
});
|
|
4444
|
-
class
|
|
4444
|
+
class _d extends ce {
|
|
4445
4445
|
get schema() {
|
|
4446
4446
|
return this._def.getter();
|
|
4447
4447
|
}
|
|
@@ -4450,7 +4450,7 @@ class vf extends ce {
|
|
|
4450
4450
|
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
4451
4451
|
}
|
|
4452
4452
|
}
|
|
4453
|
-
|
|
4453
|
+
_d.create = (t, e) => new _d({
|
|
4454
4454
|
getter: t,
|
|
4455
4455
|
typeName: Q.ZodLazy,
|
|
4456
4456
|
...se(e)
|
|
@@ -4488,7 +4488,7 @@ class lr extends ce {
|
|
|
4488
4488
|
if (typeof e.data != "string") {
|
|
4489
4489
|
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
4490
4490
|
return j(r, {
|
|
4491
|
-
expected:
|
|
4491
|
+
expected: de.joinValues(n),
|
|
4492
4492
|
received: r.parsedType,
|
|
4493
4493
|
code: P.invalid_type
|
|
4494
4494
|
}), ee;
|
|
@@ -4538,19 +4538,19 @@ class lr extends ce {
|
|
|
4538
4538
|
}
|
|
4539
4539
|
}
|
|
4540
4540
|
lr.create = oh;
|
|
4541
|
-
class
|
|
4541
|
+
class vd extends ce {
|
|
4542
4542
|
_parse(e) {
|
|
4543
|
-
const r =
|
|
4543
|
+
const r = de.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
4544
4544
|
if (n.parsedType !== W.string && n.parsedType !== W.number) {
|
|
4545
|
-
const s =
|
|
4545
|
+
const s = de.objectValues(r);
|
|
4546
4546
|
return j(n, {
|
|
4547
|
-
expected:
|
|
4547
|
+
expected: de.joinValues(s),
|
|
4548
4548
|
received: n.parsedType,
|
|
4549
4549
|
code: P.invalid_type
|
|
4550
4550
|
}), ee;
|
|
4551
4551
|
}
|
|
4552
|
-
if (this._cache || (this._cache = new Set(
|
|
4553
|
-
const s =
|
|
4552
|
+
if (this._cache || (this._cache = new Set(de.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
4553
|
+
const s = de.objectValues(r);
|
|
4554
4554
|
return j(n, {
|
|
4555
4555
|
received: n.data,
|
|
4556
4556
|
code: P.invalid_enum_value,
|
|
@@ -4563,7 +4563,7 @@ class wf extends ce {
|
|
|
4563
4563
|
return this._def.values;
|
|
4564
4564
|
}
|
|
4565
4565
|
}
|
|
4566
|
-
|
|
4566
|
+
vd.create = (t, e) => new vd({
|
|
4567
4567
|
values: t,
|
|
4568
4568
|
typeName: Q.ZodNativeEnum,
|
|
4569
4569
|
...se(e)
|
|
@@ -4669,7 +4669,7 @@ class ur extends ce {
|
|
|
4669
4669
|
status: r.value,
|
|
4670
4670
|
value: o
|
|
4671
4671
|
})) : ee);
|
|
4672
|
-
|
|
4672
|
+
de.assertNever(s);
|
|
4673
4673
|
}
|
|
4674
4674
|
}
|
|
4675
4675
|
ur.create = (t, e, r) => new ur({
|
|
@@ -4697,7 +4697,7 @@ kt.create = (t, e) => new kt({
|
|
|
4697
4697
|
typeName: Q.ZodOptional,
|
|
4698
4698
|
...se(e)
|
|
4699
4699
|
});
|
|
4700
|
-
class
|
|
4700
|
+
class dr extends ce {
|
|
4701
4701
|
_parse(e) {
|
|
4702
4702
|
return this._getType(e) === W.null ? Qe(null) : this._def.innerType._parse(e);
|
|
4703
4703
|
}
|
|
@@ -4705,7 +4705,7 @@ class fr extends ce {
|
|
|
4705
4705
|
return this._def.innerType;
|
|
4706
4706
|
}
|
|
4707
4707
|
}
|
|
4708
|
-
|
|
4708
|
+
dr.create = (t, e) => new dr({
|
|
4709
4709
|
innerType: t,
|
|
4710
4710
|
typeName: Q.ZodNullable,
|
|
4711
4711
|
...se(e)
|
|
@@ -4773,7 +4773,7 @@ fo.create = (t, e) => new fo({
|
|
|
4773
4773
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4774
4774
|
...se(e)
|
|
4775
4775
|
});
|
|
4776
|
-
class
|
|
4776
|
+
class wd extends ce {
|
|
4777
4777
|
_parse(e) {
|
|
4778
4778
|
if (this._getType(e) !== W.nan) {
|
|
4779
4779
|
const n = this._getOrReturnCtx(e);
|
|
@@ -4786,7 +4786,7 @@ class bf extends ce {
|
|
|
4786
4786
|
return { status: "valid", value: e.data };
|
|
4787
4787
|
}
|
|
4788
4788
|
}
|
|
4789
|
-
|
|
4789
|
+
wd.create = (t) => new wd({
|
|
4790
4790
|
typeName: Q.ZodNaN,
|
|
4791
4791
|
...se(t)
|
|
4792
4792
|
});
|
|
@@ -4869,10 +4869,10 @@ Ut.create;
|
|
|
4869
4869
|
const ec = wn.create, po = lo.create, go = lr.create;
|
|
4870
4870
|
bn.create;
|
|
4871
4871
|
kt.create;
|
|
4872
|
-
|
|
4872
|
+
dr.create;
|
|
4873
4873
|
const un = () => jt().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds !== void 0 || t._seconds !== void 0 && t._nanoseconds !== void 0), {
|
|
4874
4874
|
message: "Value is not a valid timestamp"
|
|
4875
|
-
}),
|
|
4875
|
+
}), bd = () => jt().refine((t) => t && (t._methodName === "serverTimestamp" || t.constructor.name === "ServerTimestampTransform"), {
|
|
4876
4876
|
message: "Value is not a valid server timestamp"
|
|
4877
4877
|
}), lh = (t, e, r) => {
|
|
4878
4878
|
const n = {};
|
|
@@ -4946,13 +4946,13 @@ const un = () => jt().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
|
|
|
4946
4946
|
i = jt();
|
|
4947
4947
|
break;
|
|
4948
4948
|
}
|
|
4949
|
-
return !
|
|
4949
|
+
return !we(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
|
|
4950
4950
|
}, Hy = (t, e, r) => {
|
|
4951
4951
|
const n = {
|
|
4952
4952
|
Collection_Path: Un(at()),
|
|
4953
4953
|
Last_Write_App: at(),
|
|
4954
4954
|
Last_Write_At: un(),
|
|
4955
|
-
Last_Save_At:
|
|
4955
|
+
Last_Save_At: bd(),
|
|
4956
4956
|
Last_Write_By: On([at().length(28), po("System")]),
|
|
4957
4957
|
Last_Write_Connection_Status: go(["Online", "Offline"]),
|
|
4958
4958
|
Last_Write_Version: mo().int(),
|
|
@@ -4960,10 +4960,10 @@ const un = () => jt().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
|
|
|
4960
4960
|
Created_At: un(),
|
|
4961
4961
|
Created_By: On([at().length(28), po("System")])
|
|
4962
4962
|
};
|
|
4963
|
-
t === "create" && (n.Saved_At =
|
|
4963
|
+
t === "create" && (n.Saved_At = bd()), t === "update" && (n.Saved_At = un(), n.Collection_Path = n.Collection_Path.optional(), n.id = n.id.optional(), n.Created_At = n.Created_At.optional(), n.Saved_At = n.Saved_At.optional(), n.Created_By = n.Created_By.optional());
|
|
4964
4964
|
const s = nh(e, e.fields), i = Array.from(s).map((c) => c.name);
|
|
4965
4965
|
e.fields.forEach((c) => {
|
|
4966
|
-
|
|
4966
|
+
we(c) ? (n[c.name] = Zy(c, r), n[`${c.name}_Array`] = Gy(c), i.includes(c.name) && (n[`${c.name}_Single`] = lh(c, r, !0), c.required || (n[`${c.name}_Single`] = n[`${c.name}_Single`].optional())), c.length && (n[c.name] = n[c.name].refine((l) => c.length && l && Object.keys(l).length === c.length, {
|
|
4967
4967
|
message: `Value must contain ${c.length} item(s)`
|
|
4968
4968
|
})), c.min && (n[c.name] = n[c.name].refine((l) => c.min && l && Object.keys(l).length >= c.min, {
|
|
4969
4969
|
message: `Value must contain at least ${c.min} item(s)`
|
|
@@ -5011,7 +5011,7 @@ const $ = "numeric", st = "short", Ve = "long", Sn = {
|
|
|
5011
5011
|
year: $,
|
|
5012
5012
|
month: $,
|
|
5013
5013
|
day: $
|
|
5014
|
-
},
|
|
5014
|
+
}, dh = {
|
|
5015
5015
|
year: $,
|
|
5016
5016
|
month: st,
|
|
5017
5017
|
day: $
|
|
@@ -5020,7 +5020,7 @@ const $ = "numeric", st = "short", Ve = "long", Sn = {
|
|
|
5020
5020
|
month: st,
|
|
5021
5021
|
day: $,
|
|
5022
5022
|
weekday: st
|
|
5023
|
-
},
|
|
5023
|
+
}, fh = {
|
|
5024
5024
|
year: $,
|
|
5025
5025
|
month: Ve,
|
|
5026
5026
|
day: $
|
|
@@ -5404,7 +5404,7 @@ class _t extends Kr {
|
|
|
5404
5404
|
const n = e_(this.name);
|
|
5405
5405
|
let [s, i, a, o, c, l, u] = n.formatToParts ? n_(n, r) : r_(n, r);
|
|
5406
5406
|
o === "BC" && (s = -Math.abs(s) + 1);
|
|
5407
|
-
const
|
|
5407
|
+
const f = Bn({
|
|
5408
5408
|
year: s,
|
|
5409
5409
|
month: i,
|
|
5410
5410
|
day: a,
|
|
@@ -5415,7 +5415,7 @@ class _t extends Kr {
|
|
|
5415
5415
|
});
|
|
5416
5416
|
let h = +r;
|
|
5417
5417
|
const p = h % 1e3;
|
|
5418
|
-
return h -= p >= 0 ? p : 1e3 + p, (
|
|
5418
|
+
return h -= p >= 0 ? p : 1e3 + p, (f - h) / (60 * 1e3);
|
|
5419
5419
|
}
|
|
5420
5420
|
/**
|
|
5421
5421
|
* Return whether this Zone is equal to another zone
|
|
@@ -5435,11 +5435,11 @@ class _t extends Kr {
|
|
|
5435
5435
|
return this.valid;
|
|
5436
5436
|
}
|
|
5437
5437
|
}
|
|
5438
|
-
let
|
|
5438
|
+
let Od = {};
|
|
5439
5439
|
function s_(t, e = {}) {
|
|
5440
5440
|
const r = JSON.stringify([t, e]);
|
|
5441
|
-
let n =
|
|
5442
|
-
return n || (n = new Intl.ListFormat(t, e),
|
|
5441
|
+
let n = Od[r];
|
|
5442
|
+
return n || (n = new Intl.ListFormat(t, e), Od[r] = n), n;
|
|
5443
5443
|
}
|
|
5444
5444
|
const _o = /* @__PURE__ */ new Map();
|
|
5445
5445
|
function vo(t, e = {}) {
|
|
@@ -5498,7 +5498,7 @@ function l_(t) {
|
|
|
5498
5498
|
function u_(t, e, r) {
|
|
5499
5499
|
return (r || e) && (t.includes("-u-") || (t += "-u"), r && (t += `-ca-${r}`), e && (t += `-nu-${e}`)), t;
|
|
5500
5500
|
}
|
|
5501
|
-
function
|
|
5501
|
+
function d_(t) {
|
|
5502
5502
|
const e = [];
|
|
5503
5503
|
for (let r = 1; r <= 12; r++) {
|
|
5504
5504
|
const n = G.utc(2009, r, 1);
|
|
@@ -5506,7 +5506,7 @@ function f_(t) {
|
|
|
5506
5506
|
}
|
|
5507
5507
|
return e;
|
|
5508
5508
|
}
|
|
5509
|
-
function
|
|
5509
|
+
function f_(t) {
|
|
5510
5510
|
const e = [];
|
|
5511
5511
|
for (let r = 1; r <= 7; r++) {
|
|
5512
5512
|
const n = G.utc(2016, 11, 13 + r);
|
|
@@ -5645,7 +5645,7 @@ class me {
|
|
|
5645
5645
|
const s = r ? { month: e, day: "numeric" } : { month: e }, i = r ? "format" : "standalone";
|
|
5646
5646
|
if (!this.monthsCache[i][e]) {
|
|
5647
5647
|
const a = n ? (o) => this.dtFormatter(o, s).format() : (o) => this.extract(o, s, "month");
|
|
5648
|
-
this.monthsCache[i][e] =
|
|
5648
|
+
this.monthsCache[i][e] = d_(a);
|
|
5649
5649
|
}
|
|
5650
5650
|
return this.monthsCache[i][e];
|
|
5651
5651
|
});
|
|
@@ -5653,7 +5653,7 @@ class me {
|
|
|
5653
5653
|
weekdays(e, r = !1) {
|
|
5654
5654
|
return sn(this, e, Zh, () => {
|
|
5655
5655
|
const n = r ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = r ? "format" : "standalone";
|
|
5656
|
-
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] =
|
|
5656
|
+
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = f_(
|
|
5657
5657
|
(i) => this.extract(i, n, "weekday")
|
|
5658
5658
|
)), this.weekdaysCache[s][e];
|
|
5659
5659
|
});
|
|
@@ -5721,13 +5721,13 @@ class me {
|
|
|
5721
5721
|
}
|
|
5722
5722
|
}
|
|
5723
5723
|
let Ra = null;
|
|
5724
|
-
class
|
|
5724
|
+
class qe extends Kr {
|
|
5725
5725
|
/**
|
|
5726
5726
|
* Get a singleton instance of UTC
|
|
5727
5727
|
* @return {FixedOffsetZone}
|
|
5728
5728
|
*/
|
|
5729
5729
|
static get utcInstance() {
|
|
5730
|
-
return Ra === null && (Ra = new
|
|
5730
|
+
return Ra === null && (Ra = new qe(0)), Ra;
|
|
5731
5731
|
}
|
|
5732
5732
|
/**
|
|
5733
5733
|
* Get an instance with a specified offset
|
|
@@ -5735,7 +5735,7 @@ class Me extends Kr {
|
|
|
5735
5735
|
* @return {FixedOffsetZone}
|
|
5736
5736
|
*/
|
|
5737
5737
|
static instance(e) {
|
|
5738
|
-
return e === 0 ?
|
|
5738
|
+
return e === 0 ? qe.utcInstance : new qe(e);
|
|
5739
5739
|
}
|
|
5740
5740
|
/**
|
|
5741
5741
|
* Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"
|
|
@@ -5749,7 +5749,7 @@ class Me extends Kr {
|
|
|
5749
5749
|
if (e) {
|
|
5750
5750
|
const r = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
5751
5751
|
if (r)
|
|
5752
|
-
return new
|
|
5752
|
+
return new qe(Zn(r[1], r[2]));
|
|
5753
5753
|
}
|
|
5754
5754
|
return null;
|
|
5755
5755
|
}
|
|
@@ -5884,8 +5884,8 @@ function At(t, e) {
|
|
|
5884
5884
|
return t;
|
|
5885
5885
|
if (E_(t)) {
|
|
5886
5886
|
const r = t.toLowerCase();
|
|
5887
|
-
return r === "default" ? e : r === "local" || r === "system" ? Wn.instance : r === "utc" || r === "gmt" ?
|
|
5888
|
-
} else return It(t) ?
|
|
5887
|
+
return r === "default" ? e : r === "local" || r === "system" ? Wn.instance : r === "utc" || r === "gmt" ? qe.utcInstance : qe.parseSpecifier(r) || _t.create(t);
|
|
5888
|
+
} else return It(t) ? qe.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new y_(t);
|
|
5889
5889
|
}
|
|
5890
5890
|
const tc = {
|
|
5891
5891
|
arab: "[٠-٩]",
|
|
@@ -5909,7 +5909,7 @@ const tc = {
|
|
|
5909
5909
|
thai: "[๐-๙]",
|
|
5910
5910
|
tibt: "[༠-༩]",
|
|
5911
5911
|
latn: "\\d"
|
|
5912
|
-
},
|
|
5912
|
+
}, Ed = {
|
|
5913
5913
|
arab: [1632, 1641],
|
|
5914
5914
|
arabext: [1776, 1785],
|
|
5915
5915
|
bali: [6992, 7001],
|
|
@@ -5939,8 +5939,8 @@ function v_(t) {
|
|
|
5939
5939
|
if (t[r].search(tc.hanidec) !== -1)
|
|
5940
5940
|
e += __.indexOf(t[r]);
|
|
5941
5941
|
else
|
|
5942
|
-
for (const s in
|
|
5943
|
-
const [i, a] =
|
|
5942
|
+
for (const s in Ed) {
|
|
5943
|
+
const [i, a] = Ed[s];
|
|
5944
5944
|
n >= i && n <= a && (e += n - i);
|
|
5945
5945
|
}
|
|
5946
5946
|
}
|
|
@@ -5959,14 +5959,14 @@ function et({ numberingSystem: t }, e = "") {
|
|
|
5959
5959
|
let s = n.get(e);
|
|
5960
5960
|
return s === void 0 && (s = new RegExp(`${tc[r]}${e}`), n.set(e, s)), s;
|
|
5961
5961
|
}
|
|
5962
|
-
let
|
|
5962
|
+
let Sd = () => Date.now(), Td = "system", Rd = null, Cd = null, Ad = null, kd = 60, Id, xd = null;
|
|
5963
5963
|
class Se {
|
|
5964
5964
|
/**
|
|
5965
5965
|
* Get the callback for returning the current timestamp.
|
|
5966
5966
|
* @type {function}
|
|
5967
5967
|
*/
|
|
5968
5968
|
static get now() {
|
|
5969
|
-
return
|
|
5969
|
+
return Sd;
|
|
5970
5970
|
}
|
|
5971
5971
|
/**
|
|
5972
5972
|
* Set the callback for returning the current timestamp.
|
|
@@ -5976,7 +5976,7 @@ class Se {
|
|
|
5976
5976
|
* @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
|
|
5977
5977
|
*/
|
|
5978
5978
|
static set now(e) {
|
|
5979
|
-
|
|
5979
|
+
Sd = e;
|
|
5980
5980
|
}
|
|
5981
5981
|
/**
|
|
5982
5982
|
* Set the default time zone to create DateTimes in. Does not affect existing instances.
|
|
@@ -5984,7 +5984,7 @@ class Se {
|
|
|
5984
5984
|
* @type {string}
|
|
5985
5985
|
*/
|
|
5986
5986
|
static set defaultZone(e) {
|
|
5987
|
-
|
|
5987
|
+
Td = e;
|
|
5988
5988
|
}
|
|
5989
5989
|
/**
|
|
5990
5990
|
* Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
|
|
@@ -5992,49 +5992,49 @@ class Se {
|
|
|
5992
5992
|
* @type {Zone}
|
|
5993
5993
|
*/
|
|
5994
5994
|
static get defaultZone() {
|
|
5995
|
-
return At(
|
|
5995
|
+
return At(Td, Wn.instance);
|
|
5996
5996
|
}
|
|
5997
5997
|
/**
|
|
5998
5998
|
* Get the default locale to create DateTimes with. Does not affect existing instances.
|
|
5999
5999
|
* @type {string}
|
|
6000
6000
|
*/
|
|
6001
6001
|
static get defaultLocale() {
|
|
6002
|
-
return
|
|
6002
|
+
return Rd;
|
|
6003
6003
|
}
|
|
6004
6004
|
/**
|
|
6005
6005
|
* Set the default locale to create DateTimes with. Does not affect existing instances.
|
|
6006
6006
|
* @type {string}
|
|
6007
6007
|
*/
|
|
6008
6008
|
static set defaultLocale(e) {
|
|
6009
|
-
|
|
6009
|
+
Rd = e;
|
|
6010
6010
|
}
|
|
6011
6011
|
/**
|
|
6012
6012
|
* Get the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
6013
6013
|
* @type {string}
|
|
6014
6014
|
*/
|
|
6015
6015
|
static get defaultNumberingSystem() {
|
|
6016
|
-
return
|
|
6016
|
+
return Cd;
|
|
6017
6017
|
}
|
|
6018
6018
|
/**
|
|
6019
6019
|
* Set the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
6020
6020
|
* @type {string}
|
|
6021
6021
|
*/
|
|
6022
6022
|
static set defaultNumberingSystem(e) {
|
|
6023
|
-
|
|
6023
|
+
Cd = e;
|
|
6024
6024
|
}
|
|
6025
6025
|
/**
|
|
6026
6026
|
* Get the default output calendar to create DateTimes with. Does not affect existing instances.
|
|
6027
6027
|
* @type {string}
|
|
6028
6028
|
*/
|
|
6029
6029
|
static get defaultOutputCalendar() {
|
|
6030
|
-
return
|
|
6030
|
+
return Ad;
|
|
6031
6031
|
}
|
|
6032
6032
|
/**
|
|
6033
6033
|
* Set the default output calendar to create DateTimes with. Does not affect existing instances.
|
|
6034
6034
|
* @type {string}
|
|
6035
6035
|
*/
|
|
6036
6036
|
static set defaultOutputCalendar(e) {
|
|
6037
|
-
|
|
6037
|
+
Ad = e;
|
|
6038
6038
|
}
|
|
6039
6039
|
/**
|
|
6040
6040
|
* @typedef {Object} WeekSettings
|
|
@@ -6046,7 +6046,7 @@ class Se {
|
|
|
6046
6046
|
* @return {WeekSettings|null}
|
|
6047
6047
|
*/
|
|
6048
6048
|
static get defaultWeekSettings() {
|
|
6049
|
-
return
|
|
6049
|
+
return xd;
|
|
6050
6050
|
}
|
|
6051
6051
|
/**
|
|
6052
6052
|
* Allows overriding the default locale week settings, i.e. the start of the week, the weekend and
|
|
@@ -6056,14 +6056,14 @@ class Se {
|
|
|
6056
6056
|
* @param {WeekSettings|null} weekSettings
|
|
6057
6057
|
*/
|
|
6058
6058
|
static set defaultWeekSettings(e) {
|
|
6059
|
-
|
|
6059
|
+
xd = To(e);
|
|
6060
6060
|
}
|
|
6061
6061
|
/**
|
|
6062
6062
|
* Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
|
|
6063
6063
|
* @type {number}
|
|
6064
6064
|
*/
|
|
6065
6065
|
static get twoDigitCutoffYear() {
|
|
6066
|
-
return
|
|
6066
|
+
return kd;
|
|
6067
6067
|
}
|
|
6068
6068
|
/**
|
|
6069
6069
|
* Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
|
|
@@ -6075,21 +6075,21 @@ class Se {
|
|
|
6075
6075
|
* @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
|
|
6076
6076
|
*/
|
|
6077
6077
|
static set twoDigitCutoffYear(e) {
|
|
6078
|
-
|
|
6078
|
+
kd = e % 100;
|
|
6079
6079
|
}
|
|
6080
6080
|
/**
|
|
6081
6081
|
* Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
6082
6082
|
* @type {boolean}
|
|
6083
6083
|
*/
|
|
6084
6084
|
static get throwOnInvalid() {
|
|
6085
|
-
return
|
|
6085
|
+
return Id;
|
|
6086
6086
|
}
|
|
6087
6087
|
/**
|
|
6088
6088
|
* Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
6089
6089
|
* @type {boolean}
|
|
6090
6090
|
*/
|
|
6091
6091
|
static set throwOnInvalid(e) {
|
|
6092
|
-
|
|
6092
|
+
Id = e;
|
|
6093
6093
|
}
|
|
6094
6094
|
/**
|
|
6095
6095
|
* Reset Luxon's global caches. Should only be necessary in testing scenarios.
|
|
@@ -6135,22 +6135,22 @@ function Tn(t, e = 4, r = 1) {
|
|
|
6135
6135
|
let c = Math.floor((a - o + 14 - e) / 7), l;
|
|
6136
6136
|
return c < 1 ? (l = n - 1, c = Wr(l, e, r)) : c > Wr(n, e, r) ? (l = n + 1, c = 1) : l = n, { weekYear: l, weekNumber: c, weekday: o, ...Gn(t) };
|
|
6137
6137
|
}
|
|
6138
|
-
function
|
|
6138
|
+
function Nd(t, e = 4, r = 1) {
|
|
6139
6139
|
const { weekYear: n, weekNumber: s, weekday: i } = t, a = nc(rc(n, 1, e), r), o = nr(n);
|
|
6140
6140
|
let c = s * 7 + i - a - 7 + e, l;
|
|
6141
6141
|
c < 1 ? (l = n - 1, c += nr(l)) : c > o ? (l = n + 1, c -= nr(n)) : l = n;
|
|
6142
|
-
const { month: u, day:
|
|
6143
|
-
return { year: l, month: u, day:
|
|
6142
|
+
const { month: u, day: d } = Ph(l, c);
|
|
6143
|
+
return { year: l, month: u, day: d, ...Gn(t) };
|
|
6144
6144
|
}
|
|
6145
6145
|
function Ca(t) {
|
|
6146
6146
|
const { year: e, month: r, day: n } = t, s = Dh(e, r, n);
|
|
6147
6147
|
return { year: e, ordinal: s, ...Gn(t) };
|
|
6148
6148
|
}
|
|
6149
|
-
function
|
|
6149
|
+
function Fd(t) {
|
|
6150
6150
|
const { year: e, ordinal: r } = t, { month: n, day: s } = Ph(e, r);
|
|
6151
6151
|
return { year: e, month: n, day: s, ...Gn(t) };
|
|
6152
6152
|
}
|
|
6153
|
-
function
|
|
6153
|
+
function Dd(t, e) {
|
|
6154
6154
|
if (!J(t.localWeekday) || !J(t.localWeekNumber) || !J(t.localWeekYear)) {
|
|
6155
6155
|
if (!J(t.weekday) || !J(t.weekNumber) || !J(t.weekYear))
|
|
6156
6156
|
throw new tr(
|
|
@@ -6215,7 +6215,7 @@ function $h() {
|
|
|
6215
6215
|
function T_(t) {
|
|
6216
6216
|
return Array.isArray(t) ? t : [t];
|
|
6217
6217
|
}
|
|
6218
|
-
function
|
|
6218
|
+
function Pd(t, e, r) {
|
|
6219
6219
|
if (t.length !== 0)
|
|
6220
6220
|
return t.reduce((n, s) => {
|
|
6221
6221
|
const i = [e(s), s];
|
|
@@ -6225,7 +6225,7 @@ function Mf(t, e, r) {
|
|
|
6225
6225
|
function R_(t, e) {
|
|
6226
6226
|
return e.reduce((r, n) => (r[n] = t[n], r), {});
|
|
6227
6227
|
}
|
|
6228
|
-
function
|
|
6228
|
+
function fr(t, e) {
|
|
6229
6229
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
6230
6230
|
}
|
|
6231
6231
|
function To(t) {
|
|
@@ -6305,11 +6305,11 @@ function Bn(t) {
|
|
|
6305
6305
|
);
|
|
6306
6306
|
return t.year < 100 && t.year >= 0 && (e = new Date(e), e.setUTCFullYear(t.year, t.month - 1, t.day)), +e;
|
|
6307
6307
|
}
|
|
6308
|
-
function
|
|
6308
|
+
function Md(t, e, r) {
|
|
6309
6309
|
return -nc(rc(t, 1, e), r) + e - 1;
|
|
6310
6310
|
}
|
|
6311
6311
|
function Wr(t, e = 4, r = 1) {
|
|
6312
|
-
const n =
|
|
6312
|
+
const n = Md(t, e, r), s = Md(t + 1, e, r);
|
|
6313
6313
|
return (nr(t) - n + s) / 7;
|
|
6314
6314
|
}
|
|
6315
6315
|
function Ro(t) {
|
|
@@ -6343,7 +6343,7 @@ function Vh(t) {
|
|
|
6343
6343
|
function Cn(t, e) {
|
|
6344
6344
|
const r = {};
|
|
6345
6345
|
for (const n in t)
|
|
6346
|
-
if (
|
|
6346
|
+
if (fr(t, n)) {
|
|
6347
6347
|
const s = t[n];
|
|
6348
6348
|
if (s == null) continue;
|
|
6349
6349
|
r[e(n)] = Vh(s);
|
|
@@ -6469,20 +6469,20 @@ function L_(t, e, r = "always", n = !1) {
|
|
|
6469
6469
|
seconds: ["second", "sec."]
|
|
6470
6470
|
}, i = ["hours", "minutes", "seconds"].indexOf(t) === -1;
|
|
6471
6471
|
if (r === "auto" && i) {
|
|
6472
|
-
const
|
|
6472
|
+
const d = t === "days";
|
|
6473
6473
|
switch (e) {
|
|
6474
6474
|
case 1:
|
|
6475
|
-
return
|
|
6475
|
+
return d ? "tomorrow" : `next ${s[t][0]}`;
|
|
6476
6476
|
case -1:
|
|
6477
|
-
return
|
|
6477
|
+
return d ? "yesterday" : `last ${s[t][0]}`;
|
|
6478
6478
|
case 0:
|
|
6479
|
-
return
|
|
6479
|
+
return d ? "today" : `this ${s[t][0]}`;
|
|
6480
6480
|
}
|
|
6481
6481
|
}
|
|
6482
6482
|
const a = Object.is(e, -0) || e < 0, o = Math.abs(e), c = o === 1, l = s[t], u = n ? c ? l[1] : l[2] || l[1] : c ? s[t][0] : t;
|
|
6483
6483
|
return a ? `${o} ${u} ago` : `in ${o} ${u}`;
|
|
6484
6484
|
}
|
|
6485
|
-
function
|
|
6485
|
+
function qd(t, e) {
|
|
6486
6486
|
let r = "";
|
|
6487
6487
|
for (const n of t)
|
|
6488
6488
|
n.literal ? r += n.val : r += e(n.val);
|
|
@@ -6490,8 +6490,8 @@ function Lf(t, e) {
|
|
|
6490
6490
|
}
|
|
6491
6491
|
const $_ = {
|
|
6492
6492
|
D: Sn,
|
|
6493
|
-
DD:
|
|
6494
|
-
DDD:
|
|
6493
|
+
DD: dh,
|
|
6494
|
+
DDD: fh,
|
|
6495
6495
|
DDDD: hh,
|
|
6496
6496
|
t: mh,
|
|
6497
6497
|
tt: ph,
|
|
@@ -6563,7 +6563,7 @@ class De {
|
|
|
6563
6563
|
), u = (h) => {
|
|
6564
6564
|
const p = De.macroTokenToFormatOpts(h);
|
|
6565
6565
|
return p ? this.formatWithSystemDefault(e, p) : h;
|
|
6566
|
-
},
|
|
6566
|
+
}, d = (h) => n ? q_(e, h) : i({ era: h }, "era"), f = (h) => {
|
|
6567
6567
|
switch (h) {
|
|
6568
6568
|
// ms
|
|
6569
6569
|
case "S":
|
|
@@ -6669,11 +6669,11 @@ class De {
|
|
|
6669
6669
|
return s ? i({ year: "numeric" }, "year") : this.num(e.year, 6);
|
|
6670
6670
|
// eras
|
|
6671
6671
|
case "G":
|
|
6672
|
-
return
|
|
6672
|
+
return d("short");
|
|
6673
6673
|
case "GG":
|
|
6674
|
-
return
|
|
6674
|
+
return d("long");
|
|
6675
6675
|
case "GGGGG":
|
|
6676
|
-
return
|
|
6676
|
+
return d("narrow");
|
|
6677
6677
|
case "kk":
|
|
6678
6678
|
return this.num(e.weekYear.toString().slice(-2), 2);
|
|
6679
6679
|
case "kkkk":
|
|
@@ -6706,7 +6706,7 @@ class De {
|
|
|
6706
6706
|
return u(h);
|
|
6707
6707
|
}
|
|
6708
6708
|
};
|
|
6709
|
-
return
|
|
6709
|
+
return qd(De.parseFormat(r), f);
|
|
6710
6710
|
}
|
|
6711
6711
|
formatDurationFromString(e, r) {
|
|
6712
6712
|
const n = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, s = (u) => {
|
|
@@ -6730,16 +6730,16 @@ class De {
|
|
|
6730
6730
|
default:
|
|
6731
6731
|
return null;
|
|
6732
6732
|
}
|
|
6733
|
-
}, i = (u,
|
|
6734
|
-
const h = s(
|
|
6733
|
+
}, i = (u, d) => (f) => {
|
|
6734
|
+
const h = s(f);
|
|
6735
6735
|
if (h) {
|
|
6736
|
-
const p =
|
|
6736
|
+
const p = d.isNegativeDuration && h !== d.largestUnit ? n : 1;
|
|
6737
6737
|
let b;
|
|
6738
|
-
return this.opts.signMode === "negativeLargestOnly" && h !==
|
|
6738
|
+
return this.opts.signMode === "negativeLargestOnly" && h !== d.largestUnit ? b = "never" : this.opts.signMode === "all" ? b = "always" : b = "auto", this.num(u.get(h) * p, f.length, b);
|
|
6739
6739
|
} else
|
|
6740
|
-
return
|
|
6740
|
+
return f;
|
|
6741
6741
|
}, a = De.parseFormat(r), o = a.reduce(
|
|
6742
|
-
(u, { literal:
|
|
6742
|
+
(u, { literal: d, val: f }) => d ? u : u.concat(f),
|
|
6743
6743
|
[]
|
|
6744
6744
|
), c = e.shiftTo(...o.map(s).filter((u) => u)), l = {
|
|
6745
6745
|
isNegativeDuration: c < 0,
|
|
@@ -6747,7 +6747,7 @@ class De {
|
|
|
6747
6747
|
// in order
|
|
6748
6748
|
largestUnit: Object.keys(c.values)[0]
|
|
6749
6749
|
};
|
|
6750
|
-
return
|
|
6750
|
+
return qd(a, i(c, l));
|
|
6751
6751
|
}
|
|
6752
6752
|
}
|
|
6753
6753
|
const Kh = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
@@ -6806,7 +6806,7 @@ function vr(t, e) {
|
|
|
6806
6806
|
}, null, e + 4];
|
|
6807
6807
|
}
|
|
6808
6808
|
function Jr(t, e) {
|
|
6809
|
-
const r = !t[e] && !t[e + 1], n = Zn(t[e + 1], t[e + 2]), s = r ? null :
|
|
6809
|
+
const r = !t[e] && !t[e + 1], n = Zn(t[e + 1], t[e + 2]), s = r ? null : qe.instance(n);
|
|
6810
6810
|
return [{}, s, e + 3];
|
|
6811
6811
|
}
|
|
6812
6812
|
function Qr(t, e) {
|
|
@@ -6815,17 +6815,17 @@ function Qr(t, e) {
|
|
|
6815
6815
|
}
|
|
6816
6816
|
const K_ = RegExp(`^T?${ac.source}$`), Y_ = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
|
|
6817
6817
|
function J_(t) {
|
|
6818
|
-
const [e, r, n, s, i, a, o, c, l] = t, u = e[0] === "-",
|
|
6818
|
+
const [e, r, n, s, i, a, o, c, l] = t, u = e[0] === "-", d = c && c[0] === "-", f = (h, p = !1) => h !== void 0 && (p || h && u) ? -h : h;
|
|
6819
6819
|
return [
|
|
6820
6820
|
{
|
|
6821
|
-
years:
|
|
6822
|
-
months:
|
|
6823
|
-
weeks:
|
|
6824
|
-
days:
|
|
6825
|
-
hours:
|
|
6826
|
-
minutes:
|
|
6827
|
-
seconds:
|
|
6828
|
-
milliseconds:
|
|
6821
|
+
years: f(Mt(r)),
|
|
6822
|
+
months: f(Mt(n)),
|
|
6823
|
+
weeks: f(Mt(s)),
|
|
6824
|
+
days: f(Mt(i)),
|
|
6825
|
+
hours: f(Mt(a)),
|
|
6826
|
+
minutes: f(Mt(o)),
|
|
6827
|
+
seconds: f(Mt(c), c === "-0"),
|
|
6828
|
+
milliseconds: f(sc(l), d)
|
|
6829
6829
|
}
|
|
6830
6830
|
];
|
|
6831
6831
|
}
|
|
@@ -6864,22 +6864,22 @@ function ev(t) {
|
|
|
6864
6864
|
c,
|
|
6865
6865
|
l,
|
|
6866
6866
|
u,
|
|
6867
|
-
|
|
6868
|
-
] = t,
|
|
6867
|
+
d
|
|
6868
|
+
] = t, f = cc(e, s, n, r, i, a, o);
|
|
6869
6869
|
let h;
|
|
6870
|
-
return c ? h = Q_[c] : l ? h = 0 : h = Zn(u,
|
|
6870
|
+
return c ? h = Q_[c] : l ? h = 0 : h = Zn(u, d), [f, new qe(h)];
|
|
6871
6871
|
}
|
|
6872
6872
|
function tv(t) {
|
|
6873
6873
|
return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
6874
6874
|
}
|
|
6875
6875
|
const rv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, nv = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, sv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
6876
|
-
function
|
|
6876
|
+
function Ld(t) {
|
|
6877
6877
|
const [, e, r, n, s, i, a, o] = t;
|
|
6878
|
-
return [cc(e, s, n, r, i, a, o),
|
|
6878
|
+
return [cc(e, s, n, r, i, a, o), qe.utcInstance];
|
|
6879
6879
|
}
|
|
6880
6880
|
function iv(t) {
|
|
6881
6881
|
const [, e, r, n, s, i, a, o] = t;
|
|
6882
|
-
return [cc(e, o, r, n, s, i, a),
|
|
6882
|
+
return [cc(e, o, r, n, s, i, a), qe.utcInstance];
|
|
6883
6883
|
}
|
|
6884
6884
|
const av = gr(V_, oc), ov = gr(U_, oc), cv = gr(W_, oc), lv = gr(Qh), em = yr(
|
|
6885
6885
|
H_,
|
|
@@ -6891,12 +6891,12 @@ const av = gr(V_, oc), ov = gr(U_, oc), cv = gr(W_, oc), lv = gr(Qh), em = yr(
|
|
|
6891
6891
|
vr,
|
|
6892
6892
|
Jr,
|
|
6893
6893
|
Qr
|
|
6894
|
-
),
|
|
6894
|
+
), dv = yr(
|
|
6895
6895
|
B_,
|
|
6896
6896
|
vr,
|
|
6897
6897
|
Jr,
|
|
6898
6898
|
Qr
|
|
6899
|
-
),
|
|
6899
|
+
), fv = yr(
|
|
6900
6900
|
vr,
|
|
6901
6901
|
Jr,
|
|
6902
6902
|
Qr
|
|
@@ -6906,8 +6906,8 @@ function hv(t) {
|
|
|
6906
6906
|
t,
|
|
6907
6907
|
[av, em],
|
|
6908
6908
|
[ov, uv],
|
|
6909
|
-
[cv,
|
|
6910
|
-
[lv,
|
|
6909
|
+
[cv, dv],
|
|
6910
|
+
[lv, fv]
|
|
6911
6911
|
);
|
|
6912
6912
|
}
|
|
6913
6913
|
function mv(t) {
|
|
@@ -6916,8 +6916,8 @@ function mv(t) {
|
|
|
6916
6916
|
function pv(t) {
|
|
6917
6917
|
return _r(
|
|
6918
6918
|
t,
|
|
6919
|
-
[rv,
|
|
6920
|
-
[nv,
|
|
6919
|
+
[rv, Ld],
|
|
6920
|
+
[nv, Ld],
|
|
6921
6921
|
[sv, iv]
|
|
6922
6922
|
);
|
|
6923
6923
|
}
|
|
@@ -6940,7 +6940,7 @@ function Ov(t) {
|
|
|
6940
6940
|
[wv, bv]
|
|
6941
6941
|
);
|
|
6942
6942
|
}
|
|
6943
|
-
const
|
|
6943
|
+
const $d = "Invalid Duration", tm = {
|
|
6944
6944
|
weeks: {
|
|
6945
6945
|
days: 7,
|
|
6946
6946
|
hours: 168,
|
|
@@ -7026,7 +7026,7 @@ const jf = "Invalid Duration", tm = {
|
|
|
7026
7026
|
"seconds",
|
|
7027
7027
|
"milliseconds"
|
|
7028
7028
|
], Tv = Vt.slice(0).reverse();
|
|
7029
|
-
function
|
|
7029
|
+
function ft(t, e, r = !1) {
|
|
7030
7030
|
const n = {
|
|
7031
7031
|
values: r ? e.values : { ...t.values, ...e.values || {} },
|
|
7032
7032
|
loc: t.loc.clone(e.loc),
|
|
@@ -7041,7 +7041,7 @@ function rm(t, e) {
|
|
|
7041
7041
|
e[n] && (r += e[n] * t[n].milliseconds);
|
|
7042
7042
|
return r;
|
|
7043
7043
|
}
|
|
7044
|
-
function
|
|
7044
|
+
function jd(t, e) {
|
|
7045
7045
|
const r = rm(t, e) < 0 ? -1 : 1;
|
|
7046
7046
|
Vt.reduceRight((n, s) => {
|
|
7047
7047
|
if (J(e[s]))
|
|
@@ -7061,7 +7061,7 @@ function Vf(t, e) {
|
|
|
7061
7061
|
return s;
|
|
7062
7062
|
}, null);
|
|
7063
7063
|
}
|
|
7064
|
-
function
|
|
7064
|
+
function Vd(t) {
|
|
7065
7065
|
const e = {};
|
|
7066
7066
|
for (const [r, n] of Object.entries(t))
|
|
7067
7067
|
n !== 0 && (e[r] = n);
|
|
@@ -7274,7 +7274,7 @@ class le {
|
|
|
7274
7274
|
...r,
|
|
7275
7275
|
floor: r.round !== !1 && r.floor !== !1
|
|
7276
7276
|
};
|
|
7277
|
-
return this.isValid ? De.create(this.loc, n).formatDurationFromString(this, e) :
|
|
7277
|
+
return this.isValid ? De.create(this.loc, n).formatDurationFromString(this, e) : $d;
|
|
7278
7278
|
}
|
|
7279
7279
|
/**
|
|
7280
7280
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -7293,7 +7293,7 @@ class le {
|
|
|
7293
7293
|
* ```
|
|
7294
7294
|
*/
|
|
7295
7295
|
toHuman(e = {}) {
|
|
7296
|
-
if (!this.isValid) return
|
|
7296
|
+
if (!this.isValid) return $d;
|
|
7297
7297
|
const r = e.showZeros !== !1, n = Vt.map((s) => {
|
|
7298
7298
|
const i = this.values[s];
|
|
7299
7299
|
return J(i) || i === 0 && !r ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: s.slice(0, -1) }).format(i);
|
|
@@ -7395,8 +7395,8 @@ class le {
|
|
|
7395
7395
|
if (!this.isValid) return this;
|
|
7396
7396
|
const r = le.fromDurationLike(e), n = {};
|
|
7397
7397
|
for (const s of Vt)
|
|
7398
|
-
(
|
|
7399
|
-
return
|
|
7398
|
+
(fr(r.values, s) || fr(this.values, s)) && (n[s] = r.get(s) + this.get(s));
|
|
7399
|
+
return ft(this, { values: n }, !0);
|
|
7400
7400
|
}
|
|
7401
7401
|
/**
|
|
7402
7402
|
* Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
|
|
@@ -7420,7 +7420,7 @@ class le {
|
|
|
7420
7420
|
const r = {};
|
|
7421
7421
|
for (const n of Object.keys(this.values))
|
|
7422
7422
|
r[n] = Vh(e(this.values[n], n));
|
|
7423
|
-
return
|
|
7423
|
+
return ft(this, { values: r }, !0);
|
|
7424
7424
|
}
|
|
7425
7425
|
/**
|
|
7426
7426
|
* Get the value of unit.
|
|
@@ -7443,7 +7443,7 @@ class le {
|
|
|
7443
7443
|
set(e) {
|
|
7444
7444
|
if (!this.isValid) return this;
|
|
7445
7445
|
const r = { ...this.values, ...Cn(e, le.normalizeUnit) };
|
|
7446
|
-
return
|
|
7446
|
+
return ft(this, { values: r });
|
|
7447
7447
|
}
|
|
7448
7448
|
/**
|
|
7449
7449
|
* "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.
|
|
@@ -7452,7 +7452,7 @@ class le {
|
|
|
7452
7452
|
*/
|
|
7453
7453
|
reconfigure({ locale: e, numberingSystem: r, conversionAccuracy: n, matrix: s } = {}) {
|
|
7454
7454
|
const a = { loc: this.loc.clone({ locale: e, numberingSystem: r }), matrix: s, conversionAccuracy: n };
|
|
7455
|
-
return
|
|
7455
|
+
return ft(this, a);
|
|
7456
7456
|
}
|
|
7457
7457
|
/**
|
|
7458
7458
|
* Return the length of the duration in the specified unit.
|
|
@@ -7483,7 +7483,7 @@ class le {
|
|
|
7483
7483
|
normalize() {
|
|
7484
7484
|
if (!this.isValid) return this;
|
|
7485
7485
|
const e = this.toObject();
|
|
7486
|
-
return
|
|
7486
|
+
return jd(this.matrix, e), ft(this, { values: e }, !0);
|
|
7487
7487
|
}
|
|
7488
7488
|
/**
|
|
7489
7489
|
* Rescale units to its largest representation
|
|
@@ -7492,8 +7492,8 @@ class le {
|
|
|
7492
7492
|
*/
|
|
7493
7493
|
rescale() {
|
|
7494
7494
|
if (!this.isValid) return this;
|
|
7495
|
-
const e =
|
|
7496
|
-
return
|
|
7495
|
+
const e = Vd(this.normalize().shiftToAll().toObject());
|
|
7496
|
+
return ft(this, { values: e }, !0);
|
|
7497
7497
|
}
|
|
7498
7498
|
/**
|
|
7499
7499
|
* Convert this Duration into its representation in a different set of units.
|
|
@@ -7519,7 +7519,7 @@ class le {
|
|
|
7519
7519
|
} else It(s[a]) && (n[a] = s[a]);
|
|
7520
7520
|
for (const a in n)
|
|
7521
7521
|
n[a] !== 0 && (r[i] += a === i ? n[a] : n[a] / this.matrix[i][a]);
|
|
7522
|
-
return
|
|
7522
|
+
return jd(this.matrix, r), ft(this, { values: r }, !0);
|
|
7523
7523
|
}
|
|
7524
7524
|
/**
|
|
7525
7525
|
* Shift this Duration to all available units.
|
|
@@ -7548,7 +7548,7 @@ class le {
|
|
|
7548
7548
|
const e = {};
|
|
7549
7549
|
for (const r of Object.keys(this.values))
|
|
7550
7550
|
e[r] = this.values[r] === 0 ? 0 : -this.values[r];
|
|
7551
|
-
return
|
|
7551
|
+
return ft(this, { values: e }, !0);
|
|
7552
7552
|
}
|
|
7553
7553
|
/**
|
|
7554
7554
|
* Removes all units with values equal to 0 from this Duration.
|
|
@@ -7557,8 +7557,8 @@ class le {
|
|
|
7557
7557
|
*/
|
|
7558
7558
|
removeZeros() {
|
|
7559
7559
|
if (!this.isValid) return this;
|
|
7560
|
-
const e =
|
|
7561
|
-
return
|
|
7560
|
+
const e = Vd(this.values);
|
|
7561
|
+
return ft(this, { values: e }, !0);
|
|
7562
7562
|
}
|
|
7563
7563
|
/**
|
|
7564
7564
|
* Get the years.
|
|
@@ -8301,7 +8301,7 @@ class an {
|
|
|
8301
8301
|
return { relative: Lh(), localeWeek: $h() };
|
|
8302
8302
|
}
|
|
8303
8303
|
}
|
|
8304
|
-
function
|
|
8304
|
+
function Ud(t, e) {
|
|
8305
8305
|
const r = (s) => s.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), n = r(e) - r(t);
|
|
8306
8306
|
return Math.floor(le.fromMillis(n).as("days"));
|
|
8307
8307
|
}
|
|
@@ -8313,11 +8313,11 @@ function Cv(t, e, r) {
|
|
|
8313
8313
|
[
|
|
8314
8314
|
"weeks",
|
|
8315
8315
|
(c, l) => {
|
|
8316
|
-
const u =
|
|
8316
|
+
const u = Ud(c, l);
|
|
8317
8317
|
return (u - u % 7) / 7;
|
|
8318
8318
|
}
|
|
8319
8319
|
],
|
|
8320
|
-
["days",
|
|
8320
|
+
["days", Ud]
|
|
8321
8321
|
], s = {}, i = t;
|
|
8322
8322
|
let a, o;
|
|
8323
8323
|
for (const [c, l] of n)
|
|
@@ -8327,30 +8327,30 @@ function Cv(t, e, r) {
|
|
|
8327
8327
|
function Av(t, e, r, n) {
|
|
8328
8328
|
let [s, i, a, o] = Cv(t, e, r);
|
|
8329
8329
|
const c = e - s, l = r.filter(
|
|
8330
|
-
(
|
|
8330
|
+
(d) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(d) >= 0
|
|
8331
8331
|
);
|
|
8332
8332
|
l.length === 0 && (a < e && (a = s.plus({ [o]: 1 })), a !== s && (i[o] = (i[o] || 0) + c / (a - s)));
|
|
8333
8333
|
const u = le.fromObject(i, n);
|
|
8334
8334
|
return l.length > 0 ? le.fromMillis(c, n).shiftTo(...l).plus(u) : u;
|
|
8335
8335
|
}
|
|
8336
8336
|
const kv = "missing Intl.DateTimeFormat.formatToParts support";
|
|
8337
|
-
function
|
|
8337
|
+
function fe(t, e = (r) => r) {
|
|
8338
8338
|
return { regex: t, deser: ([r]) => e(v_(r)) };
|
|
8339
8339
|
}
|
|
8340
8340
|
const Iv = " ", nm = `[ ${Iv}]`, sm = new RegExp(nm, "g");
|
|
8341
8341
|
function xv(t) {
|
|
8342
8342
|
return t.replace(/\./g, "\\.?").replace(sm, nm);
|
|
8343
8343
|
}
|
|
8344
|
-
function
|
|
8344
|
+
function Wd(t) {
|
|
8345
8345
|
return t.replace(/\./g, "").replace(sm, " ").toLowerCase();
|
|
8346
8346
|
}
|
|
8347
8347
|
function tt(t, e) {
|
|
8348
8348
|
return t === null ? null : {
|
|
8349
8349
|
regex: RegExp(t.map(xv).join("|")),
|
|
8350
|
-
deser: ([r]) => t.findIndex((n) =>
|
|
8350
|
+
deser: ([r]) => t.findIndex((n) => Wd(r) === Wd(n)) + e
|
|
8351
8351
|
};
|
|
8352
8352
|
}
|
|
8353
|
-
function
|
|
8353
|
+
function zd(t, e) {
|
|
8354
8354
|
return { regex: t, deser: ([, r, n]) => Zn(r, n), groups: e };
|
|
8355
8355
|
}
|
|
8356
8356
|
function on(t) {
|
|
@@ -8360,7 +8360,7 @@ function Nv(t) {
|
|
|
8360
8360
|
return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
8361
8361
|
}
|
|
8362
8362
|
function Fv(t, e) {
|
|
8363
|
-
const r = et(e), n = et(e, "{2}"), s = et(e, "{3}"), i = et(e, "{4}"), a = et(e, "{6}"), o = et(e, "{1,2}"), c = et(e, "{1,3}"), l = et(e, "{1,6}"), u = et(e, "{1,9}"),
|
|
8363
|
+
const r = et(e), n = et(e, "{2}"), s = et(e, "{3}"), i = et(e, "{4}"), a = et(e, "{6}"), o = et(e, "{1,2}"), c = et(e, "{1,3}"), l = et(e, "{1,6}"), u = et(e, "{1,9}"), d = et(e, "{2,4}"), f = et(e, "{4,6}"), h = (g) => ({ regex: RegExp(Nv(g.val)), deser: ([O]) => O, literal: !0 }), b = ((g) => {
|
|
8364
8364
|
if (t.literal)
|
|
8365
8365
|
return h(g);
|
|
8366
8366
|
switch (g.val) {
|
|
@@ -8371,90 +8371,90 @@ function Fv(t, e) {
|
|
|
8371
8371
|
return tt(e.eras("long"), 0);
|
|
8372
8372
|
// years
|
|
8373
8373
|
case "y":
|
|
8374
|
-
return
|
|
8374
|
+
return fe(l);
|
|
8375
8375
|
case "yy":
|
|
8376
|
-
return
|
|
8376
|
+
return fe(d, Ro);
|
|
8377
8377
|
case "yyyy":
|
|
8378
|
-
return
|
|
8378
|
+
return fe(i);
|
|
8379
8379
|
case "yyyyy":
|
|
8380
|
-
return
|
|
8380
|
+
return fe(f);
|
|
8381
8381
|
case "yyyyyy":
|
|
8382
|
-
return
|
|
8382
|
+
return fe(a);
|
|
8383
8383
|
// months
|
|
8384
8384
|
case "M":
|
|
8385
|
-
return
|
|
8385
|
+
return fe(o);
|
|
8386
8386
|
case "MM":
|
|
8387
|
-
return
|
|
8387
|
+
return fe(n);
|
|
8388
8388
|
case "MMM":
|
|
8389
8389
|
return tt(e.months("short", !0), 1);
|
|
8390
8390
|
case "MMMM":
|
|
8391
8391
|
return tt(e.months("long", !0), 1);
|
|
8392
8392
|
case "L":
|
|
8393
|
-
return
|
|
8393
|
+
return fe(o);
|
|
8394
8394
|
case "LL":
|
|
8395
|
-
return
|
|
8395
|
+
return fe(n);
|
|
8396
8396
|
case "LLL":
|
|
8397
8397
|
return tt(e.months("short", !1), 1);
|
|
8398
8398
|
case "LLLL":
|
|
8399
8399
|
return tt(e.months("long", !1), 1);
|
|
8400
8400
|
// dates
|
|
8401
8401
|
case "d":
|
|
8402
|
-
return
|
|
8402
|
+
return fe(o);
|
|
8403
8403
|
case "dd":
|
|
8404
|
-
return
|
|
8404
|
+
return fe(n);
|
|
8405
8405
|
// ordinals
|
|
8406
8406
|
case "o":
|
|
8407
|
-
return
|
|
8407
|
+
return fe(c);
|
|
8408
8408
|
case "ooo":
|
|
8409
|
-
return
|
|
8409
|
+
return fe(s);
|
|
8410
8410
|
// time
|
|
8411
8411
|
case "HH":
|
|
8412
|
-
return
|
|
8412
|
+
return fe(n);
|
|
8413
8413
|
case "H":
|
|
8414
|
-
return
|
|
8414
|
+
return fe(o);
|
|
8415
8415
|
case "hh":
|
|
8416
|
-
return
|
|
8416
|
+
return fe(n);
|
|
8417
8417
|
case "h":
|
|
8418
|
-
return
|
|
8418
|
+
return fe(o);
|
|
8419
8419
|
case "mm":
|
|
8420
|
-
return
|
|
8420
|
+
return fe(n);
|
|
8421
8421
|
case "m":
|
|
8422
|
-
return
|
|
8422
|
+
return fe(o);
|
|
8423
8423
|
case "q":
|
|
8424
|
-
return
|
|
8424
|
+
return fe(o);
|
|
8425
8425
|
case "qq":
|
|
8426
|
-
return
|
|
8426
|
+
return fe(n);
|
|
8427
8427
|
case "s":
|
|
8428
|
-
return
|
|
8428
|
+
return fe(o);
|
|
8429
8429
|
case "ss":
|
|
8430
|
-
return
|
|
8430
|
+
return fe(n);
|
|
8431
8431
|
case "S":
|
|
8432
|
-
return
|
|
8432
|
+
return fe(c);
|
|
8433
8433
|
case "SSS":
|
|
8434
|
-
return
|
|
8434
|
+
return fe(s);
|
|
8435
8435
|
case "u":
|
|
8436
8436
|
return on(u);
|
|
8437
8437
|
case "uu":
|
|
8438
8438
|
return on(o);
|
|
8439
8439
|
case "uuu":
|
|
8440
|
-
return
|
|
8440
|
+
return fe(r);
|
|
8441
8441
|
// meridiem
|
|
8442
8442
|
case "a":
|
|
8443
8443
|
return tt(e.meridiems(), 0);
|
|
8444
8444
|
// weekYear (k)
|
|
8445
8445
|
case "kkkk":
|
|
8446
|
-
return
|
|
8446
|
+
return fe(i);
|
|
8447
8447
|
case "kk":
|
|
8448
|
-
return
|
|
8448
|
+
return fe(d, Ro);
|
|
8449
8449
|
// weekNumber (W)
|
|
8450
8450
|
case "W":
|
|
8451
|
-
return
|
|
8451
|
+
return fe(o);
|
|
8452
8452
|
case "WW":
|
|
8453
|
-
return
|
|
8453
|
+
return fe(n);
|
|
8454
8454
|
// weekdays
|
|
8455
8455
|
case "E":
|
|
8456
8456
|
case "c":
|
|
8457
|
-
return
|
|
8457
|
+
return fe(r);
|
|
8458
8458
|
case "EEE":
|
|
8459
8459
|
return tt(e.weekdays("short", !1), 1);
|
|
8460
8460
|
case "EEEE":
|
|
@@ -8466,9 +8466,9 @@ function Fv(t, e) {
|
|
|
8466
8466
|
// offset/zone
|
|
8467
8467
|
case "Z":
|
|
8468
8468
|
case "ZZ":
|
|
8469
|
-
return
|
|
8469
|
+
return zd(new RegExp(`([+-]${o.source})(?::(${n.source}))?`), 2);
|
|
8470
8470
|
case "ZZZ":
|
|
8471
|
-
return
|
|
8471
|
+
return zd(new RegExp(`([+-]${o.source})(${n.source})?`), 2);
|
|
8472
8472
|
// we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing
|
|
8473
8473
|
// because we don't have any way to figure out what they are
|
|
8474
8474
|
case "z":
|
|
@@ -8555,7 +8555,7 @@ function qv(t, e, r) {
|
|
|
8555
8555
|
const s = {};
|
|
8556
8556
|
let i = 1;
|
|
8557
8557
|
for (const a in r)
|
|
8558
|
-
if (
|
|
8558
|
+
if (fr(r, a)) {
|
|
8559
8559
|
const o = r[a], c = o.groups ? o.groups + 1 : 1;
|
|
8560
8560
|
!o.literal && o.token && (s[o.token.val[0]] = o.deser(n.slice(i, i + c))), i += c;
|
|
8561
8561
|
}
|
|
@@ -8598,7 +8598,7 @@ function Lv(t) {
|
|
|
8598
8598
|
}
|
|
8599
8599
|
};
|
|
8600
8600
|
let r = null, n;
|
|
8601
|
-
return J(t.z) || (r = _t.create(t.z)), J(t.Z) || (r || (r = new
|
|
8601
|
+
return J(t.z) || (r = _t.create(t.z)), J(t.Z) || (r || (r = new qe(t.Z)), n = t.Z), J(t.q) || (t.M = (t.q - 1) * 3 + 1), J(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), J(t.u) || (t.S = sc(t.u)), [Object.keys(t).reduce((i, a) => {
|
|
8602
8602
|
const o = e(a);
|
|
8603
8603
|
return o && (i[o] = t[a]), i;
|
|
8604
8604
|
}, {}), r, n];
|
|
@@ -8626,7 +8626,7 @@ class am {
|
|
|
8626
8626
|
explainFromTokens(e) {
|
|
8627
8627
|
if (this.isValid) {
|
|
8628
8628
|
const [r, n] = qv(e, this.regex, this.handlers), [s, i, a] = n ? Lv(n) : [null, null, void 0];
|
|
8629
|
-
if (
|
|
8629
|
+
if (fr(n, "a") && fr(n, "H"))
|
|
8630
8630
|
throw new tr(
|
|
8631
8631
|
"Can't include meridiem when specifying 24-hour format"
|
|
8632
8632
|
);
|
|
@@ -8663,7 +8663,7 @@ function cm(t, e) {
|
|
|
8663
8663
|
const n = De.create(e, t).dtFormatter($v()), s = n.formatToParts(), i = n.resolvedOptions();
|
|
8664
8664
|
return s.map((a) => Pv(a, t, i));
|
|
8665
8665
|
}
|
|
8666
|
-
const ka = "Invalid DateTime",
|
|
8666
|
+
const ka = "Invalid DateTime", Bd = 864e13;
|
|
8667
8667
|
function Ir(t) {
|
|
8668
8668
|
return new nt("unsupported zone", `the zone "${t.name}" is not supported`);
|
|
8669
8669
|
}
|
|
@@ -8710,10 +8710,10 @@ function cn(t, e) {
|
|
|
8710
8710
|
millisecond: r.getUTCMilliseconds()
|
|
8711
8711
|
};
|
|
8712
8712
|
}
|
|
8713
|
-
function
|
|
8713
|
+
function dn(t, e, r) {
|
|
8714
8714
|
return lm(Bn(t), e, r);
|
|
8715
8715
|
}
|
|
8716
|
-
function
|
|
8716
|
+
function Zd(t, e) {
|
|
8717
8717
|
const r = t.o, n = t.c.year + Math.trunc(e.years), s = t.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
|
|
8718
8718
|
...t.c,
|
|
8719
8719
|
year: n,
|
|
@@ -8763,7 +8763,7 @@ function Na(t, e, r) {
|
|
|
8763
8763
|
} else if (s += Ce(t.c.month), r === "month") return s;
|
|
8764
8764
|
return s += Ce(t.c.day), s;
|
|
8765
8765
|
}
|
|
8766
|
-
function
|
|
8766
|
+
function Gd(t, e, r, n, s, i, a) {
|
|
8767
8767
|
let o = !r || t.c.millisecond !== 0 || t.c.second !== 0, c = "";
|
|
8768
8768
|
switch (a) {
|
|
8769
8769
|
case "day":
|
|
@@ -8804,7 +8804,7 @@ const um = {
|
|
|
8804
8804
|
minute: 0,
|
|
8805
8805
|
second: 0,
|
|
8806
8806
|
millisecond: 0
|
|
8807
|
-
},
|
|
8807
|
+
}, fn = ["year", "month", "day", "hour", "minute", "second", "millisecond"], zv = [
|
|
8808
8808
|
"weekYear",
|
|
8809
8809
|
"weekNumber",
|
|
8810
8810
|
"weekday",
|
|
@@ -8843,7 +8843,7 @@ function hn(t) {
|
|
|
8843
8843
|
if (!e) throw new uh(t);
|
|
8844
8844
|
return e;
|
|
8845
8845
|
}
|
|
8846
|
-
function
|
|
8846
|
+
function Hd(t) {
|
|
8847
8847
|
switch (t.toLowerCase()) {
|
|
8848
8848
|
case "localweekday":
|
|
8849
8849
|
case "localweekdays":
|
|
@@ -8865,7 +8865,7 @@ function Zv(t) {
|
|
|
8865
8865
|
let r = Co.get(e);
|
|
8866
8866
|
return r === void 0 && (r = t.offset(xr), Co.set(e, r)), r;
|
|
8867
8867
|
}
|
|
8868
|
-
function
|
|
8868
|
+
function Kd(t, e) {
|
|
8869
8869
|
const r = At(e.zone, Se.defaultZone);
|
|
8870
8870
|
if (!r.isValid)
|
|
8871
8871
|
return G.invalid(Ir(r));
|
|
@@ -8874,17 +8874,17 @@ function Yf(t, e) {
|
|
|
8874
8874
|
if (J(t.year))
|
|
8875
8875
|
s = Se.now();
|
|
8876
8876
|
else {
|
|
8877
|
-
for (const c of
|
|
8877
|
+
for (const c of fn)
|
|
8878
8878
|
J(t[c]) && (t[c] = um[c]);
|
|
8879
8879
|
const a = Mh(t) || qh(t);
|
|
8880
8880
|
if (a)
|
|
8881
8881
|
return G.invalid(a);
|
|
8882
8882
|
const o = Zv(r);
|
|
8883
|
-
[s, i] =
|
|
8883
|
+
[s, i] = dn(t, o, r);
|
|
8884
8884
|
}
|
|
8885
8885
|
return new G({ ts: s, zone: r, loc: n, o: i });
|
|
8886
8886
|
}
|
|
8887
|
-
function
|
|
8887
|
+
function Yd(t, e, r) {
|
|
8888
8888
|
const n = J(r.round) ? !0 : r.round, s = J(r.rounding) ? "trunc" : r.rounding, i = (o, c) => (o = ic(o, n || r.calendary ? 0 : 2, r.calendary ? "round" : s), e.loc.clone(r).relFormatter(r).format(o, c)), a = (o) => r.calendary ? e.hasSame(t, o) ? 0 : e.startOf(o).diff(t.startOf(o), o).get(o) : e.diff(t, o).get(o);
|
|
8889
8889
|
if (r.unit)
|
|
8890
8890
|
return i(a(r.unit), r.unit);
|
|
@@ -8895,7 +8895,7 @@ function Jf(t, e, r) {
|
|
|
8895
8895
|
}
|
|
8896
8896
|
return i(t > e ? -0 : 0, r.units[r.units.length - 1]);
|
|
8897
8897
|
}
|
|
8898
|
-
function
|
|
8898
|
+
function Jd(t) {
|
|
8899
8899
|
let e = {}, r;
|
|
8900
8900
|
return t.length > 0 && typeof t[t.length - 1] == "object" ? (e = t[t.length - 1], r = Array.from(t).slice(0, t.length - 1)) : r = Array.from(t), [e, r];
|
|
8901
8901
|
}
|
|
@@ -8952,8 +8952,8 @@ class G {
|
|
|
8952
8952
|
* @return {DateTime}
|
|
8953
8953
|
*/
|
|
8954
8954
|
static local() {
|
|
8955
|
-
const [e, r] =
|
|
8956
|
-
return
|
|
8955
|
+
const [e, r] = Jd(arguments), [n, s, i, a, o, c, l] = r;
|
|
8956
|
+
return Kd({ year: n, month: s, day: i, hour: a, minute: o, second: c, millisecond: l }, e);
|
|
8957
8957
|
}
|
|
8958
8958
|
/**
|
|
8959
8959
|
* Create a DateTime in UTC
|
|
@@ -8981,8 +8981,8 @@ class G {
|
|
|
8981
8981
|
* @return {DateTime}
|
|
8982
8982
|
*/
|
|
8983
8983
|
static utc() {
|
|
8984
|
-
const [e, r] =
|
|
8985
|
-
return e.zone =
|
|
8984
|
+
const [e, r] = Jd(arguments), [n, s, i, a, o, c, l] = r;
|
|
8985
|
+
return e.zone = qe.utcInstance, Kd({ year: n, month: s, day: i, hour: a, minute: o, second: c, millisecond: l }, e);
|
|
8986
8986
|
}
|
|
8987
8987
|
/**
|
|
8988
8988
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -9015,7 +9015,7 @@ class G {
|
|
|
9015
9015
|
*/
|
|
9016
9016
|
static fromMillis(e, r = {}) {
|
|
9017
9017
|
if (It(e))
|
|
9018
|
-
return e < -
|
|
9018
|
+
return e < -Bd || e > Bd ? G.invalid("Timestamp out of range") : new G({
|
|
9019
9019
|
ts: e,
|
|
9020
9020
|
zone: At(r.zone, Se.defaultZone),
|
|
9021
9021
|
loc: me.fromObject(r)
|
|
@@ -9082,16 +9082,16 @@ class G {
|
|
|
9082
9082
|
const n = At(r.zone, Se.defaultZone);
|
|
9083
9083
|
if (!n.isValid)
|
|
9084
9084
|
return G.invalid(Ir(n));
|
|
9085
|
-
const s = me.fromObject(r), i = Cn(e,
|
|
9085
|
+
const s = me.fromObject(r), i = Cn(e, Hd), { minDaysInFirstWeek: a, startOfWeek: o } = Dd(i, s), c = Se.now(), l = J(r.specificOffset) ? n.offset(c) : r.specificOffset, u = !J(i.ordinal), d = !J(i.year), f = !J(i.month) || !J(i.day), h = d || f, p = i.weekYear || i.weekNumber;
|
|
9086
9086
|
if ((h || u) && p)
|
|
9087
9087
|
throw new tr(
|
|
9088
9088
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
9089
9089
|
);
|
|
9090
|
-
if (
|
|
9090
|
+
if (f && u)
|
|
9091
9091
|
throw new tr("Can't mix ordinal dates with month/day");
|
|
9092
9092
|
const b = p || i.weekday && !h;
|
|
9093
9093
|
let g, O, S = cn(c, l);
|
|
9094
|
-
b ? (g = zv, O = Uv, S = Tn(S, a, o)) : u ? (g = Bv, O = Wv, S = Ca(S)) : (g =
|
|
9094
|
+
b ? (g = zv, O = Uv, S = Tn(S, a, o)) : u ? (g = Bv, O = Wv, S = Ca(S)) : (g = fn, O = um);
|
|
9095
9095
|
let C = !1;
|
|
9096
9096
|
for (const v of g) {
|
|
9097
9097
|
const w = i[v];
|
|
@@ -9100,7 +9100,7 @@ class G {
|
|
|
9100
9100
|
const x = b ? b_(i, a, o) : u ? O_(i) : Mh(i), y = x || qh(i);
|
|
9101
9101
|
if (y)
|
|
9102
9102
|
return G.invalid(y);
|
|
9103
|
-
const E = b ?
|
|
9103
|
+
const E = b ? Nd(i, a, o) : u ? Fd(i) : i, [R, _] = dn(E, l, n), N = new G({
|
|
9104
9104
|
ts: R,
|
|
9105
9105
|
zone: n,
|
|
9106
9106
|
o: _,
|
|
@@ -9570,8 +9570,8 @@ class G {
|
|
|
9570
9570
|
const e = 864e5, r = 6e4, n = Bn(this.c), s = this.zone.offset(n - e), i = this.zone.offset(n + e), a = this.zone.offset(n - s * r), o = this.zone.offset(n - i * r);
|
|
9571
9571
|
if (a === o)
|
|
9572
9572
|
return [this];
|
|
9573
|
-
const c = n - a * r, l = n - o * r, u = cn(c, a),
|
|
9574
|
-
return u.hour ===
|
|
9573
|
+
const c = n - a * r, l = n - o * r, u = cn(c, a), d = cn(l, o);
|
|
9574
|
+
return u.hour === d.hour && u.minute === d.minute && u.second === d.second && u.millisecond === d.millisecond ? [qt(this, { ts: c }), qt(this, { ts: l })] : [this];
|
|
9575
9575
|
}
|
|
9576
9576
|
/**
|
|
9577
9577
|
* Returns true if this DateTime is in a leap year, false otherwise
|
|
@@ -9646,7 +9646,7 @@ class G {
|
|
|
9646
9646
|
* @return {DateTime}
|
|
9647
9647
|
*/
|
|
9648
9648
|
toUTC(e = 0, r = {}) {
|
|
9649
|
-
return this.setZone(
|
|
9649
|
+
return this.setZone(qe.instance(e), r);
|
|
9650
9650
|
}
|
|
9651
9651
|
/**
|
|
9652
9652
|
* "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
|
|
@@ -9673,7 +9673,7 @@ class G {
|
|
|
9673
9673
|
let s = this.ts;
|
|
9674
9674
|
if (r || n) {
|
|
9675
9675
|
const i = e.offset(this.ts), a = this.toObject();
|
|
9676
|
-
[s] =
|
|
9676
|
+
[s] = dn(a, i, e);
|
|
9677
9677
|
}
|
|
9678
9678
|
return qt(this, { ts: s, zone: e });
|
|
9679
9679
|
} else
|
|
@@ -9713,21 +9713,21 @@ class G {
|
|
|
9713
9713
|
*/
|
|
9714
9714
|
set(e) {
|
|
9715
9715
|
if (!this.isValid) return this;
|
|
9716
|
-
const r = Cn(e,
|
|
9716
|
+
const r = Cn(e, Hd), { minDaysInFirstWeek: n, startOfWeek: s } = Dd(r, this.loc), i = !J(r.weekYear) || !J(r.weekNumber) || !J(r.weekday), a = !J(r.ordinal), o = !J(r.year), c = !J(r.month) || !J(r.day), l = o || c, u = r.weekYear || r.weekNumber;
|
|
9717
9717
|
if ((l || a) && u)
|
|
9718
9718
|
throw new tr(
|
|
9719
9719
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
9720
9720
|
);
|
|
9721
9721
|
if (c && a)
|
|
9722
9722
|
throw new tr("Can't mix ordinal dates with month/day");
|
|
9723
|
-
let
|
|
9724
|
-
i ?
|
|
9723
|
+
let d;
|
|
9724
|
+
i ? d = Nd(
|
|
9725
9725
|
{ ...Tn(this.c, n, s), ...r },
|
|
9726
9726
|
n,
|
|
9727
9727
|
s
|
|
9728
|
-
) : J(r.ordinal) ? (
|
|
9729
|
-
const [
|
|
9730
|
-
return qt(this, { ts:
|
|
9728
|
+
) : J(r.ordinal) ? (d = { ...this.toObject(), ...r }, J(r.day) && (d.day = Math.min(Rn(d.year, d.month), d.day))) : d = Fd({ ...Ca(this.c), ...r });
|
|
9729
|
+
const [f, h] = dn(d, this.o, this.zone);
|
|
9730
|
+
return qt(this, { ts: f, o: h });
|
|
9731
9731
|
}
|
|
9732
9732
|
/**
|
|
9733
9733
|
* Add a period of time to this DateTime and return the resulting DateTime
|
|
@@ -9745,7 +9745,7 @@ class G {
|
|
|
9745
9745
|
plus(e) {
|
|
9746
9746
|
if (!this.isValid) return this;
|
|
9747
9747
|
const r = le.fromDurationLike(e);
|
|
9748
|
-
return qt(this,
|
|
9748
|
+
return qt(this, Zd(this, r));
|
|
9749
9749
|
}
|
|
9750
9750
|
/**
|
|
9751
9751
|
* Subtract a period of time to this DateTime and return the resulting DateTime
|
|
@@ -9756,7 +9756,7 @@ class G {
|
|
|
9756
9756
|
minus(e) {
|
|
9757
9757
|
if (!this.isValid) return this;
|
|
9758
9758
|
const r = le.fromDurationLike(e).negate();
|
|
9759
|
-
return qt(this,
|
|
9759
|
+
return qt(this, Zd(this, r));
|
|
9760
9760
|
}
|
|
9761
9761
|
/**
|
|
9762
9762
|
* "Set" this DateTime to the beginning of a unit of time.
|
|
@@ -9906,7 +9906,7 @@ class G {
|
|
|
9906
9906
|
a = hn(a);
|
|
9907
9907
|
const o = e === "extended";
|
|
9908
9908
|
let c = Na(this, o, a);
|
|
9909
|
-
return
|
|
9909
|
+
return fn.indexOf(a) >= 3 && (c += "T"), c += Gd(
|
|
9910
9910
|
this,
|
|
9911
9911
|
o,
|
|
9912
9912
|
r,
|
|
@@ -9963,7 +9963,7 @@ class G {
|
|
|
9963
9963
|
format: a = "extended",
|
|
9964
9964
|
precision: o = "milliseconds"
|
|
9965
9965
|
} = {}) {
|
|
9966
|
-
return this.isValid ? (o = hn(o), (s &&
|
|
9966
|
+
return this.isValid ? (o = hn(o), (s && fn.indexOf(o) >= 3 ? "T" : "") + Gd(
|
|
9967
9967
|
this,
|
|
9968
9968
|
a === "extended",
|
|
9969
9969
|
r,
|
|
@@ -10197,7 +10197,7 @@ class G {
|
|
|
10197
10197
|
if (!this.isValid) return null;
|
|
10198
10198
|
const r = e.base || G.fromObject({}, { zone: this.zone }), n = e.padding ? this < r ? -e.padding : e.padding : 0;
|
|
10199
10199
|
let s = ["years", "months", "days", "hours", "minutes", "seconds"], i = e.unit;
|
|
10200
|
-
return Array.isArray(e.unit) && (s = e.unit, i = void 0),
|
|
10200
|
+
return Array.isArray(e.unit) && (s = e.unit, i = void 0), Yd(r, this.plus(n), {
|
|
10201
10201
|
...e,
|
|
10202
10202
|
numeric: "always",
|
|
10203
10203
|
units: s,
|
|
@@ -10218,7 +10218,7 @@ class G {
|
|
|
10218
10218
|
* @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
|
|
10219
10219
|
*/
|
|
10220
10220
|
toRelativeCalendar(e = {}) {
|
|
10221
|
-
return this.isValid ?
|
|
10221
|
+
return this.isValid ? Yd(e.base || G.fromObject({}, { zone: this.zone }), this, {
|
|
10222
10222
|
...e,
|
|
10223
10223
|
numeric: "auto",
|
|
10224
10224
|
units: ["years", "months", "days"],
|
|
@@ -10233,7 +10233,7 @@ class G {
|
|
|
10233
10233
|
static min(...e) {
|
|
10234
10234
|
if (!e.every(G.isDateTime))
|
|
10235
10235
|
throw new Fe("min requires all arguments be DateTimes");
|
|
10236
|
-
return
|
|
10236
|
+
return Pd(e, (r) => r.valueOf(), Math.min);
|
|
10237
10237
|
}
|
|
10238
10238
|
/**
|
|
10239
10239
|
* Return the max of several date times
|
|
@@ -10243,7 +10243,7 @@ class G {
|
|
|
10243
10243
|
static max(...e) {
|
|
10244
10244
|
if (!e.every(G.isDateTime))
|
|
10245
10245
|
throw new Fe("max requires all arguments be DateTimes");
|
|
10246
|
-
return
|
|
10246
|
+
return Pd(e, (r) => r.valueOf(), Math.max);
|
|
10247
10247
|
}
|
|
10248
10248
|
// MISC
|
|
10249
10249
|
/**
|
|
@@ -10334,7 +10334,7 @@ class G {
|
|
|
10334
10334
|
* @type {Object}
|
|
10335
10335
|
*/
|
|
10336
10336
|
static get DATE_MED() {
|
|
10337
|
-
return
|
|
10337
|
+
return dh;
|
|
10338
10338
|
}
|
|
10339
10339
|
/**
|
|
10340
10340
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
@@ -10348,7 +10348,7 @@ class G {
|
|
|
10348
10348
|
* @type {Object}
|
|
10349
10349
|
*/
|
|
10350
10350
|
static get DATE_FULL() {
|
|
10351
|
-
return
|
|
10351
|
+
return fh;
|
|
10352
10352
|
}
|
|
10353
10353
|
/**
|
|
10354
10354
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
@@ -10488,18 +10488,18 @@ function Er(t) {
|
|
|
10488
10488
|
`Unknown datetime argument: ${t}, of type ${typeof t}`
|
|
10489
10489
|
);
|
|
10490
10490
|
}
|
|
10491
|
-
const
|
|
10491
|
+
const Qd = async (t, e) => {
|
|
10492
10492
|
if (t) {
|
|
10493
|
-
const r = await
|
|
10493
|
+
const r = await be(t, [e]);
|
|
10494
10494
|
if (!r.valid)
|
|
10495
10495
|
throw new Error(r.message);
|
|
10496
10496
|
}
|
|
10497
|
-
},
|
|
10498
|
-
await
|
|
10497
|
+
}, dm = async (t, e, r, n, s, i) => {
|
|
10498
|
+
await Qd(n.custom?.preValidate, s);
|
|
10499
10499
|
for (const o of n.fields)
|
|
10500
|
-
await
|
|
10500
|
+
await Qd(o.custom?.preValidate, s);
|
|
10501
10501
|
return Hy(t, r, i).parse(e), e;
|
|
10502
|
-
}, lc = (t, e, r, n, s, i, a, o, c, l, u,
|
|
10502
|
+
}, lc = (t, e, r, n, s, i, a, o, c, l, u, d, f, h, p, b, g, O, S, C, x) => {
|
|
10503
10503
|
const { fields: y } = a;
|
|
10504
10504
|
y.filter((_) => "unique" in _ && _.unique).forEach((_) => {
|
|
10505
10505
|
t !== "delete" && (typeof s[_.name] == "string" || typeof s[_.name] == "number") && e.set(h(_, s[_.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
|
|
@@ -10507,11 +10507,11 @@ const Xf = async (t, e) => {
|
|
|
10507
10507
|
Collection_Path: r
|
|
10508
10508
|
});
|
|
10509
10509
|
}), y.forEach((_) => {
|
|
10510
|
-
if (
|
|
10510
|
+
if (fy(_, a, i)) {
|
|
10511
10511
|
const N = py(_, a, i), v = {};
|
|
10512
|
-
s[_.name] !== void 0 && (v[_.name] = s[_.name],
|
|
10513
|
-
s[w.name] !== void 0 && (
|
|
10514
|
-
}), Object.keys(v).length > 0 && (t === "create" && (v.Collection_Path = r, v.Collection_Path_String = r.join("/"), e.set(
|
|
10512
|
+
s[_.name] !== void 0 && (v[_.name] = s[_.name], we(_) && (v[`${_.name}_Array`] = s[`${_.name}_Array`])), N.forEach((w) => {
|
|
10513
|
+
s[w.name] !== void 0 && (we(w) ? v[`${w.name}_Array`] = s[`${w.name}_Array`] : v[w.name] = s[w.name]);
|
|
10514
|
+
}), Object.keys(v).length > 0 && (t === "create" && (v.Collection_Path = r, v.Collection_Path_String = r.join("/"), e.set(f(_), v)), t === "update" && e.update(f(_), v), t === "delete" && e.delete(f(_)));
|
|
10515
10515
|
}
|
|
10516
10516
|
});
|
|
10517
10517
|
const E = c[a.labels.collection];
|
|
@@ -10523,7 +10523,7 @@ const Xf = async (t, e) => {
|
|
|
10523
10523
|
}
|
|
10524
10524
|
if (t === "delete")
|
|
10525
10525
|
return;
|
|
10526
|
-
const R = y.filter((_) =>
|
|
10526
|
+
const R = y.filter((_) => we(_) && _.twoWay);
|
|
10527
10527
|
if (!o?.noTwoWay) {
|
|
10528
10528
|
for (const _ of R)
|
|
10529
10529
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
@@ -10533,10 +10533,10 @@ const Xf = async (t, e) => {
|
|
|
10533
10533
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10534
10534
|
}
|
|
10535
10535
|
};
|
|
10536
|
-
var Fa,
|
|
10536
|
+
var Fa, Xd;
|
|
10537
10537
|
function Gv() {
|
|
10538
|
-
if (
|
|
10539
|
-
|
|
10538
|
+
if (Xd) return Fa;
|
|
10539
|
+
Xd = 1;
|
|
10540
10540
|
function t(e, r) {
|
|
10541
10541
|
for (var n = -1, s = e == null ? 0 : e.length; ++n < s && r(e[n], n, e) !== !1; )
|
|
10542
10542
|
;
|
|
@@ -10544,71 +10544,71 @@ function Gv() {
|
|
|
10544
10544
|
}
|
|
10545
10545
|
return Fa = t, Fa;
|
|
10546
10546
|
}
|
|
10547
|
-
var Da,
|
|
10547
|
+
var Da, ef;
|
|
10548
10548
|
function Hv() {
|
|
10549
|
-
if (
|
|
10550
|
-
|
|
10549
|
+
if (ef) return Da;
|
|
10550
|
+
ef = 1;
|
|
10551
10551
|
var t = Zr(), e = Bo();
|
|
10552
10552
|
function r(n, s) {
|
|
10553
10553
|
return n && t(s, e(s), n);
|
|
10554
10554
|
}
|
|
10555
10555
|
return Da = r, Da;
|
|
10556
10556
|
}
|
|
10557
|
-
var Pa,
|
|
10557
|
+
var Pa, tf;
|
|
10558
10558
|
function Kv() {
|
|
10559
|
-
if (
|
|
10560
|
-
|
|
10559
|
+
if (tf) return Pa;
|
|
10560
|
+
tf = 1;
|
|
10561
10561
|
var t = Zr(), e = Gr();
|
|
10562
10562
|
function r(n, s) {
|
|
10563
10563
|
return n && t(s, e(s), n);
|
|
10564
10564
|
}
|
|
10565
10565
|
return Pa = r, Pa;
|
|
10566
10566
|
}
|
|
10567
|
-
var Ma,
|
|
10567
|
+
var Ma, rf;
|
|
10568
10568
|
function Yv() {
|
|
10569
|
-
if (
|
|
10570
|
-
|
|
10569
|
+
if (rf) return Ma;
|
|
10570
|
+
rf = 1;
|
|
10571
10571
|
var t = Zr(), e = $o();
|
|
10572
10572
|
function r(n, s) {
|
|
10573
10573
|
return t(n, e(n), s);
|
|
10574
10574
|
}
|
|
10575
10575
|
return Ma = r, Ma;
|
|
10576
10576
|
}
|
|
10577
|
-
var qa,
|
|
10578
|
-
function
|
|
10579
|
-
if (
|
|
10580
|
-
|
|
10581
|
-
var t =
|
|
10577
|
+
var qa, nf;
|
|
10578
|
+
function fm() {
|
|
10579
|
+
if (nf) return qa;
|
|
10580
|
+
nf = 1;
|
|
10581
|
+
var t = Lf(), e = Ho(), r = $o(), n = jf(), s = Object.getOwnPropertySymbols, i = s ? function(a) {
|
|
10582
10582
|
for (var o = []; a; )
|
|
10583
10583
|
t(o, r(a)), a = e(a);
|
|
10584
10584
|
return o;
|
|
10585
10585
|
} : n;
|
|
10586
10586
|
return qa = i, qa;
|
|
10587
10587
|
}
|
|
10588
|
-
var La,
|
|
10588
|
+
var La, sf;
|
|
10589
10589
|
function Jv() {
|
|
10590
|
-
if (
|
|
10591
|
-
|
|
10592
|
-
var t = Zr(), e =
|
|
10590
|
+
if (sf) return La;
|
|
10591
|
+
sf = 1;
|
|
10592
|
+
var t = Zr(), e = fm();
|
|
10593
10593
|
function r(n, s) {
|
|
10594
10594
|
return t(n, e(n), s);
|
|
10595
10595
|
}
|
|
10596
10596
|
return La = r, La;
|
|
10597
10597
|
}
|
|
10598
|
-
var $a,
|
|
10598
|
+
var $a, af;
|
|
10599
10599
|
function Qv() {
|
|
10600
|
-
if (
|
|
10601
|
-
|
|
10602
|
-
var t = $
|
|
10600
|
+
if (af) return $a;
|
|
10601
|
+
af = 1;
|
|
10602
|
+
var t = $f(), e = fm(), r = Gr();
|
|
10603
10603
|
function n(s) {
|
|
10604
10604
|
return t(s, r, e);
|
|
10605
10605
|
}
|
|
10606
10606
|
return $a = n, $a;
|
|
10607
10607
|
}
|
|
10608
|
-
var ja,
|
|
10608
|
+
var ja, of;
|
|
10609
10609
|
function Xv() {
|
|
10610
|
-
if (
|
|
10611
|
-
|
|
10610
|
+
if (of) return ja;
|
|
10611
|
+
of = 1;
|
|
10612
10612
|
var t = Object.prototype, e = t.hasOwnProperty;
|
|
10613
10613
|
function r(n) {
|
|
10614
10614
|
var s = n.length, i = new n.constructor(s);
|
|
@@ -10616,10 +10616,10 @@ function Xv() {
|
|
|
10616
10616
|
}
|
|
10617
10617
|
return ja = r, ja;
|
|
10618
10618
|
}
|
|
10619
|
-
var Va,
|
|
10619
|
+
var Va, cf;
|
|
10620
10620
|
function ew() {
|
|
10621
|
-
if (
|
|
10622
|
-
|
|
10621
|
+
if (cf) return Va;
|
|
10622
|
+
cf = 1;
|
|
10623
10623
|
var t = Go();
|
|
10624
10624
|
function e(r, n) {
|
|
10625
10625
|
var s = n ? t(r.buffer) : r.buffer;
|
|
@@ -10627,10 +10627,10 @@ function ew() {
|
|
|
10627
10627
|
}
|
|
10628
10628
|
return Va = e, Va;
|
|
10629
10629
|
}
|
|
10630
|
-
var Ua,
|
|
10630
|
+
var Ua, lf;
|
|
10631
10631
|
function tw() {
|
|
10632
|
-
if (
|
|
10633
|
-
|
|
10632
|
+
if (lf) return Ua;
|
|
10633
|
+
lf = 1;
|
|
10634
10634
|
var t = /\w*$/;
|
|
10635
10635
|
function e(r) {
|
|
10636
10636
|
var n = new r.constructor(r.source, t.exec(r));
|
|
@@ -10638,21 +10638,21 @@ function tw() {
|
|
|
10638
10638
|
}
|
|
10639
10639
|
return Ua = e, Ua;
|
|
10640
10640
|
}
|
|
10641
|
-
var Wa,
|
|
10641
|
+
var Wa, uf;
|
|
10642
10642
|
function rw() {
|
|
10643
|
-
if (
|
|
10644
|
-
|
|
10643
|
+
if (uf) return Wa;
|
|
10644
|
+
uf = 1;
|
|
10645
10645
|
var t = Br(), e = t ? t.prototype : void 0, r = e ? e.valueOf : void 0;
|
|
10646
10646
|
function n(s) {
|
|
10647
10647
|
return r ? Object(r.call(s)) : {};
|
|
10648
10648
|
}
|
|
10649
10649
|
return Wa = n, Wa;
|
|
10650
10650
|
}
|
|
10651
|
-
var za,
|
|
10651
|
+
var za, df;
|
|
10652
10652
|
function nw() {
|
|
10653
|
-
if (
|
|
10654
|
-
|
|
10655
|
-
var t = Go(), e = ew(), r = tw(), n = rw(), s =
|
|
10653
|
+
if (df) return za;
|
|
10654
|
+
df = 1;
|
|
10655
|
+
var t = Go(), e = ew(), r = tw(), n = rw(), s = Yf(), i = "[object Boolean]", a = "[object Date]", o = "[object Map]", c = "[object Number]", l = "[object RegExp]", u = "[object Set]", d = "[object String]", f = "[object Symbol]", h = "[object ArrayBuffer]", p = "[object DataView]", b = "[object Float32Array]", g = "[object Float64Array]", O = "[object Int8Array]", S = "[object Int16Array]", C = "[object Int32Array]", x = "[object Uint8Array]", y = "[object Uint8ClampedArray]", E = "[object Uint16Array]", R = "[object Uint32Array]";
|
|
10656
10656
|
function _(N, v, w) {
|
|
10657
10657
|
var I = N.constructor;
|
|
10658
10658
|
switch (v) {
|
|
@@ -10676,101 +10676,101 @@ function nw() {
|
|
|
10676
10676
|
case o:
|
|
10677
10677
|
return new I();
|
|
10678
10678
|
case c:
|
|
10679
|
-
case
|
|
10679
|
+
case d:
|
|
10680
10680
|
return new I(N);
|
|
10681
10681
|
case l:
|
|
10682
10682
|
return r(N);
|
|
10683
10683
|
case u:
|
|
10684
10684
|
return new I();
|
|
10685
|
-
case
|
|
10685
|
+
case f:
|
|
10686
10686
|
return n(N);
|
|
10687
10687
|
}
|
|
10688
10688
|
}
|
|
10689
10689
|
return za = _, za;
|
|
10690
10690
|
}
|
|
10691
|
-
var Ba,
|
|
10691
|
+
var Ba, ff;
|
|
10692
10692
|
function sw() {
|
|
10693
|
-
if (
|
|
10694
|
-
|
|
10693
|
+
if (ff) return Ba;
|
|
10694
|
+
ff = 1;
|
|
10695
10695
|
var t = Vn(), e = wt(), r = "[object Map]";
|
|
10696
10696
|
function n(s) {
|
|
10697
10697
|
return e(s) && t(s) == r;
|
|
10698
10698
|
}
|
|
10699
10699
|
return Ba = n, Ba;
|
|
10700
10700
|
}
|
|
10701
|
-
var Za,
|
|
10701
|
+
var Za, hf;
|
|
10702
10702
|
function iw() {
|
|
10703
|
-
if (
|
|
10704
|
-
|
|
10703
|
+
if (hf) return Za;
|
|
10704
|
+
hf = 1;
|
|
10705
10705
|
var t = sw(), e = Vo(), r = Uo(), n = r && r.isMap, s = n ? e(n) : t;
|
|
10706
10706
|
return Za = s, Za;
|
|
10707
10707
|
}
|
|
10708
|
-
var Ga,
|
|
10708
|
+
var Ga, mf;
|
|
10709
10709
|
function aw() {
|
|
10710
|
-
if (
|
|
10711
|
-
|
|
10710
|
+
if (mf) return Ga;
|
|
10711
|
+
mf = 1;
|
|
10712
10712
|
var t = Vn(), e = wt(), r = "[object Set]";
|
|
10713
10713
|
function n(s) {
|
|
10714
10714
|
return e(s) && t(s) == r;
|
|
10715
10715
|
}
|
|
10716
10716
|
return Ga = n, Ga;
|
|
10717
10717
|
}
|
|
10718
|
-
var Ha,
|
|
10718
|
+
var Ha, pf;
|
|
10719
10719
|
function ow() {
|
|
10720
|
-
if (
|
|
10721
|
-
|
|
10720
|
+
if (pf) return Ha;
|
|
10721
|
+
pf = 1;
|
|
10722
10722
|
var t = aw(), e = Vo(), r = Uo(), n = r && r.isSet, s = n ? e(n) : t;
|
|
10723
10723
|
return Ha = s, Ha;
|
|
10724
10724
|
}
|
|
10725
|
-
var Ka,
|
|
10725
|
+
var Ka, gf;
|
|
10726
10726
|
function cw() {
|
|
10727
|
-
if (
|
|
10728
|
-
|
|
10729
|
-
var t = Lo(), e = Gv(), r = Ko(), n = Hv(), s = Kv(), i =
|
|
10727
|
+
if (gf) return Ka;
|
|
10728
|
+
gf = 1;
|
|
10729
|
+
var t = Lo(), e = Gv(), r = Ko(), n = Hv(), s = Kv(), i = Kf(), a = Jf(), o = Yv(), c = Jv(), l = Bf(), u = Qv(), d = Vn(), f = Xv(), h = nw(), p = Qf(), b = Ft(), g = $n(), O = iw(), S = vt(), C = ow(), x = Bo(), y = Gr(), E = 1, R = 2, _ = 4, N = "[object Arguments]", v = "[object Array]", w = "[object Boolean]", I = "[object Date]", m = "[object Error]", T = "[object Function]", A = "[object GeneratorFunction]", L = "[object Map]", k = "[object Number]", M = "[object Object]", F = "[object RegExp]", Z = "[object Set]", re = "[object String]", oe = "[object Symbol]", z = "[object WeakMap]", V = "[object ArrayBuffer]", K = "[object DataView]", xe = "[object Float32Array]", Te = "[object Float64Array]", Xe = "[object Int8Array]", bt = "[object Int16Array]", br = "[object Int32Array]", q = "[object Uint8Array]", Y = "[object Uint8ClampedArray]", U = "[object Uint16Array]", H = "[object Uint32Array]", D = {};
|
|
10730
10730
|
D[N] = D[v] = D[V] = D[K] = D[w] = D[I] = D[xe] = D[Te] = D[Xe] = D[bt] = D[br] = D[L] = D[k] = D[M] = D[F] = D[Z] = D[re] = D[oe] = D[q] = D[Y] = D[U] = D[H] = !0, D[m] = D[T] = D[z] = !1;
|
|
10731
|
-
function ue(X, pe, _e, ae,
|
|
10731
|
+
function ue(X, pe, _e, ae, $e, je) {
|
|
10732
10732
|
var ke, Gt = pe & E, Or = pe & R, Ne = pe & _;
|
|
10733
|
-
if (_e && (ke =
|
|
10733
|
+
if (_e && (ke = $e ? _e(X, ae, $e, je) : _e(X)), ke !== void 0)
|
|
10734
10734
|
return ke;
|
|
10735
10735
|
if (!S(X))
|
|
10736
10736
|
return X;
|
|
10737
10737
|
var Ht = b(X);
|
|
10738
10738
|
if (Ht) {
|
|
10739
|
-
if (ke =
|
|
10739
|
+
if (ke = f(X), !Gt)
|
|
10740
10740
|
return a(X, ke);
|
|
10741
10741
|
} else {
|
|
10742
|
-
var Kt =
|
|
10742
|
+
var Kt = d(X), bc = Kt == T || Kt == A;
|
|
10743
10743
|
if (g(X))
|
|
10744
10744
|
return i(X, Gt);
|
|
10745
|
-
if (Kt == M || Kt == N || bc &&
|
|
10745
|
+
if (Kt == M || Kt == N || bc && !$e) {
|
|
10746
10746
|
if (ke = Or || bc ? {} : p(X), !Gt)
|
|
10747
10747
|
return Or ? c(X, s(ke, X)) : o(X, n(ke, X));
|
|
10748
10748
|
} else {
|
|
10749
10749
|
if (!D[Kt])
|
|
10750
|
-
return
|
|
10750
|
+
return $e ? X : {};
|
|
10751
10751
|
ke = h(X, Kt, Gt);
|
|
10752
10752
|
}
|
|
10753
10753
|
}
|
|
10754
|
-
|
|
10755
|
-
var Oc =
|
|
10754
|
+
je || (je = new t());
|
|
10755
|
+
var Oc = je.get(X);
|
|
10756
10756
|
if (Oc)
|
|
10757
10757
|
return Oc;
|
|
10758
|
-
|
|
10759
|
-
ke.add(ue(Ot, pe, _e, Ot, X,
|
|
10758
|
+
je.set(X, ke), C(X) ? X.forEach(function(Ot) {
|
|
10759
|
+
ke.add(ue(Ot, pe, _e, Ot, X, je));
|
|
10760
10760
|
}) : O(X) && X.forEach(function(Ot, Pt) {
|
|
10761
|
-
ke.set(Pt, ue(Ot, pe, _e, Pt, X,
|
|
10761
|
+
ke.set(Pt, ue(Ot, pe, _e, Pt, X, je));
|
|
10762
10762
|
});
|
|
10763
10763
|
var Dm = Ne ? Or ? u : l : Or ? y : x, Ec = Ht ? void 0 : Dm(X);
|
|
10764
10764
|
return e(Ec || X, function(Ot, Pt) {
|
|
10765
|
-
Ec && (Pt = Ot, Ot = X[Pt]), r(ke, Pt, ue(Ot, pe, _e, Pt, X,
|
|
10765
|
+
Ec && (Pt = Ot, Ot = X[Pt]), r(ke, Pt, ue(Ot, pe, _e, Pt, X, je));
|
|
10766
10766
|
}), ke;
|
|
10767
10767
|
}
|
|
10768
10768
|
return Ka = ue, Ka;
|
|
10769
10769
|
}
|
|
10770
|
-
var Ya,
|
|
10770
|
+
var Ya, yf;
|
|
10771
10771
|
function lw() {
|
|
10772
|
-
if (
|
|
10773
|
-
|
|
10772
|
+
if (yf) return Ya;
|
|
10773
|
+
yf = 1;
|
|
10774
10774
|
var t = cw(), e = 1, r = 4;
|
|
10775
10775
|
function n(s) {
|
|
10776
10776
|
return t(s, e | r);
|
|
@@ -10778,10 +10778,10 @@ function lw() {
|
|
|
10778
10778
|
return Ya = n, Ya;
|
|
10779
10779
|
}
|
|
10780
10780
|
var uw = lw();
|
|
10781
|
-
const
|
|
10781
|
+
const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
10782
10782
|
for (const e in t)
|
|
10783
10783
|
Object.prototype.hasOwnProperty.call(t, e) && (t[e] === void 0 ? delete t[e] : typeof t[e] == "object" && t[e] !== null && xt(t[e]));
|
|
10784
|
-
},
|
|
10784
|
+
}, dw = (t, e) => {
|
|
10785
10785
|
let r, n;
|
|
10786
10786
|
if (typeof t.start == "object")
|
|
10787
10787
|
r = t.start;
|
|
@@ -10814,7 +10814,7 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10814
10814
|
typeof t.end == "number" && (s = s.plus({ days: t.end })), t.endOffsetDays && (s = s.plus({ days: t.endOffsetDays })), t.endOffsetHours && (s = s.plus({ hours: t.endOffsetHours })), n = s.toJSDate();
|
|
10815
10815
|
}
|
|
10816
10816
|
return { start: r, end: n };
|
|
10817
|
-
},
|
|
10817
|
+
}, fw = (t) => {
|
|
10818
10818
|
if (t = t.toString(), /[/]|^\.+$|^__.*__$/.test(t))
|
|
10819
10819
|
return !1;
|
|
10820
10820
|
try {
|
|
@@ -10853,7 +10853,7 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10853
10853
|
if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 998)
|
|
10854
10854
|
throw new Error("Email subject is too long");
|
|
10855
10855
|
return e;
|
|
10856
|
-
},
|
|
10856
|
+
}, _f = (t) => {
|
|
10857
10857
|
if (!t || typeof t != "string")
|
|
10858
10858
|
return "";
|
|
10859
10859
|
let e = t.replace(/\0/g, "");
|
|
@@ -10867,10 +10867,10 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10867
10867
|
const r = ze(), n = Dt(), s = We(), i = Pe(), a = t.at(-1);
|
|
10868
10868
|
if (!a)
|
|
10869
10869
|
throw new Error("EMPTY_PATH");
|
|
10870
|
-
const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o,
|
|
10870
|
+
const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, d = dt(a), f = i.collections?.[c.collection];
|
|
10871
10871
|
if (!i.Role)
|
|
10872
10872
|
throw new Error("PERMISSION_DENIED");
|
|
10873
|
-
const h =
|
|
10873
|
+
const h = f && ct("Read", f), p = Fn(o, s, i), b = xf(o, i), g = Do(o, i), O = Nf(o, s, i), S = (m = []) => {
|
|
10874
10874
|
const T = [];
|
|
10875
10875
|
if (h)
|
|
10876
10876
|
T.push(he($r(r, "tenants", n, "system_fields", c.collection, `${c.collection}-${e.key}`), ye("Collection_Path_String", "==", t.join("/")), ...m));
|
|
@@ -10895,7 +10895,7 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10895
10895
|
}
|
|
10896
10896
|
}
|
|
10897
10897
|
u?.roles.includes(i.Role) && u.range && y(u.range.fields.length);
|
|
10898
|
-
const E =
|
|
10898
|
+
const E = d.admin?.statusField;
|
|
10899
10899
|
E && !u?.roles.includes(i.Role) && y(Math.max(E.active?.length || 0, E.archived?.length || 0));
|
|
10900
10900
|
const R = x === 0 ? 30 : Math.max(1, Math.floor(30 / x)), _ = [];
|
|
10901
10901
|
C.filter((m) => m.type === "Record_Owner").forEach(() => _.push(ye("Created_By", "==", i.User_ID))), C.filter((m) => m.type === "Record_User").forEach((m) => {
|
|
@@ -10914,7 +10914,7 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10914
10914
|
});
|
|
10915
10915
|
const N = [];
|
|
10916
10916
|
g.filter((m) => m.type === "Individual").forEach((m) => {
|
|
10917
|
-
const T =
|
|
10917
|
+
const T = f?.individualEntities, A = [];
|
|
10918
10918
|
if (T) {
|
|
10919
10919
|
const L = m.singleQuery ? m.singleQuery : R;
|
|
10920
10920
|
for (let k = 0; k < T.length; k += L) {
|
|
@@ -10964,7 +10964,7 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
10964
10964
|
if ("collectionField" in m) {
|
|
10965
10965
|
const T = te(l, m.collectionField);
|
|
10966
10966
|
if ("collection" in T) {
|
|
10967
|
-
const A =
|
|
10967
|
+
const A = f?.parentEntities, L = [];
|
|
10968
10968
|
if (A) {
|
|
10969
10969
|
const k = m.singleQuery ? m.singleQuery : R;
|
|
10970
10970
|
for (let M = 0; M < A.length; M += k) {
|
|
@@ -11016,7 +11016,7 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11016
11016
|
if ("collectionField" in m && "propertyField" in m) {
|
|
11017
11017
|
const T = te(l, m.collectionField), A = te(l, m.propertyField);
|
|
11018
11018
|
if ("collection" in T) {
|
|
11019
|
-
const L =
|
|
11019
|
+
const L = f?.parentPropertyEntities || {};
|
|
11020
11020
|
Object.entries(L).forEach(([k, M]) => {
|
|
11021
11021
|
if (M.length > 0) {
|
|
11022
11022
|
const F = [];
|
|
@@ -11079,14 +11079,14 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11079
11079
|
n.includes(s) || r.includes(s) || await ir(s, t?.[s].constraints, t?.[s].range, t?.[s].orQueries, t);
|
|
11080
11080
|
return Nr;
|
|
11081
11081
|
}, Ao = () => pm, pw = () => Nr, gw = async (t, e, r, n, s) => {
|
|
11082
|
-
const { labels: i, preloadCache: a } = t, c = Xr()[i.collection], l = Ie(), u =
|
|
11083
|
-
if (!
|
|
11082
|
+
const { labels: i, preloadCache: a } = t, c = Xr()[i.collection], l = Ie(), u = dt(i.collection), d = Pe();
|
|
11083
|
+
if (!d?.Role)
|
|
11084
11084
|
throw new Error("PERMISSION_DENIED");
|
|
11085
|
-
if (!a?.roles.includes(
|
|
11085
|
+
if (!a?.roles.includes(d.Role))
|
|
11086
11086
|
return;
|
|
11087
|
-
const
|
|
11087
|
+
const f = pw();
|
|
11088
11088
|
let h = i.collection;
|
|
11089
|
-
s && (h = s,
|
|
11089
|
+
s && (h = s, f[h] ||= []), f[h] && f[h].forEach((g) => g()), await ne(l, ["global", "timezone"]), e ||= await ne(u, [
|
|
11090
11090
|
"collections",
|
|
11091
11091
|
i.collection,
|
|
11092
11092
|
"custom",
|
|
@@ -11099,7 +11099,7 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11099
11099
|
]), s || (r ||= a.range);
|
|
11100
11100
|
const p = uc([i.collection], c).map((g) => {
|
|
11101
11101
|
if (r) {
|
|
11102
|
-
const { start: O, end: S } =
|
|
11102
|
+
const { start: O, end: S } = dw(r), C = r.fields.filter((y) => !r.ranges?.some((E) => E.includes(y))).map((y) => tn(ye(y, ">=", O), ye(y, "<=", S))), x = r.ranges?.map((y) => tn(ye(y[0], "<=", S), ye(y[1], ">=", O)));
|
|
11103
11103
|
g = he(g, Ac(...C, ...x || []));
|
|
11104
11104
|
}
|
|
11105
11105
|
return n && (g = he(g, tn(Ac(...n.map((O) => ye(...O)))))), e && (g = he(g, tn(...e.map((O) => ye(...O))))), g;
|
|
@@ -11116,27 +11116,27 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11116
11116
|
}, (y) => {
|
|
11117
11117
|
console.error(`${h} - ${y.message}`), O(y);
|
|
11118
11118
|
});
|
|
11119
|
-
|
|
11119
|
+
f[h].push(x);
|
|
11120
11120
|
});
|
|
11121
11121
|
});
|
|
11122
11122
|
}, ir = async (t, e, r, n, s, i) => {
|
|
11123
11123
|
const a = We(), o = Pe();
|
|
11124
11124
|
if (!o?.Role)
|
|
11125
11125
|
throw new Error("PERMISSION_DENIED");
|
|
11126
|
-
const c = a.collections[t], { labels: l, preloadCache: u } = c,
|
|
11127
|
-
let
|
|
11128
|
-
if (i && (
|
|
11126
|
+
const c = a.collections[t], { labels: l, preloadCache: u } = c, d = Ao();
|
|
11127
|
+
let f = l.collection;
|
|
11128
|
+
if (i && (f = i), d[f] === "Loading" || !u?.roles.includes(o.Role))
|
|
11129
11129
|
return;
|
|
11130
11130
|
const h = o.collections?.[t];
|
|
11131
11131
|
if (!(h && ct("Read", h) || Fn(c, a, o).length > 0)) {
|
|
11132
|
-
f
|
|
11132
|
+
d[f] = "Error";
|
|
11133
11133
|
return;
|
|
11134
11134
|
}
|
|
11135
|
-
f
|
|
11135
|
+
d[f] = "Loading";
|
|
11136
11136
|
const p = new Event(`stoker:loading:${t}`);
|
|
11137
11137
|
document.dispatchEvent(p);
|
|
11138
11138
|
try {
|
|
11139
|
-
if (await gw(c, e, r, n, i), u?.relationCollections && !i && await
|
|
11139
|
+
if (await gw(c, e, r, n, i), u?.relationCollections && !i && await be(u.relationCollections)) {
|
|
11140
11140
|
const O = $t(c, a, o);
|
|
11141
11141
|
for (const S of O)
|
|
11142
11142
|
if (!s?.[S]) {
|
|
@@ -11148,11 +11148,11 @@ const Oe = /* @__PURE__ */ Dn(uw), xt = (t) => {
|
|
|
11148
11148
|
x || await ir(S, void 0, void 0, void 0, s);
|
|
11149
11149
|
}
|
|
11150
11150
|
}
|
|
11151
|
-
f
|
|
11151
|
+
d[f] = "Loaded";
|
|
11152
11152
|
const b = new Event(`stoker:loaded:${t}`);
|
|
11153
11153
|
document.dispatchEvent(b);
|
|
11154
11154
|
} catch (b) {
|
|
11155
|
-
throw f
|
|
11155
|
+
throw d[f] = "Error", b;
|
|
11156
11156
|
}
|
|
11157
11157
|
};
|
|
11158
11158
|
let Lt = null;
|
|
@@ -11161,8 +11161,8 @@ const yw = async (t, e) => {
|
|
|
11161
11161
|
if (!e.claims.doc)
|
|
11162
11162
|
throw new Error("User document ID not found in claims");
|
|
11163
11163
|
let o = !1, c = null;
|
|
11164
|
-
return await new Promise((u,
|
|
11165
|
-
const
|
|
11164
|
+
return await new Promise((u, d) => {
|
|
11165
|
+
const f = mr(Ae(s, "tenants", n, "system_user_permissions", t.uid), (h) => {
|
|
11166
11166
|
if (h.exists()) {
|
|
11167
11167
|
if (Lt = h.data(), Lt.User_ID = h.id, !Lt.Role)
|
|
11168
11168
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -11184,20 +11184,20 @@ const yw = async (t, e) => {
|
|
|
11184
11184
|
}
|
|
11185
11185
|
c = Lt;
|
|
11186
11186
|
} else
|
|
11187
|
-
|
|
11187
|
+
d(new Error("Permissions not found"));
|
|
11188
11188
|
}, (h) => {
|
|
11189
|
-
|
|
11189
|
+
d(new Error(`Error getting permissions for user ${t.uid}`, { cause: h }));
|
|
11190
11190
|
});
|
|
11191
|
-
r.push(
|
|
11191
|
+
r.push(f);
|
|
11192
11192
|
}), r;
|
|
11193
11193
|
}, Pe = () => Lt, _w = () => {
|
|
11194
11194
|
Lt = null;
|
|
11195
|
-
},
|
|
11195
|
+
}, dc = (t) => {
|
|
11196
11196
|
if (typeof t == "object")
|
|
11197
11197
|
for (const e in t)
|
|
11198
|
-
Object.prototype.hasOwnProperty.call(t, e) && (ar(t[e]) ? t[e] = "_DELETE_FIELD" :
|
|
11198
|
+
Object.prototype.hasOwnProperty.call(t, e) && (ar(t[e]) ? t[e] = "_DELETE_FIELD" : dc(t[e]));
|
|
11199
11199
|
}, Ye = async (t, e, r, n, s, i, a, o, c) => {
|
|
11200
|
-
const l = Dt(), { labels: u } = i,
|
|
11200
|
+
const l = Dt(), { labels: u } = i, d = Ie(), f = wc(), h = await ne(d, ["global", "firebase", "writeLogTTL"]), p = {
|
|
11201
11201
|
operation: t,
|
|
11202
11202
|
collection: u.collection,
|
|
11203
11203
|
docId: s,
|
|
@@ -11215,13 +11215,13 @@ const yw = async (t, e) => {
|
|
|
11215
11215
|
const S = /* @__PURE__ */ new Date(), C = new Date((/* @__PURE__ */ new Date()).setDate(S.getDate() + h));
|
|
11216
11216
|
p.TTL = zt.fromDate(C);
|
|
11217
11217
|
}
|
|
11218
|
-
const b =
|
|
11219
|
-
t !== "delete" && (p.data.data = b, e === "written" &&
|
|
11220
|
-
const g = r.Last_Write_At, O = Ae(
|
|
11218
|
+
const b = ve(r);
|
|
11219
|
+
t !== "delete" && (p.data.data = b, e === "written" && dc(p.data.data)), t !== "delete" && e !== "written" && rr(b), t === "update" && (p.data.originalRecord = ve(c)), t !== "delete" && ["started", "written"].includes(e) && (delete p.data.data.Saved_At, delete p.data.data.Last_Save_At), e === "failed" && (p.data.error = JSON.stringify(o));
|
|
11220
|
+
const g = r.Last_Write_At, O = Ae(f, "tenants", l, n.join("/"), s, "system_write_log", `${a}-${g.valueOf()}`);
|
|
11221
11221
|
Jm(O, p).catch((S) => {
|
|
11222
11222
|
console.error(`Error saving "${e}" ${t} log entry for record ${s} in ${u.collection} collection.`, { cause: S });
|
|
11223
11223
|
});
|
|
11224
|
-
},
|
|
11224
|
+
}, fc = async (t, e, r, n, s) => {
|
|
11225
11225
|
const i = Dt(), a = ze(), o = n.labels.collection, c = n.fields.filter((u) => "unique" in u && u.unique), l = [];
|
|
11226
11226
|
if (!s.Role)
|
|
11227
11227
|
throw new Error("No role found in permissions");
|
|
@@ -11229,13 +11229,13 @@ const yw = async (t, e) => {
|
|
|
11229
11229
|
if (!u.access || u.access.includes(s.Role)) {
|
|
11230
11230
|
if (r[u.name] === void 0 || ar(r[u.name]))
|
|
11231
11231
|
return;
|
|
11232
|
-
const
|
|
11233
|
-
if (!
|
|
11232
|
+
const d = r[u.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
|
|
11233
|
+
if (!fw(d))
|
|
11234
11234
|
l.push(`${u.name} "${r[u.name]}" is invalid`);
|
|
11235
11235
|
else {
|
|
11236
|
-
const
|
|
11236
|
+
const f = await Rf(Ae(a, "tenants", i, "system_unique", o, `Unique-${o}-${u.name}`, d)).catch(() => {
|
|
11237
11237
|
});
|
|
11238
|
-
|
|
11238
|
+
f?.exists() && !(t === "update" && f.data().id === e) && l.push(`${u.name} "${r[u.name]}" already exists`);
|
|
11239
11239
|
}
|
|
11240
11240
|
}
|
|
11241
11241
|
})), l.length > 0)
|
|
@@ -11247,17 +11247,17 @@ const yw = async (t, e) => {
|
|
|
11247
11247
|
const c = i.collections[o], { labels: l } = c, u = a.collections?.[l.collection];
|
|
11248
11248
|
if (!a.Role)
|
|
11249
11249
|
throw new Error("PERMISSION_DENIED");
|
|
11250
|
-
const
|
|
11251
|
-
if (
|
|
11250
|
+
const d = u && ct("Read", u), f = Fn(c, i, a), h = [];
|
|
11251
|
+
if (d)
|
|
11252
11252
|
h.push(Ae(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${r.key}`, e));
|
|
11253
|
-
else if (
|
|
11254
|
-
for (const p of
|
|
11253
|
+
else if (f)
|
|
11254
|
+
for (const p of f)
|
|
11255
11255
|
h.push(Ae(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${p.field}`, e));
|
|
11256
11256
|
return h;
|
|
11257
|
-
},
|
|
11257
|
+
}, vf = (t) => t !== null && typeof t == "object" && !Array.isArray(t), ym = (t) => {
|
|
11258
11258
|
const e = (r) => {
|
|
11259
11259
|
Object.entries(r).forEach(([n, s]) => {
|
|
11260
|
-
|
|
11260
|
+
vf(s) && Object.keys(s).length === 2 && typeof s._seconds == "number" && typeof s._nanoseconds == "number" ? r[n] = new zt(s._seconds, s._nanoseconds) : vf(s) && e(s);
|
|
11261
11261
|
});
|
|
11262
11262
|
};
|
|
11263
11263
|
e(t);
|
|
@@ -11272,15 +11272,15 @@ const yw = async (t, e) => {
|
|
|
11272
11272
|
stream: !0
|
|
11273
11273
|
});
|
|
11274
11274
|
else {
|
|
11275
|
-
const { stream: u, data:
|
|
11275
|
+
const { stream: u, data: d } = await o.stream({
|
|
11276
11276
|
path: t,
|
|
11277
11277
|
constraints: a,
|
|
11278
11278
|
options: r,
|
|
11279
11279
|
stream: !0
|
|
11280
11280
|
});
|
|
11281
|
-
for await (const
|
|
11282
|
-
console.log(
|
|
11283
|
-
c = { data: await
|
|
11281
|
+
for await (const f of u)
|
|
11282
|
+
console.log(f.data.result.records.length);
|
|
11283
|
+
c = { data: await d };
|
|
11284
11284
|
}
|
|
11285
11285
|
const l = c.data;
|
|
11286
11286
|
for (const u of l.result.records)
|
|
@@ -11290,47 +11290,47 @@ const yw = async (t, e) => {
|
|
|
11290
11290
|
const o = Pe();
|
|
11291
11291
|
if (!o)
|
|
11292
11292
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11293
|
-
const c = e.at(-2), l =
|
|
11294
|
-
r.collections ? r.collections.forEach((
|
|
11295
|
-
if (!l.includes(
|
|
11296
|
-
throw new Error(`SCHEMA_ERROR: Collection ${
|
|
11293
|
+
const c = e.at(-2), l = Ff(n.collections[c], n, o).map((f) => f.labels.collection);
|
|
11294
|
+
r.collections ? r.collections.forEach((f) => {
|
|
11295
|
+
if (!l.includes(f))
|
|
11296
|
+
throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${c}`);
|
|
11297
11297
|
}) : r.collections = l;
|
|
11298
|
-
const u = r.depth - 1,
|
|
11299
|
-
const h = await vm([...e,
|
|
11298
|
+
const u = r.depth - 1, d = r.collections.map(async (f) => {
|
|
11299
|
+
const h = await vm([...e, f], {
|
|
11300
11300
|
constraints: r.constraints,
|
|
11301
11301
|
only: i,
|
|
11302
11302
|
pagination: r.limit,
|
|
11303
11303
|
noEmbeddingFields: a
|
|
11304
11304
|
}).catch((p) => {
|
|
11305
|
-
throw p.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${
|
|
11305
|
+
throw p.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${f} for document at ${e.join("/")}`), p;
|
|
11306
11306
|
});
|
|
11307
|
-
t[
|
|
11307
|
+
t[f] = h.records, s && await Promise.all(
|
|
11308
11308
|
// eslint-disable-next-line security/detect-object-injection
|
|
11309
|
-
t[
|
|
11309
|
+
t[f].map((p) => hc(p, [...e, f, p.id], s, n, i, a))
|
|
11310
11310
|
), u > 0 && await Promise.all(
|
|
11311
11311
|
// eslint-disable-next-line security/detect-object-injection
|
|
11312
|
-
t[
|
|
11312
|
+
t[f].map((p) => _m(p, [...e, f, p.id], { depth: u }, n, s, i, a))
|
|
11313
11313
|
);
|
|
11314
11314
|
});
|
|
11315
|
-
await Promise.all(
|
|
11315
|
+
await Promise.all(d);
|
|
11316
11316
|
}, hc = async (t, e, r, n, s, i) => {
|
|
11317
11317
|
if (!Pe())
|
|
11318
11318
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11319
11319
|
const o = e.at(-2);
|
|
11320
|
-
r.fields ||= n.collections[o].fields.filter((u) =>
|
|
11320
|
+
r.fields ||= n.collections[o].fields.filter((u) => we(u));
|
|
11321
11321
|
const c = r.depth - 1, l = [];
|
|
11322
11322
|
for (const u of r.fields)
|
|
11323
11323
|
if ("collection" in u) {
|
|
11324
|
-
const
|
|
11325
|
-
if (!
|
|
11324
|
+
const d = t[u.name];
|
|
11325
|
+
if (!d)
|
|
11326
11326
|
continue;
|
|
11327
|
-
const
|
|
11328
|
-
for (const h of
|
|
11329
|
-
const p =
|
|
11330
|
-
if (
|
|
11327
|
+
const f = Object.keys(d);
|
|
11328
|
+
for (const h of f) {
|
|
11329
|
+
const p = d[h], b = wr(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((g) => {
|
|
11330
|
+
if (d[h] = g, c > 0)
|
|
11331
11331
|
return hc(
|
|
11332
11332
|
// eslint-disable-next-line security/detect-object-injection
|
|
11333
|
-
|
|
11333
|
+
d[h],
|
|
11334
11334
|
[...p.Collection_Path, h],
|
|
11335
11335
|
{ depth: c },
|
|
11336
11336
|
n,
|
|
@@ -11339,7 +11339,7 @@ const yw = async (t, e) => {
|
|
|
11339
11339
|
);
|
|
11340
11340
|
}).catch((g) => {
|
|
11341
11341
|
if (g.message.includes("NOT_FOUND") || g.code === "permission-denied")
|
|
11342
|
-
delete
|
|
11342
|
+
delete d[h];
|
|
11343
11343
|
else
|
|
11344
11344
|
throw g;
|
|
11345
11345
|
});
|
|
@@ -11360,17 +11360,17 @@ const yw = async (t, e) => {
|
|
|
11360
11360
|
const r = e?.constraints, n = t.at(-1);
|
|
11361
11361
|
if (!n)
|
|
11362
11362
|
throw new Error("EMPTY_PATH");
|
|
11363
|
-
const s = We(!0), a = Xr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly:
|
|
11363
|
+
const s = We(!0), a = Xr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: d } = l, f = Ie(), h = Object.keys(s.collections).includes(n), p = f.disabledCollections?.includes(n);
|
|
11364
11364
|
if (!h || p)
|
|
11365
11365
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11366
|
-
const b = await
|
|
11366
|
+
const b = await dt(c.collection), g = await ne(f, [
|
|
11367
11367
|
"global",
|
|
11368
11368
|
"firebase",
|
|
11369
11369
|
"serverTimestampOptions"
|
|
11370
11370
|
]), O = Pe();
|
|
11371
11371
|
if (!O?.Role)
|
|
11372
11372
|
throw new Error("PERMISSIONS_DENIED");
|
|
11373
|
-
if (
|
|
11373
|
+
if (d?.includes(O.Role))
|
|
11374
11374
|
return await vw(t, r, e);
|
|
11375
11375
|
const S = uc(t, a);
|
|
11376
11376
|
if (S.length === 0)
|
|
@@ -11383,16 +11383,16 @@ const yw = async (t, e) => {
|
|
|
11383
11383
|
if (e?.pagination) {
|
|
11384
11384
|
if (e.pagination.startAfter && e.pagination.endBefore)
|
|
11385
11385
|
throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
|
|
11386
|
-
const m = e.pagination.startAfter || e.pagination.endBefore, T =
|
|
11386
|
+
const m = e.pagination.startAfter || e.pagination.endBefore, T = Zf(O.Role, o, s);
|
|
11387
11387
|
if (m && T !== !0)
|
|
11388
11388
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + T);
|
|
11389
11389
|
e.pagination.orderByField && e.pagination.orderByDirection ? e.pagination.startAfter || e.pagination.endBefore ? e.pagination.startAfter ? C = C.map((A, L) => he(A, rt(e.pagination.orderByField, e.pagination.orderByDirection), no(x.last.get(L)), er(e.pagination.number))) : C = C.map((A, L) => he(A, rt(e.pagination.orderByField, e.pagination.orderByDirection), so(x.first.get(L)), Dr(e.pagination.number))) : C = C.map((A) => he(A, rt(e.pagination.orderByField, e.pagination.orderByDirection), er(e.pagination.number))) : !e.pagination.startAfter && !e.pagination.endBefore ? C = C.map((A) => he(A, er(e.pagination.number))) : e.pagination.startAfter ? C = C.map((A, L) => he(A, no(x.last.get(L)), er(e.pagination.number))) : C = C.map((A, L) => he(A, so(x.first.get(L)), Dr(e.pagination.number)));
|
|
11390
11390
|
}
|
|
11391
11391
|
const y = { collection: c.collection };
|
|
11392
|
-
await ie("preOperation",
|
|
11392
|
+
await ie("preOperation", f, b, { operation: "read", context: y }), await ie("preRead", f, b, { context: y, refs: C, multiple: !0, listener: !1 });
|
|
11393
11393
|
const _ = /* @__PURE__ */ new Map(), N = C.map(async (m) => {
|
|
11394
11394
|
let T;
|
|
11395
|
-
return e?.only === "cache" ? T = await
|
|
11395
|
+
return e?.only === "cache" ? T = await Cf(m) : e?.only === "server" ? T = await Qm(m) : T = await Xm(m), T;
|
|
11396
11396
|
}), v = await Promise.all(N);
|
|
11397
11397
|
for (const m of v) {
|
|
11398
11398
|
for (const T of m.docs) {
|
|
@@ -11405,10 +11405,10 @@ const yw = async (t, e) => {
|
|
|
11405
11405
|
x.first.set(v.indexOf(m), m.docs[0]), x.last.set(v.indexOf(m), m.docs.at(-1) || m.docs[0]);
|
|
11406
11406
|
}
|
|
11407
11407
|
let w;
|
|
11408
|
-
if (e?.pagination && !u?.roles.includes(O?.Role) && !
|
|
11408
|
+
if (e?.pagination && !u?.roles.includes(O?.Role) && !d?.includes(O?.Role)) {
|
|
11409
11409
|
let m = he(S[0], ...r || []);
|
|
11410
11410
|
e.pagination.orderByField && e.pagination.orderByDirection && (m = he(m, rt(e.pagination.orderByField, e.pagination.orderByDirection)));
|
|
11411
|
-
const T = await
|
|
11411
|
+
const T = await Af(m).catch(() => {
|
|
11412
11412
|
});
|
|
11413
11413
|
if (T) {
|
|
11414
11414
|
const A = T.data().count, L = e.pagination.number;
|
|
@@ -11416,16 +11416,16 @@ const yw = async (t, e) => {
|
|
|
11416
11416
|
}
|
|
11417
11417
|
}
|
|
11418
11418
|
let I;
|
|
11419
|
-
e?.noComputedFields || (I = await
|
|
11419
|
+
e?.noComputedFields || (I = await be(b.admin?.retriever));
|
|
11420
11420
|
for (const m of _.values()) {
|
|
11421
11421
|
const T = [], A = [...m.Collection_Path, m.id];
|
|
11422
11422
|
e?.subcollections && T.push(_m(
|
|
11423
11423
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11424
11424
|
_.get(m.id),
|
|
11425
11425
|
A,
|
|
11426
|
-
|
|
11426
|
+
ve(e.subcollections),
|
|
11427
11427
|
s,
|
|
11428
|
-
|
|
11428
|
+
ve(e?.relations),
|
|
11429
11429
|
e?.only,
|
|
11430
11430
|
e?.noEmbeddingFields
|
|
11431
11431
|
)), e?.relations && (e.relations.fields && (e.relations.fields = e.relations.fields.map((F) => {
|
|
@@ -11440,19 +11440,19 @@ const yw = async (t, e) => {
|
|
|
11440
11440
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11441
11441
|
_.get(m.id),
|
|
11442
11442
|
A,
|
|
11443
|
-
|
|
11443
|
+
ve(e.relations),
|
|
11444
11444
|
s,
|
|
11445
11445
|
e?.only,
|
|
11446
11446
|
e?.noEmbeddingFields
|
|
11447
11447
|
))), await Promise.all(T);
|
|
11448
11448
|
const L = [];
|
|
11449
11449
|
for (const F of o.fields)
|
|
11450
|
-
F.type === "Computed" && !e?.noComputedFields && L.push(
|
|
11450
|
+
F.type === "Computed" && !e?.noComputedFields && L.push(be(F.formula, [m, I]).then((Z) => {
|
|
11451
11451
|
m[F.name] = Z;
|
|
11452
11452
|
})), e?.noEmbeddingFields && F.type === "Embedding" && delete m[F.name];
|
|
11453
11453
|
await Promise.all(L);
|
|
11454
11454
|
const k = { operation: "read", data: m, recordId: m.id, context: y };
|
|
11455
|
-
await ie("postOperation",
|
|
11455
|
+
await ie("postOperation", f, b, k), await ie("postRead", f, b, { context: y, refs: S, record: m, listener: !1 });
|
|
11456
11456
|
}
|
|
11457
11457
|
return { cursor: x, pages: w, records: Array.from(_.values()) };
|
|
11458
11458
|
}, ww = async (t, e, r) => {
|
|
@@ -11466,24 +11466,24 @@ const yw = async (t, e) => {
|
|
|
11466
11466
|
const a = Pe();
|
|
11467
11467
|
if (!a)
|
|
11468
11468
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11469
|
-
const o = e.at(-2), c =
|
|
11470
|
-
r.collections ? r.collections.forEach((
|
|
11471
|
-
if (!c.includes(
|
|
11472
|
-
throw new Error(`SCHEMA_ERROR: Collection ${
|
|
11469
|
+
const o = e.at(-2), c = Ff(n.collections[o], n, a).map((d) => d.labels.collection);
|
|
11470
|
+
r.collections ? r.collections.forEach((d) => {
|
|
11471
|
+
if (!c.includes(d))
|
|
11472
|
+
throw new Error(`SCHEMA_ERROR: Collection ${d} not found in subcollections of ${o}`);
|
|
11473
11473
|
}) : r.collections = c;
|
|
11474
|
-
const l = r.depth - 1, u = r.collections.map(async (
|
|
11475
|
-
const
|
|
11474
|
+
const l = r.depth - 1, u = r.collections.map(async (d) => {
|
|
11475
|
+
const f = await vm([...e, d], {
|
|
11476
11476
|
constraints: r.constraints || [],
|
|
11477
11477
|
only: i,
|
|
11478
11478
|
relations: s,
|
|
11479
11479
|
pagination: r.limit
|
|
11480
11480
|
}).catch((h) => {
|
|
11481
|
-
throw h.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${
|
|
11481
|
+
throw h.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${d} for document at ${e.join("/")}`), h;
|
|
11482
11482
|
});
|
|
11483
|
-
t[
|
|
11483
|
+
t[d] = f.records, l > 0 && await Promise.all(
|
|
11484
11484
|
// eslint-disable-next-line security/detect-object-injection
|
|
11485
|
-
t[
|
|
11486
|
-
await wm(h, [...e,
|
|
11485
|
+
t[d].map(async (h) => {
|
|
11486
|
+
await wm(h, [...e, d, h.id], { depth: l }, n, s, i);
|
|
11487
11487
|
})
|
|
11488
11488
|
);
|
|
11489
11489
|
});
|
|
@@ -11492,23 +11492,23 @@ const yw = async (t, e) => {
|
|
|
11492
11492
|
if (!Pe())
|
|
11493
11493
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11494
11494
|
const c = e.at(-2);
|
|
11495
|
-
r.fields ||= n.collections[c].fields.filter((
|
|
11495
|
+
r.fields ||= n.collections[c].fields.filter((d) => we(d));
|
|
11496
11496
|
const l = r.depth - 1, u = [];
|
|
11497
|
-
for (const
|
|
11498
|
-
if ("collection" in
|
|
11499
|
-
const
|
|
11500
|
-
if (!
|
|
11497
|
+
for (const d of r.fields)
|
|
11498
|
+
if ("collection" in d) {
|
|
11499
|
+
const f = t[d.name];
|
|
11500
|
+
if (!f)
|
|
11501
11501
|
continue;
|
|
11502
|
-
for (const [h, p] of Object.entries(
|
|
11502
|
+
for (const [h, p] of Object.entries(f)) {
|
|
11503
11503
|
const b = wr(p.Collection_Path, h, {
|
|
11504
11504
|
only: s,
|
|
11505
11505
|
noComputedFields: i,
|
|
11506
11506
|
noEmbeddingFields: a
|
|
11507
11507
|
}).then((g) => {
|
|
11508
|
-
if (
|
|
11508
|
+
if (f[h] = g, l > 0)
|
|
11509
11509
|
return bm(
|
|
11510
11510
|
// eslint-disable-next-line security/detect-object-injection
|
|
11511
|
-
|
|
11511
|
+
f[h],
|
|
11512
11512
|
[...p.Collection_Path, h],
|
|
11513
11513
|
{ depth: l },
|
|
11514
11514
|
n,
|
|
@@ -11518,7 +11518,7 @@ const yw = async (t, e) => {
|
|
|
11518
11518
|
);
|
|
11519
11519
|
}).catch((g) => {
|
|
11520
11520
|
if (g.message.includes("NOT_FOUND") || g.code === "permission-denied")
|
|
11521
|
-
delete
|
|
11521
|
+
delete f[h];
|
|
11522
11522
|
else
|
|
11523
11523
|
throw g;
|
|
11524
11524
|
});
|
|
@@ -11541,7 +11541,7 @@ const yw = async (t, e) => {
|
|
|
11541
11541
|
"global",
|
|
11542
11542
|
"firebase",
|
|
11543
11543
|
"serverTimestampOptions"
|
|
11544
|
-
]),
|
|
11544
|
+
]), d = s.collections[n], { labels: f, access: h } = d, { serverReadOnly: p } = h, b = dt(f.collection), g = Pe();
|
|
11545
11545
|
if (!g?.Role)
|
|
11546
11546
|
throw new Error("PERMISSIONS_DENIED");
|
|
11547
11547
|
if (p?.includes(g.Role))
|
|
@@ -11549,31 +11549,31 @@ const yw = async (t, e) => {
|
|
|
11549
11549
|
const O = gm(t, e, a);
|
|
11550
11550
|
if (O.length === 0)
|
|
11551
11551
|
throw new Error("PERMISSION_DENIED");
|
|
11552
|
-
const S = { collection:
|
|
11552
|
+
const S = { collection: f.collection };
|
|
11553
11553
|
await ie("preOperation", o, b, { operation: "read", recordId: e, context: S }), await ie("preRead", o, b, { context: S, refs: O, multiple: !1, listener: !1 });
|
|
11554
11554
|
let y = {};
|
|
11555
11555
|
const E = O.map(async (I) => {
|
|
11556
11556
|
let m;
|
|
11557
|
-
if (r?.only === "cache" ? m = await ep(I) : r?.only === "server" ? m = await tp(I) : m = await
|
|
11558
|
-
throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${t?.join("/") ||
|
|
11557
|
+
if (r?.only === "cache" ? m = await ep(I) : r?.only === "server" ? m = await tp(I) : m = await Rf(I), !m.exists())
|
|
11558
|
+
throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${t?.join("/") || f.collection}`);
|
|
11559
11559
|
return { id: m.id, data: m.data({ serverTimestamps: u || "none" }) };
|
|
11560
11560
|
}), R = await Promise.all(E);
|
|
11561
11561
|
for (const I of R)
|
|
11562
11562
|
y.id ||= I.id, y = { ...y, ...I.data }, delete y.Collection_Path_String;
|
|
11563
|
-
const _ = [], N = t ? [...t, e] : [
|
|
11564
|
-
if (r?.subcollections && _.push(wm(y, N,
|
|
11563
|
+
const _ = [], N = t ? [...t, e] : [f.collection, e];
|
|
11564
|
+
if (r?.subcollections && _.push(wm(y, N, ve(r.subcollections), s, ve(r?.relations), r?.only)), r?.relations && (r.relations.fields && (r.relations.fields = r.relations.fields.map((I) => {
|
|
11565
11565
|
if (typeof I == "string") {
|
|
11566
|
-
const m =
|
|
11566
|
+
const m = d.fields.find((T) => T.name === I);
|
|
11567
11567
|
if (m)
|
|
11568
11568
|
return m;
|
|
11569
11569
|
throw new Error(`SCHEMA_ERROR: Field ${I} not found in collection ${n}`);
|
|
11570
11570
|
}
|
|
11571
11571
|
return I;
|
|
11572
|
-
})), _.push(bm(y, N,
|
|
11573
|
-
for (const I of
|
|
11572
|
+
})), _.push(bm(y, N, ve(r.relations), s, r?.only, r?.noComputedFields, r?.noEmbeddingFields))), await Promise.all(_), !r?.noComputedFields)
|
|
11573
|
+
for (const I of d.fields)
|
|
11574
11574
|
I.type === "Computed" && (y[I.name] = await I.formula(y));
|
|
11575
11575
|
if (r?.noEmbeddingFields)
|
|
11576
|
-
for (const I of
|
|
11576
|
+
for (const I of d.fields)
|
|
11577
11577
|
I.type === "Embedding" && delete y[I.name];
|
|
11578
11578
|
return await ie("postOperation", o, b, { operation: "read", data: y, recordId: e, context: S }), await ie("postRead", o, b, { context: S, refs: O, record: y, listener: !1 }), y;
|
|
11579
11579
|
}, bw = (t) => t !== null && typeof t == "object", Om = (t) => {
|
|
@@ -11587,32 +11587,32 @@ const yw = async (t, e) => {
|
|
|
11587
11587
|
};
|
|
11588
11588
|
e(t);
|
|
11589
11589
|
}, Ow = async (t, e, r, n) => {
|
|
11590
|
-
const s = it(), i = Be(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11591
|
-
return Om(
|
|
11590
|
+
const s = it(), i = Be(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 }), c = ve(r);
|
|
11591
|
+
return Om(c), dc(c), (await o({
|
|
11592
11592
|
operation: "update",
|
|
11593
11593
|
path: t,
|
|
11594
11594
|
id: e,
|
|
11595
|
-
record:
|
|
11595
|
+
record: c,
|
|
11596
11596
|
user: n
|
|
11597
11597
|
})).data?.result;
|
|
11598
11598
|
}, mc = async (t, e, r, n) => {
|
|
11599
|
-
const s = n?.user, i = Dt(), a = We(), o = We(!0), c = vc(), l = Ie(), u = hr(),
|
|
11599
|
+
const s = n?.user, i = Dt(), a = We(), o = We(!0), c = vc(), l = Ie(), u = hr(), d = ze(), f = Pe();
|
|
11600
11600
|
if (t.length === 0)
|
|
11601
11601
|
throw new Error("EMPTY_PATH");
|
|
11602
11602
|
const h = t.at(-1), p = Object.keys(a.collections).includes(h), b = l.disabledCollections?.includes(h);
|
|
11603
11603
|
if (!p || b)
|
|
11604
11604
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11605
|
-
const g = a.collections[h], { labels: O, access: S, fields: C, enableWriteLog: x } = g, { serverWriteOnly: y } = S, E =
|
|
11605
|
+
const g = a.collections[h], { labels: O, access: S, fields: C, enableWriteLog: x } = g, { serverWriteOnly: y } = S, E = dt(O.collection), R = await ne(l, ["global", "appName"]), _ = n?.retry, N = u.currentUser;
|
|
11606
11606
|
if (!N)
|
|
11607
11607
|
throw new Error("NOT_AUTHENTICATED");
|
|
11608
|
-
if (!
|
|
11608
|
+
if (!f)
|
|
11609
11609
|
throw new Error("PERMISSION_DENIED");
|
|
11610
11610
|
if (Tm(e))
|
|
11611
11611
|
throw new Error("RECORD_BUSY");
|
|
11612
11612
|
const v = _?.originalRecord || n?.originalRecord || await wr(t, e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11613
11613
|
for (const V of o.collections[h].fields)
|
|
11614
11614
|
V.type === "Computed" && (delete r[V.name], delete v[V.name]);
|
|
11615
|
-
const w = xo(
|
|
11615
|
+
const w = xo(d), I = { collection: O.collection }, m = g.fields.filter((V) => V.saveToAuthToken), T = g.auth && s?.operation === "create", A = g.auth && s?.operation === "delete", L = g.auth && !T && !A && (s?.operation === "update" || r.Role || r.Enabled !== void 0 || r.Name || r.Email || r.Photo_URL || m.some((V) => r[V.name] !== void 0)), k = await ne(E, [
|
|
11616
11616
|
"collections",
|
|
11617
11617
|
O.collection,
|
|
11618
11618
|
"custom",
|
|
@@ -11632,7 +11632,7 @@ const yw = async (t, e) => {
|
|
|
11632
11632
|
if (!await ne(l, ["global", "firebase", "enableEmulators"])) {
|
|
11633
11633
|
M();
|
|
11634
11634
|
try {
|
|
11635
|
-
const { isValid: Te } = await
|
|
11635
|
+
const { isValid: Te } = await Ef(u, s.password);
|
|
11636
11636
|
if (!Te)
|
|
11637
11637
|
throw new Error("Please create a stronger password");
|
|
11638
11638
|
} catch (Te) {
|
|
@@ -11645,14 +11645,14 @@ const yw = async (t, e) => {
|
|
|
11645
11645
|
record: { ...v, ...r },
|
|
11646
11646
|
context: I,
|
|
11647
11647
|
batch: w,
|
|
11648
|
-
originalRecord:
|
|
11648
|
+
originalRecord: ve(v)
|
|
11649
11649
|
};
|
|
11650
11650
|
return await ie("preValidate", l, E, V), await Ow(t, e, r, s ? { operation: s.operation, permissions: s.permissions, password: s.password } : void 0);
|
|
11651
11651
|
}
|
|
11652
11652
|
delete r.id;
|
|
11653
11653
|
const F = Qo("update", t, r, a, R, Wt(), N.uid, zt.now(), jr(), !!_);
|
|
11654
11654
|
for (const V of C)
|
|
11655
|
-
!
|
|
11655
|
+
!we(V) && ar(F[V.name]) && V.nullable && (F[V.name] = null);
|
|
11656
11656
|
if (xt(F), xt(v), Mr(g, F, a), Mr(g, v, a), !_ && x && Ye("update", "started", F, t, e, g, N.uid, void 0, v), !_) {
|
|
11657
11657
|
const V = {
|
|
11658
11658
|
operation: "update",
|
|
@@ -11660,7 +11660,7 @@ const yw = async (t, e) => {
|
|
|
11660
11660
|
recordId: e,
|
|
11661
11661
|
context: I,
|
|
11662
11662
|
batch: w,
|
|
11663
|
-
originalRecord:
|
|
11663
|
+
originalRecord: ve(v)
|
|
11664
11664
|
};
|
|
11665
11665
|
await ie("preOperation", l, E, V);
|
|
11666
11666
|
const K = {
|
|
@@ -11669,18 +11669,18 @@ const yw = async (t, e) => {
|
|
|
11669
11669
|
recordId: e,
|
|
11670
11670
|
context: I,
|
|
11671
11671
|
batch: w,
|
|
11672
|
-
originalRecord:
|
|
11672
|
+
originalRecord: ve(v)
|
|
11673
11673
|
};
|
|
11674
11674
|
await ie("preWrite", l, E, K);
|
|
11675
11675
|
}
|
|
11676
11676
|
if (Mr(g, F, a), sh(g, F), !_)
|
|
11677
11677
|
try {
|
|
11678
11678
|
const V = { ...v, ...F };
|
|
11679
|
-
rr(V), await
|
|
11679
|
+
rr(V), await dm("update", V, g, E, { operation: "update", record: V, context: I, batch: w, originalRecord: ve(v) }, a), k && (M(), await fc("update", e, F, g, f));
|
|
11680
11680
|
} catch (V) {
|
|
11681
11681
|
throw new Error(`VALIDATION_ERROR: ${V.message}`);
|
|
11682
11682
|
}
|
|
11683
|
-
if (Rg(F, v, e, g, a, N.uid,
|
|
11683
|
+
if (Rg(F, v, e, g, a, N.uid, f), xt(F), lc("update", w, t, e, F, a, g, n, c, Fo, No, xn, (V) => Ae(d, "tenants", i, "system_fields", O.collection, `${O.collection}-${V.name}`, e), (V, K) => Ae(d, "tenants", i, "system_unique", O.collection, `Unique-${O.collection}-${V.name}`, K), (V) => Ae(d, "tenants", i, "system_fields", O.collection, `${O.collection}-${V}`, e)), w.update(Ae(d, "tenants", i, t.join("/"), e), F), !_ && x && Ye("update", "written", F, t, e, g, N.uid, void 0, v), await pc("update", t, e, F, I, g, E, w, N.uid, x || !1, f, !!_, v), _?.type === "unique") {
|
|
11684
11684
|
const V = { ...v, ...F };
|
|
11685
11685
|
return rr(V), { id: e, ...V };
|
|
11686
11686
|
}
|
|
@@ -11691,17 +11691,17 @@ const yw = async (t, e) => {
|
|
|
11691
11691
|
recordId: e,
|
|
11692
11692
|
context: I,
|
|
11693
11693
|
retry: !!_,
|
|
11694
|
-
originalRecord:
|
|
11694
|
+
originalRecord: ve(v)
|
|
11695
11695
|
}, re = { ...Z };
|
|
11696
11696
|
await ie("postWrite", l, E, Z), await ie("postOperation", l, E, re);
|
|
11697
11697
|
const oe = { ...v, ...F };
|
|
11698
11698
|
return rr(oe), { id: e, ...oe };
|
|
11699
|
-
}, pc = async (t, e, r, n, s, i, a, o, c, l, u,
|
|
11699
|
+
}, pc = async (t, e, r, n, s, i, a, o, c, l, u, d, f) => {
|
|
11700
11700
|
const h = We(), p = Ie(), { labels: b } = i;
|
|
11701
11701
|
let g = 0;
|
|
11702
11702
|
const O = async () => {
|
|
11703
11703
|
try {
|
|
11704
|
-
await
|
|
11704
|
+
await ve(o).commit();
|
|
11705
11705
|
return;
|
|
11706
11706
|
} catch (S) {
|
|
11707
11707
|
let C;
|
|
@@ -11711,9 +11711,9 @@ const yw = async (t, e) => {
|
|
|
11711
11711
|
"custom",
|
|
11712
11712
|
"autoCorrectUnique"
|
|
11713
11713
|
]);
|
|
11714
|
-
if (S.code === "unavailable" && await
|
|
11714
|
+
if (S.code === "unavailable" && await be(p.onIndexedDBConnectionLost), t !== "delete" && S.code === "permission-denied")
|
|
11715
11715
|
try {
|
|
11716
|
-
await
|
|
11716
|
+
await fc(t, r, n, i, u);
|
|
11717
11717
|
} catch (N) {
|
|
11718
11718
|
const v = N.message.split(", "), w = [], I = [];
|
|
11719
11719
|
let m = !1;
|
|
@@ -11740,7 +11740,7 @@ const yw = async (t, e) => {
|
|
|
11740
11740
|
retry: {
|
|
11741
11741
|
type: "unique",
|
|
11742
11742
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11743
|
-
originalRecord:
|
|
11743
|
+
originalRecord: f
|
|
11744
11744
|
}
|
|
11745
11745
|
});
|
|
11746
11746
|
return;
|
|
@@ -11754,9 +11754,9 @@ const yw = async (t, e) => {
|
|
|
11754
11754
|
context: s,
|
|
11755
11755
|
error: y,
|
|
11756
11756
|
batch: o,
|
|
11757
|
-
retry:
|
|
11757
|
+
retry: d,
|
|
11758
11758
|
retries: g,
|
|
11759
|
-
originalRecord: t === "update" ?
|
|
11759
|
+
originalRecord: t === "update" ? f : void 0
|
|
11760
11760
|
}, R = S.code === "unavailable", _ = await ie("postWriteError", p, a, E);
|
|
11761
11761
|
if (_?.resolved)
|
|
11762
11762
|
return;
|
|
@@ -11774,18 +11774,18 @@ const yw = async (t, e) => {
|
|
|
11774
11774
|
c,
|
|
11775
11775
|
y,
|
|
11776
11776
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11777
|
-
t === "update" ?
|
|
11777
|
+
t === "update" ? f : void 0
|
|
11778
11778
|
);
|
|
11779
11779
|
throw y;
|
|
11780
11780
|
}
|
|
11781
11781
|
};
|
|
11782
11782
|
await O();
|
|
11783
11783
|
}, Ew = async (t, e, r, n) => {
|
|
11784
|
-
const s = it(), i = Be(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11785
|
-
return Om(
|
|
11784
|
+
const s = it(), i = Be(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 }), c = ve(e);
|
|
11785
|
+
return Om(c), (await o({
|
|
11786
11786
|
operation: "create",
|
|
11787
11787
|
path: t,
|
|
11788
|
-
record:
|
|
11788
|
+
record: c,
|
|
11789
11789
|
user: r,
|
|
11790
11790
|
id: n
|
|
11791
11791
|
})).data?.result;
|
|
@@ -11793,10 +11793,10 @@ const yw = async (t, e) => {
|
|
|
11793
11793
|
const n = r?.user, s = Dt(), i = We(), a = vc(), o = Ie(), c = hr(), l = ze(), u = Pe();
|
|
11794
11794
|
if (t.length === 0)
|
|
11795
11795
|
throw new Error("EMPTY_PATH");
|
|
11796
|
-
const
|
|
11797
|
-
if (!
|
|
11796
|
+
const d = t.at(-1), f = Object.keys(i.collections).includes(d), h = o.disabledCollections?.includes(d);
|
|
11797
|
+
if (!f || h)
|
|
11798
11798
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11799
|
-
const p = i.collections[
|
|
11799
|
+
const p = i.collections[d], { labels: b, access: g, enableWriteLog: O, softDelete: S } = p, { serverWriteOnly: C } = g, x = dt(b.collection), y = await ne(o, ["global", "appName"]), E = r?.retry, R = c.currentUser;
|
|
11800
11800
|
if (!R)
|
|
11801
11801
|
throw new Error("NOT_AUTHENTICATED");
|
|
11802
11802
|
if (!u)
|
|
@@ -11823,7 +11823,7 @@ const yw = async (t, e) => {
|
|
|
11823
11823
|
if (!await ne(o, ["global", "firebase", "enableEmulators"])) {
|
|
11824
11824
|
N();
|
|
11825
11825
|
try {
|
|
11826
|
-
const { isValid: Z } = await
|
|
11826
|
+
const { isValid: Z } = await Ef(c, n.password);
|
|
11827
11827
|
if (!Z)
|
|
11828
11828
|
throw new Error("Please create a stronger password");
|
|
11829
11829
|
} catch (Z) {
|
|
@@ -11854,7 +11854,7 @@ const yw = async (t, e) => {
|
|
|
11854
11854
|
batch: v
|
|
11855
11855
|
})), Mr(p, m, i), sh(p, m), E || await _y(m, p, x, u.Role), !E)
|
|
11856
11856
|
try {
|
|
11857
|
-
await
|
|
11857
|
+
await dm("create", m, p, x, { operation: "create", record: m, context: I, batch: v }, i), _ && (N(), await fc("create", w, m, p, u));
|
|
11858
11858
|
} catch (k) {
|
|
11859
11859
|
throw new Error(`VALIDATION_ERROR: ${k.message}`);
|
|
11860
11860
|
}
|
|
@@ -11880,10 +11880,10 @@ const yw = async (t, e) => {
|
|
|
11880
11880
|
const n = Dt(), s = We(), i = vc(), a = hr(), o = ze(), c = Ie(), l = Pe();
|
|
11881
11881
|
if (t.length === 0)
|
|
11882
11882
|
throw new Error("EMPTY_PATH");
|
|
11883
|
-
const u = t.at(-1),
|
|
11884
|
-
if (!
|
|
11883
|
+
const u = t.at(-1), d = Object.keys(s.collections).includes(u), f = c.disabledCollections?.includes(u);
|
|
11884
|
+
if (!d || f)
|
|
11885
11885
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11886
|
-
const h = s.collections[u], { labels: p, access: b, enableWriteLog: g, softDelete: O } = h, { serverWriteOnly: S } = b, C =
|
|
11886
|
+
const h = s.collections[u], { labels: p, access: b, enableWriteLog: g, softDelete: O } = h, { serverWriteOnly: S } = b, C = dt(p.collection), x = await ne(c, ["global", "appName"]), y = r?.retry, E = a.currentUser;
|
|
11887
11887
|
if (!E)
|
|
11888
11888
|
throw new Error("NOT_AUTHENTICATED");
|
|
11889
11889
|
if (!l)
|
|
@@ -11948,17 +11948,17 @@ const Cw = async (t, e) => {
|
|
|
11948
11948
|
const r = hr(), n = wc(), s = r.currentUser;
|
|
11949
11949
|
if (s?.uid !== e.uid)
|
|
11950
11950
|
return;
|
|
11951
|
-
const i = await
|
|
11951
|
+
const i = await Cf(he(rp(n, "system_write_log"), ye("status", "==", "written"), ye("user", "==", e.uid), rt("Last_Write_At", "asc")));
|
|
11952
11952
|
await new Promise((o) => setTimeout(o, 1e4));
|
|
11953
11953
|
const a = Rm();
|
|
11954
11954
|
if (a?.version)
|
|
11955
11955
|
for (const o of i.docs) {
|
|
11956
11956
|
pt[o.id] ??= 0;
|
|
11957
|
-
const c = o.data(), { data: l, operation: u, docId:
|
|
11957
|
+
const c = o.data(), { data: l, operation: u, docId: d, collection: f, Collection_Path: h, Last_Write_Version: p } = c;
|
|
11958
11958
|
await new Promise((O) => setTimeout(O, 1e3));
|
|
11959
11959
|
const b = await Rw("stoker-writelog", {
|
|
11960
11960
|
path: h,
|
|
11961
|
-
id:
|
|
11961
|
+
id: d,
|
|
11962
11962
|
log: o.id
|
|
11963
11963
|
});
|
|
11964
11964
|
if (!b || b.status !== "written")
|
|
@@ -11972,36 +11972,36 @@ const Cw = async (t, e) => {
|
|
|
11972
11972
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11973
11973
|
l.data,
|
|
11974
11974
|
h,
|
|
11975
|
-
|
|
11975
|
+
d,
|
|
11976
11976
|
// eslint-disable-next-line security/detect-object-injection
|
|
11977
|
-
t.collections[
|
|
11977
|
+
t.collections[f],
|
|
11978
11978
|
e.uid,
|
|
11979
11979
|
`Version mismatch- write log version ${p} not compatible with forced version ${a.version}`,
|
|
11980
11980
|
u === "update" ? l.originalRecord : void 0
|
|
11981
11981
|
);
|
|
11982
11982
|
continue;
|
|
11983
11983
|
}
|
|
11984
|
-
const g = localStorage.getItem(`stoker-retry-${
|
|
11984
|
+
const g = localStorage.getItem(`stoker-retry-${d}`);
|
|
11985
11985
|
if (g !== "done" && !(g && Date.now() - parseInt(g) < 1e4)) {
|
|
11986
|
-
if (localStorage.setItem(`stoker-retry-${
|
|
11986
|
+
if (localStorage.setItem(`stoker-retry-${d}`, Date.now().toString()), console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (pt[d]++, await Em(h, l.data, {
|
|
11987
11987
|
retry: {
|
|
11988
11988
|
type: "offline",
|
|
11989
|
-
docId:
|
|
11989
|
+
docId: d
|
|
11990
11990
|
}
|
|
11991
11991
|
}).catch((O) => {
|
|
11992
11992
|
console.error(O);
|
|
11993
|
-
}), pt[
|
|
11994
|
-
const O = t.collections[
|
|
11995
|
-
S && l.data?.[S.archivedField] && l.data?.[S.archivedField] !== l.originalRecord?.[S.archivedField] && (l.data[S.timestampField] = jr()), l.data && Sm(l.data), pt[
|
|
11993
|
+
}), pt[d]--, localStorage.setItem(`stoker-retry-${d}`, "done")), u === "update") {
|
|
11994
|
+
const O = t.collections[f], { softDelete: S } = O;
|
|
11995
|
+
S && l.data?.[S.archivedField] && l.data?.[S.archivedField] !== l.originalRecord?.[S.archivedField] && (l.data[S.timestampField] = jr()), l.data && Sm(l.data), pt[d]++, await mc(h, d, l.data, {
|
|
11996
11996
|
retry: {
|
|
11997
11997
|
type: "offline",
|
|
11998
11998
|
originalRecord: l.originalRecord
|
|
11999
11999
|
}
|
|
12000
12000
|
}).catch((C) => {
|
|
12001
12001
|
console.error(C);
|
|
12002
|
-
}), pt[
|
|
12002
|
+
}), pt[d]--, localStorage.setItem(`stoker-retry-${d}`, "done");
|
|
12003
12003
|
}
|
|
12004
|
-
u === "delete" && (pt[
|
|
12004
|
+
u === "delete" && (pt[d]++, await Tw(h, d, {
|
|
12005
12005
|
retry: {
|
|
12006
12006
|
type: "offline",
|
|
12007
12007
|
record: {
|
|
@@ -12014,7 +12014,7 @@ const Cw = async (t, e) => {
|
|
|
12014
12014
|
}
|
|
12015
12015
|
}).catch((O) => {
|
|
12016
12016
|
console.error(O);
|
|
12017
|
-
}), pt[
|
|
12017
|
+
}), pt[d]--, localStorage.setItem(`stoker-retry-${d}`, "done"));
|
|
12018
12018
|
}
|
|
12019
12019
|
}
|
|
12020
12020
|
}, Tm = (t) => !!pt[t], Aw = () => {
|
|
@@ -12024,7 +12024,7 @@ let mn, Qa = 0;
|
|
|
12024
12024
|
const kw = async () => {
|
|
12025
12025
|
const t = Nm(), e = Ie();
|
|
12026
12026
|
return mr(Ae(t, "system_deployment", "latest_deploy"), (n) => {
|
|
12027
|
-
n.exists() ? (mn = n.data(), Qa++, Qa > 1 && (mn.refresh ? window.location.reload() :
|
|
12027
|
+
n.exists() ? (mn = n.data(), Qa++, Qa > 1 && (mn.refresh ? window.location.reload() : be(e.onVersionUpdate, [mn, Qa]))) : console.error("Version info not found");
|
|
12028
12028
|
}, (n) => {
|
|
12029
12029
|
console.error("Error getting version info", { cause: n.message });
|
|
12030
12030
|
});
|
|
@@ -12033,34 +12033,34 @@ let ko;
|
|
|
12033
12033
|
const Iw = async () => {
|
|
12034
12034
|
const t = Ie(), e = Nm();
|
|
12035
12035
|
mr(Ae(e, "system_deployment", "maintenance_mode"), (r) => {
|
|
12036
|
-
r.exists() ? (ko = r.data(),
|
|
12036
|
+
r.exists() ? (ko = r.data(), be(t.onMaintenanceUpdate, [ko.active ? "on" : "off"])) : console.error("Maintenance status not found");
|
|
12037
12037
|
}, (r) => {
|
|
12038
12038
|
console.error("Error getting maintenance status", { cause: r.message });
|
|
12039
12039
|
});
|
|
12040
12040
|
}, xw = () => ko;
|
|
12041
12041
|
let Fr, Sr = null;
|
|
12042
12042
|
const Nw = () => {
|
|
12043
|
-
const t =
|
|
12043
|
+
const t = Tf(), e = Ie();
|
|
12044
12044
|
let r = !1;
|
|
12045
12045
|
return Hm(Km(t, ".info/connected"), (s) => {
|
|
12046
|
-
s.val() === !0 ? (Sr && (clearTimeout(Sr), Sr = null), Fr = "Online",
|
|
12047
|
-
Fr = "Offline",
|
|
12046
|
+
s.val() === !0 ? (Sr && (clearTimeout(Sr), Sr = null), Fr = "Online", be(e.onConnectionStatusChange, [Fr, !r]), r || (r = !0)) : !Sr && r && (Sr = setTimeout(() => {
|
|
12047
|
+
Fr = "Offline", be(e.onConnectionStatusChange, [Fr]);
|
|
12048
12048
|
}, 5e3));
|
|
12049
12049
|
});
|
|
12050
12050
|
}, Wt = () => Fr ?? "Online", Fw = () => navigator.onLine ? "Online" : "Offline", Cm = async () => {
|
|
12051
12051
|
const t = Ie(), e = hr(), r = e.currentUser;
|
|
12052
|
-
if (t.preLogout && await
|
|
12052
|
+
if (t.preLogout && await be(t.preLogout, [r]) === !1)
|
|
12053
12053
|
throw new Error("Operation cancelled by preLogout");
|
|
12054
12054
|
try {
|
|
12055
12055
|
e.signOut();
|
|
12056
12056
|
} catch (n) {
|
|
12057
12057
|
console.error(n);
|
|
12058
12058
|
const s = { error: !0, instances: [{ instance: "[DEFAULT]", code: "SIGN_OUT", error: n }] };
|
|
12059
|
-
await
|
|
12059
|
+
await be(t.postLogout, [s]);
|
|
12060
12060
|
}
|
|
12061
12061
|
}, Dw = (t) => {
|
|
12062
12062
|
const e = (s) => {
|
|
12063
|
-
typeof s == "string" && s.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"),
|
|
12063
|
+
typeof s == "string" && s.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"), be(t.onFirestoreSlowConnection)), typeof s == "string" && s.includes("Using maximum backoff delay to prevent overloading the backend.") && (console.warn("Firestore Load Failure Detected"), be(t.onFirestoreLoadFailure)), typeof s == "string" && s.includes("The user's credential is no longer valid. The user must sign in again.") && (console.warn("User Credential Expired"), Cm()), typeof s == "string" && s.includes("Connection to Indexed Database server lost. Refresh the page to try again") && (console.warn("Indexed Database Connection Lost"), be(t.onIndexedDBConnectionLost));
|
|
12064
12064
|
}, r = console.error.bind(console);
|
|
12065
12065
|
let n = !1;
|
|
12066
12066
|
console.error = (...s) => {
|
|
@@ -12084,13 +12084,13 @@ let kn;
|
|
|
12084
12084
|
const Pw = (t, e) => {
|
|
12085
12085
|
const r = mw(t, e);
|
|
12086
12086
|
kn = r === "(default)" ? void 0 : r;
|
|
12087
|
-
}, Mw = () => kn, ze = () => kn ? kc(kn) : kc(),
|
|
12087
|
+
}, Mw = () => kn, ze = () => kn ? kc(kn) : kc(), wf = () => {
|
|
12088
12088
|
if (typeof navigator > "u")
|
|
12089
12089
|
return {};
|
|
12090
12090
|
const t = navigator.userAgent;
|
|
12091
12091
|
return /iPad|iPhone|iPod/.test(t) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 ? { experimentalForceLongPolling: !0 } : /Safari/i.test(t) && !/Chrome|Chromium|CriOS|EdgiOS|Edg\/|OPR|FxiOS/i.test(t) ? { experimentalForceLongPolling: !0 } : {};
|
|
12092
12092
|
};
|
|
12093
|
-
let ht, gc, St, Am, ge, km, Lr, yc, _c,
|
|
12093
|
+
let ht, gc, St, Am, ge, km, Lr, yc, _c, Me, Im, In = [], Oe;
|
|
12094
12094
|
const Xa = {
|
|
12095
12095
|
firestoreWriteApp: {}
|
|
12096
12096
|
}, mt = {
|
|
@@ -12109,7 +12109,7 @@ const Xa = {
|
|
|
12109
12109
|
return gc;
|
|
12110
12110
|
},
|
|
12111
12111
|
getEnv() {
|
|
12112
|
-
return
|
|
12112
|
+
return Oe;
|
|
12113
12113
|
},
|
|
12114
12114
|
getTimezone() {
|
|
12115
12115
|
return Am;
|
|
@@ -12117,12 +12117,12 @@ const Xa = {
|
|
|
12117
12117
|
getConnectionStatus: Wt,
|
|
12118
12118
|
getNetworkStatus: Fw,
|
|
12119
12119
|
getSchema(t = !1) {
|
|
12120
|
-
const e =
|
|
12120
|
+
const e = ve(Lr);
|
|
12121
12121
|
if (t) {
|
|
12122
12122
|
for (const r of Object.values(e.collections))
|
|
12123
12123
|
for (const n of r.fields)
|
|
12124
12124
|
if (n.type === "Computed") {
|
|
12125
|
-
const s = kg(n,
|
|
12125
|
+
const s = kg(n, dt(r.labels.collection));
|
|
12126
12126
|
s.formula && (n.formula = s.formula);
|
|
12127
12127
|
}
|
|
12128
12128
|
} else
|
|
@@ -12134,16 +12134,16 @@ const Xa = {
|
|
|
12134
12134
|
return Im;
|
|
12135
12135
|
},
|
|
12136
12136
|
getCurrentUserRoleGroups() {
|
|
12137
|
-
return
|
|
12137
|
+
return ve(_c);
|
|
12138
12138
|
},
|
|
12139
12139
|
getAllRoleGroups() {
|
|
12140
|
-
return
|
|
12140
|
+
return ve(yc);
|
|
12141
12141
|
},
|
|
12142
12142
|
getGlobalConfigModule() {
|
|
12143
|
-
return
|
|
12143
|
+
return ve(ge);
|
|
12144
12144
|
},
|
|
12145
12145
|
getCollectionConfigModule(t) {
|
|
12146
|
-
return
|
|
12146
|
+
return ve(km[t]);
|
|
12147
12147
|
},
|
|
12148
12148
|
getVersionInfo: Rm,
|
|
12149
12149
|
getMaintenanceInfo: xw,
|
|
@@ -12166,17 +12166,17 @@ const Xa = {
|
|
|
12166
12166
|
return Ge.maintenance;
|
|
12167
12167
|
}
|
|
12168
12168
|
}, qw = () => {
|
|
12169
|
-
gc = "", Lr = {}, yc = {}, _c = {},
|
|
12169
|
+
gc = "", Lr = {}, yc = {}, _c = {}, Me = {}, dy(), _w(), Aw();
|
|
12170
12170
|
}, Lw = () => In, $w = () => {
|
|
12171
12171
|
In = [];
|
|
12172
12172
|
};
|
|
12173
|
-
let
|
|
12173
|
+
let bf = !1, Of = 0;
|
|
12174
12174
|
const tb = async (t, e, r, n) => {
|
|
12175
|
-
if (
|
|
12175
|
+
if (Oe = r, ht)
|
|
12176
12176
|
return console.error("Stoker is already initialized."), !0;
|
|
12177
|
-
Pm("stoker-client", vp, "web"), St =
|
|
12178
|
-
const s = JSON.parse(
|
|
12179
|
-
Pw(
|
|
12177
|
+
Pm("stoker-client", vp, "web"), St = Oe.MODE, ge = t.default({ sdk: "web", utils: Io, context: n }), Am = await ne(ge, ["global", "timezone"]), ne(ge, ["global", "roles"]), ne(ge, ["global", "appName"]), ne(ge, ["global", "auth", "enableMultiFactorAuth"]);
|
|
12178
|
+
const s = JSON.parse(Oe.STOKER_FB_WEB_APP_CONFIG);
|
|
12179
|
+
Pw(Oe.STOKER_FB_FIRESTORE_EDITION, s.projectId);
|
|
12180
12180
|
const i = Mw(), a = await ne(ge, ["global", "firebase", "GDPRSettings"]);
|
|
12181
12181
|
ht = Hn(s, {
|
|
12182
12182
|
automaticDataCollectionEnabled: a || !0
|
|
@@ -12187,12 +12187,12 @@ const tb = async (t, e, r, n) => {
|
|
|
12187
12187
|
for (const w of c)
|
|
12188
12188
|
Xa[`${w}App`] = Hn(s, w);
|
|
12189
12189
|
const { firestoreWriteApp: l } = Xa, u = Hn(s, "maintenance");
|
|
12190
|
-
Ge.maintenance = rn(u,
|
|
12191
|
-
const
|
|
12192
|
-
if (
|
|
12190
|
+
Ge.maintenance = rn(u, wf(), i);
|
|
12191
|
+
const d = yp();
|
|
12192
|
+
if (d.settings.minimumFetchIntervalMillis = 36e5, await _p(d), Oe.STOKER_FB_ENABLE_APP_CHECK === "true" && Oe.STOKER_FB_APP_CHECK_KEY) {
|
|
12193
12193
|
(St === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
|
|
12194
12194
|
const w = {
|
|
12195
|
-
provider: new pp(
|
|
12195
|
+
provider: new pp(Oe.STOKER_FB_APP_CHECK_KEY),
|
|
12196
12196
|
isTokenAutoRefreshEnabled: !0
|
|
12197
12197
|
};
|
|
12198
12198
|
Ct.main = Yn(ht, w), Ct.firestoreWrite = Yn(l, w), Ct.maintenance = Yn(u, w);
|
|
@@ -12200,7 +12200,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12200
12200
|
const m = (T, A) => {
|
|
12201
12201
|
if (console.log(`App Check token error detected for ${A}`), !I)
|
|
12202
12202
|
if (I = !0, ge.onAppCheckTokenFailure)
|
|
12203
|
-
|
|
12203
|
+
be(ge.onAppCheckTokenFailure, [T]);
|
|
12204
12204
|
else {
|
|
12205
12205
|
const L = sessionStorage.getItem("stoker-app-check-reload");
|
|
12206
12206
|
!L || new Date(L).getTime() < Date.now() - 3e5 ? (sessionStorage.setItem("stoker-app-check-reload", (/* @__PURE__ */ new Date()).toISOString()), window.location.reload()) : alert("For security reasons, please close this tab and wait a while before restarting it.");
|
|
@@ -12211,7 +12211,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12211
12211
|
}, (T) => m(T, "firestoreWrite")), Jn(Ct.maintenance, () => {
|
|
12212
12212
|
}, (T) => m(T, "maintenance"));
|
|
12213
12213
|
}
|
|
12214
|
-
const
|
|
12214
|
+
const f = await ne(ge, [
|
|
12215
12215
|
"global",
|
|
12216
12216
|
"firebase",
|
|
12217
12217
|
"enableAnalytics"
|
|
@@ -12240,7 +12240,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12240
12240
|
]), C = await qm().catch((w) => {
|
|
12241
12241
|
throw new Error("Error checking analytics support.", { cause: w });
|
|
12242
12242
|
});
|
|
12243
|
-
St === "production" &&
|
|
12243
|
+
St === "production" && f && C && Lm(ht, h || {}), p && $m(p);
|
|
12244
12244
|
const x = await ne(ge, [
|
|
12245
12245
|
"global",
|
|
12246
12246
|
"auth",
|
|
@@ -12254,7 +12254,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12254
12254
|
mt[w] = Sc(Xa[`${w}App`], E);
|
|
12255
12255
|
const { main: R } = mt;
|
|
12256
12256
|
Um(R, async (w) => {
|
|
12257
|
-
if (w && await
|
|
12257
|
+
if (w && await be(ge.preLogin, [w]) === !1)
|
|
12258
12258
|
throw new Error("Operation cancelled by preLogin");
|
|
12259
12259
|
});
|
|
12260
12260
|
const _ = await ne(ge, [
|
|
@@ -12264,31 +12264,31 @@ const tb = async (t, e, r, n) => {
|
|
|
12264
12264
|
]);
|
|
12265
12265
|
if (St === "development" && b) {
|
|
12266
12266
|
if (!_?.includes("Auth")) {
|
|
12267
|
-
const w =
|
|
12267
|
+
const w = Oe.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
|
|
12268
12268
|
for (const I of Object.values(mt))
|
|
12269
12269
|
Wm(I, `http://localhost:${w}`);
|
|
12270
12270
|
}
|
|
12271
12271
|
if (!_?.includes("Database")) {
|
|
12272
|
-
const w =
|
|
12273
|
-
Ym(
|
|
12272
|
+
const w = Oe.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
|
|
12273
|
+
Ym(Tf(), "localhost", w);
|
|
12274
12274
|
}
|
|
12275
12275
|
if (!_?.includes("Firestore")) {
|
|
12276
|
-
const w =
|
|
12276
|
+
const w = Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12277
12277
|
Ic(Ge.maintenance, "localhost", w);
|
|
12278
12278
|
}
|
|
12279
12279
|
if (!_?.includes("Storage")) {
|
|
12280
|
-
const w =
|
|
12281
|
-
|
|
12280
|
+
const w = Oe.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
|
|
12281
|
+
fp(hp(), "localhost", w);
|
|
12282
12282
|
}
|
|
12283
12283
|
if (!_?.includes("Functions")) {
|
|
12284
|
-
const w =
|
|
12285
|
-
mp(Ue(ht,
|
|
12284
|
+
const w = Oe.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
|
|
12285
|
+
mp(Ue(ht, Oe.STOKER_FB_FUNCTIONS_REGION), "localhost", w);
|
|
12286
12286
|
}
|
|
12287
12287
|
}
|
|
12288
12288
|
if (kw(), Iw(), Nw(), St === "development" && (O ? en(O) : en("debug")), St === "production" && (S ? en(S) : en("error")), g) {
|
|
12289
12289
|
const w = Kn(R, async (I) => {
|
|
12290
12290
|
if (I) {
|
|
12291
|
-
const m = JSON.parse(
|
|
12291
|
+
const m = JSON.parse(Oe.STOKER_FB_WEB_APP_CONFIG);
|
|
12292
12292
|
Mm(() => {
|
|
12293
12293
|
console.log(`Tenant - ${m.projectId} - User - ${I.uid}`);
|
|
12294
12294
|
});
|
|
@@ -12304,15 +12304,19 @@ const tb = async (t, e, r, n) => {
|
|
|
12304
12304
|
w.currentUser || (N = !0);
|
|
12305
12305
|
let v;
|
|
12306
12306
|
return Kn(R, async (w) => {
|
|
12307
|
-
|
|
12307
|
+
if (w && Me?.uid && w.uid !== Me.uid) {
|
|
12308
|
+
window.location.reload();
|
|
12309
|
+
return;
|
|
12310
|
+
}
|
|
12311
|
+
const I = ++Of, m = () => I !== Of;
|
|
12308
12312
|
if (w) {
|
|
12309
|
-
|
|
12310
|
-
const T = await zm(
|
|
12313
|
+
Me = w;
|
|
12314
|
+
const T = await zm(Me);
|
|
12311
12315
|
if (m())
|
|
12312
12316
|
return;
|
|
12313
12317
|
const { claims: A } = T;
|
|
12314
12318
|
gc = A.tenant, Im = {
|
|
12315
|
-
...
|
|
12319
|
+
...Me,
|
|
12316
12320
|
token: {
|
|
12317
12321
|
claims: A
|
|
12318
12322
|
}
|
|
@@ -12326,8 +12330,8 @@ const tb = async (t, e, r, n) => {
|
|
|
12326
12330
|
}));
|
|
12327
12331
|
if (await Promise.all(L), m())
|
|
12328
12332
|
return;
|
|
12329
|
-
|
|
12330
|
-
const k = await ne(ge, ["global", "auth", "tabManager"], [
|
|
12333
|
+
bf || (Dw(ge), bf = !0), v = await ne(ge, ["global", "auth", "offlinePersistenceType"], [Me, A]);
|
|
12334
|
+
const k = await ne(ge, ["global", "auth", "tabManager"], [Me, A]), M = await ne(ge, ["global", "auth", "garbageCollectionStrategy"], [Me, A]), F = await ne(ge, ["global", "auth", "maxCacheSize"], [Me, A]) || -1, Z = await ne(ge, ["global", "auth", "maxWriteCacheSize"], [Me, A]);
|
|
12331
12335
|
if (m())
|
|
12332
12336
|
return;
|
|
12333
12337
|
let re;
|
|
@@ -12348,7 +12352,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12348
12352
|
garbageCollector: V
|
|
12349
12353
|
})
|
|
12350
12354
|
};
|
|
12351
|
-
const K =
|
|
12355
|
+
const K = wf();
|
|
12352
12356
|
if (Ge.main = rn(ht, {
|
|
12353
12357
|
...re,
|
|
12354
12358
|
...K
|
|
@@ -12359,7 +12363,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12359
12363
|
...re,
|
|
12360
12364
|
...K
|
|
12361
12365
|
}, i), St === "development" && b && !_?.includes("Firestore")) {
|
|
12362
|
-
const q =
|
|
12366
|
+
const q = Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12363
12367
|
for (const [Y, U] of Object.entries(Ge))
|
|
12364
12368
|
Y !== "maintenance" && Ic(U, "localhost", q);
|
|
12365
12369
|
}
|
|
@@ -12367,7 +12371,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12367
12371
|
const q = ap(Ge.main);
|
|
12368
12372
|
q && op(q);
|
|
12369
12373
|
}
|
|
12370
|
-
const Te = await Je(Ue(ht,
|
|
12374
|
+
const Te = await Je(Ue(ht, Oe.STOKER_FB_FUNCTIONS_REGION), "stoker-schema")().catch((q) => {
|
|
12371
12375
|
throw new Error("Error fetching schema.", { cause: q });
|
|
12372
12376
|
});
|
|
12373
12377
|
if (m())
|
|
@@ -12375,12 +12379,12 @@ const tb = async (t, e, r, n) => {
|
|
|
12375
12379
|
Lr = Te.data.schema;
|
|
12376
12380
|
const Xe = Object.entries(Te.data.allRoleGroups).map(([q, Y]) => [q, new Set(Y)]);
|
|
12377
12381
|
yc = Object.fromEntries(Xe), _c = Te.data.currentUserRoleGroups, km = Ag(Object.keys(Lr.collections), e, "web", Io, n);
|
|
12378
|
-
const bt = await yw(
|
|
12379
|
-
if (m() || (In.push(...bt), v === "WRITE" && Cw(Lr,
|
|
12382
|
+
const bt = await yw(Me, T);
|
|
12383
|
+
if (m() || (In.push(...bt), v === "WRITE" && Cw(Lr, Me), await be(ge.postLogin, [Me]), m()))
|
|
12380
12384
|
return;
|
|
12381
12385
|
const br = new Event("stoker:ready");
|
|
12382
12386
|
document.dispatchEvent(br);
|
|
12383
|
-
} else if (
|
|
12387
|
+
} else if (Me) {
|
|
12384
12388
|
qw(), Lw().forEach((M) => {
|
|
12385
12389
|
M();
|
|
12386
12390
|
}), $w();
|
|
@@ -12388,7 +12392,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12388
12392
|
document.dispatchEvent(A);
|
|
12389
12393
|
const L = { error: !1, instances: [] };
|
|
12390
12394
|
await Promise.all(Object.values(mt).map(async (M) => {
|
|
12391
|
-
M.currentUser && await
|
|
12395
|
+
M.currentUser && await Sf(M).catch((F) => {
|
|
12392
12396
|
L.error = !0, L.instances.push({
|
|
12393
12397
|
instance: M.app.name,
|
|
12394
12398
|
code: "SIGN_OUT",
|
|
@@ -12411,10 +12415,10 @@ const tb = async (t, e, r, n) => {
|
|
|
12411
12415
|
console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), L.error = !0, L.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error: M });
|
|
12412
12416
|
}), ["ALL", "WRITE"].includes(v) && await Dc(Ge.firestoreWrite).catch((M) => {
|
|
12413
12417
|
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), L.error = !0, L.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: M });
|
|
12414
|
-
})), L.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await
|
|
12418
|
+
})), L.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await be(ge.postLogout, [L]);
|
|
12415
12419
|
}
|
|
12416
12420
|
}), N ? !1 : R.currentUser ? (g && console.info(`${R.currentUser.uid} successfully logged in.`), !0) : !1;
|
|
12417
|
-
}, { getTenant: Dt, getEnv: Be, getTimezone: xm, getSchema: We, getCurrentUser: rb, getCurrentUserRoleGroups: Xr, getAllRoleGroups: vc, getGlobalConfigModule: Ie, getCollectionConfigModule:
|
|
12421
|
+
}, { getTenant: Dt, getEnv: Be, getTimezone: xm, getSchema: We, getCurrentUser: rb, getCurrentUserRoleGroups: Xr, getAllRoleGroups: vc, getGlobalConfigModule: Ie, getCollectionConfigModule: dt, getAppCheck: nb, getAppCheckFirestoreWrite: sb, getFirestoreWriteAuth: jw, getFirestoreWrite: wc, getFirestoreMaintenance: Nm } = Io, ib = async (t, e, r) => {
|
|
12418
12422
|
const [n, s] = [hr(), jw()], i = Ie();
|
|
12419
12423
|
if (!t || !e)
|
|
12420
12424
|
throw new Error("Email and password are required.");
|
|
@@ -12437,19 +12441,19 @@ const tb = async (t, e, r, n) => {
|
|
|
12437
12441
|
throw c;
|
|
12438
12442
|
}
|
|
12439
12443
|
if (!s.currentUser) {
|
|
12440
|
-
const c = it(), l = Be(), u = Ue(c, l.STOKER_FB_FUNCTIONS_REGION),
|
|
12444
|
+
const c = it(), l = Be(), u = Ue(c, l.STOKER_FB_FUNCTIONS_REGION), d = Je(u, "stoker-customtoken");
|
|
12441
12445
|
try {
|
|
12442
|
-
const h = (await
|
|
12446
|
+
const h = (await d()).data.customToken;
|
|
12443
12447
|
if (!h)
|
|
12444
12448
|
throw new Error("The user is not authenticated.");
|
|
12445
12449
|
await Gm(s, h);
|
|
12446
12450
|
} catch {
|
|
12447
|
-
throw n && n.currentUser && await
|
|
12451
|
+
throw n && n.currentUser && await Sf(n), new Error("The user is not authenticated.");
|
|
12448
12452
|
}
|
|
12449
12453
|
}
|
|
12450
12454
|
console.info(`${a} successfully logged in.`);
|
|
12451
12455
|
} catch (a) {
|
|
12452
|
-
throw await
|
|
12456
|
+
throw await be(i.postLogin, [null, a]), a;
|
|
12453
12457
|
}
|
|
12454
12458
|
}, ab = (t) => (document.addEventListener("stoker:ready", t), () => {
|
|
12455
12459
|
document.removeEventListener("stoker:ready", t);
|
|
@@ -12488,7 +12492,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12488
12492
|
collectionPath: e.Collection_Path,
|
|
12489
12493
|
folderName: r
|
|
12490
12494
|
});
|
|
12491
|
-
},
|
|
12495
|
+
}, db = async () => {
|
|
12492
12496
|
const t = [ze(), wc()];
|
|
12493
12497
|
for (const e of Object.values(t))
|
|
12494
12498
|
await lp(e).catch((r) => {
|
|
@@ -12501,27 +12505,27 @@ const tb = async (t, e, r, n) => {
|
|
|
12501
12505
|
const a = Pe();
|
|
12502
12506
|
if (!a?.Role)
|
|
12503
12507
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
12504
|
-
const o = We(!0), l = Xr()[i], u = ze(),
|
|
12505
|
-
if (!
|
|
12508
|
+
const o = We(!0), l = Xr()[i], u = ze(), d = o.collections[i];
|
|
12509
|
+
if (!d)
|
|
12506
12510
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12507
|
-
const { labels:
|
|
12511
|
+
const { labels: f, preloadCache: h } = d, p = Ie(), b = Object.keys(o.collections).includes(i), g = p.disabledCollections?.includes(i);
|
|
12508
12512
|
if (!b || g)
|
|
12509
12513
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12510
|
-
const O =
|
|
12514
|
+
const O = dt(f.collection), S = await ne(p, [
|
|
12511
12515
|
"global",
|
|
12512
12516
|
"firebase",
|
|
12513
12517
|
"serverTimestampOptions"
|
|
12514
12518
|
]), C = gm(t, e, l);
|
|
12515
12519
|
if (C.length === 0)
|
|
12516
12520
|
throw new Error("PERMISSION_DENIED");
|
|
12517
|
-
const x = h?.roles?.includes(a.Role), y = { collection:
|
|
12521
|
+
const x = h?.roles?.includes(a.Role), y = { collection: f.collection };
|
|
12518
12522
|
await ie("preOperation", p, O, { operation: "read", recordId: e, context: y }), await ie("preRead", p, O, { context: y, refs: C, multiple: !1, listener: !0 });
|
|
12519
12523
|
const _ = /* @__PURE__ */ new Map(), N = [];
|
|
12520
12524
|
let v = {};
|
|
12521
12525
|
const w = /* @__PURE__ */ new Map();
|
|
12522
12526
|
typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((k) => {
|
|
12523
12527
|
if (typeof k == "string") {
|
|
12524
|
-
const M =
|
|
12528
|
+
const M = d.fields.find((F) => F.name === k);
|
|
12525
12529
|
if (M)
|
|
12526
12530
|
return M;
|
|
12527
12531
|
throw new Error(`SCHEMA_ERROR: Field ${k} not found in collection ${i}`);
|
|
@@ -12529,28 +12533,28 @@ const tb = async (t, e, r, n) => {
|
|
|
12529
12533
|
return k;
|
|
12530
12534
|
}));
|
|
12531
12535
|
const I = () => {
|
|
12532
|
-
const k =
|
|
12536
|
+
const k = kf(u, async () => {
|
|
12533
12537
|
if (k(), v) {
|
|
12534
12538
|
if (mm(v, w), !s?.noComputedFields) {
|
|
12535
12539
|
const M = [];
|
|
12536
|
-
for (const F of
|
|
12537
|
-
F.type === "Computed" && M.push(
|
|
12540
|
+
for (const F of d.fields)
|
|
12541
|
+
F.type === "Computed" && M.push(be(() => F.formula(v)).then((Z) => {
|
|
12538
12542
|
v && (v[F.name] = Z);
|
|
12539
12543
|
}));
|
|
12540
12544
|
await Promise.all(M);
|
|
12541
12545
|
}
|
|
12542
12546
|
if (s?.noEmbeddingFields)
|
|
12543
|
-
for (const M of
|
|
12547
|
+
for (const M of d.fields)
|
|
12544
12548
|
M.type === "Embedding" && delete v[M.name];
|
|
12545
12549
|
}
|
|
12546
|
-
r(
|
|
12550
|
+
r(ve(v));
|
|
12547
12551
|
});
|
|
12548
|
-
}, m = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), A = (k) => typeof k == "object" ? k.fields.filter((F) => typeof F == "object" &&
|
|
12552
|
+
}, m = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), A = (k) => typeof k == "object" ? k.fields.filter((F) => typeof F == "object" && we(F) && $t(d, o, a).includes(F.collection)) : d.fields.filter((F) => we(F) && $t(d, o, a).includes(F.collection)), L = (k) => new Promise((M) => {
|
|
12549
12553
|
if (!s?.relations) {
|
|
12550
12554
|
M({});
|
|
12551
12555
|
return;
|
|
12552
12556
|
}
|
|
12553
|
-
const F =
|
|
12557
|
+
const F = ve(s.relations), Z = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), oe = A(F);
|
|
12554
12558
|
for (const z of oe)
|
|
12555
12559
|
for (const V of T.values())
|
|
12556
12560
|
V.type === z.type && V.field === z.name && // eslint-disable-next-line security/detect-object-injection
|
|
@@ -12712,17 +12716,17 @@ const tb = async (t, e, r, n) => {
|
|
|
12712
12716
|
if (r?.id !== e)
|
|
12713
12717
|
throw new Error("INPUT_ERROR: Mismatched last cursor IDs");
|
|
12714
12718
|
});
|
|
12715
|
-
},
|
|
12719
|
+
}, fb = async (t, e, r, n) => {
|
|
12716
12720
|
const s = n?.constraints, i = t.at(-1);
|
|
12717
12721
|
if (!i)
|
|
12718
12722
|
throw new Error("EMPTY_PATH");
|
|
12719
12723
|
const a = Pe();
|
|
12720
12724
|
if (!a?.Role)
|
|
12721
12725
|
throw new Error("PERMISSION_DENIED");
|
|
12722
|
-
const o = We(!0), l = Xr()[i], u = ze(),
|
|
12726
|
+
const o = We(!0), l = Xr()[i], u = ze(), d = o.collections[i], { labels: f, preloadCache: h, access: p } = d, { serverReadOnly: b } = p, g = Ie(), O = Object.keys(o.collections).includes(i), S = g.disabledCollections?.includes(i);
|
|
12723
12727
|
if (!O || S)
|
|
12724
12728
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12725
|
-
const C =
|
|
12729
|
+
const C = dt(f.collection), x = await ne(g, [
|
|
12726
12730
|
"global",
|
|
12727
12731
|
"firebase",
|
|
12728
12732
|
"serverTimestampOptions"
|
|
@@ -12744,7 +12748,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12744
12748
|
if (n?.pagination) {
|
|
12745
12749
|
if (n.pagination.startAfter && n.pagination.endBefore || n.pagination.startAfter && n.pagination.endAt || n.pagination.startAfter && n.pagination.startAt || n.pagination.startAt && n.pagination.endBefore || n.pagination.startAt && n.pagination.endAt || n.pagination.endBefore && n.pagination.endAt)
|
|
12746
12750
|
throw new Error("INPUT_ERROR: Only one of startAfter, startAt, endBefore, or endAt can be provided");
|
|
12747
|
-
const q = n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt, Y =
|
|
12751
|
+
const q = n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt, Y = Zf(a.Role, d, o);
|
|
12748
12752
|
if (q && Y !== !0)
|
|
12749
12753
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + Y);
|
|
12750
12754
|
n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt ? n.pagination.startAfter ? (to(n.pagination.startAfter), R = R.map((U, H) => {
|
|
@@ -12765,22 +12769,22 @@ const tb = async (t, e, r, n) => {
|
|
|
12765
12769
|
})) : n.pagination.endAt && (to(n.pagination.endAt), R = R.map((U, H) => {
|
|
12766
12770
|
if (!n.pagination?.orderByField || !n.pagination.orderByDirection)
|
|
12767
12771
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
|
|
12768
|
-
let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection),
|
|
12772
|
+
let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection), dp(N.last.get(H)));
|
|
12769
12773
|
return n.pagination.number && (D = he(D, Dr(n.pagination.number))), D;
|
|
12770
12774
|
})) : R = R.map((U) => {
|
|
12771
12775
|
let H = he(U);
|
|
12772
12776
|
return n.pagination?.orderByField && n.pagination.orderByDirection && (H = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection))), n.pagination.number && (H = he(H, er(n.pagination.number))), H;
|
|
12773
12777
|
});
|
|
12774
12778
|
}
|
|
12775
|
-
const v = { collection:
|
|
12779
|
+
const v = { collection: f.collection };
|
|
12776
12780
|
await ie("preOperation", g, C, { operation: "read", context: v }), await ie("preRead", g, C, { context: v, refs: R, multiple: !0, listener: !0 });
|
|
12777
12781
|
let m = !0;
|
|
12778
12782
|
const T = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), L = [], k = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), Z = (q, Y, U) => {
|
|
12779
12783
|
const H = [];
|
|
12780
12784
|
k.forEach((D) => {
|
|
12781
12785
|
mm(D, M.get(D.id));
|
|
12782
|
-
for (const ue of
|
|
12783
|
-
ue.type === "Computed" && !n?.noComputedFields && H.push(
|
|
12786
|
+
for (const ue of d.fields)
|
|
12787
|
+
ue.type === "Computed" && !n?.noComputedFields && H.push(be(ue.formula, [D, U]).then((X) => {
|
|
12784
12788
|
D[ue.name] = X;
|
|
12785
12789
|
})), n?.noEmbeddingFields && ue.type === "Embedding" && delete D[ue.name];
|
|
12786
12790
|
}), Promise.all(H).then(() => {
|
|
@@ -12801,8 +12805,8 @@ const tb = async (t, e, r, n) => {
|
|
|
12801
12805
|
D === "loaded" || D === "deleted" || (U = !1);
|
|
12802
12806
|
}), T.size === _.length && U) {
|
|
12803
12807
|
m = !1;
|
|
12804
|
-
const H =
|
|
12805
|
-
H(), !n?.noComputedFields && C?.admin?.retriever ?
|
|
12808
|
+
const H = kf(u, () => {
|
|
12809
|
+
H(), !n?.noComputedFields && C?.admin?.retriever ? be(C.admin.retriever).then((D) => {
|
|
12806
12810
|
Z(q, Y, D);
|
|
12807
12811
|
}) : Z(q, Y);
|
|
12808
12812
|
});
|
|
@@ -12810,7 +12814,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12810
12814
|
};
|
|
12811
12815
|
typeof n?.relations == "object" && (n.relations.fields = n.relations.fields.map((q) => {
|
|
12812
12816
|
if (typeof q == "string") {
|
|
12813
|
-
const Y =
|
|
12817
|
+
const Y = d.fields.find((U) => U.name === q);
|
|
12814
12818
|
if (Y)
|
|
12815
12819
|
return Y;
|
|
12816
12820
|
throw new Error(`SCHEMA_ERROR: Field ${q} not found in collection ${i}`);
|
|
@@ -12822,13 +12826,13 @@ const tb = async (t, e, r, n) => {
|
|
|
12822
12826
|
return;
|
|
12823
12827
|
const U = q.id;
|
|
12824
12828
|
A.set(U, "loading"), z[U] ||= /* @__PURE__ */ new Map();
|
|
12825
|
-
const H =
|
|
12829
|
+
const H = ve(n?.relations), D = typeof H == "object" ? H.fields.filter((pe) => typeof pe == "object" && we(pe) && $t(d, o, a).includes(pe.collection)) : d.fields.filter((pe) => we(pe) && $t(d, o, a).includes(pe.collection)), ue = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
|
|
12826
12830
|
oe[U] ||= /* @__PURE__ */ new Map();
|
|
12827
12831
|
for (const pe of D)
|
|
12828
12832
|
for (const _e of z[U].entries()) {
|
|
12829
|
-
const [ae,
|
|
12830
|
-
|
|
12831
|
-
!q[pe.name][ae]) && (
|
|
12833
|
+
const [ae, $e] = _e;
|
|
12834
|
+
$e.doc === U && $e.type === pe.type && $e.field === pe.name && (!k.has(U) || // eslint-disable-next-line security/detect-object-injection
|
|
12835
|
+
!q[pe.name][ae]) && ($e.listener(), oe[U].delete(ae));
|
|
12832
12836
|
}
|
|
12833
12837
|
for (const pe of D)
|
|
12834
12838
|
if ("collection" in pe) {
|
|
@@ -12846,15 +12850,15 @@ const tb = async (t, e, r, n) => {
|
|
|
12846
12850
|
const _e = q[pe.name];
|
|
12847
12851
|
if (!_e)
|
|
12848
12852
|
continue;
|
|
12849
|
-
for (const [ae,
|
|
12853
|
+
for (const [ae, $e] of Object.entries(_e))
|
|
12850
12854
|
if (X.has(ae)) {
|
|
12851
|
-
const
|
|
12852
|
-
_e[ae].id ? (ue.set(ae, !0), Array.from(ue.values()).every((ke) => ke) && A.set(U, "loaded")) : setTimeout(
|
|
12855
|
+
const je = async () => {
|
|
12856
|
+
_e[ae].id ? (ue.set(ae, !0), Array.from(ue.values()).every((ke) => ke) && A.set(U, "loaded")) : setTimeout(je, 100);
|
|
12853
12857
|
};
|
|
12854
|
-
|
|
12858
|
+
je();
|
|
12855
12859
|
} else {
|
|
12856
|
-
const
|
|
12857
|
-
Gt?.includes(a.Role) ? wr([
|
|
12860
|
+
const je = o.collections[pe.collection], { access: ke } = je, { serverReadOnly: Gt } = ke;
|
|
12861
|
+
Gt?.includes(a.Role) ? wr([...$e.Collection_Path], ae).then((Ne) => {
|
|
12858
12862
|
if (!Ne) {
|
|
12859
12863
|
delete _e[ae];
|
|
12860
12864
|
return;
|
|
@@ -12865,11 +12869,11 @@ const tb = async (t, e, r, n) => {
|
|
|
12865
12869
|
}
|
|
12866
12870
|
_e[ae] = Ne, ue.set(ae, !0), Array.from(ue.values()).every((Ht) => Ht) && (A.set(U, "loaded"), re(Y));
|
|
12867
12871
|
}).catch((Ne) => {
|
|
12868
|
-
delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${
|
|
12872
|
+
delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${$e.Collection_Path?.join("/")}`, {
|
|
12869
12873
|
cause: Ne
|
|
12870
12874
|
}));
|
|
12871
12875
|
}) : Fm(
|
|
12872
|
-
[
|
|
12876
|
+
[...$e.Collection_Path],
|
|
12873
12877
|
ae,
|
|
12874
12878
|
(Ne) => {
|
|
12875
12879
|
if (!Ne) {
|
|
@@ -12884,7 +12888,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12884
12888
|
},
|
|
12885
12889
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12886
12890
|
(Ne) => {
|
|
12887
|
-
delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${
|
|
12891
|
+
delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${$e.Collection_Path?.join("/")}`, {
|
|
12888
12892
|
cause: Ne
|
|
12889
12893
|
}));
|
|
12890
12894
|
},
|
|
@@ -12904,7 +12908,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12904
12908
|
}
|
|
12905
12909
|
}
|
|
12906
12910
|
}, K = (q) => {
|
|
12907
|
-
const Y =
|
|
12911
|
+
const Y = ve(n?.relations), U = typeof Y == "object" ? Y.fields.filter((H) => typeof H == "object" && we(H) && $t(d, o, a).includes(H.collection)) : d.fields.filter((H) => we(H) && $t(d, o, a).includes(H.collection));
|
|
12908
12912
|
for (const H of U)
|
|
12909
12913
|
if (z[q])
|
|
12910
12914
|
for (const D of z[q].entries()) {
|
|
@@ -12919,7 +12923,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12919
12923
|
const D = M.get(U.id) || /* @__PURE__ */ new Map(), ue = D.get(q) || /* @__PURE__ */ new Set();
|
|
12920
12924
|
hm(H, ue), D.set(q, ue), M.set(U.id, D), k.set(U.id, Y);
|
|
12921
12925
|
}, Te = n?.only === "cache" || y && n?.only !== "default";
|
|
12922
|
-
if (y && n?.tempCache && await ir(
|
|
12926
|
+
if (y && n?.tempCache && await ir(f.collection, n.tempCache?.constraints, void 0, void 0, void 0, n.tempCache?.label), n?.multipleQueries) {
|
|
12923
12927
|
const q = [];
|
|
12924
12928
|
for (const Y of n.multipleQueries)
|
|
12925
12929
|
q.push(he(R[0], ...Y));
|
|
@@ -12947,7 +12951,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12947
12951
|
if (n?.pagination && !h?.roles.includes(a.Role) && !b?.includes(a.Role)) {
|
|
12948
12952
|
let q = he(E[0], ...s || []);
|
|
12949
12953
|
n.pagination.orderByField && n.pagination.orderByDirection && (q = he(q, rt(n.pagination.orderByField, n.pagination.orderByDirection)));
|
|
12950
|
-
const Y = await
|
|
12954
|
+
const Y = await Af(q).catch(() => {
|
|
12951
12955
|
});
|
|
12952
12956
|
if (Y) {
|
|
12953
12957
|
Xe = Y.data().count;
|
|
@@ -12980,10 +12984,10 @@ const tb = async (t, e, r, n) => {
|
|
|
12980
12984
|
await Vw(e, r, n, s, i, a);
|
|
12981
12985
|
return;
|
|
12982
12986
|
}
|
|
12983
|
-
const
|
|
12987
|
+
const d = Ja(t), f = hw(e), h = r ? _f(r) : void 0, p = n ? _f(n) : void 0, b = s ? Ja(s) : void 0, g = i ? Ja(i) : void 0, O = a ? An(a) : void 0, S = c ? An(c) : void 0, C = Array.isArray(d) ? d : [d];
|
|
12984
12988
|
if (C.length === 0 || C.length === 1 && !C[0])
|
|
12985
12989
|
throw new Error("No valid email addresses provided");
|
|
12986
|
-
const x = ze(), y = { to:
|
|
12990
|
+
const x = ze(), y = { to: d, message: { subject: f } };
|
|
12987
12991
|
if (h && (y.message.text = h), p && (y.message.html = p), b) {
|
|
12988
12992
|
const E = Array.isArray(b) ? b : [b];
|
|
12989
12993
|
E.length > 0 && E[0] && (y.cc = b);
|
|
@@ -12992,7 +12996,7 @@ const tb = async (t, e, r, n) => {
|
|
|
12992
12996
|
const E = Array.isArray(g) ? g : [g];
|
|
12993
12997
|
E.length > 0 && E[0] && (y.bcc = g);
|
|
12994
12998
|
}
|
|
12995
|
-
O && (y.replyTo = O), o && (y.message.attachments = o), S && (y.from = S), await
|
|
12999
|
+
O && (y.replyTo = O), o && (y.message.attachments = o), S && (y.from = S), await If($r(x, "system_mail"), y);
|
|
12996
13000
|
}, Uw = async (t) => {
|
|
12997
13001
|
const e = it(), r = Be(), n = Ue(e, r.STOKER_FB_FUNCTIONS_REGION);
|
|
12998
13002
|
await Je(n, "stoker-adminsms")({
|
|
@@ -13004,7 +13008,7 @@ const tb = async (t, e, r, n) => {
|
|
|
13004
13008
|
return;
|
|
13005
13009
|
}
|
|
13006
13010
|
const s = ze(), i = { to: t, body: e };
|
|
13007
|
-
await
|
|
13011
|
+
await If($r(s, "system_messages"), i);
|
|
13008
13012
|
}, gb = (t) => {
|
|
13009
13013
|
const e = xm();
|
|
13010
13014
|
return G.fromJSDate(t).setZone(e);
|
|
@@ -13035,7 +13039,7 @@ export {
|
|
|
13035
13039
|
nb as getAppCheck,
|
|
13036
13040
|
sb as getAppCheckFirestoreWrite,
|
|
13037
13041
|
ne as getCachedConfigValue,
|
|
13038
|
-
|
|
13042
|
+
dt as getCollectionConfigModule,
|
|
13039
13043
|
uc as getCollectionRefs,
|
|
13040
13044
|
Wt as getConnectionStatus,
|
|
13041
13045
|
rb as getCurrentUser,
|
|
@@ -13079,10 +13083,10 @@ export {
|
|
|
13079
13083
|
pb as sendMessage,
|
|
13080
13084
|
Om as serializeTimestamps,
|
|
13081
13085
|
Cm as signOut,
|
|
13082
|
-
|
|
13086
|
+
fb as subscribeMany,
|
|
13083
13087
|
Fm as subscribeOne,
|
|
13084
|
-
|
|
13088
|
+
be as tryPromise,
|
|
13085
13089
|
mc as updateRecord,
|
|
13086
13090
|
Ow as updateRecordServer,
|
|
13087
|
-
|
|
13091
|
+
db as waitForPendingWrites
|
|
13088
13092
|
};
|