@stoker-platform/node-client 0.5.66 → 0.5.68

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 CHANGED
@@ -2,16 +2,16 @@ import He from "lodash/isEqual.js";
2
2
  import Zo from "lodash/merge.js";
3
3
  import zo from "lodash/set.js";
4
4
  import fe from "lodash/cloneDeep.js";
5
- import { getApp as ni, initializeApp as si, applicationDefault as ri } from "firebase-admin/app";
6
- import { getFirestore as ce, Timestamp as ut, FieldValue as he } from "firebase-admin/firestore";
5
+ import { getApp as Ls, initializeApp as si, applicationDefault as ri } from "firebase-admin/app";
6
+ import { getFirestore as qo, Timestamp as ut, FieldValue as he } from "firebase-admin/firestore";
7
7
  import { pathToFileURL as ii } from "node:url";
8
- import qo from "cross-spawn";
8
+ import Bo from "cross-spawn";
9
9
  import { getDatabase as oi } from "firebase-admin/database";
10
10
  import { getAuth as Et } from "firebase-admin/auth";
11
11
  const zn = (n) => !!n.auth, Se = (n, e) => {
12
12
  if (e?.operations)
13
13
  return e.operations.includes(n);
14
- }, qn = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0, Bo = (n, e) => e ? !e.Role || n.restrictCreate === !0 ? !1 : typeof n.restrictCreate == "object" ? n.restrictCreate?.includes(e.Role) : !0 : !0, ai = (n, e) => e ? !e.Role || n.restrictUpdate === !0 ? !1 : typeof n.restrictUpdate == "object" ? n.restrictUpdate?.includes(e.Role) : !0 : !0, rr = (n, e, t) => {
14
+ }, qn = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0, Ho = (n, e) => e ? !e.Role || n.restrictCreate === !0 ? !1 : typeof n.restrictCreate == "object" ? n.restrictCreate?.includes(e.Role) : !0 : !0, ai = (n, e) => e ? !e.Role || n.restrictUpdate === !0 ? !1 : typeof n.restrictUpdate == "object" ? n.restrictUpdate?.includes(e.Role) : !0 : !0, ir = (n, e, t) => {
15
15
  const { labels: s } = n;
16
16
  return t.collections && // eslint-disable-next-line security/detect-object-injection
17
17
  Se("Update", t.collections[s.collection]) && (!e.access || qn(e, t)) && ai(e, t) && !(n.auth && !t.collections?.[s.collection].auth && ["Enabled", "Role", "Name", "Email", "Photo_URL"].includes(e.name));
@@ -27,7 +27,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
27
27
  c.role === e.Role && (!c.assignable || d?.active) && s.push(l);
28
28
  });
29
29
  }), s;
30
- }, Ls = (n, e) => {
30
+ }, Vs = (n, e) => {
31
31
  const t = [], { labels: s, access: r } = n, { entityRestrictions: i } = r, o = e.collections?.[s.collection];
32
32
  return i?.restrictions?.forEach((a) => {
33
33
  "roles" in a && a.roles.forEach((l) => {
@@ -62,14 +62,14 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
62
62
  !i.find((m) => m.field === c.field) && c.roles.includes(t.Role) && i.push(c);
63
63
  }
64
64
  return i;
65
- }, Ho = (n, e, t, s, r, i, o) => {
65
+ }, Go = (n, e, t, s, r, i, o) => {
66
66
  const { fields: a } = e, l = r.collections?.[e.labels.collection];
67
67
  let c = !0;
68
68
  if (!l) {
69
69
  c = !1;
70
70
  return;
71
71
  }
72
- const d = li(e, r), m = Ls(e, r), u = ci(e, t, r);
72
+ const d = li(e, r), m = Vs(e, r), u = ci(e, t, r);
73
73
  d?.filter((E) => E.type === "Record_Owner").forEach((E) => {
74
74
  "operations" in E && E.operations && !E.operations.includes(n) || i.Created_By !== s && (c = !1);
75
75
  }), d?.filter((E) => E.type === "Record_User").forEach((E) => {
@@ -97,7 +97,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
97
97
  const C = U(a, E.collectionField), _ = U(a, E.propertyField);
98
98
  Object.entries(l?.parentPropertyEntities || {}).some((z) => {
99
99
  const [k, p] = z;
100
- return k === i[_.name] && i[`${C.name}_Array`].some(($) => p.includes($));
100
+ return k === i[_.name] && i[`${C.name}_Array`].some((F) => p.includes(F));
101
101
  }) || (v = !1);
102
102
  }), g && y) {
103
103
  if (!(f || v)) {
@@ -134,8 +134,8 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
134
134
  c = !1;
135
135
  return;
136
136
  }
137
- Object.entries(p.parentPropertyEntities || {}).some(($) => {
138
- const [A, j] = $;
137
+ Object.entries(p.parentPropertyEntities || {}).some((F) => {
138
+ const [A, j] = F;
139
139
  return A === i[z.name] && i[`${k.name}_Array`].some((h) => j.includes(h));
140
140
  }) || (O = !1);
141
141
  }), R && I) {
@@ -154,14 +154,14 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
154
154
  if (!a || !r.Role)
155
155
  return l = !1, l;
156
156
  Se(n, a) || (l = !1);
157
- const d = Ls(e, r)?.filter((m) => m.type === "Individual").length > 0;
158
- return n === "Create" && d && (l = !1), Ho(n, e, t, s, r, i) || (l = !1), l;
157
+ const d = Vs(e, r)?.filter((m) => m.type === "Individual").length > 0;
158
+ return n === "Create" && d && (l = !1), Go(n, e, t, s, r, i) || (l = !1), l;
159
159
  }, di = (n, e, t) => {
160
160
  const { labels: s } = n, r = [];
161
161
  for (const i of Object.values(e.collections))
162
162
  ;
163
163
  return r;
164
- }, Go = (n, e) => {
164
+ }, Yo = (n, e) => {
165
165
  let t = !0, s = "";
166
166
  return Object.keys(e).forEach((r) => {
167
167
  if (!["Doc_ID", "Role", "Collection", "Enabled", "collections"].includes(r)) {
@@ -248,7 +248,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
248
248
  });
249
249
  }
250
250
  }), s && console.error(`PERMISSION_DENIED: ${s}`)), t;
251
- }, Yo = (n, e, t) => {
251
+ }, Jo = (n, e, t) => {
252
252
  let s = !0, r = "";
253
253
  Object.values(n.collections).filter((i) => i.auth).forEach((i) => {
254
254
  if (e.collections?.[i.labels.collection]?.auth && !i.access.auth?.includes(e.Role)) {
@@ -335,7 +335,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
335
335
  }
336
336
  }
337
337
  return r && console.error(`PERMISSION_DENIED: ${r}`), s;
338
- }, Jo = (n, e, t, s, r, i, o, a, l) => {
338
+ }, Qo = (n, e, t, s, r, i, o, a, l) => {
339
339
  const { access: c } = e, { permissionWriteRestrictions: d } = c;
340
340
  let m = !0, u = "";
341
341
  const f = d?.filter((g) => s === g.userRole);
@@ -379,7 +379,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
379
379
  }
380
380
  });
381
381
  }), u && console.error(`PERMISSION_DENIED: ${u}`), m);
382
- }, Qo = (n, e, t, s) => {
382
+ }, Ko = (n, e, t, s) => {
383
383
  let r = !0, i = "";
384
384
  return Object.values(n.collections).forEach((o) => {
385
385
  const a = t.collections?.[o.labels.collection], l = s?.collections?.[o.labels.collection], c = e?.collections?.[o.labels.collection];
@@ -409,7 +409,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
409
409
  return;
410
410
  }
411
411
  }), i && console.error(`PERMISSION_DENIED: ${i}`), r;
412
- }, Vs = (n, e, t, s, r, i, o, a, l, c, d) => {
412
+ }, Us = (n, e, t, s, r, i, o, a, l, c, d) => {
413
413
  const { labels: m } = s;
414
414
  let u = !0, f = "";
415
415
  if (!e.Role)
@@ -421,7 +421,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
421
421
  if (i) {
422
422
  if (!o?.Role)
423
423
  return f = "Current user does not have a role", u = !1, u;
424
- if (!Jo(n, s, r, o.Role, e.Role, a, c, c?.Role, l))
424
+ if (!Qo(n, s, r, o.Role, e.Role, a, c, c?.Role, l))
425
425
  return u = !1, u;
426
426
  if (n === "update" && d !== "delete" && c?.User_ID && e.User_ID !== c.User_ID)
427
427
  return f = "User ID does not match original user ID", u = !1, u;
@@ -430,24 +430,24 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
430
430
  if (n === "delete" && i === e.User_ID)
431
431
  return f = "User cannot delete their own record", u = !1, u;
432
432
  }
433
- return n === "delete" || d === "delete" || !a ? u : a.Role ? (Go(r, a) || (u = !1), a.Collection && a.Collection !== m.collection ? (f = "Permissions collection does not match record collection", u = !1, u) : a.Role !== e.Role ? (f = "Permissions role does not match record role", u = !1, u) : a.Enabled !== void 0 && !!a.Enabled != !!e.Enabled ? (f = "Permissions enabled state does not match record enabled state", u = !1, u) : a.Doc_ID && a.Doc_ID !== t ? (f = "Permissions doc ID does not match record doc ID", u = !1, u) : !Yo(r, a, a.Role) || i && o && l && !Qo(r, o, a, l) ? (u = !1, u) : (f && console.error(`PERMISSION_DENIED: ${f}`), u)) : (f = "Permissions do not have a role", u = !1, u);
434
- }, ir = (n, e, t, s, r, i, o) => {
433
+ return n === "delete" || d === "delete" || !a ? u : a.Role ? (Yo(r, a) || (u = !1), a.Collection && a.Collection !== m.collection ? (f = "Permissions collection does not match record collection", u = !1, u) : a.Role !== e.Role ? (f = "Permissions role does not match record role", u = !1, u) : a.Enabled !== void 0 && !!a.Enabled != !!e.Enabled ? (f = "Permissions enabled state does not match record enabled state", u = !1, u) : a.Doc_ID && a.Doc_ID !== t ? (f = "Permissions doc ID does not match record doc ID", u = !1, u) : !Jo(r, a, a.Role) || i && o && l && !Ko(r, o, a, l) ? (u = !1, u) : (f && console.error(`PERMISSION_DENIED: ${f}`), u)) : (f = "Permissions do not have a role", u = !1, u);
434
+ }, or = (n, e, t, s, r, i, o) => {
435
435
  const { labels: a, fields: l } = t, c = i?.collections?.[a.collection];
436
436
  let d = !0;
437
437
  if (r && !c)
438
438
  throw new Error("PERMISSION_DENIED");
439
439
  r && !Se("Create", c) && (d = !1), r && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
440
- !lt("Create", t, s, r, i, n) && (d = !1), t.auth && o && (r && !zn(c) && (d = !1), Vs("create", n, e, t, s, r, i, o) || (d = !1));
440
+ !lt("Create", t, s, r, i, n) && (d = !1), t.auth && o && (r && !zn(c) && (d = !1), Us("create", n, e, t, s, r, i, o) || (d = !1));
441
441
  for (const m of l) {
442
442
  const u = n[m.name];
443
- m.access && !qn(m, i) && u !== void 0 && (d = !1), u !== void 0 && !Bo(m, i) && (d = !1);
443
+ m.access && !qn(m, i) && u !== void 0 && (d = !1), u !== void 0 && !Ho(m, i) && (d = !1);
444
444
  }
445
445
  if (!d)
446
446
  throw new Error("PERMISSION_DENIED");
447
447
  }, Re = (n) => n && (n._methodName === "deleteField" || n.constructor.name === "DeleteTransform"), it = (n) => {
448
448
  for (const e in n)
449
449
  Object.prototype.hasOwnProperty.call(n, e) && (Re(n[e]) ? delete n[e] : typeof n[e] == "object" && n[e] !== null && it(n[e]));
450
- }, or = (n, e, t, s, r, i, o, a, l, c) => {
450
+ }, ar = (n, e, t, s, r, i, o, a, l, c) => {
451
451
  const { labels: d, fields: m } = s, u = o?.collections?.[d.collection], f = { ...e, ...n };
452
452
  it(f);
453
453
  let g = !0, v = "";
@@ -456,21 +456,21 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
456
456
  i && !Se("Update", u) && (g = !1, v = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
457
457
  (!lt("Update", s, r, i, o, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
458
458
  !lt("Update", s, r, i, o, f)) && (g = !1, v = "Authenticated user does not have Update access to this document"), i && s.softDelete && f[s.softDelete.archivedField] !== e[s.softDelete.archivedField] && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
459
- !Se("Delete", u) && (g = !1, v = "Authenticated user does not have Delete or Restore access to this document"), a && (i && !zn(u) && (g = !1, v = "Authenticated user does not have Auth access for this collection"), Vs("update", f, t, s, r, i, o, l, c, e, a) || (v = "Authenticated user does not have sufficient write access for this record", g = !1));
459
+ !Se("Delete", u) && (g = !1, v = "Authenticated user does not have Delete or Restore access to this document"), a && (i && !zn(u) && (g = !1, v = "Authenticated user does not have Auth access for this collection"), Us("update", f, t, s, r, i, o, l, c, e, a) || (v = "Authenticated user does not have sufficient write access for this record", g = !1));
460
460
  for (const y of m) {
461
461
  const w = n[y.name];
462
462
  y.access && !qn(y, o) && w !== void 0 && (v = `Authenticated user does not have access to field ${y.name}`, g = !1), w !== void 0 && !ai(y, o) && (v = `Authenticated user does not have Update access to field ${y.name}`, g = !1);
463
463
  }
464
464
  if (!g)
465
465
  throw v && console.error(`PERMISSION_DENIED: ${v}`), new Error("PERMISSION_DENIED");
466
- }, Ko = (n, e, t, s, r, i) => {
466
+ }, Xo = (n, e, t, s, r, i) => {
467
467
  const { labels: o } = t, a = i.collections?.[o.collection];
468
468
  let l = !0;
469
469
  if (!a)
470
470
  throw new Error("PERMISSION_DENIED");
471
- if (Se("Delete", a) || (l = !1), lt("Delete", t, s, r, i, n) || (l = !1), t.auth && n.User_ID && (zn(a) || (l = !1), Vs("delete", n, e, t, s, r, i) || (l = !1)), !l)
471
+ if (Se("Delete", a) || (l = !1), lt("Delete", t, s, r, i, n) || (l = !1), t.auth && n.User_ID && (zn(a) || (l = !1), Us("delete", n, e, t, s, r, i) || (l = !1)), !l)
472
472
  throw new Error("PERMISSION_DENIED");
473
- }, Xo = async (n, e, t, s, r) => {
473
+ }, ea = async (n, e, t, s, r) => {
474
474
  const { labels: i } = e, o = r.collections?.[i.collection];
475
475
  let a = !0;
476
476
  if (!o) {
@@ -479,7 +479,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
479
479
  }
480
480
  if (Se("Read", o) || (a = !1), lt("Read", e, t, s, r, n) || (a = !1), !a)
481
481
  throw new Error("PERMISSION_DENIED");
482
- }, ea = async (n, e, t, s, r) => {
482
+ }, ta = async (n, e, t, s, r) => {
483
483
  const { labels: i } = e, o = r.collections?.[i.collection];
484
484
  let a = !0;
485
485
  if (!o) {
@@ -490,10 +490,10 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
490
490
  lt("Read", e, t, s, r, l) || (a = !1);
491
491
  }), !a)
492
492
  throw new Error("PERMISSION_DENIED");
493
- }, ta = (n, e, t) => {
493
+ }, na = (n, e, t) => {
494
494
  const { access: s } = n;
495
495
  return s.operations[t]?.includes(e);
496
- }, na = (n, e, t) => {
496
+ }, sa = (n, e, t) => {
497
497
  const { access: s } = e, { entityRestrictions: r } = s;
498
498
  if (r?.restrictions) {
499
499
  for (const i of r.restrictions)
@@ -516,7 +516,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
516
516
  return `${i.type} parent filter`;
517
517
  }
518
518
  return !0;
519
- }, sa = (n, e, t, s, r) => {
519
+ }, ra = (n, e, t, s, r) => {
520
520
  const i = {};
521
521
  for (const o of n) {
522
522
  const l = e[o].default({ sdk: t, utils: s, context: r });
@@ -534,7 +534,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
534
534
  }, Bt = (n, e) => n && typeof n == "function" ? e ? n(...e) : n() : n, ie = async (n, e) => {
535
535
  let t = n;
536
536
  return n && (typeof n == "function" || typeof n.then == "function") && (e ? t = await n(...e) : t = await n()), t;
537
- }, lu = async (n, e, t, s) => {
537
+ }, uu = async (n, e, t, s) => {
538
538
  for (const d of e)
539
539
  if (d === "__proto__" || d === "constructor" || d === "prototype")
540
540
  throw new Error("Invalid config path: prototype pollution keys are not allowed");
@@ -692,7 +692,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
692
692
  break;
693
693
  }
694
694
  })), [...new Set(t)];
695
- }, ra = (n, e) => {
695
+ }, ia = (n, e) => {
696
696
  const t = [], { fields: s, roleSystemFields: r, preloadCache: i, queries: o } = n, a = Bn();
697
697
  return t.push({
698
698
  name: "Collection_Path",
@@ -710,7 +710,7 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
710
710
  }), hi(n, e).forEach((c) => {
711
711
  wt.includes(c.name) && t.push(U(a, c.name));
712
712
  }), [...new Set(t)];
713
- }, ia = (n, e, t) => {
713
+ }, oa = (n, e, t) => {
714
714
  const s = [], { fields: r, preloadCache: i } = e, o = Bn();
715
715
  i?.range && i.range.fields.forEach((c) => {
716
716
  wt.includes(c) ? s.push(U(o, c)) : s.push(U(r, c));
@@ -751,13 +751,13 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
751
751
  const l = U(r, i.archivedField);
752
752
  l && s.push(l);
753
753
  }
754
- return s.push(...ia(n, e, t)), [...new Set(s)];
754
+ return s.push(...oa(n, e, t)), [...new Set(s)];
755
755
  }, mi = (n, e) => {
756
756
  const { preloadCache: t } = n, s = /* @__PURE__ */ new Set();
757
757
  for (const r of e.config.roles) {
758
- if (!ta(n, r, "read"))
758
+ if (!na(n, r, "read"))
759
759
  continue;
760
- const i = ra(n, r);
760
+ const i = ia(n, r);
761
761
  let o = !1;
762
762
  if (s.size === 0)
763
763
  s.add({ key: "1", roles: [r], fields: i }), o = !0;
@@ -772,12 +772,12 @@ const zn = (n) => !!n.auth, Se = (n, e) => {
772
772
  for (const r of s.values())
773
773
  if (r.roles.includes(n))
774
774
  return r;
775
- }, oa = (n, e) => {
775
+ }, aa = (n, e) => {
776
776
  const { fields: t } = e, s = Bn(), r = [];
777
777
  return [...t, ...s.filter((o) => o.name !== "id")].forEach((o) => {
778
778
  n?.fields.some((a) => a.name === o.name) || r.push(o);
779
779
  }), r;
780
- }, Us = (n, e, t) => {
780
+ }, Ws = (n, e, t) => {
781
781
  const s = {};
782
782
  return Object.values(n.collections).forEach((r) => {
783
783
  const i = mi(r, n), o = Array.from(i);
@@ -806,7 +806,7 @@ async function oe(n, e, t, s) {
806
806
  if (n !== "setEmbedding" && (await ts(n, e?.[n], s), n === "postWriteError"))
807
807
  return r;
808
808
  }
809
- const Ws = (n, e, t, s, r, i, o, a, l, c) => (n === "create" && (t.Collection_Path = e, t.Created_At = a, t.Saved_At = l, t.Created_By = o || "System"), t.Last_Write_App = r, t.Last_Write_At = a, t.Last_Save_At = l, t.Last_Write_By = o || "System", t.Last_Write_Connection_Status = i, t.Last_Write_Version = s.version, t), pt = (n, e) => {
809
+ const js = (n, e, t, s, r, i, o, a, l, c) => (n === "create" && (t.Collection_Path = e, t.Created_At = a, t.Saved_At = l, t.Created_By = o || "System"), t.Last_Write_App = r, t.Last_Write_At = a, t.Last_Save_At = l, t.Last_Write_By = o || "System", t.Last_Write_Connection_Status = i, t.Last_Write_Version = s.version, t), pt = (n, e) => {
810
810
  const { access: t, queries: s } = n, { serverReadOnly: r } = t, i = /* @__PURE__ */ new Set();
811
811
  if (s)
812
812
  for (const o of s) {
@@ -853,7 +853,7 @@ const Ws = (n, e, t, s, r, i, o, a, l, c) => (n === "create" && (t.Collection_Pa
853
853
  vt(n, n.fields).forEach((s) => {
854
854
  e[s.name] ? e[`${s.name}_Lowercase`] = e[s.name].toLowerCase() : delete e[`${s.name}_Lowercase`];
855
855
  });
856
- }, aa = async (n, e, t, s) => {
856
+ }, la = async (n, e, t, s) => {
857
857
  const { fields: r } = e;
858
858
  for (const i of t.fields) {
859
859
  const o = U(r, i.name);
@@ -899,14 +899,14 @@ var ne;
899
899
  }
900
900
  n.joinValues = s, n.jsonStringifyReplacer = (r, i) => typeof i == "bigint" ? i.toString() : i;
901
901
  })(ne || (ne = {}));
902
- var ar;
902
+ var lr;
903
903
  (function(n) {
904
904
  n.mergeShapes = (e, t) => ({
905
905
  ...e,
906
906
  ...t
907
907
  // second overwrites first
908
908
  });
909
- })(ar || (ar = {}));
909
+ })(lr || (lr = {}));
910
910
  const V = ne.arrayToEnum([
911
911
  "string",
912
912
  "nan",
@@ -1087,11 +1087,11 @@ const ws = (n, e) => {
1087
1087
  }
1088
1088
  return { message: t };
1089
1089
  };
1090
- let la = ws;
1091
- function ca() {
1092
- return la;
1090
+ let ca = ws;
1091
+ function ua() {
1092
+ return ca;
1093
1093
  }
1094
- const ua = (n) => {
1094
+ const da = (n) => {
1095
1095
  const { data: e, path: t, errorMaps: s, issueData: r } = n, i = [...t, ...r.path || []], o = {
1096
1096
  ...r,
1097
1097
  path: i
@@ -1113,7 +1113,7 @@ const ua = (n) => {
1113
1113
  };
1114
1114
  };
1115
1115
  function P(n, e) {
1116
- const t = ca(), s = ua({
1116
+ const t = ua(), s = da({
1117
1117
  issueData: e,
1118
1118
  data: n.data,
1119
1119
  path: n.path,
@@ -1173,7 +1173,7 @@ class Ee {
1173
1173
  }
1174
1174
  const J = Object.freeze({
1175
1175
  status: "aborted"
1176
- }), Ht = (n) => ({ status: "dirty", value: n }), $e = (n) => ({ status: "valid", value: n }), lr = (n) => n.status === "aborted", cr = (n) => n.status === "dirty", At = (n) => n.status === "valid", Nn = (n) => typeof Promise < "u" && n instanceof Promise;
1176
+ }), Ht = (n) => ({ status: "dirty", value: n }), Fe = (n) => ({ status: "valid", value: n }), cr = (n) => n.status === "aborted", ur = (n) => n.status === "dirty", At = (n) => n.status === "valid", Nn = (n) => typeof Promise < "u" && n instanceof Promise;
1177
1177
  var W;
1178
1178
  (function(n) {
1179
1179
  n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e?.message;
@@ -1186,7 +1186,7 @@ class Ze {
1186
1186
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
1187
1187
  }
1188
1188
  }
1189
- const ur = (n, e) => {
1189
+ const dr = (n, e) => {
1190
1190
  if (At(e))
1191
1191
  return { success: !0, data: e.value };
1192
1192
  if (!n.common.issues.length)
@@ -1271,7 +1271,7 @@ class ee {
1271
1271
  data: e,
1272
1272
  parsedType: nt(e)
1273
1273
  }, r = this._parseSync({ data: e, path: s.path, parent: s });
1274
- return ur(s, r);
1274
+ return dr(s, r);
1275
1275
  }
1276
1276
  "~validate"(e) {
1277
1277
  const t = {
@@ -1324,7 +1324,7 @@ class ee {
1324
1324
  data: e,
1325
1325
  parsedType: nt(e)
1326
1326
  }, r = this._parse({ data: e, path: s.path, parent: s }), i = await (Nn(r) ? r : Promise.resolve(r));
1327
- return ur(s, i);
1327
+ return dr(s, i);
1328
1328
  }
1329
1329
  refine(e, t) {
1330
1330
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -1340,7 +1340,7 @@ class ee {
1340
1340
  return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
1341
1341
  }
1342
1342
  _refinement(e) {
1343
- return new Mt({
1343
+ return new $t({
1344
1344
  schema: this,
1345
1345
  typeName: Y.ZodEffects,
1346
1346
  effect: { type: "refinement", refinement: e }
@@ -1360,7 +1360,7 @@ class ee {
1360
1360
  return ot.create(this, this._def);
1361
1361
  }
1362
1362
  nullable() {
1363
- return Ft.create(this, this._def);
1363
+ return Mt.create(this, this._def);
1364
1364
  }
1365
1365
  nullish() {
1366
1366
  return this.nullable().optional();
@@ -1369,7 +1369,7 @@ class ee {
1369
1369
  return We.create(this);
1370
1370
  }
1371
1371
  promise() {
1372
- return Mn.create(this, this._def);
1372
+ return $n.create(this, this._def);
1373
1373
  }
1374
1374
  or(e) {
1375
1375
  return An.create([this, e], this._def);
@@ -1378,7 +1378,7 @@ class ee {
1378
1378
  return Cn.create(this, e, this._def);
1379
1379
  }
1380
1380
  transform(e) {
1381
- return new Mt({
1381
+ return new $t({
1382
1382
  ...K(this._def),
1383
1383
  schema: this,
1384
1384
  typeName: Y.ZodEffects,
@@ -1395,7 +1395,7 @@ class ee {
1395
1395
  });
1396
1396
  }
1397
1397
  brand() {
1398
- return new Ca({
1398
+ return new Fa({
1399
1399
  typeName: Y.ZodBranded,
1400
1400
  type: this,
1401
1401
  ...K(this._def)
@@ -1418,7 +1418,7 @@ class ee {
1418
1418
  });
1419
1419
  }
1420
1420
  pipe(e) {
1421
- return js.create(this, e);
1421
+ return Zs.create(this, e);
1422
1422
  }
1423
1423
  readonly() {
1424
1424
  return Ss.create(this);
@@ -1430,28 +1430,28 @@ class ee {
1430
1430
  return this.safeParse(null).success;
1431
1431
  }
1432
1432
  }
1433
- const da = /^c[^\s-]{8,}$/i, fa = /^[0-9a-z]+$/, ha = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ma = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, pa = /^[a-z0-9_-]{21}$/i, ya = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ga = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, wa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, _a = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1433
+ const fa = /^c[^\s-]{8,}$/i, ha = /^[0-9a-z]+$/, ma = /^[0-9A-HJKMNP-TV-Z]{26}$/i, pa = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ya = /^[a-z0-9_-]{21}$/i, ga = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, wa = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, _a = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ea = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1434
1434
  let ns;
1435
- const Ea = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, va = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Oa = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ka = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ba = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ta = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, yi = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Sa = new RegExp(`^${yi}$`);
1435
+ const va = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Oa = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ka = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ba = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ta = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Sa = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, yi = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ra = new RegExp(`^${yi}$`);
1436
1436
  function gi(n) {
1437
1437
  let e = "[0-5]\\d";
1438
1438
  n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
1439
1439
  const t = n.precision ? "+" : "?";
1440
1440
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
1441
1441
  }
1442
- function Ra(n) {
1442
+ function Ia(n) {
1443
1443
  return new RegExp(`^${gi(n)}$`);
1444
1444
  }
1445
- function Ia(n) {
1445
+ function xa(n) {
1446
1446
  let e = `${yi}T${gi(n)}`;
1447
1447
  const t = [];
1448
1448
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
1449
1449
  }
1450
- function xa(n, e) {
1451
- return !!((e === "v4" || !e) && Ea.test(n) || (e === "v6" || !e) && Oa.test(n));
1452
- }
1453
1450
  function Na(n, e) {
1454
- if (!ya.test(n))
1451
+ return !!((e === "v4" || !e) && va.test(n) || (e === "v6" || !e) && ka.test(n));
1452
+ }
1453
+ function Da(n, e) {
1454
+ if (!ga.test(n))
1455
1455
  return !1;
1456
1456
  try {
1457
1457
  const [t] = n.split(".");
@@ -1463,8 +1463,8 @@ function Na(n, e) {
1463
1463
  return !1;
1464
1464
  }
1465
1465
  }
1466
- function Da(n, e) {
1467
- return !!((e === "v4" || !e) && va.test(n) || (e === "v6" || !e) && ka.test(n));
1466
+ function Aa(n, e) {
1467
+ return !!((e === "v4" || !e) && Oa.test(n) || (e === "v6" || !e) && ba.test(n));
1468
1468
  }
1469
1469
  class Ge extends ee {
1470
1470
  _parse(e) {
@@ -1515,43 +1515,43 @@ class Ge extends ee {
1515
1515
  message: i.message
1516
1516
  }), s.dirty());
1517
1517
  } else if (i.kind === "email")
1518
- wa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1518
+ _a.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1519
1519
  validation: "email",
1520
1520
  code: D.invalid_string,
1521
1521
  message: i.message
1522
1522
  }), s.dirty());
1523
1523
  else if (i.kind === "emoji")
1524
- ns || (ns = new RegExp(_a, "u")), ns.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1524
+ ns || (ns = new RegExp(Ea, "u")), ns.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1525
1525
  validation: "emoji",
1526
1526
  code: D.invalid_string,
1527
1527
  message: i.message
1528
1528
  }), s.dirty());
1529
1529
  else if (i.kind === "uuid")
1530
- ma.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1530
+ pa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1531
1531
  validation: "uuid",
1532
1532
  code: D.invalid_string,
1533
1533
  message: i.message
1534
1534
  }), s.dirty());
1535
1535
  else if (i.kind === "nanoid")
1536
- pa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1536
+ ya.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1537
1537
  validation: "nanoid",
1538
1538
  code: D.invalid_string,
1539
1539
  message: i.message
1540
1540
  }), s.dirty());
1541
1541
  else if (i.kind === "cuid")
1542
- da.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1542
+ fa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1543
1543
  validation: "cuid",
1544
1544
  code: D.invalid_string,
1545
1545
  message: i.message
1546
1546
  }), s.dirty());
1547
1547
  else if (i.kind === "cuid2")
1548
- fa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1548
+ ha.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1549
1549
  validation: "cuid2",
1550
1550
  code: D.invalid_string,
1551
1551
  message: i.message
1552
1552
  }), s.dirty());
1553
1553
  else if (i.kind === "ulid")
1554
- ha.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1554
+ ma.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1555
1555
  validation: "ulid",
1556
1556
  code: D.invalid_string,
1557
1557
  message: i.message
@@ -1582,39 +1582,39 @@ class Ge extends ee {
1582
1582
  code: D.invalid_string,
1583
1583
  validation: { endsWith: i.value },
1584
1584
  message: i.message
1585
- }), s.dirty()) : i.kind === "datetime" ? Ia(i).test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1585
+ }), s.dirty()) : i.kind === "datetime" ? xa(i).test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1586
1586
  code: D.invalid_string,
1587
1587
  validation: "datetime",
1588
1588
  message: i.message
1589
- }), s.dirty()) : i.kind === "date" ? Sa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1589
+ }), s.dirty()) : i.kind === "date" ? Ra.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1590
1590
  code: D.invalid_string,
1591
1591
  validation: "date",
1592
1592
  message: i.message
1593
- }), s.dirty()) : i.kind === "time" ? Ra(i).test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1593
+ }), s.dirty()) : i.kind === "time" ? Ia(i).test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1594
1594
  code: D.invalid_string,
1595
1595
  validation: "time",
1596
1596
  message: i.message
1597
- }), s.dirty()) : i.kind === "duration" ? ga.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1597
+ }), s.dirty()) : i.kind === "duration" ? wa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1598
1598
  validation: "duration",
1599
1599
  code: D.invalid_string,
1600
1600
  message: i.message
1601
- }), s.dirty()) : i.kind === "ip" ? xa(e.data, i.version) || (r = this._getOrReturnCtx(e, r), P(r, {
1601
+ }), s.dirty()) : i.kind === "ip" ? Na(e.data, i.version) || (r = this._getOrReturnCtx(e, r), P(r, {
1602
1602
  validation: "ip",
1603
1603
  code: D.invalid_string,
1604
1604
  message: i.message
1605
- }), s.dirty()) : i.kind === "jwt" ? Na(e.data, i.alg) || (r = this._getOrReturnCtx(e, r), P(r, {
1605
+ }), s.dirty()) : i.kind === "jwt" ? Da(e.data, i.alg) || (r = this._getOrReturnCtx(e, r), P(r, {
1606
1606
  validation: "jwt",
1607
1607
  code: D.invalid_string,
1608
1608
  message: i.message
1609
- }), s.dirty()) : i.kind === "cidr" ? Da(e.data, i.version) || (r = this._getOrReturnCtx(e, r), P(r, {
1609
+ }), s.dirty()) : i.kind === "cidr" ? Aa(e.data, i.version) || (r = this._getOrReturnCtx(e, r), P(r, {
1610
1610
  validation: "cidr",
1611
1611
  code: D.invalid_string,
1612
1612
  message: i.message
1613
- }), s.dirty()) : i.kind === "base64" ? ba.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1613
+ }), s.dirty()) : i.kind === "base64" ? Ta.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1614
1614
  validation: "base64",
1615
1615
  code: D.invalid_string,
1616
1616
  message: i.message
1617
- }), s.dirty()) : i.kind === "base64url" ? Ta.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1617
+ }), s.dirty()) : i.kind === "base64url" ? Sa.test(e.data) || (r = this._getOrReturnCtx(e, r), P(r, {
1618
1618
  validation: "base64url",
1619
1619
  code: D.invalid_string,
1620
1620
  message: i.message
@@ -1849,7 +1849,7 @@ Ge.create = (n) => new Ge({
1849
1849
  coerce: n?.coerce ?? !1,
1850
1850
  ...K(n)
1851
1851
  });
1852
- function Aa(n, e) {
1852
+ function Ca(n, e) {
1853
1853
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, i = Number.parseInt(n.toFixed(r).replace(".", "")), o = Number.parseInt(e.toFixed(r).replace(".", ""));
1854
1854
  return i % o / 10 ** r;
1855
1855
  }
@@ -1888,7 +1888,7 @@ class Ct extends ee {
1888
1888
  inclusive: i.inclusive,
1889
1889
  exact: !1,
1890
1890
  message: i.message
1891
- }), r.dirty()) : i.kind === "multipleOf" ? Aa(e.data, i.value) !== 0 && (s = this._getOrReturnCtx(e, s), P(s, {
1891
+ }), r.dirty()) : i.kind === "multipleOf" ? Ca(e.data, i.value) !== 0 && (s = this._getOrReturnCtx(e, s), P(s, {
1892
1892
  code: D.not_multiple_of,
1893
1893
  multipleOf: i.value,
1894
1894
  message: i.message
@@ -2168,7 +2168,7 @@ class _s extends ee {
2168
2168
  received: s.parsedType
2169
2169
  }), J;
2170
2170
  }
2171
- return $e(e.data);
2171
+ return Fe(e.data);
2172
2172
  }
2173
2173
  }
2174
2174
  _s.create = (n) => new _s({
@@ -2254,7 +2254,7 @@ Dn.create = (n) => new Dn({
2254
2254
  typeName: Y.ZodDate,
2255
2255
  ...K(n)
2256
2256
  });
2257
- class dr extends ee {
2257
+ class fr extends ee {
2258
2258
  _parse(e) {
2259
2259
  if (this._getType(e) !== V.symbol) {
2260
2260
  const s = this._getOrReturnCtx(e);
@@ -2264,10 +2264,10 @@ class dr extends ee {
2264
2264
  received: s.parsedType
2265
2265
  }), J;
2266
2266
  }
2267
- return $e(e.data);
2267
+ return Fe(e.data);
2268
2268
  }
2269
2269
  }
2270
- dr.create = (n) => new dr({
2270
+ fr.create = (n) => new fr({
2271
2271
  typeName: Y.ZodSymbol,
2272
2272
  ...K(n)
2273
2273
  });
@@ -2281,14 +2281,14 @@ class Es extends ee {
2281
2281
  received: s.parsedType
2282
2282
  }), J;
2283
2283
  }
2284
- return $e(e.data);
2284
+ return Fe(e.data);
2285
2285
  }
2286
2286
  }
2287
2287
  Es.create = (n) => new Es({
2288
2288
  typeName: Y.ZodUndefined,
2289
2289
  ...K(n)
2290
2290
  });
2291
- class fr extends ee {
2291
+ class hr extends ee {
2292
2292
  _parse(e) {
2293
2293
  if (this._getType(e) !== V.null) {
2294
2294
  const s = this._getOrReturnCtx(e);
@@ -2298,10 +2298,10 @@ class fr extends ee {
2298
2298
  received: s.parsedType
2299
2299
  }), J;
2300
2300
  }
2301
- return $e(e.data);
2301
+ return Fe(e.data);
2302
2302
  }
2303
2303
  }
2304
- fr.create = (n) => new fr({
2304
+ hr.create = (n) => new hr({
2305
2305
  typeName: Y.ZodNull,
2306
2306
  ...K(n)
2307
2307
  });
@@ -2310,22 +2310,22 @@ class vs extends ee {
2310
2310
  super(...arguments), this._any = !0;
2311
2311
  }
2312
2312
  _parse(e) {
2313
- return $e(e.data);
2313
+ return Fe(e.data);
2314
2314
  }
2315
2315
  }
2316
2316
  vs.create = (n) => new vs({
2317
2317
  typeName: Y.ZodAny,
2318
2318
  ...K(n)
2319
2319
  });
2320
- class hr extends ee {
2320
+ class mr extends ee {
2321
2321
  constructor() {
2322
2322
  super(...arguments), this._unknown = !0;
2323
2323
  }
2324
2324
  _parse(e) {
2325
- return $e(e.data);
2325
+ return Fe(e.data);
2326
2326
  }
2327
2327
  }
2328
- hr.create = (n) => new hr({
2328
+ mr.create = (n) => new mr({
2329
2329
  typeName: Y.ZodUnknown,
2330
2330
  ...K(n)
2331
2331
  });
@@ -2343,7 +2343,7 @@ ct.create = (n) => new ct({
2343
2343
  typeName: Y.ZodNever,
2344
2344
  ...K(n)
2345
2345
  });
2346
- class mr extends ee {
2346
+ class pr extends ee {
2347
2347
  _parse(e) {
2348
2348
  if (this._getType(e) !== V.undefined) {
2349
2349
  const s = this._getOrReturnCtx(e);
@@ -2353,10 +2353,10 @@ class mr extends ee {
2353
2353
  received: s.parsedType
2354
2354
  }), J;
2355
2355
  }
2356
- return $e(e.data);
2356
+ return Fe(e.data);
2357
2357
  }
2358
2358
  }
2359
- mr.create = (n) => new mr({
2359
+ pr.create = (n) => new pr({
2360
2360
  typeName: Y.ZodVoid,
2361
2361
  ...K(n)
2362
2362
  });
@@ -2447,7 +2447,7 @@ function Rt(n) {
2447
2447
  } else return n instanceof We ? new We({
2448
2448
  ...n._def,
2449
2449
  type: Rt(n.element)
2450
- }) : n instanceof ot ? ot.create(Rt(n.unwrap())) : n instanceof Ft ? Ft.create(Rt(n.unwrap())) : n instanceof _t ? _t.create(n.items.map((e) => Rt(e))) : n;
2450
+ }) : n instanceof ot ? ot.create(Rt(n.unwrap())) : n instanceof Mt ? Mt.create(Rt(n.unwrap())) : n instanceof _t ? _t.create(n.items.map((e) => Rt(e))) : n;
2451
2451
  }
2452
2452
  class ue extends ee {
2453
2453
  constructor() {
@@ -2838,10 +2838,10 @@ function Os(n, e) {
2838
2838
  class Cn extends ee {
2839
2839
  _parse(e) {
2840
2840
  const { status: t, ctx: s } = this._processInputParams(e), r = (i, o) => {
2841
- if (lr(i) || lr(o))
2841
+ if (cr(i) || cr(o))
2842
2842
  return J;
2843
2843
  const a = Os(i.value, o.value);
2844
- return a.valid ? ((cr(i) || cr(o)) && t.dirty(), { status: t.value, value: a.data }) : (P(s, {
2844
+ return a.valid ? ((ur(i) || ur(o)) && t.dirty(), { status: t.value, value: a.data }) : (P(s, {
2845
2845
  code: D.invalid_intersection_types
2846
2846
  }), J);
2847
2847
  };
@@ -2923,7 +2923,7 @@ _t.create = (n, e) => {
2923
2923
  ...K(e)
2924
2924
  });
2925
2925
  };
2926
- class $n extends ee {
2926
+ class Fn extends ee {
2927
2927
  get keySchema() {
2928
2928
  return this._def.keyType;
2929
2929
  }
@@ -2951,12 +2951,12 @@ class $n extends ee {
2951
2951
  return this._def.valueType;
2952
2952
  }
2953
2953
  static create(e, t, s) {
2954
- return t instanceof ee ? new $n({
2954
+ return t instanceof ee ? new Fn({
2955
2955
  keyType: e,
2956
2956
  valueType: t,
2957
2957
  typeName: Y.ZodRecord,
2958
2958
  ...K(s)
2959
- }) : new $n({
2959
+ }) : new Fn({
2960
2960
  keyType: Ge.create(),
2961
2961
  valueType: e,
2962
2962
  typeName: Y.ZodRecord,
@@ -2964,7 +2964,7 @@ class $n extends ee {
2964
2964
  });
2965
2965
  }
2966
2966
  }
2967
- class pr extends ee {
2967
+ class yr extends ee {
2968
2968
  get keySchema() {
2969
2969
  return this._def.keyType;
2970
2970
  }
@@ -3006,7 +3006,7 @@ class pr extends ee {
3006
3006
  }
3007
3007
  }
3008
3008
  }
3009
- pr.create = (n, e, t) => new pr({
3009
+ yr.create = (n, e, t) => new yr({
3010
3010
  valueType: e,
3011
3011
  keyType: n,
3012
3012
  typeName: Y.ZodMap,
@@ -3076,7 +3076,7 @@ nn.create = (n, e) => new nn({
3076
3076
  typeName: Y.ZodSet,
3077
3077
  ...K(e)
3078
3078
  });
3079
- class yr extends ee {
3079
+ class gr extends ee {
3080
3080
  get schema() {
3081
3081
  return this._def.getter();
3082
3082
  }
@@ -3085,7 +3085,7 @@ class yr extends ee {
3085
3085
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
3086
3086
  }
3087
3087
  }
3088
- yr.create = (n, e) => new yr({
3088
+ gr.create = (n, e) => new gr({
3089
3089
  getter: n,
3090
3090
  typeName: Y.ZodLazy,
3091
3091
  ...K(e)
@@ -3112,13 +3112,13 @@ ks.create = (n, e) => new ks({
3112
3112
  ...K(e)
3113
3113
  });
3114
3114
  function wi(n, e) {
3115
- return new $t({
3115
+ return new Ft({
3116
3116
  values: n,
3117
3117
  typeName: Y.ZodEnum,
3118
3118
  ...K(e)
3119
3119
  });
3120
3120
  }
3121
- class $t extends ee {
3121
+ class Ft extends ee {
3122
3122
  _parse(e) {
3123
3123
  if (typeof e.data != "string") {
3124
3124
  const t = this._getOrReturnCtx(e), s = this._def.values;
@@ -3136,7 +3136,7 @@ class $t extends ee {
3136
3136
  options: s
3137
3137
  }), J;
3138
3138
  }
3139
- return $e(e.data);
3139
+ return Fe(e.data);
3140
3140
  }
3141
3141
  get options() {
3142
3142
  return this._def.values;
@@ -3160,20 +3160,20 @@ class $t extends ee {
3160
3160
  return e;
3161
3161
  }
3162
3162
  extract(e, t = this._def) {
3163
- return $t.create(e, {
3163
+ return Ft.create(e, {
3164
3164
  ...this._def,
3165
3165
  ...t
3166
3166
  });
3167
3167
  }
3168
3168
  exclude(e, t = this._def) {
3169
- return $t.create(this.options.filter((s) => !e.includes(s)), {
3169
+ return Ft.create(this.options.filter((s) => !e.includes(s)), {
3170
3170
  ...this._def,
3171
3171
  ...t
3172
3172
  });
3173
3173
  }
3174
3174
  }
3175
- $t.create = wi;
3176
- class gr extends ee {
3175
+ Ft.create = wi;
3176
+ class wr extends ee {
3177
3177
  _parse(e) {
3178
3178
  const t = ne.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3179
3179
  if (s.parsedType !== V.string && s.parsedType !== V.number) {
@@ -3192,18 +3192,18 @@ class gr extends ee {
3192
3192
  options: r
3193
3193
  }), J;
3194
3194
  }
3195
- return $e(e.data);
3195
+ return Fe(e.data);
3196
3196
  }
3197
3197
  get enum() {
3198
3198
  return this._def.values;
3199
3199
  }
3200
3200
  }
3201
- gr.create = (n, e) => new gr({
3201
+ wr.create = (n, e) => new wr({
3202
3202
  values: n,
3203
3203
  typeName: Y.ZodNativeEnum,
3204
3204
  ...K(e)
3205
3205
  });
3206
- class Mn extends ee {
3206
+ class $n extends ee {
3207
3207
  unwrap() {
3208
3208
  return this._def.type;
3209
3209
  }
@@ -3216,18 +3216,18 @@ class Mn extends ee {
3216
3216
  received: t.parsedType
3217
3217
  }), J;
3218
3218
  const s = t.parsedType === V.promise ? t.data : Promise.resolve(t.data);
3219
- return $e(s.then((r) => this._def.type.parseAsync(r, {
3219
+ return Fe(s.then((r) => this._def.type.parseAsync(r, {
3220
3220
  path: t.path,
3221
3221
  errorMap: t.common.contextualErrorMap
3222
3222
  })));
3223
3223
  }
3224
3224
  }
3225
- Mn.create = (n, e) => new Mn({
3225
+ $n.create = (n, e) => new $n({
3226
3226
  type: n,
3227
3227
  typeName: Y.ZodPromise,
3228
3228
  ...K(e)
3229
3229
  });
3230
- class Mt extends ee {
3230
+ class $t extends ee {
3231
3231
  innerType() {
3232
3232
  return this._def.schema;
3233
3233
  }
@@ -3307,13 +3307,13 @@ class Mt extends ee {
3307
3307
  ne.assertNever(r);
3308
3308
  }
3309
3309
  }
3310
- Mt.create = (n, e, t) => new Mt({
3310
+ $t.create = (n, e, t) => new $t({
3311
3311
  schema: n,
3312
3312
  typeName: Y.ZodEffects,
3313
3313
  effect: e,
3314
3314
  ...K(t)
3315
3315
  });
3316
- Mt.createWithPreprocess = (n, e, t) => new Mt({
3316
+ $t.createWithPreprocess = (n, e, t) => new $t({
3317
3317
  schema: e,
3318
3318
  effect: { type: "preprocess", transform: n },
3319
3319
  typeName: Y.ZodEffects,
@@ -3321,7 +3321,7 @@ Mt.createWithPreprocess = (n, e, t) => new Mt({
3321
3321
  });
3322
3322
  class ot extends ee {
3323
3323
  _parse(e) {
3324
- return this._getType(e) === V.undefined ? $e(void 0) : this._def.innerType._parse(e);
3324
+ return this._getType(e) === V.undefined ? Fe(void 0) : this._def.innerType._parse(e);
3325
3325
  }
3326
3326
  unwrap() {
3327
3327
  return this._def.innerType;
@@ -3332,15 +3332,15 @@ ot.create = (n, e) => new ot({
3332
3332
  typeName: Y.ZodOptional,
3333
3333
  ...K(e)
3334
3334
  });
3335
- class Ft extends ee {
3335
+ class Mt extends ee {
3336
3336
  _parse(e) {
3337
- return this._getType(e) === V.null ? $e(null) : this._def.innerType._parse(e);
3337
+ return this._getType(e) === V.null ? Fe(null) : this._def.innerType._parse(e);
3338
3338
  }
3339
3339
  unwrap() {
3340
3340
  return this._def.innerType;
3341
3341
  }
3342
3342
  }
3343
- Ft.create = (n, e) => new Ft({
3343
+ Mt.create = (n, e) => new Mt({
3344
3344
  innerType: n,
3345
3345
  typeName: Y.ZodNullable,
3346
3346
  ...K(e)
@@ -3408,7 +3408,7 @@ Ts.create = (n, e) => new Ts({
3408
3408
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
3409
3409
  ...K(e)
3410
3410
  });
3411
- class wr extends ee {
3411
+ class _r extends ee {
3412
3412
  _parse(e) {
3413
3413
  if (this._getType(e) !== V.nan) {
3414
3414
  const s = this._getOrReturnCtx(e);
@@ -3421,11 +3421,11 @@ class wr extends ee {
3421
3421
  return { status: "valid", value: e.data };
3422
3422
  }
3423
3423
  }
3424
- wr.create = (n) => new wr({
3424
+ _r.create = (n) => new _r({
3425
3425
  typeName: Y.ZodNaN,
3426
3426
  ...K(n)
3427
3427
  });
3428
- class Ca extends ee {
3428
+ class Fa extends ee {
3429
3429
  _parse(e) {
3430
3430
  const { ctx: t } = this._processInputParams(e), s = t.data;
3431
3431
  return this._def.type._parse({
@@ -3438,7 +3438,7 @@ class Ca extends ee {
3438
3438
  return this._def.type;
3439
3439
  }
3440
3440
  }
3441
- class js extends ee {
3441
+ class Zs extends ee {
3442
3442
  _parse(e) {
3443
3443
  const { status: t, ctx: s } = this._processInputParams(e);
3444
3444
  if (s.common.async)
@@ -3471,7 +3471,7 @@ class js extends ee {
3471
3471
  }
3472
3472
  }
3473
3473
  static create(e, t) {
3474
- return new js({
3474
+ return new Zs({
3475
3475
  in: e,
3476
3476
  out: t,
3477
3477
  typeName: Y.ZodPipeline
@@ -3501,13 +3501,13 @@ ct.create;
3501
3501
  const Ot = We.create, je = ue.create, ke = An.create;
3502
3502
  Cn.create;
3503
3503
  _t.create;
3504
- const on = $n.create, be = ks.create, Fn = $t.create;
3505
- Mn.create;
3504
+ const on = Fn.create, be = ks.create, Mn = Ft.create;
3505
+ $n.create;
3506
3506
  ot.create;
3507
- Ft.create;
3507
+ Mt.create;
3508
3508
  const En = () => pe().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
3509
3509
  message: "Value is not a valid timestamp"
3510
- }), _r = () => pe().refine((n) => n && (n._methodName === "serverTimestamp" || n.constructor.name === "ServerTimestampTransform"), {
3510
+ }), Er = () => pe().refine((n) => n && (n._methodName === "serverTimestamp" || n.constructor.name === "ServerTimestampTransform"), {
3511
3511
  message: "Value is not a valid server timestamp"
3512
3512
  }), _i = (n, e, t) => {
3513
3513
  const s = {};
@@ -3541,9 +3541,9 @@ const En = () => pe().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3541
3541
  if (i = Te(), e.length && (i = i.length(e.length)), e.minlength && (i = i.min(e.minlength)), e.maxlength && (i = i.max(e.maxlength)), e.email && (i = i.email()), e.uuid && (i = i.uuid()), e.url && (i = i.url()), e.emoji && (i = i.emoji()), e.ip && (i = i.ip()), e.pattern && (i = i.regex(new RegExp(e.pattern))), t && (i = i.toLowerCase()), e.values)
3542
3542
  if (t) {
3543
3543
  const o = e.values.map((a) => a.toLowerCase());
3544
- i = Fn(o);
3544
+ i = Mn(o);
3545
3545
  } else
3546
- i = Fn(e.values);
3546
+ i = Mn(e.values);
3547
3547
  break;
3548
3548
  case "Boolean":
3549
3549
  i = Xt();
@@ -3582,20 +3582,20 @@ const En = () => pe().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3582
3582
  break;
3583
3583
  }
3584
3584
  return !X(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
3585
- }, Fa = (n, e, t) => {
3585
+ }, Pa = (n, e, t) => {
3586
3586
  const s = {
3587
3587
  Collection_Path: Ot(Te()),
3588
3588
  Last_Write_App: Te(),
3589
3589
  Last_Write_At: En(),
3590
- Last_Save_At: _r(),
3590
+ Last_Save_At: Er(),
3591
3591
  Last_Write_By: ke([Te().length(28), be("System")]),
3592
- Last_Write_Connection_Status: Fn(["Online", "Offline"]),
3592
+ Last_Write_Connection_Status: Mn(["Online", "Offline"]),
3593
3593
  Last_Write_Version: yt().int(),
3594
3594
  id: Te().regex(new RegExp("^[a-zA-Z0-9]+$")).length(20),
3595
3595
  Created_At: En(),
3596
3596
  Created_By: ke([Te().length(28), be("System")])
3597
3597
  };
3598
- n === "create" && (s.Saved_At = _r()), n === "update" && (s.Saved_At = En(), s.Collection_Path = s.Collection_Path.optional(), s.id = s.id.optional(), s.Created_At = s.Created_At.optional(), s.Saved_At = s.Saved_At.optional(), s.Created_By = s.Created_By.optional());
3598
+ n === "create" && (s.Saved_At = Er()), n === "update" && (s.Saved_At = En(), s.Collection_Path = s.Collection_Path.optional(), s.id = s.id.optional(), s.Created_At = s.Created_At.optional(), s.Saved_At = s.Saved_At.optional(), s.Created_By = s.Created_By.optional());
3599
3599
  const r = pt(e, e.fields), i = Array.from(r).map((l) => l.name);
3600
3600
  e.fields.forEach((l) => {
3601
3601
  X(l) ? (s[l.name] = $a(l, t), s[`${l.name}_Array`] = Ma(l), i.includes(l.name) && (s[`${l.name}_Single`] = _i(l, t, !0), l.required || (s[`${l.name}_Single`] = s[`${l.name}_Single`].optional())), l.length && (s[l.name] = s[l.name].refine((c) => l.length && c && Object.keys(c).length === l.length, {
@@ -3613,17 +3613,17 @@ const En = () => pe().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3613
3613
  };
3614
3614
  class kt extends Error {
3615
3615
  }
3616
- class Pa extends kt {
3616
+ class La extends kt {
3617
3617
  constructor(e) {
3618
3618
  super(`Invalid DateTime: ${e.toMessage()}`);
3619
3619
  }
3620
3620
  }
3621
- class La extends kt {
3621
+ class Va extends kt {
3622
3622
  constructor(e) {
3623
3623
  super(`Invalid Interval: ${e.toMessage()}`);
3624
3624
  }
3625
3625
  }
3626
- class Va extends kt {
3626
+ class Ua extends kt {
3627
3627
  constructor(e) {
3628
3628
  super(`Invalid Duration: ${e.toMessage()}`);
3629
3629
  }
@@ -3642,130 +3642,130 @@ class tt extends kt {
3642
3642
  super("Zone is an abstract class");
3643
3643
  }
3644
3644
  }
3645
- const M = "numeric", Le = "short", Ie = "long", Ln = {
3646
- year: M,
3647
- month: M,
3648
- day: M
3645
+ const $ = "numeric", Le = "short", Ie = "long", Ln = {
3646
+ year: $,
3647
+ month: $,
3648
+ day: $
3649
3649
  }, vi = {
3650
- year: M,
3650
+ year: $,
3651
3651
  month: Le,
3652
- day: M
3653
- }, Ua = {
3654
- year: M,
3652
+ day: $
3653
+ }, Wa = {
3654
+ year: $,
3655
3655
  month: Le,
3656
- day: M,
3656
+ day: $,
3657
3657
  weekday: Le
3658
3658
  }, Oi = {
3659
- year: M,
3659
+ year: $,
3660
3660
  month: Ie,
3661
- day: M
3661
+ day: $
3662
3662
  }, ki = {
3663
- year: M,
3663
+ year: $,
3664
3664
  month: Ie,
3665
- day: M,
3665
+ day: $,
3666
3666
  weekday: Ie
3667
3667
  }, bi = {
3668
- hour: M,
3669
- minute: M
3668
+ hour: $,
3669
+ minute: $
3670
3670
  }, Ti = {
3671
- hour: M,
3672
- minute: M,
3673
- second: M
3671
+ hour: $,
3672
+ minute: $,
3673
+ second: $
3674
3674
  }, Si = {
3675
- hour: M,
3676
- minute: M,
3677
- second: M,
3675
+ hour: $,
3676
+ minute: $,
3677
+ second: $,
3678
3678
  timeZoneName: Le
3679
3679
  }, Ri = {
3680
- hour: M,
3681
- minute: M,
3682
- second: M,
3680
+ hour: $,
3681
+ minute: $,
3682
+ second: $,
3683
3683
  timeZoneName: Ie
3684
3684
  }, Ii = {
3685
- hour: M,
3686
- minute: M,
3685
+ hour: $,
3686
+ minute: $,
3687
3687
  hourCycle: "h23"
3688
3688
  }, xi = {
3689
- hour: M,
3690
- minute: M,
3691
- second: M,
3689
+ hour: $,
3690
+ minute: $,
3691
+ second: $,
3692
3692
  hourCycle: "h23"
3693
3693
  }, Ni = {
3694
- hour: M,
3695
- minute: M,
3696
- second: M,
3694
+ hour: $,
3695
+ minute: $,
3696
+ second: $,
3697
3697
  hourCycle: "h23",
3698
3698
  timeZoneName: Le
3699
3699
  }, Di = {
3700
- hour: M,
3701
- minute: M,
3702
- second: M,
3700
+ hour: $,
3701
+ minute: $,
3702
+ second: $,
3703
3703
  hourCycle: "h23",
3704
3704
  timeZoneName: Ie
3705
3705
  }, Ai = {
3706
- year: M,
3707
- month: M,
3708
- day: M,
3709
- hour: M,
3710
- minute: M
3706
+ year: $,
3707
+ month: $,
3708
+ day: $,
3709
+ hour: $,
3710
+ minute: $
3711
3711
  }, Ci = {
3712
- year: M,
3713
- month: M,
3714
- day: M,
3715
- hour: M,
3716
- minute: M,
3717
- second: M
3718
- }, $i = {
3719
- year: M,
3712
+ year: $,
3713
+ month: $,
3714
+ day: $,
3715
+ hour: $,
3716
+ minute: $,
3717
+ second: $
3718
+ }, Fi = {
3719
+ year: $,
3720
3720
  month: Le,
3721
- day: M,
3722
- hour: M,
3723
- minute: M
3724
- }, Mi = {
3725
- year: M,
3721
+ day: $,
3722
+ hour: $,
3723
+ minute: $
3724
+ }, $i = {
3725
+ year: $,
3726
3726
  month: Le,
3727
- day: M,
3728
- hour: M,
3729
- minute: M,
3730
- second: M
3731
- }, Wa = {
3732
- year: M,
3727
+ day: $,
3728
+ hour: $,
3729
+ minute: $,
3730
+ second: $
3731
+ }, ja = {
3732
+ year: $,
3733
3733
  month: Le,
3734
- day: M,
3734
+ day: $,
3735
3735
  weekday: Le,
3736
- hour: M,
3737
- minute: M
3738
- }, Fi = {
3739
- year: M,
3736
+ hour: $,
3737
+ minute: $
3738
+ }, Mi = {
3739
+ year: $,
3740
3740
  month: Ie,
3741
- day: M,
3742
- hour: M,
3743
- minute: M,
3741
+ day: $,
3742
+ hour: $,
3743
+ minute: $,
3744
3744
  timeZoneName: Le
3745
3745
  }, Pi = {
3746
- year: M,
3746
+ year: $,
3747
3747
  month: Ie,
3748
- day: M,
3749
- hour: M,
3750
- minute: M,
3751
- second: M,
3748
+ day: $,
3749
+ hour: $,
3750
+ minute: $,
3751
+ second: $,
3752
3752
  timeZoneName: Le
3753
3753
  }, Li = {
3754
- year: M,
3754
+ year: $,
3755
3755
  month: Ie,
3756
- day: M,
3756
+ day: $,
3757
3757
  weekday: Ie,
3758
- hour: M,
3759
- minute: M,
3758
+ hour: $,
3759
+ minute: $,
3760
3760
  timeZoneName: Ie
3761
3761
  }, Vi = {
3762
- year: M,
3762
+ year: $,
3763
3763
  month: Ie,
3764
- day: M,
3764
+ day: $,
3765
3765
  weekday: Ie,
3766
- hour: M,
3767
- minute: M,
3768
- second: M,
3766
+ hour: $,
3767
+ minute: $,
3768
+ second: $,
3769
3769
  timeZoneName: Ie
3770
3770
  };
3771
3771
  class an {
@@ -3895,7 +3895,7 @@ class Hn extends an {
3895
3895
  }
3896
3896
  }
3897
3897
  const Rs = /* @__PURE__ */ new Map();
3898
- function ja(n) {
3898
+ function Za(n) {
3899
3899
  let e = Rs.get(n);
3900
3900
  return e === void 0 && (e = new Intl.DateTimeFormat("en-US", {
3901
3901
  hour12: !1,
@@ -3909,7 +3909,7 @@ function ja(n) {
3909
3909
  era: "short"
3910
3910
  }), Rs.set(n, e)), e;
3911
3911
  }
3912
- const Za = {
3912
+ const za = {
3913
3913
  year: 0,
3914
3914
  month: 1,
3915
3915
  day: 2,
@@ -3918,14 +3918,14 @@ const Za = {
3918
3918
  minute: 5,
3919
3919
  second: 6
3920
3920
  };
3921
- function za(n, e) {
3921
+ function qa(n, e) {
3922
3922
  const t = n.format(e).replace(/\u200E/g, ""), s = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t), [, r, i, o, a, l, c, d] = s;
3923
3923
  return [o, r, i, a, l, c, d];
3924
3924
  }
3925
- function qa(n, e) {
3925
+ function Ba(n, e) {
3926
3926
  const t = n.formatToParts(e), s = [];
3927
3927
  for (let r = 0; r < t.length; r++) {
3928
- const { type: i, value: o } = t[r], a = Za[i];
3928
+ const { type: i, value: o } = t[r], a = za[i];
3929
3929
  i === "era" ? s[a] = o : H(a) || (s[a] = parseInt(o, 10));
3930
3930
  }
3931
3931
  return s;
@@ -4036,8 +4036,8 @@ class Qe extends an {
4036
4036
  if (!this.valid) return NaN;
4037
4037
  const t = new Date(e);
4038
4038
  if (isNaN(t)) return NaN;
4039
- const s = ja(this.name);
4040
- let [r, i, o, a, l, c, d] = s.formatToParts ? qa(s, t) : za(s, t);
4039
+ const s = Za(this.name);
4040
+ let [r, i, o, a, l, c, d] = s.formatToParts ? Ba(s, t) : qa(s, t);
4041
4041
  a === "BC" && (r = -Math.abs(r) + 1);
4042
4042
  const u = Yn({
4043
4043
  year: r,
@@ -4070,11 +4070,11 @@ class Qe extends an {
4070
4070
  return this.valid;
4071
4071
  }
4072
4072
  }
4073
- let Er = {};
4074
- function Ba(n, e = {}) {
4073
+ let vr = {};
4074
+ function Ha(n, e = {}) {
4075
4075
  const t = JSON.stringify([n, e]);
4076
- let s = Er[t];
4077
- return s || (s = new Intl.ListFormat(n, e), Er[t] = s), s;
4076
+ let s = vr[t];
4077
+ return s || (s = new Intl.ListFormat(n, e), vr[t] = s), s;
4078
4078
  }
4079
4079
  const Is = /* @__PURE__ */ new Map();
4080
4080
  function xs(n, e = {}) {
@@ -4083,19 +4083,19 @@ function xs(n, e = {}) {
4083
4083
  return s === void 0 && (s = new Intl.DateTimeFormat(n, e), Is.set(t, s)), s;
4084
4084
  }
4085
4085
  const Ns = /* @__PURE__ */ new Map();
4086
- function Ha(n, e = {}) {
4086
+ function Ga(n, e = {}) {
4087
4087
  const t = JSON.stringify([n, e]);
4088
4088
  let s = Ns.get(t);
4089
4089
  return s === void 0 && (s = new Intl.NumberFormat(n, e), Ns.set(t, s)), s;
4090
4090
  }
4091
4091
  const Ds = /* @__PURE__ */ new Map();
4092
- function Ga(n, e = {}) {
4092
+ function Ya(n, e = {}) {
4093
4093
  const { base: t, ...s } = e, r = JSON.stringify([n, s]);
4094
4094
  let i = Ds.get(r);
4095
4095
  return i === void 0 && (i = new Intl.RelativeTimeFormat(n, e), Ds.set(r, i)), i;
4096
4096
  }
4097
4097
  let Gt = null;
4098
- function Ya() {
4098
+ function Ja() {
4099
4099
  return Gt || (Gt = new Intl.DateTimeFormat().resolvedOptions().locale, Gt);
4100
4100
  }
4101
4101
  const As = /* @__PURE__ */ new Map();
@@ -4104,7 +4104,7 @@ function Ui(n) {
4104
4104
  return e === void 0 && (e = new Intl.DateTimeFormat(n).resolvedOptions(), As.set(n, e)), e;
4105
4105
  }
4106
4106
  const Cs = /* @__PURE__ */ new Map();
4107
- function Ja(n) {
4107
+ function Qa(n) {
4108
4108
  let e = Cs.get(n);
4109
4109
  if (!e) {
4110
4110
  const t = new Intl.Locale(n);
@@ -4112,7 +4112,7 @@ function Ja(n) {
4112
4112
  }
4113
4113
  return e;
4114
4114
  }
4115
- function Qa(n) {
4115
+ function Ka(n) {
4116
4116
  const e = n.indexOf("-x-");
4117
4117
  e !== -1 && (n = n.substring(0, e));
4118
4118
  const t = n.indexOf("-u-");
@@ -4130,10 +4130,10 @@ function Qa(n) {
4130
4130
  return [r, i, o];
4131
4131
  }
4132
4132
  }
4133
- function Ka(n, e, t) {
4133
+ function Xa(n, e, t) {
4134
4134
  return (t || e) && (n.includes("-u-") || (n += "-u"), t && (n += `-ca-${t}`), e && (n += `-nu-${e}`)), n;
4135
4135
  }
4136
- function Xa(n) {
4136
+ function el(n) {
4137
4137
  const e = [];
4138
4138
  for (let t = 1; t <= 12; t++) {
4139
4139
  const s = L.utc(2009, t, 1);
@@ -4141,7 +4141,7 @@ function Xa(n) {
4141
4141
  }
4142
4142
  return e;
4143
4143
  }
4144
- function el(n) {
4144
+ function tl(n) {
4145
4145
  const e = [];
4146
4146
  for (let t = 1; t <= 7; t++) {
4147
4147
  const s = L.utc(2016, 11, 13 + t);
@@ -4153,16 +4153,16 @@ function mn(n, e, t, s) {
4153
4153
  const r = n.listingMode();
4154
4154
  return r === "error" ? null : r === "en" ? t(e) : s(e);
4155
4155
  }
4156
- function tl(n) {
4156
+ function nl(n) {
4157
4157
  return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || Ui(n.locale).numberingSystem === "latn";
4158
4158
  }
4159
- class nl {
4159
+ class sl {
4160
4160
  constructor(e, t, s) {
4161
4161
  this.padTo = s.padTo || 0, this.floor = s.floor || !1;
4162
4162
  const { padTo: r, floor: i, ...o } = s;
4163
4163
  if (!t || Object.keys(o).length > 0) {
4164
4164
  const a = { useGrouping: !1, ...s };
4165
- s.padTo > 0 && (a.minimumIntegerDigits = s.padTo), this.inf = Ha(e, a);
4165
+ s.padTo > 0 && (a.minimumIntegerDigits = s.padTo), this.inf = Ga(e, a);
4166
4166
  }
4167
4167
  }
4168
4168
  format(e) {
@@ -4170,12 +4170,12 @@ class nl {
4170
4170
  const t = this.floor ? Math.floor(e) : e;
4171
4171
  return this.inf.format(t);
4172
4172
  } else {
4173
- const t = this.floor ? Math.floor(e) : Hs(e, 3);
4173
+ const t = this.floor ? Math.floor(e) : Gs(e, 3);
4174
4174
  return de(t, this.padTo);
4175
4175
  }
4176
4176
  }
4177
4177
  }
4178
- class sl {
4178
+ class rl {
4179
4179
  constructor(e, t, s) {
4180
4180
  this.opts = s, this.originalZone = void 0;
4181
4181
  let r;
@@ -4211,12 +4211,12 @@ class sl {
4211
4211
  return this.dtf.resolvedOptions();
4212
4212
  }
4213
4213
  }
4214
- class rl {
4214
+ class il {
4215
4215
  constructor(e, t, s) {
4216
- this.opts = { style: "long", ...s }, !t && Gi() && (this.rtf = Ga(e, s));
4216
+ this.opts = { style: "long", ...s }, !t && Gi() && (this.rtf = Ya(e, s));
4217
4217
  }
4218
4218
  format(e, t) {
4219
- return this.rtf ? this.rtf.format(e, t) : Sl(t, e, this.opts.numeric, this.opts.style !== "long");
4219
+ return this.rtf ? this.rtf.format(e, t) : Rl(t, e, this.opts.numeric, this.opts.style !== "long");
4220
4220
  }
4221
4221
  formatToParts(e, t) {
4222
4222
  return this.rtf ? this.rtf.formatToParts(e, t) : [];
@@ -4238,7 +4238,7 @@ class re {
4238
4238
  );
4239
4239
  }
4240
4240
  static create(e, t, s, r, i = !1) {
4241
- const o = e || le.defaultLocale, a = o || (i ? "en-US" : Ya()), l = t || le.defaultNumberingSystem, c = s || le.defaultOutputCalendar, d = Ms(r) || le.defaultWeekSettings;
4241
+ const o = e || le.defaultLocale, a = o || (i ? "en-US" : Ja()), l = t || le.defaultNumberingSystem, c = s || le.defaultOutputCalendar, d = $s(r) || le.defaultWeekSettings;
4242
4242
  return new re(a, l, c, d, o);
4243
4243
  }
4244
4244
  static resetCache() {
@@ -4248,11 +4248,11 @@ class re {
4248
4248
  return re.create(e, t, s, r);
4249
4249
  }
4250
4250
  constructor(e, t, s, r, i) {
4251
- const [o, a, l] = Qa(e);
4252
- this.locale = o, this.numberingSystem = t || a || null, this.outputCalendar = s || l || null, this.weekSettings = r, this.intl = Ka(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
4251
+ const [o, a, l] = Ka(e);
4252
+ this.locale = o, this.numberingSystem = t || a || null, this.outputCalendar = s || l || null, this.weekSettings = r, this.intl = Xa(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
4253
4253
  }
4254
4254
  get fastNumbers() {
4255
- return this.fastNumbersCached == null && (this.fastNumbersCached = tl(this)), this.fastNumbersCached;
4255
+ return this.fastNumbersCached == null && (this.fastNumbersCached = nl(this)), this.fastNumbersCached;
4256
4256
  }
4257
4257
  listingMode() {
4258
4258
  const e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
@@ -4263,7 +4263,7 @@ class re {
4263
4263
  e.locale || this.specifiedLocale,
4264
4264
  e.numberingSystem || this.numberingSystem,
4265
4265
  e.outputCalendar || this.outputCalendar,
4266
- Ms(e.weekSettings) || this.weekSettings,
4266
+ $s(e.weekSettings) || this.weekSettings,
4267
4267
  e.defaultToEN || !1
4268
4268
  );
4269
4269
  }
@@ -4280,7 +4280,7 @@ class re {
4280
4280
  const r = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
4281
4281
  if (!this.monthsCache[i][e]) {
4282
4282
  const o = s ? (a) => this.dtFormatter(a, r).format() : (a) => this.extract(a, r, "month");
4283
- this.monthsCache[i][e] = Xa(o);
4283
+ this.monthsCache[i][e] = el(o);
4284
4284
  }
4285
4285
  return this.monthsCache[i][e];
4286
4286
  });
@@ -4288,7 +4288,7 @@ class re {
4288
4288
  weekdays(e, t = !1) {
4289
4289
  return mn(this, e, no, () => {
4290
4290
  const s = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, r = t ? "format" : "standalone";
4291
- return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = el(
4291
+ return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = tl(
4292
4292
  (i) => this.extract(i, s, "weekday")
4293
4293
  )), this.weekdaysCache[r][e];
4294
4294
  });
@@ -4322,22 +4322,22 @@ class re {
4322
4322
  return o ? o.value : null;
4323
4323
  }
4324
4324
  numberFormatter(e = {}) {
4325
- return new nl(this.intl, e.forceSimple || this.fastNumbers, e);
4325
+ return new sl(this.intl, e.forceSimple || this.fastNumbers, e);
4326
4326
  }
4327
4327
  dtFormatter(e, t = {}) {
4328
- return new sl(e, this.intl, t);
4328
+ return new rl(e, this.intl, t);
4329
4329
  }
4330
4330
  relFormatter(e = {}) {
4331
- return new rl(this.intl, this.isEnglish(), e);
4331
+ return new il(this.intl, this.isEnglish(), e);
4332
4332
  }
4333
4333
  listFormatter(e = {}) {
4334
- return Ba(this.intl, e);
4334
+ return Ha(this.intl, e);
4335
4335
  }
4336
4336
  isEnglish() {
4337
4337
  return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Ui(this.intl).locale.startsWith("en-us");
4338
4338
  }
4339
4339
  getWeekSettings() {
4340
- return this.weekSettings ? this.weekSettings : Yi() ? Ja(this.locale) : Wi;
4340
+ return this.weekSettings ? this.weekSettings : Yi() ? Qa(this.locale) : Wi;
4341
4341
  }
4342
4342
  getStartOfWeek() {
4343
4343
  return this.getWeekSettings().firstDay;
@@ -4475,7 +4475,7 @@ class _e extends an {
4475
4475
  return !0;
4476
4476
  }
4477
4477
  }
4478
- class il extends an {
4478
+ class ol extends an {
4479
4479
  constructor(e) {
4480
4480
  super(), this.zoneName = e;
4481
4481
  }
@@ -4517,12 +4517,12 @@ function rt(n, e) {
4517
4517
  return e;
4518
4518
  if (n instanceof an)
4519
4519
  return n;
4520
- if (dl(n)) {
4520
+ if (fl(n)) {
4521
4521
  const t = n.toLowerCase();
4522
4522
  return t === "default" ? e : t === "local" || t === "system" ? Hn.instance : t === "utc" || t === "gmt" ? _e.utcInstance : _e.parseSpecifier(t) || Qe.create(n);
4523
- } else return at(n) ? _e.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new il(n);
4523
+ } else return at(n) ? _e.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new ol(n);
4524
4524
  }
4525
- const Zs = {
4525
+ const zs = {
4526
4526
  arab: "[٠-٩]",
4527
4527
  arabext: "[۰-۹]",
4528
4528
  bali: "[᭐-᭙]",
@@ -4544,7 +4544,7 @@ const Zs = {
4544
4544
  thai: "[๐-๙]",
4545
4545
  tibt: "[༠-༩]",
4546
4546
  latn: "\\d"
4547
- }, vr = {
4547
+ }, Or = {
4548
4548
  arab: [1632, 1641],
4549
4549
  arabext: [1776, 1785],
4550
4550
  bali: [6992, 7001],
@@ -4564,18 +4564,18 @@ const Zs = {
4564
4564
  telu: [3174, 3183],
4565
4565
  thai: [3664, 3673],
4566
4566
  tibt: [3872, 3881]
4567
- }, ol = Zs.hanidec.replace(/[\[|\]]/g, "").split("");
4568
- function al(n) {
4567
+ }, al = zs.hanidec.replace(/[\[|\]]/g, "").split("");
4568
+ function ll(n) {
4569
4569
  let e = parseInt(n, 10);
4570
4570
  if (isNaN(e)) {
4571
4571
  e = "";
4572
4572
  for (let t = 0; t < n.length; t++) {
4573
4573
  const s = n.charCodeAt(t);
4574
- if (n[t].search(Zs.hanidec) !== -1)
4575
- e += ol.indexOf(n[t]);
4574
+ if (n[t].search(zs.hanidec) !== -1)
4575
+ e += al.indexOf(n[t]);
4576
4576
  else
4577
- for (const r in vr) {
4578
- const [i, o] = vr[r];
4577
+ for (const r in Or) {
4578
+ const [i, o] = Or[r];
4579
4579
  s >= i && s <= o && (e += s - i);
4580
4580
  }
4581
4581
  }
@@ -4583,25 +4583,25 @@ function al(n) {
4583
4583
  } else
4584
4584
  return e;
4585
4585
  }
4586
- const $s = /* @__PURE__ */ new Map();
4587
- function ll() {
4588
- $s.clear();
4586
+ const Fs = /* @__PURE__ */ new Map();
4587
+ function cl() {
4588
+ Fs.clear();
4589
4589
  }
4590
- function Me({ numberingSystem: n }, e = "") {
4590
+ function $e({ numberingSystem: n }, e = "") {
4591
4591
  const t = n || "latn";
4592
- let s = $s.get(t);
4593
- s === void 0 && (s = /* @__PURE__ */ new Map(), $s.set(t, s));
4592
+ let s = Fs.get(t);
4593
+ s === void 0 && (s = /* @__PURE__ */ new Map(), Fs.set(t, s));
4594
4594
  let r = s.get(e);
4595
- return r === void 0 && (r = new RegExp(`${Zs[t]}${e}`), s.set(e, r)), r;
4595
+ return r === void 0 && (r = new RegExp(`${zs[t]}${e}`), s.set(e, r)), r;
4596
4596
  }
4597
- let Or = () => Date.now(), kr = "system", br = null, Tr = null, Sr = null, Rr = 60, Ir, xr = null;
4597
+ let kr = () => Date.now(), br = "system", Tr = null, Sr = null, Rr = null, Ir = 60, xr, Nr = null;
4598
4598
  class le {
4599
4599
  /**
4600
4600
  * Get the callback for returning the current timestamp.
4601
4601
  * @type {function}
4602
4602
  */
4603
4603
  static get now() {
4604
- return Or;
4604
+ return kr;
4605
4605
  }
4606
4606
  /**
4607
4607
  * Set the callback for returning the current timestamp.
@@ -4611,7 +4611,7 @@ class le {
4611
4611
  * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
4612
4612
  */
4613
4613
  static set now(e) {
4614
- Or = e;
4614
+ kr = e;
4615
4615
  }
4616
4616
  /**
4617
4617
  * Set the default time zone to create DateTimes in. Does not affect existing instances.
@@ -4619,7 +4619,7 @@ class le {
4619
4619
  * @type {string}
4620
4620
  */
4621
4621
  static set defaultZone(e) {
4622
- kr = e;
4622
+ br = e;
4623
4623
  }
4624
4624
  /**
4625
4625
  * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
@@ -4627,49 +4627,49 @@ class le {
4627
4627
  * @type {Zone}
4628
4628
  */
4629
4629
  static get defaultZone() {
4630
- return rt(kr, Hn.instance);
4630
+ return rt(br, Hn.instance);
4631
4631
  }
4632
4632
  /**
4633
4633
  * Get the default locale to create DateTimes with. Does not affect existing instances.
4634
4634
  * @type {string}
4635
4635
  */
4636
4636
  static get defaultLocale() {
4637
- return br;
4637
+ return Tr;
4638
4638
  }
4639
4639
  /**
4640
4640
  * Set the default locale to create DateTimes with. Does not affect existing instances.
4641
4641
  * @type {string}
4642
4642
  */
4643
4643
  static set defaultLocale(e) {
4644
- br = e;
4644
+ Tr = e;
4645
4645
  }
4646
4646
  /**
4647
4647
  * Get the default numbering system to create DateTimes with. Does not affect existing instances.
4648
4648
  * @type {string}
4649
4649
  */
4650
4650
  static get defaultNumberingSystem() {
4651
- return Tr;
4651
+ return Sr;
4652
4652
  }
4653
4653
  /**
4654
4654
  * Set the default numbering system to create DateTimes with. Does not affect existing instances.
4655
4655
  * @type {string}
4656
4656
  */
4657
4657
  static set defaultNumberingSystem(e) {
4658
- Tr = e;
4658
+ Sr = e;
4659
4659
  }
4660
4660
  /**
4661
4661
  * Get the default output calendar to create DateTimes with. Does not affect existing instances.
4662
4662
  * @type {string}
4663
4663
  */
4664
4664
  static get defaultOutputCalendar() {
4665
- return Sr;
4665
+ return Rr;
4666
4666
  }
4667
4667
  /**
4668
4668
  * Set the default output calendar to create DateTimes with. Does not affect existing instances.
4669
4669
  * @type {string}
4670
4670
  */
4671
4671
  static set defaultOutputCalendar(e) {
4672
- Sr = e;
4672
+ Rr = e;
4673
4673
  }
4674
4674
  /**
4675
4675
  * @typedef {Object} WeekSettings
@@ -4681,7 +4681,7 @@ class le {
4681
4681
  * @return {WeekSettings|null}
4682
4682
  */
4683
4683
  static get defaultWeekSettings() {
4684
- return xr;
4684
+ return Nr;
4685
4685
  }
4686
4686
  /**
4687
4687
  * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and
@@ -4691,14 +4691,14 @@ class le {
4691
4691
  * @param {WeekSettings|null} weekSettings
4692
4692
  */
4693
4693
  static set defaultWeekSettings(e) {
4694
- xr = Ms(e);
4694
+ Nr = $s(e);
4695
4695
  }
4696
4696
  /**
4697
4697
  * 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.
4698
4698
  * @type {number}
4699
4699
  */
4700
4700
  static get twoDigitCutoffYear() {
4701
- return Rr;
4701
+ return Ir;
4702
4702
  }
4703
4703
  /**
4704
4704
  * 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.
@@ -4710,28 +4710,28 @@ class le {
4710
4710
  * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
4711
4711
  */
4712
4712
  static set twoDigitCutoffYear(e) {
4713
- Rr = e % 100;
4713
+ Ir = e % 100;
4714
4714
  }
4715
4715
  /**
4716
4716
  * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
4717
4717
  * @type {boolean}
4718
4718
  */
4719
4719
  static get throwOnInvalid() {
4720
- return Ir;
4720
+ return xr;
4721
4721
  }
4722
4722
  /**
4723
4723
  * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
4724
4724
  * @type {boolean}
4725
4725
  */
4726
4726
  static set throwOnInvalid(e) {
4727
- Ir = e;
4727
+ xr = e;
4728
4728
  }
4729
4729
  /**
4730
4730
  * Reset Luxon's global caches. Should only be necessary in testing scenarios.
4731
4731
  * @return {void}
4732
4732
  */
4733
4733
  static resetCaches() {
4734
- re.resetCache(), Qe.resetCache(), L.resetCache(), ll();
4734
+ re.resetCache(), Qe.resetCache(), L.resetCache(), cl();
4735
4735
  }
4736
4736
  }
4737
4737
  class Pe {
@@ -4749,7 +4749,7 @@ function Ne(n, e) {
4749
4749
  `you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`
4750
4750
  );
4751
4751
  }
4752
- function zs(n, e, t) {
4752
+ function qs(n, e, t) {
4753
4753
  const s = new Date(Date.UTC(n, e - 1, t));
4754
4754
  n < 100 && n >= 0 && s.setUTCFullYear(s.getUTCFullYear() - 1900);
4755
4755
  const r = s.getUTCDay();
@@ -4762,16 +4762,16 @@ function qi(n, e) {
4762
4762
  const t = ln(n) ? Zi : ji, s = t.findIndex((i) => i < e), r = e - t[s];
4763
4763
  return { month: s + 1, day: r };
4764
4764
  }
4765
- function qs(n, e) {
4765
+ function Bs(n, e) {
4766
4766
  return (n - e + 7) % 7 + 1;
4767
4767
  }
4768
4768
  function Vn(n, e = 4, t = 1) {
4769
- const { year: s, month: r, day: i } = n, o = zi(s, r, i), a = qs(zs(s, r, i), t);
4769
+ const { year: s, month: r, day: i } = n, o = zi(s, r, i), a = Bs(qs(s, r, i), t);
4770
4770
  let l = Math.floor((o - a + 14 - e) / 7), c;
4771
4771
  return l < 1 ? (c = s - 1, l = sn(c, e, t)) : l > sn(s, e, t) ? (c = s + 1, l = 1) : c = s, { weekYear: c, weekNumber: l, weekday: a, ...Qn(n) };
4772
4772
  }
4773
- function Nr(n, e = 4, t = 1) {
4774
- const { weekYear: s, weekNumber: r, weekday: i } = n, o = qs(zs(s, 1, e), t), a = Nt(s);
4773
+ function Dr(n, e = 4, t = 1) {
4774
+ const { weekYear: s, weekNumber: r, weekday: i } = n, o = Bs(qs(s, 1, e), t), a = Nt(s);
4775
4775
  let l = r * 7 + i - o - 7 + e, c;
4776
4776
  l < 1 ? (c = s - 1, l += Nt(c)) : l > a ? (c = s + 1, l -= Nt(s)) : c = s;
4777
4777
  const { month: d, day: m } = qi(c, l);
@@ -4781,11 +4781,11 @@ function as(n) {
4781
4781
  const { year: e, month: t, day: s } = n, r = zi(e, t, s);
4782
4782
  return { year: e, ordinal: r, ...Qn(n) };
4783
4783
  }
4784
- function Dr(n) {
4784
+ function Ar(n) {
4785
4785
  const { year: e, ordinal: t } = n, { month: s, day: r } = qi(e, t);
4786
4786
  return { year: e, month: s, day: r, ...Qn(n) };
4787
4787
  }
4788
- function Ar(n, e) {
4788
+ function Cr(n, e) {
4789
4789
  if (!H(n.localWeekday) || !H(n.localWeekNumber) || !H(n.localWeekYear)) {
4790
4790
  if (!H(n.weekday) || !H(n.weekNumber) || !H(n.weekYear))
4791
4791
  throw new It(
@@ -4798,7 +4798,7 @@ function Ar(n, e) {
4798
4798
  } else
4799
4799
  return { minDaysInFirstWeek: 4, startOfWeek: 1 };
4800
4800
  }
4801
- function cl(n, e = 4, t = 1) {
4801
+ function ul(n, e = 4, t = 1) {
4802
4802
  const s = Gn(n.weekYear), r = De(
4803
4803
  n.weekNumber,
4804
4804
  1,
@@ -4806,7 +4806,7 @@ function cl(n, e = 4, t = 1) {
4806
4806
  ), i = De(n.weekday, 1, 7);
4807
4807
  return s ? r ? i ? !1 : Ne("weekday", n.weekday) : Ne("week", n.weekNumber) : Ne("weekYear", n.weekYear);
4808
4808
  }
4809
- function ul(n) {
4809
+ function dl(n) {
4810
4810
  const e = Gn(n.year), t = De(n.ordinal, 1, Nt(n.year));
4811
4811
  return e ? t ? !1 : Ne("ordinal", n.ordinal) : Ne("year", n.year);
4812
4812
  }
@@ -4827,10 +4827,10 @@ function at(n) {
4827
4827
  function Gn(n) {
4828
4828
  return typeof n == "number" && n % 1 === 0;
4829
4829
  }
4830
- function dl(n) {
4830
+ function fl(n) {
4831
4831
  return typeof n == "string";
4832
4832
  }
4833
- function fl(n) {
4833
+ function hl(n) {
4834
4834
  return Object.prototype.toString.call(n) === "[object Date]";
4835
4835
  }
4836
4836
  function Gi() {
@@ -4847,23 +4847,23 @@ function Yi() {
4847
4847
  return !1;
4848
4848
  }
4849
4849
  }
4850
- function hl(n) {
4850
+ function ml(n) {
4851
4851
  return Array.isArray(n) ? n : [n];
4852
4852
  }
4853
- function Cr(n, e, t) {
4853
+ function Fr(n, e, t) {
4854
4854
  if (n.length !== 0)
4855
4855
  return n.reduce((s, r) => {
4856
4856
  const i = [e(r), r];
4857
4857
  return s && t(s[0], i[0]) === s[0] ? s : i;
4858
4858
  }, null)[1];
4859
4859
  }
4860
- function ml(n, e) {
4860
+ function pl(n, e) {
4861
4861
  return e.reduce((t, s) => (t[s] = n[s], t), {});
4862
4862
  }
4863
4863
  function Pt(n, e) {
4864
4864
  return Object.prototype.hasOwnProperty.call(n, e);
4865
4865
  }
4866
- function Ms(n) {
4866
+ function $s(n) {
4867
4867
  if (n == null)
4868
4868
  return null;
4869
4869
  if (typeof n != "object")
@@ -4879,7 +4879,7 @@ function Ms(n) {
4879
4879
  function De(n, e, t) {
4880
4880
  return Gn(n) && n >= e && n <= t;
4881
4881
  }
4882
- function pl(n, e) {
4882
+ function yl(n, e) {
4883
4883
  return n - e * Math.floor(n / e);
4884
4884
  }
4885
4885
  function de(n, e = 2) {
@@ -4895,13 +4895,13 @@ function ht(n) {
4895
4895
  if (!(H(n) || n === null || n === ""))
4896
4896
  return parseFloat(n);
4897
4897
  }
4898
- function Bs(n) {
4898
+ function Hs(n) {
4899
4899
  if (!(H(n) || n === null || n === "")) {
4900
4900
  const e = parseFloat("0." + n) * 1e3;
4901
4901
  return Math.floor(e);
4902
4902
  }
4903
4903
  }
4904
- function Hs(n, e, t = "round") {
4904
+ function Gs(n, e, t = "round") {
4905
4905
  const s = 10 ** e;
4906
4906
  switch (t) {
4907
4907
  case "expand":
@@ -4925,7 +4925,7 @@ function Nt(n) {
4925
4925
  return ln(n) ? 366 : 365;
4926
4926
  }
4927
4927
  function Un(n, e) {
4928
- const t = pl(e - 1, 12) + 1, s = n + (e - t) / 12;
4928
+ const t = yl(e - 1, 12) + 1, s = n + (e - t) / 12;
4929
4929
  return t === 2 ? ln(s) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
4930
4930
  }
4931
4931
  function Yn(n) {
@@ -4941,13 +4941,13 @@ function Yn(n) {
4941
4941
  return n.year < 100 && n.year >= 0 && (e = new Date(e), e.setUTCFullYear(n.year, n.month - 1, n.day)), +e;
4942
4942
  }
4943
4943
  function $r(n, e, t) {
4944
- return -qs(zs(n, 1, e), t) + e - 1;
4944
+ return -Bs(qs(n, 1, e), t) + e - 1;
4945
4945
  }
4946
4946
  function sn(n, e = 4, t = 1) {
4947
4947
  const s = $r(n, e, t), r = $r(n + 1, e, t);
4948
4948
  return (Nt(n) - s + r) / 7;
4949
4949
  }
4950
- function Fs(n) {
4950
+ function Ms(n) {
4951
4951
  return n > 99 ? n : n > le.twoDigitCutoffYear ? 1900 + n : 2e3 + n;
4952
4952
  }
4953
4953
  function Ji(n, e, t, s = null) {
@@ -4999,9 +4999,9 @@ function en(n, e) {
4999
4999
  }
5000
5000
  }
5001
5001
  function Qn(n) {
5002
- return ml(n, ["hour", "minute", "second", "millisecond"]);
5002
+ return pl(n, ["hour", "minute", "second", "millisecond"]);
5003
5003
  }
5004
- const yl = [
5004
+ const gl = [
5005
5005
  "January",
5006
5006
  "February",
5007
5007
  "March",
@@ -5027,15 +5027,15 @@ const yl = [
5027
5027
  "Oct",
5028
5028
  "Nov",
5029
5029
  "Dec"
5030
- ], gl = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
5030
+ ], wl = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
5031
5031
  function Xi(n) {
5032
5032
  switch (n) {
5033
5033
  case "narrow":
5034
- return [...gl];
5034
+ return [...wl];
5035
5035
  case "short":
5036
5036
  return [...Ki];
5037
5037
  case "long":
5038
- return [...yl];
5038
+ return [...gl];
5039
5039
  case "numeric":
5040
5040
  return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
5041
5041
  case "2-digit":
@@ -5052,11 +5052,11 @@ const eo = [
5052
5052
  "Friday",
5053
5053
  "Saturday",
5054
5054
  "Sunday"
5055
- ], to = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], wl = ["M", "T", "W", "T", "F", "S", "S"];
5055
+ ], to = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], _l = ["M", "T", "W", "T", "F", "S", "S"];
5056
5056
  function no(n) {
5057
5057
  switch (n) {
5058
5058
  case "narrow":
5059
- return [...wl];
5059
+ return [..._l];
5060
5060
  case "short":
5061
5061
  return [...to];
5062
5062
  case "long":
@@ -5067,32 +5067,32 @@ function no(n) {
5067
5067
  return null;
5068
5068
  }
5069
5069
  }
5070
- const so = ["AM", "PM"], _l = ["Before Christ", "Anno Domini"], El = ["BC", "AD"], vl = ["B", "A"];
5070
+ const so = ["AM", "PM"], El = ["Before Christ", "Anno Domini"], vl = ["BC", "AD"], Ol = ["B", "A"];
5071
5071
  function ro(n) {
5072
5072
  switch (n) {
5073
5073
  case "narrow":
5074
- return [...vl];
5074
+ return [...Ol];
5075
5075
  case "short":
5076
- return [...El];
5076
+ return [...vl];
5077
5077
  case "long":
5078
- return [..._l];
5078
+ return [...El];
5079
5079
  default:
5080
5080
  return null;
5081
5081
  }
5082
5082
  }
5083
- function Ol(n) {
5083
+ function kl(n) {
5084
5084
  return so[n.hour < 12 ? 0 : 1];
5085
5085
  }
5086
- function kl(n, e) {
5086
+ function bl(n, e) {
5087
5087
  return no(e)[n.weekday - 1];
5088
5088
  }
5089
- function bl(n, e) {
5089
+ function Tl(n, e) {
5090
5090
  return Xi(e)[n.month - 1];
5091
5091
  }
5092
- function Tl(n, e) {
5092
+ function Sl(n, e) {
5093
5093
  return ro(e)[n.year < 0 ? 0 : 1];
5094
5094
  }
5095
- function Sl(n, e, t = "always", s = !1) {
5095
+ function Rl(n, e, t = "always", s = !1) {
5096
5096
  const r = {
5097
5097
  years: ["year", "yr."],
5098
5098
  quarters: ["quarter", "qtr."],
@@ -5123,7 +5123,7 @@ function Mr(n, e) {
5123
5123
  s.literal ? t += s.val : t += e(s.val);
5124
5124
  return t;
5125
5125
  }
5126
- const Rl = {
5126
+ const Il = {
5127
5127
  D: Ln,
5128
5128
  DD: vi,
5129
5129
  DDD: Oi,
@@ -5137,11 +5137,11 @@ const Rl = {
5137
5137
  TTT: Ni,
5138
5138
  TTTT: Di,
5139
5139
  f: Ai,
5140
- ff: $i,
5141
- fff: Fi,
5140
+ ff: Fi,
5141
+ fff: Mi,
5142
5142
  ffff: Li,
5143
5143
  F: Ci,
5144
- FF: Mi,
5144
+ FF: $i,
5145
5145
  FFF: Pi,
5146
5146
  FFFF: Vi
5147
5147
  };
@@ -5162,7 +5162,7 @@ class ge {
5162
5162
  return s.length > 0 && i.push({ literal: r || /^\s+$/.test(s), val: s }), i;
5163
5163
  }
5164
5164
  static macroTokenToFormatOpts(e) {
5165
- return Rl[e];
5165
+ return Il[e];
5166
5166
  }
5167
5167
  constructor(e, t) {
5168
5168
  this.opts = t, this.loc = e, this.systemLoc = null;
@@ -5192,13 +5192,13 @@ class ge {
5192
5192
  return t > 0 && (r.padTo = t), s && (r.signDisplay = s), this.loc.numberFormatter(r).format(e);
5193
5193
  }
5194
5194
  formatDateTimeFromString(e, t) {
5195
- const s = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (f, g) => this.loc.extract(e, f, g), o = (f) => e.isOffsetFixed && e.offset === 0 && f.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, f.format) : "", a = () => s ? Ol(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (f, g) => s ? bl(e, f) : i(g ? { month: f } : { month: f, day: "numeric" }, "month"), c = (f, g) => s ? kl(e, f) : i(
5195
+ const s = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (f, g) => this.loc.extract(e, f, g), o = (f) => e.isOffsetFixed && e.offset === 0 && f.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, f.format) : "", a = () => s ? kl(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (f, g) => s ? Tl(e, f) : i(g ? { month: f } : { month: f, day: "numeric" }, "month"), c = (f, g) => s ? bl(e, f) : i(
5196
5196
  g ? { weekday: f } : { weekday: f, month: "long", day: "numeric" },
5197
5197
  "weekday"
5198
5198
  ), d = (f) => {
5199
5199
  const g = ge.macroTokenToFormatOpts(f);
5200
5200
  return g ? this.formatWithSystemDefault(e, g) : f;
5201
- }, m = (f) => s ? Tl(e, f) : i({ era: f }, "era"), u = (f) => {
5201
+ }, m = (f) => s ? Sl(e, f) : i({ era: f }, "era"), u = (f) => {
5202
5202
  switch (f) {
5203
5203
  // ms
5204
5204
  case "S":
@@ -5418,14 +5418,14 @@ function oo(...n) {
5418
5418
  return [s, null, t + r];
5419
5419
  };
5420
5420
  }
5421
- const ao = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Il = `(?:${ao.source}?(?:\\[(${io.source})\\])?)?`, Gs = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, lo = RegExp(`${Gs.source}${Il}`), Ys = RegExp(`(?:[Tt]${lo.source})?`), xl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Nl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Dl = /(\d{4})-?(\d{3})/, Al = oo("weekYear", "weekNumber", "weekDay"), Cl = oo("year", "ordinal"), $l = /(\d{4})-(\d\d)-(\d\d)/, co = RegExp(
5422
- `${Gs.source} ?(?:${ao.source}|(${io.source}))?`
5421
+ const ao = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, xl = `(?:${ao.source}?(?:\\[(${io.source})\\])?)?`, Ys = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, lo = RegExp(`${Ys.source}${xl}`), Js = RegExp(`(?:[Tt]${lo.source})?`), Nl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Dl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Al = /(\d{4})-?(\d{3})/, Cl = oo("weekYear", "weekNumber", "weekDay"), Fl = oo("year", "ordinal"), $l = /(\d{4})-(\d\d)-(\d\d)/, co = RegExp(
5422
+ `${Ys.source} ?(?:${ao.source}|(${io.source}))?`
5423
5423
  ), Ml = RegExp(`(?: ${co.source})?`);
5424
5424
  function Dt(n, e, t) {
5425
5425
  const s = n[e];
5426
5426
  return H(s) ? t : st(s);
5427
5427
  }
5428
- function Fl(n, e) {
5428
+ function Pl(n, e) {
5429
5429
  return [{
5430
5430
  year: Dt(n, e),
5431
5431
  month: Dt(n, e + 1, 1),
@@ -5437,7 +5437,7 @@ function jt(n, e) {
5437
5437
  hours: Dt(n, e, 0),
5438
5438
  minutes: Dt(n, e + 1, 0),
5439
5439
  seconds: Dt(n, e + 2, 0),
5440
- milliseconds: Bs(n[e + 3])
5440
+ milliseconds: Hs(n[e + 3])
5441
5441
  }, null, e + 4];
5442
5442
  }
5443
5443
  function cn(n, e) {
@@ -5448,8 +5448,8 @@ function un(n, e) {
5448
5448
  const t = n[e] ? Qe.create(n[e]) : null;
5449
5449
  return [{}, t, e + 1];
5450
5450
  }
5451
- const Pl = RegExp(`^T?${Gs.source}$`), Ll = /^-?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)?)?)$/;
5452
- function Vl(n) {
5451
+ const Ll = RegExp(`^T?${Ys.source}$`), Vl = /^-?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)?)?)$/;
5452
+ function Ul(n) {
5453
5453
  const [e, t, s, r, i, o, a, l, c] = n, d = e[0] === "-", m = l && l[0] === "-", u = (f, g = !1) => f !== void 0 && (g || f && d) ? -f : f;
5454
5454
  return [
5455
5455
  {
@@ -5460,11 +5460,11 @@ function Vl(n) {
5460
5460
  hours: u(ht(o)),
5461
5461
  minutes: u(ht(a)),
5462
5462
  seconds: u(ht(l), l === "-0"),
5463
- milliseconds: u(Bs(c), m)
5463
+ milliseconds: u(Hs(c), m)
5464
5464
  }
5465
5465
  ];
5466
5466
  }
5467
- const Ul = {
5467
+ const Wl = {
5468
5468
  GMT: 0,
5469
5469
  EDT: -240,
5470
5470
  EST: -300,
@@ -5475,9 +5475,9 @@ const Ul = {
5475
5475
  PDT: -420,
5476
5476
  PST: -480
5477
5477
  };
5478
- function Js(n, e, t, s, r, i, o) {
5478
+ function Qs(n, e, t, s, r, i, o) {
5479
5479
  const a = {
5480
- year: e.length === 2 ? Fs(st(e)) : st(e),
5480
+ year: e.length === 2 ? Ms(st(e)) : st(e),
5481
5481
  month: Ki.indexOf(t) + 1,
5482
5482
  day: st(s),
5483
5483
  hour: st(r),
@@ -5485,8 +5485,8 @@ function Js(n, e, t, s, r, i, o) {
5485
5485
  };
5486
5486
  return o && (a.second = st(o)), n && (a.weekday = n.length > 3 ? eo.indexOf(n) + 1 : to.indexOf(n) + 1), a;
5487
5487
  }
5488
- const Wl = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
5489
- function jl(n) {
5488
+ const jl = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
5489
+ function Zl(n) {
5490
5490
  const [
5491
5491
  ,
5492
5492
  e,
@@ -5500,29 +5500,24 @@ function jl(n) {
5500
5500
  c,
5501
5501
  d,
5502
5502
  m
5503
- ] = n, u = Js(e, r, s, t, i, o, a);
5503
+ ] = n, u = Qs(e, r, s, t, i, o, a);
5504
5504
  let f;
5505
- return l ? f = Ul[l] : c ? f = 0 : f = Jn(d, m), [u, new _e(f)];
5505
+ return l ? f = Wl[l] : c ? f = 0 : f = Jn(d, m), [u, new _e(f)];
5506
5506
  }
5507
- function Zl(n) {
5507
+ function zl(n) {
5508
5508
  return n.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
5509
5509
  }
5510
- const zl = /^(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$/, ql = /^(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$/, Bl = /^(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})$/;
5511
- function Fr(n) {
5510
+ const ql = /^(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$/, Bl = /^(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$/, Hl = /^(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})$/;
5511
+ function Pr(n) {
5512
5512
  const [, e, t, s, r, i, o, a] = n;
5513
- return [Js(e, r, s, t, i, o, a), _e.utcInstance];
5513
+ return [Qs(e, r, s, t, i, o, a), _e.utcInstance];
5514
5514
  }
5515
- function Hl(n) {
5515
+ function Gl(n) {
5516
5516
  const [, e, t, s, r, i, o, a] = n;
5517
- return [Js(e, a, t, s, r, i, o), _e.utcInstance];
5517
+ return [Qs(e, a, t, s, r, i, o), _e.utcInstance];
5518
5518
  }
5519
- const Gl = Vt(xl, Ys), Yl = Vt(Nl, Ys), Jl = Vt(Dl, Ys), Ql = Vt(lo), uo = Ut(
5520
- Fl,
5521
- jt,
5522
- cn,
5523
- un
5524
- ), Kl = Ut(
5525
- Al,
5519
+ const Yl = Vt(Nl, Js), Jl = Vt(Dl, Js), Ql = Vt(Al, Js), Kl = Vt(lo), uo = Ut(
5520
+ Pl,
5526
5521
  jt,
5527
5522
  cn,
5528
5523
  un
@@ -5532,50 +5527,55 @@ const Gl = Vt(xl, Ys), Yl = Vt(Nl, Ys), Jl = Vt(Dl, Ys), Ql = Vt(lo), uo = Ut(
5532
5527
  cn,
5533
5528
  un
5534
5529
  ), ec = Ut(
5530
+ Fl,
5531
+ jt,
5532
+ cn,
5533
+ un
5534
+ ), tc = Ut(
5535
5535
  jt,
5536
5536
  cn,
5537
5537
  un
5538
5538
  );
5539
- function tc(n) {
5539
+ function nc(n) {
5540
5540
  return Wt(
5541
5541
  n,
5542
- [Gl, uo],
5543
- [Yl, Kl],
5542
+ [Yl, uo],
5544
5543
  [Jl, Xl],
5545
- [Ql, ec]
5544
+ [Ql, ec],
5545
+ [Kl, tc]
5546
5546
  );
5547
5547
  }
5548
- function nc(n) {
5549
- return Wt(Zl(n), [Wl, jl]);
5550
- }
5551
5548
  function sc(n) {
5549
+ return Wt(zl(n), [jl, Zl]);
5550
+ }
5551
+ function rc(n) {
5552
5552
  return Wt(
5553
5553
  n,
5554
- [zl, Fr],
5555
- [ql, Fr],
5556
- [Bl, Hl]
5554
+ [ql, Pr],
5555
+ [Bl, Pr],
5556
+ [Hl, Gl]
5557
5557
  );
5558
5558
  }
5559
- function rc(n) {
5560
- return Wt(n, [Ll, Vl]);
5559
+ function ic(n) {
5560
+ return Wt(n, [Vl, Ul]);
5561
5561
  }
5562
- const ic = Ut(jt);
5563
- function oc(n) {
5564
- return Wt(n, [Pl, ic]);
5562
+ const oc = Ut(jt);
5563
+ function ac(n) {
5564
+ return Wt(n, [Ll, oc]);
5565
5565
  }
5566
- const ac = Vt($l, Ml), lc = Vt(co), cc = Ut(
5566
+ const lc = Vt($l, Ml), cc = Vt(co), uc = Ut(
5567
5567
  jt,
5568
5568
  cn,
5569
5569
  un
5570
5570
  );
5571
- function uc(n) {
5571
+ function dc(n) {
5572
5572
  return Wt(
5573
5573
  n,
5574
- [ac, uo],
5575
- [lc, cc]
5574
+ [lc, uo],
5575
+ [cc, uc]
5576
5576
  );
5577
5577
  }
5578
- const Pr = "Invalid Duration", fo = {
5578
+ const Lr = "Invalid Duration", fo = {
5579
5579
  weeks: {
5580
5580
  days: 7,
5581
5581
  hours: 168,
@@ -5592,7 +5592,7 @@ const Pr = "Invalid Duration", fo = {
5592
5592
  hours: { minutes: 60, seconds: 3600, milliseconds: 3600 * 1e3 },
5593
5593
  minutes: { seconds: 60, milliseconds: 60 * 1e3 },
5594
5594
  seconds: { milliseconds: 1e3 }
5595
- }, dc = {
5595
+ }, fc = {
5596
5596
  years: {
5597
5597
  quarters: 4,
5598
5598
  months: 12,
@@ -5621,7 +5621,7 @@ const Pr = "Invalid Duration", fo = {
5621
5621
  milliseconds: 720 * 60 * 60 * 1e3
5622
5622
  },
5623
5623
  ...fo
5624
- }, xe = 146097 / 400, bt = 146097 / 4800, fc = {
5624
+ }, xe = 146097 / 400, bt = 146097 / 4800, hc = {
5625
5625
  years: {
5626
5626
  quarters: 4,
5627
5627
  months: 12,
@@ -5660,7 +5660,7 @@ const Pr = "Invalid Duration", fo = {
5660
5660
  "minutes",
5661
5661
  "seconds",
5662
5662
  "milliseconds"
5663
- ], hc = gt.slice(0).reverse();
5663
+ ], mc = gt.slice(0).reverse();
5664
5664
  function Be(n, e, t = !1) {
5665
5665
  const s = {
5666
5666
  values: t ? e.values : { ...n.values, ...e.values || {} },
@@ -5672,11 +5672,11 @@ function Be(n, e, t = !1) {
5672
5672
  }
5673
5673
  function ho(n, e) {
5674
5674
  let t = e.milliseconds ?? 0;
5675
- for (const s of hc.slice(1))
5675
+ for (const s of mc.slice(1))
5676
5676
  e[s] && (t += e[s] * n[s].milliseconds);
5677
5677
  return t;
5678
5678
  }
5679
- function Lr(n, e) {
5679
+ function Vr(n, e) {
5680
5680
  const t = ho(n, e) < 0 ? -1 : 1;
5681
5681
  gt.reduceRight((s, r) => {
5682
5682
  if (H(e[r]))
@@ -5696,7 +5696,7 @@ function Lr(n, e) {
5696
5696
  return r;
5697
5697
  }, null);
5698
5698
  }
5699
- function Vr(n) {
5699
+ function Ur(n) {
5700
5700
  const e = {};
5701
5701
  for (const [t, s] of Object.entries(n))
5702
5702
  s !== 0 && (e[t] = s);
@@ -5708,7 +5708,7 @@ class te {
5708
5708
  */
5709
5709
  constructor(e) {
5710
5710
  const t = e.conversionAccuracy === "longterm" || !1;
5711
- let s = t ? fc : dc;
5711
+ let s = t ? hc : fc;
5712
5712
  e.matrix && (s = e.matrix), this.values = e.values, this.loc = e.loc || re.create(), this.conversionAccuracy = t ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = s, this.isLuxonDuration = !0;
5713
5713
  }
5714
5714
  /**
@@ -5791,7 +5791,7 @@ class te {
5791
5791
  * @return {Duration}
5792
5792
  */
5793
5793
  static fromISO(e, t) {
5794
- const [s] = rc(e);
5794
+ const [s] = ic(e);
5795
5795
  return s ? te.fromObject(s, t) : te.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
5796
5796
  }
5797
5797
  /**
@@ -5811,7 +5811,7 @@ class te {
5811
5811
  * @return {Duration}
5812
5812
  */
5813
5813
  static fromISOTime(e, t) {
5814
- const [s] = oc(e);
5814
+ const [s] = ac(e);
5815
5815
  return s ? te.fromObject(s, t) : te.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
5816
5816
  }
5817
5817
  /**
@@ -5825,7 +5825,7 @@ class te {
5825
5825
  throw new ye("need to specify a reason the Duration is invalid");
5826
5826
  const s = e instanceof Pe ? e : new Pe(e, t);
5827
5827
  if (le.throwOnInvalid)
5828
- throw new Va(s);
5828
+ throw new Ua(s);
5829
5829
  return new te({ invalid: s });
5830
5830
  }
5831
5831
  /**
@@ -5909,7 +5909,7 @@ class te {
5909
5909
  ...t,
5910
5910
  floor: t.round !== !1 && t.floor !== !1
5911
5911
  };
5912
- return this.isValid ? ge.create(this.loc, s).formatDurationFromString(this, e) : Pr;
5912
+ return this.isValid ? ge.create(this.loc, s).formatDurationFromString(this, e) : Lr;
5913
5913
  }
5914
5914
  /**
5915
5915
  * Returns a string representation of a Duration with all units included.
@@ -5928,7 +5928,7 @@ class te {
5928
5928
  * ```
5929
5929
  */
5930
5930
  toHuman(e = {}) {
5931
- if (!this.isValid) return Pr;
5931
+ if (!this.isValid) return Lr;
5932
5932
  const t = e.showZeros !== !1, s = gt.map((r) => {
5933
5933
  const i = this.values[r];
5934
5934
  return H(i) || i === 0 && !t ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: r.slice(0, -1) }).format(i);
@@ -5956,7 +5956,7 @@ class te {
5956
5956
  toISO() {
5957
5957
  if (!this.isValid) return null;
5958
5958
  let e = "P";
5959
- return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += Hs(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
5959
+ return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += Gs(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
5960
5960
  }
5961
5961
  /**
5962
5962
  * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.
@@ -6118,7 +6118,7 @@ class te {
6118
6118
  normalize() {
6119
6119
  if (!this.isValid) return this;
6120
6120
  const e = this.toObject();
6121
- return Lr(this.matrix, e), Be(this, { values: e }, !0);
6121
+ return Vr(this.matrix, e), Be(this, { values: e }, !0);
6122
6122
  }
6123
6123
  /**
6124
6124
  * Rescale units to its largest representation
@@ -6127,7 +6127,7 @@ class te {
6127
6127
  */
6128
6128
  rescale() {
6129
6129
  if (!this.isValid) return this;
6130
- const e = Vr(this.normalize().shiftToAll().toObject());
6130
+ const e = Ur(this.normalize().shiftToAll().toObject());
6131
6131
  return Be(this, { values: e }, !0);
6132
6132
  }
6133
6133
  /**
@@ -6154,7 +6154,7 @@ class te {
6154
6154
  } else at(r[o]) && (s[o] = r[o]);
6155
6155
  for (const o in s)
6156
6156
  s[o] !== 0 && (t[i] += o === i ? s[o] : s[o] / this.matrix[i][o]);
6157
- return Lr(this.matrix, t), Be(this, { values: t }, !0);
6157
+ return Vr(this.matrix, t), Be(this, { values: t }, !0);
6158
6158
  }
6159
6159
  /**
6160
6160
  * Shift this Duration to all available units.
@@ -6192,7 +6192,7 @@ class te {
6192
6192
  */
6193
6193
  removeZeros() {
6194
6194
  if (!this.isValid) return this;
6195
- const e = Vr(this.values);
6195
+ const e = Ur(this.values);
6196
6196
  return Be(this, { values: e }, !0);
6197
6197
  }
6198
6198
  /**
@@ -6299,7 +6299,7 @@ class te {
6299
6299
  }
6300
6300
  }
6301
6301
  const Tt = "Invalid Interval";
6302
- function mc(n, e) {
6302
+ function pc(n, e) {
6303
6303
  return !n || !n.isValid ? ae.invalid("missing or invalid start") : !e || !e.isValid ? ae.invalid("missing or invalid end") : e < n ? ae.invalid(
6304
6304
  "end before start",
6305
6305
  `The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`
@@ -6323,7 +6323,7 @@ class ae {
6323
6323
  throw new ye("need to specify a reason the Interval is invalid");
6324
6324
  const s = e instanceof Pe ? e : new Pe(e, t);
6325
6325
  if (le.throwOnInvalid)
6326
- throw new La(s);
6326
+ throw new Va(s);
6327
6327
  return new ae({ invalid: s });
6328
6328
  }
6329
6329
  /**
@@ -6333,7 +6333,7 @@ class ae {
6333
6333
  * @return {Interval}
6334
6334
  */
6335
6335
  static fromDateTimes(e, t) {
6336
- const s = qt(e), r = qt(t), i = mc(s, r);
6336
+ const s = qt(e), r = qt(t), i = pc(s, r);
6337
6337
  return i ?? new ae({
6338
6338
  start: s,
6339
6339
  end: r
@@ -6936,11 +6936,11 @@ class pn {
6936
6936
  return { relative: Gi(), localeWeek: Yi() };
6937
6937
  }
6938
6938
  }
6939
- function Ur(n, e) {
6939
+ function Wr(n, e) {
6940
6940
  const t = (r) => r.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), s = t(e) - t(n);
6941
6941
  return Math.floor(te.fromMillis(s).as("days"));
6942
6942
  }
6943
- function pc(n, e, t) {
6943
+ function yc(n, e, t) {
6944
6944
  const s = [
6945
6945
  ["years", (l, c) => c.year - l.year],
6946
6946
  ["quarters", (l, c) => c.quarter - l.quarter + (c.year - l.year) * 4],
@@ -6948,19 +6948,19 @@ function pc(n, e, t) {
6948
6948
  [
6949
6949
  "weeks",
6950
6950
  (l, c) => {
6951
- const d = Ur(l, c);
6951
+ const d = Wr(l, c);
6952
6952
  return (d - d % 7) / 7;
6953
6953
  }
6954
6954
  ],
6955
- ["days", Ur]
6955
+ ["days", Wr]
6956
6956
  ], r = {}, i = n;
6957
6957
  let o, a;
6958
6958
  for (const [l, c] of s)
6959
6959
  t.indexOf(l) >= 0 && (o = l, r[l] = c(n, e), a = i.plus(r), a > e ? (r[l]--, n = i.plus(r), n > e && (a = n, r[l]--, n = i.plus(r))) : n = a);
6960
6960
  return [n, r, a, o];
6961
6961
  }
6962
- function yc(n, e, t, s) {
6963
- let [r, i, o, a] = pc(n, e, t);
6962
+ function gc(n, e, t, s) {
6963
+ let [r, i, o, a] = yc(n, e, t);
6964
6964
  const l = e - r, c = t.filter(
6965
6965
  (m) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(m) >= 0
6966
6966
  );
@@ -6968,47 +6968,47 @@ function yc(n, e, t, s) {
6968
6968
  const d = te.fromObject(i, s);
6969
6969
  return c.length > 0 ? te.fromMillis(l, s).shiftTo(...c).plus(d) : d;
6970
6970
  }
6971
- const gc = "missing Intl.DateTimeFormat.formatToParts support";
6971
+ const wc = "missing Intl.DateTimeFormat.formatToParts support";
6972
6972
  function se(n, e = (t) => t) {
6973
- return { regex: n, deser: ([t]) => e(al(t)) };
6973
+ return { regex: n, deser: ([t]) => e(ll(t)) };
6974
6974
  }
6975
- const wc = " ", mo = `[ ${wc}]`, po = new RegExp(mo, "g");
6976
- function _c(n) {
6975
+ const _c = " ", mo = `[ ${_c}]`, po = new RegExp(mo, "g");
6976
+ function Ec(n) {
6977
6977
  return n.replace(/\./g, "\\.?").replace(po, mo);
6978
6978
  }
6979
- function Wr(n) {
6979
+ function jr(n) {
6980
6980
  return n.replace(/\./g, "").replace(po, " ").toLowerCase();
6981
6981
  }
6982
- function Fe(n, e) {
6982
+ function Me(n, e) {
6983
6983
  return n === null ? null : {
6984
- regex: RegExp(n.map(_c).join("|")),
6985
- deser: ([t]) => n.findIndex((s) => Wr(t) === Wr(s)) + e
6984
+ regex: RegExp(n.map(Ec).join("|")),
6985
+ deser: ([t]) => n.findIndex((s) => jr(t) === jr(s)) + e
6986
6986
  };
6987
6987
  }
6988
- function jr(n, e) {
6988
+ function Zr(n, e) {
6989
6989
  return { regex: n, deser: ([, t, s]) => Jn(t, s), groups: e };
6990
6990
  }
6991
6991
  function yn(n) {
6992
6992
  return { regex: n, deser: ([e]) => e };
6993
6993
  }
6994
- function Ec(n) {
6994
+ function vc(n) {
6995
6995
  return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
6996
6996
  }
6997
- function vc(n, e) {
6998
- const t = Me(e), s = Me(e, "{2}"), r = Me(e, "{3}"), i = Me(e, "{4}"), o = Me(e, "{6}"), a = Me(e, "{1,2}"), l = Me(e, "{1,3}"), c = Me(e, "{1,6}"), d = Me(e, "{1,9}"), m = Me(e, "{2,4}"), u = Me(e, "{4,6}"), f = (y) => ({ regex: RegExp(Ec(y.val)), deser: ([w]) => w, literal: !0 }), v = ((y) => {
6997
+ function Oc(n, e) {
6998
+ const t = $e(e), s = $e(e, "{2}"), r = $e(e, "{3}"), i = $e(e, "{4}"), o = $e(e, "{6}"), a = $e(e, "{1,2}"), l = $e(e, "{1,3}"), c = $e(e, "{1,6}"), d = $e(e, "{1,9}"), m = $e(e, "{2,4}"), u = $e(e, "{4,6}"), f = (y) => ({ regex: RegExp(vc(y.val)), deser: ([w]) => w, literal: !0 }), v = ((y) => {
6999
6999
  if (n.literal)
7000
7000
  return f(y);
7001
7001
  switch (y.val) {
7002
7002
  // era
7003
7003
  case "G":
7004
- return Fe(e.eras("short"), 0);
7004
+ return Me(e.eras("short"), 0);
7005
7005
  case "GG":
7006
- return Fe(e.eras("long"), 0);
7006
+ return Me(e.eras("long"), 0);
7007
7007
  // years
7008
7008
  case "y":
7009
7009
  return se(c);
7010
7010
  case "yy":
7011
- return se(m, Fs);
7011
+ return se(m, Ms);
7012
7012
  case "yyyy":
7013
7013
  return se(i);
7014
7014
  case "yyyyy":
@@ -7021,17 +7021,17 @@ function vc(n, e) {
7021
7021
  case "MM":
7022
7022
  return se(s);
7023
7023
  case "MMM":
7024
- return Fe(e.months("short", !0), 1);
7024
+ return Me(e.months("short", !0), 1);
7025
7025
  case "MMMM":
7026
- return Fe(e.months("long", !0), 1);
7026
+ return Me(e.months("long", !0), 1);
7027
7027
  case "L":
7028
7028
  return se(a);
7029
7029
  case "LL":
7030
7030
  return se(s);
7031
7031
  case "LLL":
7032
- return Fe(e.months("short", !1), 1);
7032
+ return Me(e.months("short", !1), 1);
7033
7033
  case "LLLL":
7034
- return Fe(e.months("long", !1), 1);
7034
+ return Me(e.months("long", !1), 1);
7035
7035
  // dates
7036
7036
  case "d":
7037
7037
  return se(a);
@@ -7075,12 +7075,12 @@ function vc(n, e) {
7075
7075
  return se(t);
7076
7076
  // meridiem
7077
7077
  case "a":
7078
- return Fe(e.meridiems(), 0);
7078
+ return Me(e.meridiems(), 0);
7079
7079
  // weekYear (k)
7080
7080
  case "kkkk":
7081
7081
  return se(i);
7082
7082
  case "kk":
7083
- return se(m, Fs);
7083
+ return se(m, Ms);
7084
7084
  // weekNumber (W)
7085
7085
  case "W":
7086
7086
  return se(a);
@@ -7091,19 +7091,19 @@ function vc(n, e) {
7091
7091
  case "c":
7092
7092
  return se(t);
7093
7093
  case "EEE":
7094
- return Fe(e.weekdays("short", !1), 1);
7094
+ return Me(e.weekdays("short", !1), 1);
7095
7095
  case "EEEE":
7096
- return Fe(e.weekdays("long", !1), 1);
7096
+ return Me(e.weekdays("long", !1), 1);
7097
7097
  case "ccc":
7098
- return Fe(e.weekdays("short", !0), 1);
7098
+ return Me(e.weekdays("short", !0), 1);
7099
7099
  case "cccc":
7100
- return Fe(e.weekdays("long", !0), 1);
7100
+ return Me(e.weekdays("long", !0), 1);
7101
7101
  // offset/zone
7102
7102
  case "Z":
7103
7103
  case "ZZ":
7104
- return jr(new RegExp(`([+-]${a.source})(?::(${s.source}))?`), 2);
7104
+ return Zr(new RegExp(`([+-]${a.source})(?::(${s.source}))?`), 2);
7105
7105
  case "ZZZ":
7106
- return jr(new RegExp(`([+-]${a.source})(${s.source})?`), 2);
7106
+ return Zr(new RegExp(`([+-]${a.source})(${s.source})?`), 2);
7107
7107
  // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing
7108
7108
  // because we don't have any way to figure out what they are
7109
7109
  case "z":
@@ -7116,11 +7116,11 @@ function vc(n, e) {
7116
7116
  return f(y);
7117
7117
  }
7118
7118
  })(n) || {
7119
- invalidReason: gc
7119
+ invalidReason: wc
7120
7120
  };
7121
7121
  return v.token = n, v;
7122
7122
  }
7123
- const Oc = {
7123
+ const kc = {
7124
7124
  year: {
7125
7125
  "2-digit": "yy",
7126
7126
  numeric: "yyyyy"
@@ -7162,7 +7162,7 @@ const Oc = {
7162
7162
  short: "ZZZ"
7163
7163
  }
7164
7164
  };
7165
- function kc(n, e, t) {
7165
+ function bc(n, e, t) {
7166
7166
  const { type: s, value: r } = n;
7167
7167
  if (s === "literal") {
7168
7168
  const l = /^\s+$/.test(r);
@@ -7174,17 +7174,17 @@ function kc(n, e, t) {
7174
7174
  const i = e[s];
7175
7175
  let o = s;
7176
7176
  s === "hour" && (e.hour12 != null ? o = e.hour12 ? "hour12" : "hour24" : e.hourCycle != null ? e.hourCycle === "h11" || e.hourCycle === "h12" ? o = "hour12" : o = "hour24" : o = t.hour12 ? "hour12" : "hour24");
7177
- let a = Oc[o];
7177
+ let a = kc[o];
7178
7178
  if (typeof a == "object" && (a = a[i]), a)
7179
7179
  return {
7180
7180
  literal: !1,
7181
7181
  val: a
7182
7182
  };
7183
7183
  }
7184
- function bc(n) {
7184
+ function Tc(n) {
7185
7185
  return [`^${n.map((t) => t.regex).reduce((t, s) => `${t}(${s.source})`, "")}$`, n];
7186
7186
  }
7187
- function Tc(n, e, t) {
7187
+ function Sc(n, e, t) {
7188
7188
  const s = n.match(e);
7189
7189
  if (s) {
7190
7190
  const r = {};
@@ -7198,7 +7198,7 @@ function Tc(n, e, t) {
7198
7198
  } else
7199
7199
  return [s, {}];
7200
7200
  }
7201
- function Sc(n) {
7201
+ function Rc(n) {
7202
7202
  const e = (i) => {
7203
7203
  switch (i) {
7204
7204
  case "S":
@@ -7233,34 +7233,34 @@ function Sc(n) {
7233
7233
  }
7234
7234
  };
7235
7235
  let t = null, s;
7236
- return H(n.z) || (t = Qe.create(n.z)), H(n.Z) || (t || (t = new _e(n.Z)), s = n.Z), H(n.q) || (n.M = (n.q - 1) * 3 + 1), H(n.h) || (n.h < 12 && n.a === 1 ? n.h += 12 : n.h === 12 && n.a === 0 && (n.h = 0)), n.G === 0 && n.y && (n.y = -n.y), H(n.u) || (n.S = Bs(n.u)), [Object.keys(n).reduce((i, o) => {
7236
+ return H(n.z) || (t = Qe.create(n.z)), H(n.Z) || (t || (t = new _e(n.Z)), s = n.Z), H(n.q) || (n.M = (n.q - 1) * 3 + 1), H(n.h) || (n.h < 12 && n.a === 1 ? n.h += 12 : n.h === 12 && n.a === 0 && (n.h = 0)), n.G === 0 && n.y && (n.y = -n.y), H(n.u) || (n.S = Hs(n.u)), [Object.keys(n).reduce((i, o) => {
7237
7237
  const a = e(o);
7238
7238
  return a && (i[a] = n[o]), i;
7239
7239
  }, {}), t, s];
7240
7240
  }
7241
7241
  let ls = null;
7242
- function Rc() {
7242
+ function Ic() {
7243
7243
  return ls || (ls = L.fromMillis(1555555555555)), ls;
7244
7244
  }
7245
- function Ic(n, e) {
7245
+ function xc(n, e) {
7246
7246
  if (n.literal)
7247
7247
  return n;
7248
7248
  const t = ge.macroTokenToFormatOpts(n.val), s = _o(t, e);
7249
7249
  return s == null || s.includes(void 0) ? n : s;
7250
7250
  }
7251
7251
  function yo(n, e) {
7252
- return Array.prototype.concat(...n.map((t) => Ic(t, e)));
7252
+ return Array.prototype.concat(...n.map((t) => xc(t, e)));
7253
7253
  }
7254
7254
  class go {
7255
7255
  constructor(e, t) {
7256
- if (this.locale = e, this.format = t, this.tokens = yo(ge.parseFormat(t), e), this.units = this.tokens.map((s) => vc(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
7257
- const [s, r] = bc(this.units);
7256
+ if (this.locale = e, this.format = t, this.tokens = yo(ge.parseFormat(t), e), this.units = this.tokens.map((s) => Oc(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
7257
+ const [s, r] = Tc(this.units);
7258
7258
  this.regex = RegExp(s, "i"), this.handlers = r;
7259
7259
  }
7260
7260
  }
7261
7261
  explainFromTokens(e) {
7262
7262
  if (this.isValid) {
7263
- const [t, s] = Tc(e, this.regex, this.handlers), [r, i, o] = s ? Sc(s) : [null, null, void 0];
7263
+ const [t, s] = Sc(e, this.regex, this.handlers), [r, i, o] = s ? Rc(s) : [null, null, void 0];
7264
7264
  if (Pt(s, "a") && Pt(s, "H"))
7265
7265
  throw new It(
7266
7266
  "Can't include meridiem when specifying 24-hour format"
@@ -7288,17 +7288,17 @@ class go {
7288
7288
  function wo(n, e, t) {
7289
7289
  return new go(n, t).explainFromTokens(e);
7290
7290
  }
7291
- function xc(n, e, t) {
7291
+ function Nc(n, e, t) {
7292
7292
  const { result: s, zone: r, specificOffset: i, invalidReason: o } = wo(n, e, t);
7293
7293
  return [s, r, i, o];
7294
7294
  }
7295
7295
  function _o(n, e) {
7296
7296
  if (!n)
7297
7297
  return null;
7298
- const s = ge.create(e, n).dtFormatter(Rc()), r = s.formatToParts(), i = s.resolvedOptions();
7299
- return r.map((o) => kc(o, n, i));
7298
+ const s = ge.create(e, n).dtFormatter(Ic()), r = s.formatToParts(), i = s.resolvedOptions();
7299
+ return r.map((o) => bc(o, n, i));
7300
7300
  }
7301
- const cs = "Invalid DateTime", Zr = 864e13;
7301
+ const cs = "Invalid DateTime", zr = 864e13;
7302
7302
  function Yt(n) {
7303
7303
  return new Pe("unsupported zone", `the zone "${n.name}" is not supported`);
7304
7304
  }
@@ -7348,7 +7348,7 @@ function gn(n, e) {
7348
7348
  function vn(n, e, t) {
7349
7349
  return Eo(Yn(n), e, t);
7350
7350
  }
7351
- function zr(n, e) {
7351
+ function qr(n, e) {
7352
7352
  const t = n.o, s = n.c.year + Math.trunc(e.years), r = n.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
7353
7353
  ...n.c,
7354
7354
  year: s,
@@ -7398,7 +7398,7 @@ function fs(n, e, t) {
7398
7398
  } else if (r += de(n.c.month), t === "month") return r;
7399
7399
  return r += de(n.c.day), r;
7400
7400
  }
7401
- function qr(n, e, t, s, r, i, o) {
7401
+ function Br(n, e, t, s, r, i, o) {
7402
7402
  let a = !t || n.c.millisecond !== 0 || n.c.second !== 0, l = "";
7403
7403
  switch (o) {
7404
7404
  case "day":
@@ -7426,20 +7426,20 @@ const vo = {
7426
7426
  minute: 0,
7427
7427
  second: 0,
7428
7428
  millisecond: 0
7429
- }, Nc = {
7429
+ }, Dc = {
7430
7430
  weekNumber: 1,
7431
7431
  weekday: 1,
7432
7432
  hour: 0,
7433
7433
  minute: 0,
7434
7434
  second: 0,
7435
7435
  millisecond: 0
7436
- }, Dc = {
7436
+ }, Ac = {
7437
7437
  ordinal: 1,
7438
7438
  hour: 0,
7439
7439
  minute: 0,
7440
7440
  second: 0,
7441
7441
  millisecond: 0
7442
- }, On = ["year", "month", "day", "hour", "minute", "second", "millisecond"], Ac = [
7442
+ }, On = ["year", "month", "day", "hour", "minute", "second", "millisecond"], Cc = [
7443
7443
  "weekYear",
7444
7444
  "weekNumber",
7445
7445
  "weekday",
@@ -7447,7 +7447,7 @@ const vo = {
7447
7447
  "minute",
7448
7448
  "second",
7449
7449
  "millisecond"
7450
- ], Cc = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
7450
+ ], Fc = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
7451
7451
  function kn(n) {
7452
7452
  const e = {
7453
7453
  year: "year",
@@ -7478,7 +7478,7 @@ function kn(n) {
7478
7478
  if (!e) throw new Ei(n);
7479
7479
  return e;
7480
7480
  }
7481
- function Br(n) {
7481
+ function Hr(n) {
7482
7482
  switch (n.toLowerCase()) {
7483
7483
  case "localweekday":
7484
7484
  case "localweekdays":
@@ -7500,7 +7500,7 @@ function $c(n) {
7500
7500
  let t = Ps.get(e);
7501
7501
  return t === void 0 && (t = n.offset(Jt), Ps.set(e, t)), t;
7502
7502
  }
7503
- function Hr(n, e) {
7503
+ function Gr(n, e) {
7504
7504
  const t = rt(e.zone, le.defaultZone);
7505
7505
  if (!t.isValid)
7506
7506
  return L.invalid(Yt(t));
@@ -7519,8 +7519,8 @@ function Hr(n, e) {
7519
7519
  }
7520
7520
  return new L({ ts: r, zone: t, loc: s, o: i });
7521
7521
  }
7522
- function Gr(n, e, t) {
7523
- const s = H(t.round) ? !0 : t.round, r = H(t.rounding) ? "trunc" : t.rounding, i = (a, l) => (a = Hs(a, s || t.calendary ? 0 : 2, t.calendary ? "round" : r), e.loc.clone(t).relFormatter(t).format(a, l)), o = (a) => t.calendary ? e.hasSame(n, a) ? 0 : e.startOf(a).diff(n.startOf(a), a).get(a) : e.diff(n, a).get(a);
7522
+ function Yr(n, e, t) {
7523
+ const s = H(t.round) ? !0 : t.round, r = H(t.rounding) ? "trunc" : t.rounding, i = (a, l) => (a = Gs(a, s || t.calendary ? 0 : 2, t.calendary ? "round" : r), e.loc.clone(t).relFormatter(t).format(a, l)), o = (a) => t.calendary ? e.hasSame(n, a) ? 0 : e.startOf(a).diff(n.startOf(a), a).get(a) : e.diff(n, a).get(a);
7524
7524
  if (t.unit)
7525
7525
  return i(o(t.unit), t.unit);
7526
7526
  for (const a of t.units) {
@@ -7530,7 +7530,7 @@ function Gr(n, e, t) {
7530
7530
  }
7531
7531
  return i(n > e ? -0 : 0, t.units[t.units.length - 1]);
7532
7532
  }
7533
- function Yr(n) {
7533
+ function Jr(n) {
7534
7534
  let e = {}, t;
7535
7535
  return n.length > 0 && typeof n[n.length - 1] == "object" ? (e = n[n.length - 1], t = Array.from(n).slice(0, n.length - 1)) : t = Array.from(n), [e, t];
7536
7536
  }
@@ -7587,8 +7587,8 @@ class L {
7587
7587
  * @return {DateTime}
7588
7588
  */
7589
7589
  static local() {
7590
- const [e, t] = Yr(arguments), [s, r, i, o, a, l, c] = t;
7591
- return Hr({ year: s, month: r, day: i, hour: o, minute: a, second: l, millisecond: c }, e);
7590
+ const [e, t] = Jr(arguments), [s, r, i, o, a, l, c] = t;
7591
+ return Gr({ year: s, month: r, day: i, hour: o, minute: a, second: l, millisecond: c }, e);
7592
7592
  }
7593
7593
  /**
7594
7594
  * Create a DateTime in UTC
@@ -7616,8 +7616,8 @@ class L {
7616
7616
  * @return {DateTime}
7617
7617
  */
7618
7618
  static utc() {
7619
- const [e, t] = Yr(arguments), [s, r, i, o, a, l, c] = t;
7620
- return e.zone = _e.utcInstance, Hr({ year: s, month: r, day: i, hour: o, minute: a, second: l, millisecond: c }, e);
7619
+ const [e, t] = Jr(arguments), [s, r, i, o, a, l, c] = t;
7620
+ return e.zone = _e.utcInstance, Gr({ year: s, month: r, day: i, hour: o, minute: a, second: l, millisecond: c }, e);
7621
7621
  }
7622
7622
  /**
7623
7623
  * Create a DateTime from a JavaScript Date object. Uses the default zone.
@@ -7627,7 +7627,7 @@ class L {
7627
7627
  * @return {DateTime}
7628
7628
  */
7629
7629
  static fromJSDate(e, t = {}) {
7630
- const s = fl(e) ? e.valueOf() : NaN;
7630
+ const s = hl(e) ? e.valueOf() : NaN;
7631
7631
  if (Number.isNaN(s))
7632
7632
  return L.invalid("invalid input");
7633
7633
  const r = rt(t.zone, le.defaultZone);
@@ -7650,7 +7650,7 @@ class L {
7650
7650
  */
7651
7651
  static fromMillis(e, t = {}) {
7652
7652
  if (at(e))
7653
- return e < -Zr || e > Zr ? L.invalid("Timestamp out of range") : new L({
7653
+ return e < -zr || e > zr ? L.invalid("Timestamp out of range") : new L({
7654
7654
  ts: e,
7655
7655
  zone: rt(t.zone, le.defaultZone),
7656
7656
  loc: re.fromObject(t)
@@ -7717,7 +7717,7 @@ class L {
7717
7717
  const s = rt(t.zone, le.defaultZone);
7718
7718
  if (!s.isValid)
7719
7719
  return L.invalid(Yt(s));
7720
- const r = re.fromObject(t), i = Wn(e, Br), { minDaysInFirstWeek: o, startOfWeek: a } = Ar(i, r), l = le.now(), c = H(t.specificOffset) ? s.offset(l) : t.specificOffset, d = !H(i.ordinal), m = !H(i.year), u = !H(i.month) || !H(i.day), f = m || u, g = i.weekYear || i.weekNumber;
7720
+ const r = re.fromObject(t), i = Wn(e, Hr), { minDaysInFirstWeek: o, startOfWeek: a } = Cr(i, r), l = le.now(), c = H(t.specificOffset) ? s.offset(l) : t.specificOffset, d = !H(i.ordinal), m = !H(i.year), u = !H(i.month) || !H(i.day), f = m || u, g = i.weekYear || i.weekNumber;
7721
7721
  if ((f || d) && g)
7722
7722
  throw new It(
7723
7723
  "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
@@ -7726,16 +7726,16 @@ class L {
7726
7726
  throw new It("Can't mix ordinal dates with month/day");
7727
7727
  const v = g || i.weekday && !f;
7728
7728
  let y, w, R = gn(l, c);
7729
- v ? (y = Ac, w = Nc, R = Vn(R, o, a)) : d ? (y = Cc, w = Dc, R = as(R)) : (y = On, w = vo);
7729
+ v ? (y = Cc, w = Dc, R = Vn(R, o, a)) : d ? (y = Fc, w = Ac, R = as(R)) : (y = On, w = vo);
7730
7730
  let O = !1;
7731
7731
  for (const p of y) {
7732
- const $ = i[p];
7733
- H($) ? O ? i[p] = w[p] : i[p] = R[p] : O = !0;
7732
+ const F = i[p];
7733
+ H(F) ? O ? i[p] = w[p] : i[p] = R[p] : O = !0;
7734
7734
  }
7735
- const I = v ? cl(i, o, a) : d ? ul(i) : Bi(i), E = I || Hi(i);
7735
+ const I = v ? ul(i, o, a) : d ? dl(i) : Bi(i), E = I || Hi(i);
7736
7736
  if (E)
7737
7737
  return L.invalid(E);
7738
- const C = v ? Nr(i, o, a) : d ? Dr(i) : i, [_, z] = vn(C, c, s), k = new L({
7738
+ const C = v ? Dr(i, o, a) : d ? Ar(i) : i, [_, z] = vn(C, c, s), k = new L({
7739
7739
  ts: _,
7740
7740
  zone: s,
7741
7741
  o: z,
@@ -7764,7 +7764,7 @@ class L {
7764
7764
  * @return {DateTime}
7765
7765
  */
7766
7766
  static fromISO(e, t = {}) {
7767
- const [s, r] = tc(e);
7767
+ const [s, r] = nc(e);
7768
7768
  return St(s, r, t, "ISO 8601", e);
7769
7769
  }
7770
7770
  /**
@@ -7783,7 +7783,7 @@ class L {
7783
7783
  * @return {DateTime}
7784
7784
  */
7785
7785
  static fromRFC2822(e, t = {}) {
7786
- const [s, r] = nc(e);
7786
+ const [s, r] = sc(e);
7787
7787
  return St(s, r, t, "RFC 2822", e);
7788
7788
  }
7789
7789
  /**
@@ -7803,7 +7803,7 @@ class L {
7803
7803
  * @return {DateTime}
7804
7804
  */
7805
7805
  static fromHTTP(e, t = {}) {
7806
- const [s, r] = sc(e);
7806
+ const [s, r] = rc(e);
7807
7807
  return St(s, r, t, "HTTP", t);
7808
7808
  }
7809
7809
  /**
@@ -7827,7 +7827,7 @@ class L {
7827
7827
  locale: r,
7828
7828
  numberingSystem: i,
7829
7829
  defaultToEN: !0
7830
- }), [a, l, c, d] = xc(o, e, t);
7830
+ }), [a, l, c, d] = Nc(o, e, t);
7831
7831
  return d ? L.invalid(d) : St(a, l, s, `format ${t}`, e, c);
7832
7832
  }
7833
7833
  /**
@@ -7858,7 +7858,7 @@ class L {
7858
7858
  * @return {DateTime}
7859
7859
  */
7860
7860
  static fromSQL(e, t = {}) {
7861
- const [s, r] = uc(e);
7861
+ const [s, r] = dc(e);
7862
7862
  return St(s, r, t, "SQL", e);
7863
7863
  }
7864
7864
  /**
@@ -7872,7 +7872,7 @@ class L {
7872
7872
  throw new ye("need to specify a reason the DateTime is invalid");
7873
7873
  const s = e instanceof Pe ? e : new Pe(e, t);
7874
7874
  if (le.throwOnInvalid)
7875
- throw new Pa(s);
7875
+ throw new La(s);
7876
7876
  return new L({ invalid: s });
7877
7877
  }
7878
7878
  /**
@@ -8348,7 +8348,7 @@ class L {
8348
8348
  */
8349
8349
  set(e) {
8350
8350
  if (!this.isValid) return this;
8351
- const t = Wn(e, Br), { minDaysInFirstWeek: s, startOfWeek: r } = Ar(t, this.loc), i = !H(t.weekYear) || !H(t.weekNumber) || !H(t.weekday), o = !H(t.ordinal), a = !H(t.year), l = !H(t.month) || !H(t.day), c = a || l, d = t.weekYear || t.weekNumber;
8351
+ const t = Wn(e, Hr), { minDaysInFirstWeek: s, startOfWeek: r } = Cr(t, this.loc), i = !H(t.weekYear) || !H(t.weekNumber) || !H(t.weekday), o = !H(t.ordinal), a = !H(t.year), l = !H(t.month) || !H(t.day), c = a || l, d = t.weekYear || t.weekNumber;
8352
8352
  if ((c || o) && d)
8353
8353
  throw new It(
8354
8354
  "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
@@ -8356,11 +8356,11 @@ class L {
8356
8356
  if (l && o)
8357
8357
  throw new It("Can't mix ordinal dates with month/day");
8358
8358
  let m;
8359
- i ? m = Nr(
8359
+ i ? m = Dr(
8360
8360
  { ...Vn(this.c, s, r), ...t },
8361
8361
  s,
8362
8362
  r
8363
- ) : H(t.ordinal) ? (m = { ...this.toObject(), ...t }, H(t.day) && (m.day = Math.min(Un(m.year, m.month), m.day))) : m = Dr({ ...as(this.c), ...t });
8363
+ ) : H(t.ordinal) ? (m = { ...this.toObject(), ...t }, H(t.day) && (m.day = Math.min(Un(m.year, m.month), m.day))) : m = Ar({ ...as(this.c), ...t });
8364
8364
  const [u, f] = vn(m, this.o, this.zone);
8365
8365
  return mt(this, { ts: u, o: f });
8366
8366
  }
@@ -8380,7 +8380,7 @@ class L {
8380
8380
  plus(e) {
8381
8381
  if (!this.isValid) return this;
8382
8382
  const t = te.fromDurationLike(e);
8383
- return mt(this, zr(this, t));
8383
+ return mt(this, qr(this, t));
8384
8384
  }
8385
8385
  /**
8386
8386
  * Subtract a period of time to this DateTime and return the resulting DateTime
@@ -8391,7 +8391,7 @@ class L {
8391
8391
  minus(e) {
8392
8392
  if (!this.isValid) return this;
8393
8393
  const t = te.fromDurationLike(e).negate();
8394
- return mt(this, zr(this, t));
8394
+ return mt(this, qr(this, t));
8395
8395
  }
8396
8396
  /**
8397
8397
  * "Set" this DateTime to the beginning of a unit of time.
@@ -8541,7 +8541,7 @@ class L {
8541
8541
  o = kn(o);
8542
8542
  const a = e === "extended";
8543
8543
  let l = fs(this, a, o);
8544
- return On.indexOf(o) >= 3 && (l += "T"), l += qr(
8544
+ return On.indexOf(o) >= 3 && (l += "T"), l += Br(
8545
8545
  this,
8546
8546
  a,
8547
8547
  t,
@@ -8598,7 +8598,7 @@ class L {
8598
8598
  format: o = "extended",
8599
8599
  precision: a = "milliseconds"
8600
8600
  } = {}) {
8601
- return this.isValid ? (a = kn(a), (r && On.indexOf(a) >= 3 ? "T" : "") + qr(
8601
+ return this.isValid ? (a = kn(a), (r && On.indexOf(a) >= 3 ? "T" : "") + Br(
8602
8602
  this,
8603
8603
  o === "extended",
8604
8604
  t,
@@ -8761,7 +8761,7 @@ class L {
8761
8761
  diff(e, t = "milliseconds", s = {}) {
8762
8762
  if (!this.isValid || !e.isValid)
8763
8763
  return te.invalid("created by diffing an invalid DateTime");
8764
- const r = { locale: this.locale, numberingSystem: this.numberingSystem, ...s }, i = hl(t).map(te.normalizeUnit), o = e.valueOf() > this.valueOf(), a = o ? this : e, l = o ? e : this, c = yc(a, l, i, r);
8764
+ const r = { locale: this.locale, numberingSystem: this.numberingSystem, ...s }, i = ml(t).map(te.normalizeUnit), o = e.valueOf() > this.valueOf(), a = o ? this : e, l = o ? e : this, c = gc(a, l, i, r);
8765
8765
  return o ? c.negate() : c;
8766
8766
  }
8767
8767
  /**
@@ -8832,7 +8832,7 @@ class L {
8832
8832
  if (!this.isValid) return null;
8833
8833
  const t = e.base || L.fromObject({}, { zone: this.zone }), s = e.padding ? this < t ? -e.padding : e.padding : 0;
8834
8834
  let r = ["years", "months", "days", "hours", "minutes", "seconds"], i = e.unit;
8835
- return Array.isArray(e.unit) && (r = e.unit, i = void 0), Gr(t, this.plus(s), {
8835
+ return Array.isArray(e.unit) && (r = e.unit, i = void 0), Yr(t, this.plus(s), {
8836
8836
  ...e,
8837
8837
  numeric: "always",
8838
8838
  units: r,
@@ -8853,7 +8853,7 @@ class L {
8853
8853
  * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
8854
8854
  */
8855
8855
  toRelativeCalendar(e = {}) {
8856
- return this.isValid ? Gr(e.base || L.fromObject({}, { zone: this.zone }), this, {
8856
+ return this.isValid ? Yr(e.base || L.fromObject({}, { zone: this.zone }), this, {
8857
8857
  ...e,
8858
8858
  numeric: "auto",
8859
8859
  units: ["years", "months", "days"],
@@ -8868,7 +8868,7 @@ class L {
8868
8868
  static min(...e) {
8869
8869
  if (!e.every(L.isDateTime))
8870
8870
  throw new ye("min requires all arguments be DateTimes");
8871
- return Cr(e, (t) => t.valueOf(), Math.min);
8871
+ return Fr(e, (t) => t.valueOf(), Math.min);
8872
8872
  }
8873
8873
  /**
8874
8874
  * Return the max of several date times
@@ -8878,7 +8878,7 @@ class L {
8878
8878
  static max(...e) {
8879
8879
  if (!e.every(L.isDateTime))
8880
8880
  throw new ye("max requires all arguments be DateTimes");
8881
- return Cr(e, (t) => t.valueOf(), Math.max);
8881
+ return Fr(e, (t) => t.valueOf(), Math.max);
8882
8882
  }
8883
8883
  // MISC
8884
8884
  /**
@@ -8976,7 +8976,7 @@ class L {
8976
8976
  * @type {Object}
8977
8977
  */
8978
8978
  static get DATE_MED_WITH_WEEKDAY() {
8979
- return Ua;
8979
+ return Wa;
8980
8980
  }
8981
8981
  /**
8982
8982
  * {@link DateTime#toLocaleString} format like 'October 14, 1983'
@@ -9067,28 +9067,28 @@ class L {
9067
9067
  * @type {Object}
9068
9068
  */
9069
9069
  static get DATETIME_MED() {
9070
- return $i;
9070
+ return Fi;
9071
9071
  }
9072
9072
  /**
9073
9073
  * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
9074
9074
  * @type {Object}
9075
9075
  */
9076
9076
  static get DATETIME_MED_WITH_SECONDS() {
9077
- return Mi;
9077
+ return $i;
9078
9078
  }
9079
9079
  /**
9080
9080
  * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
9081
9081
  * @type {Object}
9082
9082
  */
9083
9083
  static get DATETIME_MED_WITH_WEEKDAY() {
9084
- return Wa;
9084
+ return ja;
9085
9085
  }
9086
9086
  /**
9087
9087
  * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
9088
9088
  * @type {Object}
9089
9089
  */
9090
9090
  static get DATETIME_FULL() {
9091
- return Fi;
9091
+ return Mi;
9092
9092
  }
9093
9093
  /**
9094
9094
  * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
@@ -9138,14 +9138,14 @@ const Mc = (n, e) => {
9138
9138
  Collection_Path: Ot(Te()),
9139
9139
  ...t
9140
9140
  });
9141
- }, Fc = (n, e, t, s) => {
9141
+ }, Pc = (n, e, t, s) => {
9142
9142
  let r = je({}).catchall(Mc(n, e)), i;
9143
9143
  if (!s && t) {
9144
9144
  const o = Ae(n, t);
9145
9145
  i = Bt(o.admin?.skipFormRequiredValidation);
9146
9146
  }
9147
9147
  return (!n.required || i) && (r = r.optional()), r;
9148
- }, Pc = () => pe().refine((n) => n === null || n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
9148
+ }, Lc = () => pe().refine((n) => n === null || n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
9149
9149
  message: "Must be a valid date"
9150
9150
  }), Oo = (n, e, t) => {
9151
9151
  let s;
@@ -9162,7 +9162,7 @@ const Mc = (n, e) => {
9162
9162
  s = Te(), n.length && (s = s.length(n.length, `Must be ${n.length} character(s) long`)), n.minlength && (s = s.min(n.minlength, `Must contain at least ${n.minlength} character(s)`)), n.maxlength && (s = s.max(n.maxlength, `Must contain at most ${n.maxlength} character(s)`)), n.email ? s = s.email("Must be a valid email address") : n.uuid ? s = ke([s.uuid("Must be a valid UUID"), be("")]) : n.url ? s = ke([s.url("Must be a valid URL"), be("")]) : n.emoji ? s = ke([s.emoji("Must be a valid emoji"), be("")]) : n.ip ? s = ke([s.ip("Must be a valid IP address"), be("")]) : n.pattern && (!t && a ? s = ke([s.regex(new RegExp(n.pattern)), s.regex(/^blob:/)], {
9163
9163
  message: "Must be a valid value"
9164
9164
  }) : s = s.regex(new RegExp(n.pattern), "Must be a valid value")), n.values && (s = ke([
9165
- Fn(n.values, {
9165
+ Mn(n.values, {
9166
9166
  message: `Must be one of the following values: ${n.values.join(", ")}`
9167
9167
  }),
9168
9168
  ss()
@@ -9189,7 +9189,7 @@ const Mc = (n, e) => {
9189
9189
  t ? (s = je({
9190
9190
  seconds: yt(),
9191
9191
  nanoseconds: yt()
9192
- }), n.min && n.max ? s = s.describe(`${r}Must be between ${L.fromMillis(n.min).toLocaleString(L.DATE_MED)} and ${L.fromMillis(n.max).toLocaleString(L.DATE_MED)}`) : n.min ? s = s.describe(`${r}Must be greater than or equal to ${L.fromMillis(n.min).toLocaleString(L.DATE_MED)}`) : n.max ? s = s.describe(`${r}Must be less than or equal to ${L.fromMillis(n.max).toLocaleString(L.DATE_MED)}`) : r && (s = s.describe(r.trim()))) : (s = Pc(), n.min && (s = s.refine((l) => l.toMillis() >= n.min, {
9192
+ }), n.min && n.max ? s = s.describe(`${r}Must be between ${L.fromMillis(n.min).toLocaleString(L.DATE_MED)} and ${L.fromMillis(n.max).toLocaleString(L.DATE_MED)}`) : n.min ? s = s.describe(`${r}Must be greater than or equal to ${L.fromMillis(n.min).toLocaleString(L.DATE_MED)}`) : n.max ? s = s.describe(`${r}Must be less than or equal to ${L.fromMillis(n.max).toLocaleString(L.DATE_MED)}`) : r && (s = s.describe(r.trim()))) : (s = Lc(), n.min && (s = s.refine((l) => l.toMillis() >= n.min, {
9193
9193
  message: `Must be greater than or equal to ${L.fromMillis(n.min).toLocaleString(L.DATE_MED)}`
9194
9194
  })), n.max && (s = s.refine((l) => l.toMillis() <= n.max, {
9195
9195
  message: `Must be less than or equal to ${L.fromMillis(n.max).toLocaleString(L.DATE_MED)}`
@@ -9212,10 +9212,10 @@ const Mc = (n, e) => {
9212
9212
  s = pe();
9213
9213
  }
9214
9214
  return (!n.required || i || o) && (s = s.optional()), s;
9215
- }, cu = (n, e, t, s, r) => {
9215
+ }, du = (n, e, t, s, r) => {
9216
9216
  const { auth: i, softDelete: o } = n, a = {};
9217
9217
  n.fields.forEach((c) => {
9218
- c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (X(c) ? (a[c.name] = Fc(c, e, t, s), s ? (c.length && (a[c.name] = a[c.name].describe(`Must contain ${c.length} item(s)`)), c.min && (a[c.name] = a[c.name].describe(`Must contain at least ${c.min} item(s)`)), c.max && (a[c.name] = a[c.name].describe(`Must contain at most ${c.max} item(s)`))) : (c.length && (a[c.name] = a[c.name].refine((d) => c.length && d && Object.keys(d).length === c.length, {
9218
+ c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (X(c) ? (a[c.name] = Pc(c, e, t, s), s ? (c.length && (a[c.name] = a[c.name].describe(`Must contain ${c.length} item(s)`)), c.min && (a[c.name] = a[c.name].describe(`Must contain at least ${c.min} item(s)`)), c.max && (a[c.name] = a[c.name].describe(`Must contain at most ${c.max} item(s)`))) : (c.length && (a[c.name] = a[c.name].refine((d) => c.length && d && Object.keys(d).length === c.length, {
9219
9219
  message: `Must contain ${c.length} item(s)`
9220
9220
  })), c.min && (a[c.name] = a[c.name].refine((d) => c.min && d && Object.keys(d).length >= c.min, {
9221
9221
  message: `Must contain at least ${c.min} item(s)`
@@ -9234,18 +9234,18 @@ const Mc = (n, e) => {
9234
9234
  }));
9235
9235
  const l = je(a);
9236
9236
  return n.allowSchemalessFields ? l.passthrough() : l.strict();
9237
- }, Jr = async (n, e) => {
9237
+ }, Qr = async (n, e) => {
9238
9238
  if (n) {
9239
9239
  const t = await ie(n, [e]);
9240
9240
  if (!t.valid)
9241
9241
  throw new Error(t.message);
9242
9242
  }
9243
9243
  }, rn = async (n, e, t, s, r, i) => {
9244
- await Jr(s.custom?.preValidate, r);
9244
+ await Qr(s.custom?.preValidate, r);
9245
9245
  for (const a of s.fields)
9246
- await Jr(a.custom?.preValidate, r);
9247
- return Fa(n, t, i).parse(e), e;
9248
- }, Qs = (n, e, t, s, r, i, o, a, l, c, d, m, u, f, g, v, y, w, R, O, I) => {
9246
+ await Qr(a.custom?.preValidate, r);
9247
+ return Pa(n, t, i).parse(e), e;
9248
+ }, Ks = (n, e, t, s, r, i, o, a, l, c, d, m, u, f, g, v, y, w, R, O, I) => {
9249
9249
  const { fields: E } = o;
9250
9250
  E.filter((p) => "unique" in p && p.unique).forEach((p) => {
9251
9251
  n !== "delete" && (typeof r[p.name] == "string" || typeof r[p.name] == "number") && (e.set(f(p, r[p.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
@@ -9254,39 +9254,39 @@ const Mc = (n, e) => {
9254
9254
  }), I && I.size++);
9255
9255
  }), E.forEach((p) => {
9256
9256
  if (ft(p, o, i)) {
9257
- const $ = hn(p, o, i), A = {};
9258
- r[p.name] !== void 0 && (A[p.name] = r[p.name], X(p) && (A[`${p.name}_Array`] = r[`${p.name}_Array`])), $.forEach((j) => {
9257
+ const F = hn(p, o, i), A = {};
9258
+ r[p.name] !== void 0 && (A[p.name] = r[p.name], X(p) && (A[`${p.name}_Array`] = r[`${p.name}_Array`])), F.forEach((j) => {
9259
9259
  r[j.name] !== void 0 && (X(j) ? A[`${j.name}_Array`] = r[`${j.name}_Array`] : A[j.name] = r[j.name]);
9260
9260
  }), Object.keys(A).length > 0 && (n === "create" && (A.Collection_Path = t, A.Collection_Path_String = t.join("/"), e.set(u(p), A)), n === "update" && e.update(u(p), A), n === "delete" && e.delete(u(p)), I && I.size++);
9261
9261
  }
9262
9262
  });
9263
9263
  const C = l[o.labels.collection];
9264
9264
  for (const p of C) {
9265
- const $ = oa(p, o), A = { ...r };
9266
- $.forEach((j) => {
9265
+ const F = aa(p, o), A = { ...r };
9266
+ F.forEach((j) => {
9267
9267
  delete A[j.name], delete A[`${j.name}_Array`], delete A[`${j.name}_Single`], delete A[`${j.name}_Lowercase`];
9268
9268
  }), Object.keys(A).length > 0 && (n === "create" && (A.Collection_Path ||= t, A.Collection_Path_String = t.join("/"), e.set(g(p.key), A)), n === "update" && e.update(g(p.key), A), n === "delete" && e.delete(g(p.key)), I && I.size++);
9269
9269
  }
9270
- const _ = (p, $) => {
9270
+ const _ = (p, F) => {
9271
9271
  let A = 1;
9272
- ft($, p, i) && A++, p.fields.forEach((h) => {
9273
- ft(h, p, i) && JSON.parse(es(hn(h, p, i))).includes($.name) && A++;
9272
+ ft(F, p, i) && A++, p.fields.forEach((h) => {
9273
+ ft(h, p, i) && JSON.parse(es(hn(h, p, i))).includes(F.name) && A++;
9274
9274
  });
9275
9275
  const j = l[p.labels.collection];
9276
9276
  for (const h of j)
9277
- h.fields.some((S) => S.name === $.name) && X($) && A++;
9277
+ h.fields.some((S) => S.name === F.name) && X(F) && A++;
9278
9278
  return A;
9279
- }, z = (p, $, A, j, h) => {
9279
+ }, z = (p, F, A, j, h) => {
9280
9280
  const S = {};
9281
- S[`${A.name}.${s}`] = m(), S[`${A.name}_Array`] = d(s), S[`${A.name}_Single`] = m(), e.update(v(h, j), S), ft(A, $, i) && e.update(y(p, A.name, j), {
9281
+ S[`${A.name}.${s}`] = m(), S[`${A.name}_Array`] = d(s), S[`${A.name}_Single`] = m(), e.update(v(h, j), S), ft(A, F, i) && e.update(y(p, A.name, j), {
9282
9282
  [`${A.name}.${s}`]: m(),
9283
9283
  [`${A.name}_Array`]: d(s)
9284
- }), $.fields.forEach((T) => {
9285
- ft(T, $, i) && JSON.parse(es(hn(T, $, i))).includes(A.name) && e.update(y(p, T.name, j), {
9284
+ }), F.fields.forEach((T) => {
9285
+ ft(T, F, i) && JSON.parse(es(hn(T, F, i))).includes(A.name) && e.update(y(p, T.name, j), {
9286
9286
  [`${A.name}_Array`]: d(s)
9287
9287
  });
9288
9288
  });
9289
- const b = l[$.labels.collection];
9289
+ const b = l[F.labels.collection];
9290
9290
  for (const T of b)
9291
9291
  T.fields.some((N) => N.name === A.name) && X(A) && e.update(w(p, T.key, j), S);
9292
9292
  };
@@ -9297,7 +9297,7 @@ const Mc = (n, e) => {
9297
9297
  for (const p of k) {
9298
9298
  if (!I)
9299
9299
  throw new Error("VALIDATION_ERROR: batchSize is required");
9300
- const $ = i.collections[p.collection], A = U($.fields, p.twoWay), j = pt($, $.fields), h = Array.from(j).map((S) => S.name);
9300
+ const F = i.collections[p.collection], A = U(F.fields, p.twoWay), j = pt(F, F.fields), h = Array.from(j).map((S) => S.name);
9301
9301
  if (!A)
9302
9302
  throw new Error(`SCHEMA_ERROR: Field ${p.twoWay} not found in collection ${p.collection}`);
9303
9303
  if (X(A)) {
@@ -9327,30 +9327,30 @@ const Mc = (n, e) => {
9327
9327
  id: s,
9328
9328
  ...N
9329
9329
  });
9330
- const F = Rn(r);
9330
+ const M = Rn(r);
9331
9331
  e.update(v(b.Collection_Path, S), {
9332
9332
  ...q,
9333
- ...F
9334
- }), I.size++, ft(A, $, i) && (e.update(y(p, A.name, S), {
9333
+ ...M
9334
+ }), I.size++, ft(A, F, i) && (e.update(y(p, A.name, S), {
9335
9335
  [`${A.name}.${s}`]: {
9336
9336
  Collection_Path: t,
9337
9337
  ...N
9338
9338
  },
9339
9339
  [`${A.name}_Array`]: c(s)
9340
- }), I.size++), $.fields.forEach((Z) => {
9341
- if (ft(Z, $, i)) {
9342
- const x = JSON.parse(es(hn(Z, $, i))), Q = {};
9343
- x.includes(A.name) && (Q[`${p.twoWay}_Array`] = c(s)), Object.keys(F).forEach((B) => {
9344
- x.includes(B) && (Q[B] = F[B]);
9340
+ }), I.size++), F.fields.forEach((Z) => {
9341
+ if (ft(Z, F, i)) {
9342
+ const x = JSON.parse(es(hn(Z, F, i))), Q = {};
9343
+ x.includes(A.name) && (Q[`${p.twoWay}_Array`] = c(s)), Object.keys(M).forEach((B) => {
9344
+ x.includes(B) && (Q[B] = M[B]);
9345
9345
  }), Object.keys(Q).length > 0 && (e.update(y(p, Z.name, S), Q), I.size++);
9346
9346
  }
9347
9347
  });
9348
- const G = l[$.labels.collection];
9348
+ const G = l[F.labels.collection];
9349
9349
  for (const Z of G)
9350
9350
  if (Z.fields.some((x) => x.name === A.name)) {
9351
9351
  const x = { ...q };
9352
- Object.keys(F).forEach((Q) => {
9353
- Z.fields.some((B) => B.name === Q) && (x[Q] = F[Q]);
9352
+ Object.keys(M).forEach((Q) => {
9353
+ Z.fields.some((B) => B.name === Q) && (x[Q] = M[Q]);
9354
9354
  }), Object.keys(x).length > 0 && (e.update(w(p, Z.key, S), x), I.size++);
9355
9355
  }
9356
9356
  }
@@ -9361,26 +9361,26 @@ const Mc = (n, e) => {
9361
9361
  for (const p of k) {
9362
9362
  if (!I)
9363
9363
  throw new Error("VALIDATION_ERROR: batchSize is required");
9364
- const $ = i.collections[p.collection], A = U($.fields, p.twoWay);
9364
+ const F = i.collections[p.collection], A = U(F.fields, p.twoWay);
9365
9365
  if (!A)
9366
9366
  throw new Error(`SCHEMA_ERROR: Field ${p.twoWay} not found in collection ${p.collection}`);
9367
9367
  if (X(A)) {
9368
9368
  if (n === "update" && R && !(r[p.name] && Re(r[p.name])) && r[`${p.name}_Array`] && R[`${p.name}_Array`]?.length > 0)
9369
9369
  for (const [j, h] of Object.entries(R[p.name]))
9370
- !r[`${p.name}_Array`].includes(j) && !O?.get(p.name)?.includes(j) && (I.size += _($, A), I.size <= 500 && z(p, $, A, j, h.Collection_Path));
9370
+ !r[`${p.name}_Array`].includes(j) && !O?.get(p.name)?.includes(j) && (I.size += _(F, A), I.size <= 500 && z(p, F, A, j, h.Collection_Path));
9371
9371
  } else
9372
9372
  throw new Error(`SCHEMA_ERROR: Invalid field type: ${A.type}`);
9373
9373
  }
9374
9374
  for (const p of k) {
9375
9375
  if (!I)
9376
9376
  throw new Error("VALIDATION_ERROR: batchSize is required");
9377
- const $ = i.collections[p.collection], A = U($.fields, p.twoWay);
9377
+ const F = i.collections[p.collection], A = U(F.fields, p.twoWay);
9378
9378
  if (!A)
9379
9379
  throw new Error(`SCHEMA_ERROR: Field ${p.twoWay} not found in collection ${p.collection}`);
9380
9380
  if (X(A)) {
9381
9381
  if (n === "update" && R && r[p.name] && Re(r[p.name]) && R[`${p.name}_Array`]?.length > 0)
9382
9382
  for (const [j, h] of Object.entries(R[p.name]))
9383
- O?.get(p.name)?.includes(j) || (I.size += _($, A), I.size <= 500 && z(p, $, A, j, h.Collection_Path));
9383
+ O?.get(p.name)?.includes(j) || (I.size += _(F, A), I.size <= 500 && z(p, F, A, j, h.Collection_Path));
9384
9384
  } else
9385
9385
  throw new Error(`SCHEMA_ERROR: Invalid field type: ${A.type}`);
9386
9386
  }
@@ -9388,7 +9388,7 @@ const Mc = (n, e) => {
9388
9388
  }, Ue = (n) => {
9389
9389
  for (const e in n)
9390
9390
  Object.prototype.hasOwnProperty.call(n, e) && (n[e] === void 0 ? delete n[e] : typeof n[e] == "object" && n[e] !== null && Ue(n[e]));
9391
- }, Ks = (n) => {
9391
+ }, Xs = (n) => {
9392
9392
  if (n = n.toString(), /[/]|^\.+$|^__.*__$/.test(n))
9393
9393
  return !1;
9394
9394
  try {
@@ -9399,7 +9399,7 @@ const Mc = (n, e) => {
9399
9399
  return !1;
9400
9400
  }
9401
9401
  return !(new Blob([n]).size > 1500);
9402
- }, Qr = async (n, e, t, s = 1e3, r = 5) => {
9402
+ }, Kr = async (n, e, t, s = 1e3, r = 5) => {
9403
9403
  for (; r > 0; )
9404
9404
  try {
9405
9405
  await n(...e);
@@ -9416,14 +9416,14 @@ const Mc = (n, e) => {
9416
9416
  if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 254)
9417
9417
  throw new Error("Email address is too long");
9418
9418
  return e;
9419
- }, hs = (n) => n ? Array.isArray(n) ? n.map((s) => jn(s)).filter((s) => s.length > 0) : jn(n) || "" : "", Lc = (n) => {
9419
+ }, hs = (n) => n ? Array.isArray(n) ? n.map((s) => jn(s)).filter((s) => s.length > 0) : jn(n) || "" : "", Vc = (n) => {
9420
9420
  if (!n || typeof n != "string")
9421
9421
  return "";
9422
9422
  let e = n.replace(/[\r\n]/g, " ");
9423
9423
  if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 998)
9424
9424
  throw new Error("Email subject is too long");
9425
9425
  return e;
9426
- }, Kr = (n) => {
9426
+ }, Xr = (n) => {
9427
9427
  if (!n || typeof n != "string")
9428
9428
  return "";
9429
9429
  let e = n.replace(/\0/g, "");
@@ -9433,7 +9433,13 @@ const Mc = (n, e) => {
9433
9433
  `), e.length > 5e6)
9434
9434
  throw new Error("Email body is too long");
9435
9435
  return e;
9436
- }, Vc = async (n, e) => {
9436
+ }, Uc = (n = "enterprise", e) => n === "enterprise" ? e : "(default)", ce = (n) => {
9437
+ const e = n || Ls(), t = process.env.STOKER_FB_WEB_APP_CONFIG;
9438
+ if (!t)
9439
+ throw new Error("STOKER_FB_WEB_APP_CONFIG not set.");
9440
+ const s = JSON.parse(t), r = Uc(process.env.FB_FIRESTORE_EDITION, s.projectId);
9441
+ return qo(e, r);
9442
+ }, Wc = async (n, e) => {
9437
9443
  const t = {};
9438
9444
  for (const s of e) {
9439
9445
  const r = `${n}/${s}.js`, i = ii(r).href;
@@ -9444,7 +9450,7 @@ const Mc = (n, e) => {
9444
9450
  }
9445
9451
  return t;
9446
9452
  };
9447
- let ms, ko, bn, bo, Qt, To, Tn, Sn, ps = 0, Xr = !1;
9453
+ let ms, ko, bn, bo, Qt, To, Tn, Sn, ps = 0, ei = !1;
9448
9454
  const xt = {
9449
9455
  getTenant() {
9450
9456
  if (!bn)
@@ -9466,7 +9472,7 @@ const xt = {
9466
9472
  getCustomizationFile(n, e) {
9467
9473
  if (!Object.keys(e.collections).includes(n))
9468
9474
  throw new Error("PERMISSION_DENIED");
9469
- const t = sa([n], To, "node", xt);
9475
+ const t = ra([n], To, "node", xt);
9470
9476
  return fe(t?.[n]);
9471
9477
  },
9472
9478
  getVersionInfo() {
@@ -9475,16 +9481,16 @@ const xt = {
9475
9481
  getMaintenanceInfo() {
9476
9482
  return Sn;
9477
9483
  }
9478
- }, uu = async (n, e, t, s, r) => {
9479
- const i = !!Xr;
9480
- if (Xr = !0, e && (bn = e), ko = n, ms && !r)
9484
+ }, fu = async (n, e, t, s, r) => {
9485
+ const i = !!ei;
9486
+ if (ei = !0, e && (bn = e), ko = n, ms && !r)
9481
9487
  return xt;
9482
9488
  if (!process.env.STOKER_FB_WEB_APP_CONFIG)
9483
9489
  throw new Error("STOKER_FB_WEB_APP_CONFIG not set.");
9484
9490
  const o = process.env.STOKER_FB_WEB_APP_CONFIG, a = JSON.parse(o), d = (await import(ii(t).href)).default;
9485
9491
  Qt = d({ sdk: "node", utils: xt }), !r && n === "development" && (process.env.FIREBASE_AUTH_EMULATOR_HOST = "127.0.0.1:9099", process.env.FIREBASE_DATABASE_EMULATOR_HOST = "127.0.0.1:9000", process.env.FIRESTORE_EMULATOR_HOST = "127.0.0.1:8080", process.env.FIREBASE_STORAGE_EMULATOR_HOST = "127.0.0.1:9199");
9486
9492
  try {
9487
- ms = ni();
9493
+ ms = Ls();
9488
9494
  } catch {
9489
9495
  ms = si({
9490
9496
  credential: ri(),
@@ -9494,7 +9500,7 @@ const xt = {
9494
9500
  });
9495
9501
  }
9496
9502
  const m = await Ke();
9497
- return To = await Vc(s, Object.keys(m.collections)), bo = await ie(Qt.timezone), i || ce().collection("system_deployment").doc("maintenance_mode").onSnapshot((u) => {
9503
+ return To = await Wc(s, Object.keys(m.collections)), bo = await ie(Qt.timezone), i || ce().collection("system_deployment").doc("maintenance_mode").onSnapshot((u) => {
9498
9504
  u.exists ? (Sn = u.data(), ie(Qt.onMaintenanceUpdate, ["node", Sn.active ? "on" : "off"])) : console.error("Maintenance status not found");
9499
9505
  }, (u) => {
9500
9506
  console.error(u.message);
@@ -9508,8 +9514,8 @@ const xt = {
9508
9514
  };
9509
9515
  f();
9510
9516
  }), xt;
9511
- }, { getTenant: Xe, setTenant: du, getMode: So, getTimezone: Ro, getGlobalConfigModule: Zt, getCustomizationFile: et, getVersionInfo: fu, getMaintenanceInfo: hu } = xt, mu = async (n, e, t, s) => new Promise((r, i) => {
9512
- const o = qo(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
9517
+ }, { getTenant: Xe, setTenant: hu, getMode: So, getTimezone: Ro, getGlobalConfigModule: Zt, getCustomizationFile: et, getVersionInfo: mu, getMaintenanceInfo: pu } = xt, yu = async (n, e, t, s) => new Promise((r, i) => {
9518
+ const o = Bo(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
9513
9519
  let a = "";
9514
9520
  const l = () => {
9515
9521
  o.kill("SIGINT");
@@ -9525,13 +9531,13 @@ const xt = {
9525
9531
  }), o.on("exit", (m) => {
9526
9532
  d(), m === 0 ? r(a) : i();
9527
9533
  }), process.on("SIGINT", l), process.on("SIGTERM", c);
9528
- }), pu = async () => {
9534
+ }), gu = async () => {
9529
9535
  const n = process.env.STOKER_FB_WEB_APP_CONFIG;
9530
9536
  if (!n)
9531
9537
  throw new Error("Firebase web app config not found");
9532
9538
  const e = JSON.parse(n);
9533
9539
  try {
9534
- return ni();
9540
+ return Ls();
9535
9541
  } catch {
9536
9542
  return si({
9537
9543
  credential: ri(),
@@ -9553,7 +9559,7 @@ const xt = {
9553
9559
  for (const i of Object.values(r.collections))
9554
9560
  i.fields = i.fields.filter((o) => o.type !== "Computed");
9555
9561
  return r;
9556
- }, yu = async () => {
9562
+ }, wu = async () => {
9557
9563
  const t = await oi().ref("schema").orderByChild("published_time").limitToLast(2).get();
9558
9564
  if (!(t.numChildren() < 2))
9559
9565
  return Object.values(t.val())[0];
@@ -9562,7 +9568,7 @@ const xt = {
9562
9568
  for (let r = 0; r < e.length; r++)
9563
9569
  r % 2 === 0 ? s = s.collection(e[r]) : s = s.doc(e[r]);
9564
9570
  return s;
9565
- }, Uc = (n, e, t, s, r) => {
9571
+ }, jc = (n, e, t, s, r) => {
9566
9572
  const i = ce(), o = e.at(-1);
9567
9573
  if (!o)
9568
9574
  throw new Error("EMPTY_PATH");
@@ -9572,7 +9578,7 @@ const xt = {
9572
9578
  const f = r.collections?.[l.collection];
9573
9579
  if (!r.Role)
9574
9580
  throw new Error("PERMISSION_DENIED");
9575
- const g = f && Se("Read", f), v = ui(a, t, r), y = li(a, r), w = Ls(a, r), R = ci(a, t, r), O = (h = []) => {
9581
+ const g = f && Se("Read", f), v = ui(a, t, r), y = li(a, r), w = Vs(a, r), R = ci(a, t, r), O = (h = []) => {
9576
9582
  const S = [], b = pi(r.Role, a, t);
9577
9583
  if (!b)
9578
9584
  throw new Error("PERMISSION_DENIED");
@@ -9650,15 +9656,15 @@ const xt = {
9650
9656
  const N = r.collections?.[T.collection];
9651
9657
  if (!N)
9652
9658
  throw new Error("PERMISSION_DENIED");
9653
- const q = N.individualEntities, F = [];
9659
+ const q = N.individualEntities, M = [];
9654
9660
  if (q) {
9655
9661
  const G = b.singleQuery ? b.singleQuery : z;
9656
9662
  for (let Z = 0; Z < q.length; Z += G) {
9657
9663
  const x = q.slice(Z, Z + G);
9658
- F.push(x);
9664
+ M.push(x);
9659
9665
  }
9660
9666
  if (!b.singleQuery)
9661
- F.forEach((Z) => {
9667
+ M.forEach((Z) => {
9662
9668
  p.push(...O(k.concat([[`${T.name}_Array`, "array-contains-any", Z]])));
9663
9669
  });
9664
9670
  else {
@@ -9670,7 +9676,7 @@ const xt = {
9670
9676
  }
9671
9677
  }
9672
9678
  });
9673
- const $ = [];
9679
+ const F = [];
9674
9680
  w.filter((h) => h.type === "Parent").forEach((h) => {
9675
9681
  if ("collectionField" in h) {
9676
9682
  const S = U(c, h.collectionField);
@@ -9679,12 +9685,12 @@ const xt = {
9679
9685
  if (b) {
9680
9686
  const N = h.singleQuery ? h.singleQuery : z;
9681
9687
  for (let q = 0; q < b.length; q += N) {
9682
- const F = b.slice(q, q + N);
9683
- T.push(F);
9688
+ const M = b.slice(q, q + N);
9689
+ T.push(M);
9684
9690
  }
9685
9691
  if (!h.singleQuery)
9686
9692
  T.forEach((q) => {
9687
- $.push(...O(k.concat([[`${S.name}_Array`, "array-contains-any", q]])));
9693
+ F.push(...O(k.concat([[`${S.name}_Array`, "array-contains-any", q]])));
9688
9694
  });
9689
9695
  else {
9690
9696
  if (b && b.length > N)
@@ -9702,26 +9708,26 @@ const xt = {
9702
9708
  const q = r.collections?.[T.collection];
9703
9709
  if (!q)
9704
9710
  throw new Error("PERMISSION_DENIED");
9705
- const F = q.parentEntities, G = [];
9706
- if (F) {
9711
+ const M = q.parentEntities, G = [];
9712
+ if (M) {
9707
9713
  const Z = b.singleQuery ? b.singleQuery : z;
9708
- for (let x = 0; x < F.length; x += Z) {
9709
- const Q = F.slice(x, x + Z);
9714
+ for (let x = 0; x < M.length; x += Z) {
9715
+ const Q = M.slice(x, x + Z);
9710
9716
  G.push(Q);
9711
9717
  }
9712
9718
  if (!b.singleQuery)
9713
9719
  G.forEach((x) => {
9714
- $.push(...O(k.concat([
9720
+ F.push(...O(k.concat([
9715
9721
  [`${N.name}_Array`, "array-contains-any", x]
9716
9722
  ])));
9717
9723
  });
9718
9724
  else {
9719
- if (F && F.length > Z)
9725
+ if (M && M.length > Z)
9720
9726
  throw new Error(`INPUT_ERROR: Profile_Parent entity parentFilter with singleQuery set to true must not have more than ${b.singleQuery} entities`);
9721
9727
  k.push([
9722
9728
  `${N.name}_Array`,
9723
9729
  "array-contains-any",
9724
- F
9730
+ M
9725
9731
  ]);
9726
9732
  }
9727
9733
  }
@@ -9729,19 +9735,19 @@ const xt = {
9729
9735
  }
9730
9736
  });
9731
9737
  const A = [];
9732
- $.length === 0 && (w.filter((h) => h.type === "Parent_Property").forEach((h) => {
9738
+ F.length === 0 && (w.filter((h) => h.type === "Parent_Property").forEach((h) => {
9733
9739
  if ("collectionField" in h && "propertyField" in h) {
9734
9740
  const S = U(c, h.collectionField), b = U(c, h.propertyField);
9735
9741
  if ("collection" in S) {
9736
9742
  const T = f?.parentPropertyEntities || {};
9737
9743
  Object.entries(T).forEach(([N, q]) => {
9738
9744
  if (q.length > 0) {
9739
- const F = [];
9745
+ const M = [];
9740
9746
  for (let G = 0; G < q.length; G += z) {
9741
9747
  const Z = q.slice(G, G + z);
9742
- F.push(Z);
9748
+ M.push(Z);
9743
9749
  }
9744
- F.forEach((G) => {
9750
+ M.forEach((G) => {
9745
9751
  A.push(...O(k.concat([
9746
9752
  [`${S.name}_Array`, "array-contains-any", G],
9747
9753
  [b.name, "==", N]
@@ -9759,8 +9765,8 @@ const xt = {
9759
9765
  const q = r.collections?.[b.collection];
9760
9766
  if (!q)
9761
9767
  throw new Error("PERMISSION_DENIED");
9762
- const F = q.parentPropertyEntities || {};
9763
- Object.entries(F).forEach(([G, Z]) => {
9768
+ const M = q.parentPropertyEntities || {};
9769
+ Object.entries(M).forEach(([G, Z]) => {
9764
9770
  if (Z.length > 0) {
9765
9771
  const x = [];
9766
9772
  for (let Q = 0; Q < Z.length; Q += z) {
@@ -9782,7 +9788,7 @@ const xt = {
9782
9788
  }
9783
9789
  }
9784
9790
  }));
9785
- const j = [...p, ...$, ...A];
9791
+ const j = [...p, ...F, ...A];
9786
9792
  return !w.length && !R.length ? O(k) : j;
9787
9793
  } else
9788
9794
  throw new Error("PERMISSION_DENIED");
@@ -9825,14 +9831,14 @@ const xt = {
9825
9831
  });
9826
9832
  e[g] = v.records, i && await Promise.all(
9827
9833
  // eslint-disable-next-line security/detect-object-injection
9828
- e[g].map((y) => Xs(n, y, [...t, g, y.id], i, r, void 0, a, l, c))
9834
+ e[g].map((y) => er(n, y, [...t, g, y.id], i, r, void 0, a, l, c))
9829
9835
  ), u > 0 && await Promise.all(
9830
9836
  // eslint-disable-next-line security/detect-object-injection
9831
9837
  e[g].map((y) => xo(n, y, [...t, g, y.id], { depth: u }, r, i, o, a, l, c))
9832
9838
  );
9833
9839
  });
9834
9840
  await Promise.all(f);
9835
- }, Xs = async (n, e, t, s, r, i, o, a, l) => {
9841
+ }, er = async (n, e, t, s, r, i, o, a, l) => {
9836
9842
  const c = t.at(-2);
9837
9843
  s.fields ||= r.collections[c].fields.filter((u) => X(u));
9838
9844
  const d = s.depth - 1, m = [];
@@ -9849,7 +9855,7 @@ const xt = {
9849
9855
  noEmbeddingFields: l
9850
9856
  }).then((R) => {
9851
9857
  if (f[v] = R, d > 0)
9852
- return Xs(
9858
+ return er(
9853
9859
  n,
9854
9860
  // eslint-disable-next-line security/detect-object-injection
9855
9861
  f[v],
@@ -9910,7 +9916,7 @@ const xt = {
9910
9916
  if (!v.Enabled)
9911
9917
  throw new Error("PERMISSION_DENIED");
9912
9918
  }
9913
- let _ = Uc(s, n, g, e?.userId, v);
9919
+ let _ = jc(s, n, g, e?.userId, v);
9914
9920
  if (_.length === 0)
9915
9921
  return { cursor: {}, pages: 0, records: [] };
9916
9922
  if (t && (_ = _.map((h) => (t.forEach(([S, b, T]) => {
@@ -9923,7 +9929,7 @@ const xt = {
9923
9929
  throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
9924
9930
  const h = e.pagination.startAfter || e.pagination.endBefore;
9925
9931
  if (e?.userId) {
9926
- const S = na(v.Role, I, g);
9932
+ const S = sa(v.Role, I, g);
9927
9933
  if (h && S !== !0)
9928
9934
  throw new Error("INPUT_ERROR: Pagination is not allowed when using " + S);
9929
9935
  }
@@ -9931,7 +9937,7 @@ const xt = {
9931
9937
  }
9932
9938
  const z = {};
9933
9939
  await oe("preOperation", y, C, { operation: "read", context: z }), await oe("preRead", y, C, { context: z, refs: _, multiple: !0, listener: !1 }), a = /* @__PURE__ */ new Map();
9934
- const $ = _.map(async (h) => await c.get(h)), A = await Promise.all($);
9940
+ const F = _.map(async (h) => await c.get(h)), A = await Promise.all(F);
9935
9941
  for (const h of A) {
9936
9942
  for (const S of h.docs) {
9937
9943
  a.has(S.id) || a.set(S.id, {});
@@ -9944,7 +9950,7 @@ const xt = {
9944
9950
  }
9945
9951
  if (e?.pagination) {
9946
9952
  let h = _[0];
9947
- t && (h = t.reduce((N, [q, F, G]) => N.where(q, F, G), h)), e.pagination.orderByField && e.pagination.orderByDirection && (h = h.orderBy(e.pagination.orderByField, e.pagination.orderByDirection));
9953
+ t && (h = t.reduce((N, [q, M, G]) => N.where(q, M, G), h)), e.pagination.orderByField && e.pagination.orderByDirection && (h = h.orderBy(e.pagination.orderByField, e.pagination.orderByDirection));
9948
9954
  const b = (await h.count().get()).data().count, T = e.pagination.number;
9949
9955
  i = T > 0 ? Math.ceil(b / T) : 0;
9950
9956
  }
@@ -9964,15 +9970,15 @@ const xt = {
9964
9970
  e.userId,
9965
9971
  e.transactional ? c : void 0,
9966
9972
  e?.noEmbeddingFields
9967
- )), e?.relations && (e.relations.fields && (e.relations.fields = e.relations.fields.map((F) => {
9968
- if (typeof F == "string") {
9969
- const G = I.fields.find((Z) => Z.name === F);
9973
+ )), e?.relations && (e.relations.fields && (e.relations.fields = e.relations.fields.map((M) => {
9974
+ if (typeof M == "string") {
9975
+ const G = I.fields.find((Z) => Z.name === M);
9970
9976
  if (G)
9971
9977
  return G;
9972
- throw new Error(`SCHEMA_ERROR: Field ${F} not found in collection ${w}`);
9978
+ throw new Error(`SCHEMA_ERROR: Field ${M} not found in collection ${w}`);
9973
9979
  }
9974
- return F;
9975
- })), S.push(Xs(
9980
+ return M;
9981
+ })), S.push(er(
9976
9982
  s,
9977
9983
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9978
9984
  a.get(h.id),
@@ -9985,25 +9991,25 @@ const xt = {
9985
9991
  e?.noEmbeddingFields
9986
9992
  ))), await Promise.all(S);
9987
9993
  const T = [];
9988
- for (const F of I.fields) {
9989
- if (F.type === "Computed" && !e?.noComputedFields) {
9990
- const G = Ae(F, C);
9994
+ for (const M of I.fields) {
9995
+ if (M.type === "Computed" && !e?.noComputedFields) {
9996
+ const G = Ae(M, C);
9991
9997
  if (!G.formula)
9992
9998
  continue;
9993
9999
  T.push(ie(G.formula, [h, j]).then((Z) => {
9994
- h[F.name] = Z;
10000
+ h[M.name] = Z;
9995
10001
  }));
9996
10002
  }
9997
- e?.noEmbeddingFields && F.type === "Embedding" && delete h[F.name];
10003
+ e?.noEmbeddingFields && M.type === "Embedding" && delete h[M.name];
9998
10004
  }
9999
10005
  if (await Promise.all(T), e?.userId && v?.Role) {
10000
- const F = v.Role;
10001
- if (!(C.custom?.serverAccess?.read !== void 0 ? await ie(C.custom.serverAccess.read, [F, h]) : !0)) {
10006
+ const M = v.Role;
10007
+ if (!(C.custom?.serverAccess?.read !== void 0 ? await ie(C.custom.serverAccess.read, [M, h]) : !0)) {
10002
10008
  a.delete(h.id);
10003
10009
  continue;
10004
10010
  }
10005
10011
  for (const Z of I.fields) {
10006
- const x = !Z.access || Z.access.includes(F), Q = Ae(Z, C), B = Q?.custom?.serverAccess?.read !== void 0 ? await ie(Q.custom.serverAccess.read, [F, h]) : !0;
10012
+ const x = !Z.access || Z.access.includes(M), Q = Ae(Z, C), B = Q?.custom?.serverAccess?.read !== void 0 ? await ie(Q.custom.serverAccess.read, [M, h]) : !0;
10007
10013
  (!x || !B) && (X(Z) ? (delete a.get(h.id)[Z.name], delete a.get(h.id)[`${Z.name}_Array`], delete a.get(h.id)[`${Z.name}_Single`]) : delete a.get(h.id)[Z.name]);
10008
10014
  }
10009
10015
  }
@@ -10015,7 +10021,7 @@ const xt = {
10015
10021
  };
10016
10022
  await oe("postOperation", y, C, N), await oe("postRead", y, C, { context: z, refs: _, record: h, listener: !1 });
10017
10023
  }
10018
- e?.userId && await ea(
10024
+ e?.userId && await ta(
10019
10025
  Array.from(a.values()),
10020
10026
  I,
10021
10027
  g,
@@ -10134,8 +10140,8 @@ const xt = {
10134
10140
  throw new Error("PERMISSION_DENIED");
10135
10141
  const _ = {};
10136
10142
  await oe("preOperation", g, I, { operation: "read", recordId: e, context: _ }), await oe("preRead", g, I, { context: _, refs: C, multiple: !1, listener: !1 }), i = {};
10137
- const p = C.map((b) => a.get(b)), $ = await Promise.all(p);
10138
- for (const b of $)
10143
+ const p = C.map((b) => a.get(b)), F = await Promise.all(p);
10144
+ for (const b of F)
10139
10145
  if (b.exists) {
10140
10146
  const T = b.data();
10141
10147
  i.id ||= b.id, i = { ...i, ...T }, delete i.Collection_Path_String;
@@ -10167,11 +10173,11 @@ const xt = {
10167
10173
  if (!(I.custom?.serverAccess?.read !== void 0 ? await ie(I.custom?.serverAccess?.read, [b, i]) : !0))
10168
10174
  throw new Error("PERMISSION_DENIED");
10169
10175
  for (const N of R.fields) {
10170
- const q = !N.access || N.access.includes(b), F = Ae(N, I), G = F?.custom?.serverAccess?.read !== void 0 ? await ie(F.custom.serverAccess.read, [b, i]) : !0;
10176
+ const q = !N.access || N.access.includes(b), M = Ae(N, I), G = M?.custom?.serverAccess?.read !== void 0 ? await ie(M.custom.serverAccess.read, [b, i]) : !0;
10171
10177
  (!q || !G) && (X(N) ? (delete i[N.name], delete i[`${N.name}_Array`], delete i[`${N.name}_Single`]) : delete i[N.name]);
10172
10178
  }
10173
10179
  }
10174
- await oe("postOperation", g, I, { operation: "read", data: i, recordId: e, context: _ }), await oe("postRead", g, I, { context: _, refs: C, record: i, listener: !1 }), t?.userId && await Xo(i, R, u, t.userId, f);
10180
+ await oe("postOperation", g, I, { operation: "read", data: i, recordId: e, context: _ }), await oe("postRead", g, I, { context: _, refs: C, record: i, listener: !1 }), t?.userId && await ea(i, R, u, t.userId, f);
10175
10181
  };
10176
10182
  return t?.providedTransaction ? await o(t.providedTransaction) : await r.runTransaction(async (a) => {
10177
10183
  await o(a);
@@ -10184,7 +10190,7 @@ const xt = {
10184
10190
  return;
10185
10191
  Ae(f, c);
10186
10192
  const g = s[f.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
10187
- if (!Ks(g))
10193
+ if (!Xs(g))
10188
10194
  u.push(`${f.name} "${s[f.name]}" is invalid`);
10189
10195
  else {
10190
10196
  const v = await l.collection("tenants").doc(e).collection("system_unique").doc(d).collection(`Unique-${d}-${f.name}`).doc(g).get();
@@ -10239,14 +10245,14 @@ ${i}`);
10239
10245
  })()
10240
10246
  ]), r.length > 0)
10241
10247
  throw new Error(r.join(", "));
10242
- }, $o = async (n, e, t, s, r, i, o, a, l) => {
10248
+ }, Fo = async (n, e, t, s, r, i, o, a, l) => {
10243
10249
  const c = ce(), d = So(), m = process.env.ADMIN_EMAIL;
10244
10250
  if (d === "development" || process.env.FIRESTORE_EMULATOR_HOST)
10245
10251
  if (m)
10246
10252
  n = m;
10247
10253
  else
10248
10254
  throw new Error("Admin email not set");
10249
- const u = hs(n), f = Lc(e), g = t ? Kr(t) : void 0, v = s ? Kr(s) : void 0, y = r ? hs(r) : void 0, w = i ? hs(i) : void 0, R = o ? jn(o) : void 0, O = l ? jn(l) : void 0, I = Array.isArray(u) ? u : [u];
10255
+ const u = hs(n), f = Vc(e), g = t ? Xr(t) : void 0, v = s ? Xr(s) : void 0, y = r ? hs(r) : void 0, w = i ? hs(i) : void 0, R = o ? jn(o) : void 0, O = l ? jn(l) : void 0, I = Array.isArray(u) ? u : [u];
10250
10256
  if (I.length === 0 || I.length === 1 && !I[0])
10251
10257
  throw new Error("No valid email addresses provided");
10252
10258
  const E = { to: u, message: { subject: f } };
@@ -10259,19 +10265,19 @@ ${i}`);
10259
10265
  C.length > 0 && C[0] && (E.bcc = w);
10260
10266
  }
10261
10267
  R && (E.replyTo = R), a && (E.message.attachments = a), O && (E.from = O), await c.collection("system_mail").add(E);
10262
- }, Wc = ["tenant", "role", "collection", "doc"], Mo = new Set(Wc);
10263
- function er(n) {
10264
- return Mo.has(n);
10268
+ }, Zc = ["tenant", "role", "collection", "doc"], $o = new Set(Zc);
10269
+ function tr(n) {
10270
+ return $o.has(n);
10265
10271
  }
10266
- function jc(n) {
10272
+ function zc(n) {
10267
10273
  if (!n)
10268
10274
  return {};
10269
10275
  const e = {};
10270
10276
  for (const t of Object.keys(n))
10271
- Mo.has(t) || (e[t] = n[t]);
10277
+ $o.has(t) || (e[t] = n[t]);
10272
10278
  return e;
10273
10279
  }
10274
- const Fo = async (n, e, t, s, r, i, o) => {
10280
+ const Mo = async (n, e, t, s, r, i, o) => {
10275
10281
  const a = Et(), l = ce(), { labels: c, fields: d } = s, m = "USER_ERROR", u = async (y, w) => {
10276
10282
  try {
10277
10283
  await dn(y);
@@ -10294,7 +10300,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10294
10300
  }
10295
10301
  const g = {};
10296
10302
  for (const y of d)
10297
- y.saveToAuthToken && !er(y.name) && r[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (Re(r[y.name]) ? g[y.name] = null : g[y.name] = r[y.name]);
10303
+ y.saveToAuthToken && !tr(y.name) && r[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (Re(r[y.name]) ? g[y.name] = null : g[y.name] = r[y.name]);
10298
10304
  try {
10299
10305
  await a.setCustomUserClaims(f.uid, {
10300
10306
  ...g,
@@ -10332,7 +10338,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10332
10338
  if (y) {
10333
10339
  const w = `https://${a.app.options.projectId}.firebaseapp.com/__/auth/action${y}`, R = await ie(t.appName), O = t?.mail?.emailVerification && t.mail.emailVerification(w, R);
10334
10340
  try {
10335
- await $o(r.Email, O?.subject || "Please verify your email address", void 0, O?.html || `Please verify your email address by clicking the link:
10341
+ await Fo(r.Email, O?.subject || "Please verify your email address", void 0, O?.html || `Please verify your email address by clicking the link:
10336
10342
  </br>
10337
10343
  </br>
10338
10344
  <a href="${w}">${w}</a>`);
@@ -10342,7 +10348,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10342
10348
  }
10343
10349
  }
10344
10350
  return f.uid;
10345
- }, tr = async (n, e) => {
10351
+ }, nr = async (n, e) => {
10346
10352
  const { labels: t, parentCollection: s } = e;
10347
10353
  if (s) {
10348
10354
  const r = n.at(-2);
@@ -10355,7 +10361,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10355
10361
  throw new Error("PERMISSION_DENIED");
10356
10362
  } else if (n.length > 1)
10357
10363
  throw new Error("PERMISSION_DENIED");
10358
- }, Zn = (n) => n !== null && typeof n == "object" && !Array.isArray(n), gu = (n) => {
10364
+ }, Zn = (n) => n !== null && typeof n == "object" && !Array.isArray(n), _u = (n) => {
10359
10365
  const e = (t) => {
10360
10366
  Object.entries(t).forEach(([s, r]) => {
10361
10367
  Zn(r) && Object.keys(r).length === 2 && typeof r.seconds == "number" && typeof r.nanoseconds == "number" ? t[s] = new ut(r.seconds, r.nanoseconds) : Zn(r) && e(r);
@@ -10369,11 +10375,11 @@ const Fo = async (n, e, t, s, r, i, o) => {
10369
10375
  });
10370
10376
  };
10371
10377
  e(n);
10372
- }, nr = (n) => {
10378
+ }, sr = (n) => {
10373
10379
  if (typeof n == "object")
10374
10380
  for (const e in n)
10375
- Object.prototype.hasOwnProperty.call(n, e) && (n[e] === "_DELETE_FIELD" ? n[e] = he.delete() : nr(n[e]));
10376
- }, Zc = (n, e, t) => {
10381
+ Object.prototype.hasOwnProperty.call(n, e) && (n[e] === "_DELETE_FIELD" ? n[e] = he.delete() : sr(n[e]));
10382
+ }, qc = (n, e, t) => {
10377
10383
  if (X(t) && t.includeFields) {
10378
10384
  const s = {};
10379
10385
  return t.includeFields.forEach((r) => {
@@ -10385,7 +10391,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10385
10391
  }), s;
10386
10392
  }
10387
10393
  return {};
10388
- }, ei = async (n, e, t, s, r, i, o) => {
10394
+ }, ti = async (n, e, t, s, r, i, o) => {
10389
10395
  if (!X(t) || !t.enforceHierarchy)
10390
10396
  return;
10391
10397
  const { fields: a } = e, l = ce(), c = Object.entries(s[t.name]);
@@ -10407,7 +10413,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10407
10413
  delete e[n.name][t], e[`${n.name}_Array`] = e[`${n.name}_Array`]?.filter((s) => s !== t), delete e[`${n.name}_Single`];
10408
10414
  }, ys = async (n, e, t, s, r) => {
10409
10415
  e[n.name] ||= {}, e[n.name][s] = t, e[`${n.name}_Array`] ||= [], e[`${n.name}_Array`].push(s), r && (e[`${n.name}_Single`] = { id: s, ...t });
10410
- }, zc = (n, e, t, s, r, i) => {
10416
+ }, Bc = (n, e, t, s, r, i) => {
10411
10417
  const o = [], a = [];
10412
10418
  for (const l of s.fields)
10413
10419
  X(l) && l.twoWay && l.collection === t && ((n === "Create" || !i?.[l.name]?.[e]) && r[l.name]?.[e] && o.push(l), n === "Update" && i?.[l.name]?.[e] && !r[l.name]?.[e] && a.push(l));
@@ -10415,7 +10421,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10415
10421
  }, Lo = async (n, e, t, s, r, i, o, a, l, c, d, m) => {
10416
10422
  const { fields: u } = i, f = ce(), g = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
10417
10423
  for (const w of u)
10418
- X(w) && ["OneToOne", "OneToMany"].includes(w.type) && w.enforceHierarchy && s[w.name] && (n === "Create" || n === "Update" && !He(m?.[w.name], s[w.name])) && await ei(e, i, w, s, a, l);
10424
+ X(w) && ["OneToOne", "OneToMany"].includes(w.type) && w.enforceHierarchy && s[w.name] && (n === "Create" || n === "Update" && !He(m?.[w.name], s[w.name])) && await ti(e, i, w, s, a, l);
10419
10425
  for (const w of u)
10420
10426
  if (X(w) && w.twoWay) {
10421
10427
  const R = o.collections[w.collection], O = U(R.fields, w.twoWay), I = pt(R, [O]);
@@ -10441,14 +10447,14 @@ const Fo = async (n, e, t, s, r, i, o) => {
10441
10447
  [_]: h
10442
10448
  }), k = fe({ ...h, ...Rn(s) });
10443
10449
  }
10444
- const $ = {
10450
+ const F = {
10445
10451
  ...k[O.name],
10446
10452
  [t]: {
10447
10453
  Collection_Path: s.Collection_Path,
10448
- ...Zc(i, s, O)
10454
+ ...qc(i, s, O)
10449
10455
  }
10450
10456
  };
10451
- k[O.name] = $, k[`${O.name}_Array`] ||= [], k[`${O.name}_Array`].push(t), I.size === 1 && (k[`${O.name}_Single`] = { id: t, ...$ }), y.set(w.collection, {
10457
+ k[O.name] = F, k[`${O.name}_Array`] ||= [], k[`${O.name}_Array`].push(t), I.size === 1 && (k[`${O.name}_Single`] = { id: t, ...F }), y.set(w.collection, {
10452
10458
  ...y.get(w.collection) || {},
10453
10459
  [_]: k
10454
10460
  });
@@ -10466,7 +10472,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10466
10472
  k = p;
10467
10473
  else {
10468
10474
  l.size++, l && l.size > 500 && console.error(new Error(`VALIDATION_ERROR: ${l.size} operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of two way updates, unique field checks, entity restrictions (in permissions when dealing with user collections) or relation hierarchy checks.`));
10469
- const $ = Ce(f, z.Collection_Path, e), A = await a.get($.doc(_));
10475
+ const F = Ce(f, z.Collection_Path, e), A = await a.get(F.doc(_));
10470
10476
  if (!A.exists) {
10471
10477
  g.set(w.name, [...g.get(w.name) || [], _]);
10472
10478
  continue;
@@ -10477,7 +10483,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10477
10483
  [_]: j
10478
10484
  }), k = fe({ ...j, ...Rn(s) });
10479
10485
  }
10480
- k[O.name][t] && delete k[O.name][t], Array.isArray(k[`${O.name}_Array`]) && (k[`${O.name}_Array`] = k[`${O.name}_Array`].filter(($) => $ !== t)), I.size === 1 && delete k[`${O.name}_Single`], y.set(w.collection, {
10486
+ k[O.name][t] && delete k[O.name][t], Array.isArray(k[`${O.name}_Array`]) && (k[`${O.name}_Array`] = k[`${O.name}_Array`].filter((F) => F !== t)), I.size === 1 && delete k[`${O.name}_Single`], y.set(w.collection, {
10481
10487
  ...y.get(w.collection) || {},
10482
10488
  [_]: k
10483
10489
  });
@@ -10488,25 +10494,25 @@ const Fo = async (n, e, t, s, r, i, o) => {
10488
10494
  for (const [w, R] of y.entries()) {
10489
10495
  const O = o.collections[w], I = et(w, o);
10490
10496
  for (const [E, C] of Object.entries(R)) {
10491
- const { addedFields: _, removedFields: z } = zc(n, E, w, i, s, m);
10497
+ const { addedFields: _, removedFields: z } = Bc(n, E, w, i, s, m);
10492
10498
  if (c && d) {
10493
10499
  for (const k of _) {
10494
10500
  const p = U(O.fields, k.twoWay);
10495
- if (!rr(O, p, d)) {
10501
+ if (!ir(O, p, d)) {
10496
10502
  _n(k, r, E);
10497
10503
  continue;
10498
10504
  }
10499
10505
  }
10500
10506
  for (const k of z) {
10501
- const p = U(O.fields, k.twoWay), $ = pt(O, [p]);
10502
- if (!rr(O, p, d)) {
10507
+ const p = U(O.fields, k.twoWay), F = pt(O, [p]);
10508
+ if (!ir(O, p, d)) {
10503
10509
  ys(
10504
10510
  k,
10505
10511
  r,
10506
10512
  // eslint-disable-next-line security/detect-object-injection
10507
10513
  m?.[k.name]?.[E],
10508
10514
  E,
10509
- $.size === 1
10515
+ F.size === 1
10510
10516
  );
10511
10517
  continue;
10512
10518
  }
@@ -10523,14 +10529,14 @@ const Fo = async (n, e, t, s, r, i, o) => {
10523
10529
  for (const k of _)
10524
10530
  _n(k, r, E);
10525
10531
  for (const k of z) {
10526
- const p = U(O.fields, k.twoWay), $ = pt(O, [p]);
10532
+ const p = U(O.fields, k.twoWay), F = pt(O, [p]);
10527
10533
  ys(
10528
10534
  k,
10529
10535
  r,
10530
10536
  // eslint-disable-next-line security/detect-object-injection
10531
10537
  m?.[k.name]?.[E],
10532
10538
  E,
10533
- $.size === 1
10539
+ F.size === 1
10534
10540
  );
10535
10541
  }
10536
10542
  }
@@ -10538,14 +10544,14 @@ const Fo = async (n, e, t, s, r, i, o) => {
10538
10544
  for (const k of _)
10539
10545
  _n(k, r, E);
10540
10546
  for (const k of z) {
10541
- const p = U(O.fields, k.twoWay), $ = pt(O, [p]);
10547
+ const p = U(O.fields, k.twoWay), F = pt(O, [p]);
10542
10548
  ys(
10543
10549
  k,
10544
10550
  r,
10545
10551
  // eslint-disable-next-line security/detect-object-injection
10546
10552
  m?.[k.name]?.[E],
10547
10553
  E,
10548
- $.size === 1
10554
+ F.size === 1
10549
10555
  );
10550
10556
  }
10551
10557
  }
@@ -10557,7 +10563,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10557
10563
  }
10558
10564
  for (const k of _) {
10559
10565
  const p = U(O.fields, k.twoWay);
10560
- ["OneToOne", "OneToMany"].includes(p.type) && X(p) && p.enforceHierarchy && await ei(e, O, p, C, a, l, !0);
10566
+ ["OneToOne", "OneToMany"].includes(p.type) && X(p) && p.enforceHierarchy && await ti(e, O, p, C, a, l, !0);
10561
10567
  }
10562
10568
  }
10563
10569
  }
@@ -10598,7 +10604,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10598
10604
  return !1;
10599
10605
  }
10600
10606
  return !0;
10601
- }, qc = 10, Bc = async (n, e) => {
10607
+ }, Hc = 10, Gc = async (n, e) => {
10602
10608
  if (n.length === 0)
10603
10609
  return;
10604
10610
  const t = Math.min(e, n.length);
@@ -10659,10 +10665,10 @@ const Fo = async (n, e, t, s, r, i, o) => {
10659
10665
  }
10660
10666
  }
10661
10667
  }
10662
- await Bc(f, qc);
10668
+ await Gc(f, Hc);
10663
10669
  }
10664
10670
  }
10665
- }, wu = async (n, e, t) => {
10671
+ }, Eu = async (n, e, t) => {
10666
10672
  const s = t?.userId, r = t?.user;
10667
10673
  let i = t?.context;
10668
10674
  const o = Xe(), a = Zt();
@@ -10678,13 +10684,13 @@ const Fo = async (n, e, t, s, r, i, o) => {
10678
10684
  throw new Error("COLLECTION_NOT_FOUND");
10679
10685
  const u = l.collections[c], { labels: f, fields: g, enableWriteLog: v, softDelete: y } = u, w = et(f.collection, l), R = await ie(a.appName), O = ce(), I = Et(), C = (s ? await I.getUser(s) : void 0)?.customClaims?.role;
10680
10686
  let _;
10681
- s && await tr(n, u);
10687
+ s && await nr(n, u);
10682
10688
  const z = Ce(O, n, o), k = t?.id || z.doc().id;
10683
- i = i || {}, i.collection = f.collection, e.id = k, Po(e), nr(e);
10684
- const p = Ws("create", n, e, l, R, "Online", s || "System", ut.now(), he.serverTimestamp());
10689
+ i = i || {}, i.collection = f.collection, e.id = k, Po(e), sr(e);
10690
+ const p = js("create", n, e, l, R, "Online", s || "System", ut.now(), he.serverTimestamp());
10685
10691
  t?.createdAt && (p.Created_At = t.createdAt), t?.createdBy && (p.Created_By = t.createdBy);
10686
- const $ = fe(p);
10687
- y && (p[y.archivedField] = !1), Ue(e), v && !t?.providedTransaction && await Lt("create", "started", p, o, n, k, u), await oe("preOperation", a, w, { operation: "create", data: p, recordId: k, context: i }), await oe("preWrite", a, w, { operation: "create", data: p, recordId: k, context: i }), In(u, p, l), xn(u, p), await aa(p, u, w, C), Ue(p);
10692
+ const F = fe(p);
10693
+ y && (p[y.archivedField] = !1), Ue(e), v && !t?.providedTransaction && await Lt("create", "started", p, o, n, k, u), await oe("preOperation", a, w, { operation: "create", data: p, recordId: k, context: i }), await oe("preWrite", a, w, { operation: "create", data: p, recordId: k, context: i }), In(u, p, l), xn(u, p), await la(p, u, w, C), Ue(p);
10688
10694
  try {
10689
10695
  if (u.auth && r && !r.password)
10690
10696
  throw new Error("Password is required");
@@ -10694,7 +10700,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10694
10700
  }
10695
10701
  Ue(p), e.id = k, y && (p[y.archivedField] = !1), In(u, p, l), xn(u, p);
10696
10702
  try {
10697
- Vo("create", p, $), Uo("create", u, p), await rn("create", p, u, w, { operation: "create", record: p, context: i }, l);
10703
+ Vo("create", p, F), Uo("create", u, p), await rn("create", p, u, w, { operation: "create", record: p, context: i }, l);
10698
10704
  } catch (T) {
10699
10705
  throw new Error(`VALIDATION_ERROR: ${T.message}`);
10700
10706
  }
@@ -10707,14 +10713,14 @@ const Fo = async (n, e, t, s, r, i, o) => {
10707
10713
  for (const q of u.fields) {
10708
10714
  if (!(q.name in p))
10709
10715
  continue;
10710
- const F = Ae(q, w);
10711
- if (F?.custom?.serverAccess?.create !== void 0 && !await ie(F.custom.serverAccess.create, [T, p]))
10716
+ const M = Ae(q, w);
10717
+ if (M?.custom?.serverAccess?.create !== void 0 && !await ie(M.custom.serverAccess.create, [T, p]))
10712
10718
  throw new Error("PERMISSION_DENIED");
10713
10719
  }
10714
10720
  }
10715
10721
  r && (r.permissions ||= {}, r.permissions.Role ||= p.Role, r.permissions.Enabled ||= p.Enabled);
10716
10722
  const h = async (T, N) => {
10717
- const [q, F, G, Z] = await Promise.all([
10723
+ const [q, M, G, Z] = await Promise.all([
10718
10724
  t?.providedTransaction ? Promise.resolve({}) : T.get(O.collection("system_deployment").doc("latest_deploy")),
10719
10725
  t?.providedTransaction ? Promise.resolve({}) : T.get(O.collection("system_deployment").doc("maintenance_mode")),
10720
10726
  s ? T.get(O.collection("tenants").doc(o).collection("system_user_permissions").doc(s)) : Promise.resolve({}),
@@ -10726,9 +10732,9 @@ const Fo = async (n, e, t, s, r, i, o) => {
10726
10732
  const x = q.data();
10727
10733
  if (x.force && p.Last_Write_At.valueOf() < x.time.valueOf())
10728
10734
  throw new Error("VERSION_ERROR");
10729
- if (!F.exists)
10735
+ if (!M.exists)
10730
10736
  throw new Error("MAINTENANCE_MODE");
10731
- if (F.data().active)
10737
+ if (M.data().active)
10732
10738
  throw new Error("MAINTENANCE_MODE");
10733
10739
  }
10734
10740
  if (l = Z, s) {
@@ -10751,7 +10757,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10751
10757
  ]) : !0))
10752
10758
  throw new Error("PERMISSION_DENIED");
10753
10759
  const ze = e[B.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
10754
- if (Ks(ze)) {
10760
+ if (Xs(ze)) {
10755
10761
  if (N && N.size++, N && N.size > 500)
10756
10762
  throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks.");
10757
10763
  if ((await T.get(O.collection("tenants").doc(o).collection("system_unique").doc(f.collection).collection(`Unique-${f.collection}-${B.name}`).doc(ze)))?.exists)
@@ -10762,13 +10768,13 @@ const Fo = async (n, e, t, s, r, i, o) => {
10762
10768
  });
10763
10769
  await Promise.all(Q);
10764
10770
  }
10765
- ir(p, k, u, l, s, _, r?.permissions), r?.permissions && s && _ && await Wo(T, r.permissions, s, _, l), ir(p, k, u, l, s, _, r?.permissions);
10771
+ or(p, k, u, l, s, _, r?.permissions), r?.permissions && s && _ && await Wo(T, r.permissions, s, _, l), or(p, k, u, l, s, _, r?.permissions);
10766
10772
  };
10767
10773
  if (u.auth && r) {
10768
10774
  await O.runTransaction(async (N) => {
10769
10775
  await h(N);
10770
10776
  }, { maxAttempts: 10 });
10771
- const T = await Fo(
10777
+ const T = await Mo(
10772
10778
  o,
10773
10779
  k,
10774
10780
  a,
@@ -10784,13 +10790,13 @@ const Fo = async (n, e, t, s, r, i, o) => {
10784
10790
  try {
10785
10791
  const N = { size: 1 };
10786
10792
  await h(T, N), t?.noTwoWay || await Lo("Create", o, k, p, p, u, l, T, N, s, _);
10787
- const q = Us(l);
10788
- Qs("create", T, n, k, p, l, u, t, q, he.arrayUnion, he.arrayRemove, he.delete, (F) => O.collection("tenants").doc(o).collection("system_fields").doc(f.collection).collection(`${f.collection}-${F.name}`).doc(k), (F, G) => O.collection("tenants").doc(o).collection("system_unique").doc(f.collection).collection(`Unique-${f.collection}-${F.name}`).doc(G), (F) => O.collection("tenants").doc(o).collection("system_fields").doc(f.collection).collection(`${f.collection}-${F}`).doc(k), (F, G) => Ce(O, F, o).doc(G), (F, G, Z) => O.collection("tenants").doc(o).collection("system_fields").doc(F.collection).collection(`${F.collection}-${G}`).doc(Z), (F, G, Z) => O.collection("tenants").doc(o).collection("system_fields").doc(F.collection).collection(`${F.collection}-${G.replaceAll(" ", "-")}`).doc(Z), void 0, void 0, N), T.set(z.doc(k), p);
10793
+ const q = Ws(l);
10794
+ Ks("create", T, n, k, p, l, u, t, q, he.arrayUnion, he.arrayRemove, he.delete, (M) => O.collection("tenants").doc(o).collection("system_fields").doc(f.collection).collection(`${f.collection}-${M.name}`).doc(k), (M, G) => O.collection("tenants").doc(o).collection("system_unique").doc(f.collection).collection(`Unique-${f.collection}-${M.name}`).doc(G), (M) => O.collection("tenants").doc(o).collection("system_fields").doc(f.collection).collection(`${f.collection}-${M}`).doc(k), (M, G) => Ce(O, M, o).doc(G), (M, G, Z) => O.collection("tenants").doc(o).collection("system_fields").doc(M.collection).collection(`${M.collection}-${G}`).doc(Z), (M, G, Z) => O.collection("tenants").doc(o).collection("system_fields").doc(M.collection).collection(`${M.collection}-${G.replaceAll(" ", "-")}`).doc(Z), void 0, void 0, N), T.set(z.doc(k), p);
10789
10795
  } catch (N) {
10790
10796
  if (t?.providedTransaction)
10791
10797
  throw N;
10792
10798
  {
10793
- const F = await oe("postWriteError", a, w, {
10799
+ const M = await oe("postWriteError", a, w, {
10794
10800
  operation: "create",
10795
10801
  data: p,
10796
10802
  recordId: k,
@@ -10799,7 +10805,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10799
10805
  });
10800
10806
  if (v && (await new Promise((G) => {
10801
10807
  setTimeout(G, 250);
10802
- }), await Lt("create", F?.resolved ? "success" : "failed", p, o, n, k, u, F?.resolved ? void 0 : N)), !F?.resolved)
10808
+ }), await Lt("create", M?.resolved ? "success" : "failed", p, o, n, k, u, M?.resolved ? void 0 : N)), !M?.resolved)
10803
10809
  throw u.auth && r && await dn(p), N;
10804
10810
  }
10805
10811
  }
@@ -10845,10 +10851,10 @@ const Fo = async (n, e, t, s, r, i, o) => {
10845
10851
  }
10846
10852
  if (l)
10847
10853
  throw new Error(`ROLLBACK_FAILED: ${s}`);
10848
- }, Hc = async (n, e, t, s, r, i, o, a, l, c, d) => {
10854
+ }, Yc = async (n, e, t, s, r, i, o, a, l, c, d) => {
10849
10855
  const m = Et(), u = ce(), f = {};
10850
10856
  for (const y of r.fields)
10851
- y.saveToAuthToken && !er(y.name) && i[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (Re(i[y.name]) ? f[y.name] = null : f[y.name] = i[y.name]);
10857
+ y.saveToAuthToken && !tr(y.name) && i[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (Re(i[y.name]) ? f[y.name] = null : f[y.name] = i[y.name]);
10852
10858
  const g = "USER_ERROR";
10853
10859
  let v = "";
10854
10860
  if (n === "create") {
@@ -10857,7 +10863,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10857
10863
  if (!l)
10858
10864
  throw new Error("VALIDATION_ERROR: Permissions are required");
10859
10865
  try {
10860
- v = await Fo(e, t, s, r, i, l, d);
10866
+ v = await Mo(e, t, s, r, i, l, d);
10861
10867
  } catch (y) {
10862
10868
  throw new Error(y.message);
10863
10869
  }
@@ -10874,7 +10880,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10874
10880
  if (i.Role && i.Role !== o.Role || Object.keys(f).length)
10875
10881
  try {
10876
10882
  const w = {
10877
- ...jc(a.customClaims),
10883
+ ...zc(a.customClaims),
10878
10884
  ...f
10879
10885
  };
10880
10886
  await m.setCustomUserClaims(o.User_ID, {
@@ -10911,7 +10917,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10911
10917
  if (R) {
10912
10918
  const O = `https://${m.app.options.projectId}.firebaseapp.com/__/auth/action${R}`, I = await ie(s.appName), E = s?.mail?.emailVerification && s.mail.emailVerification(O, I);
10913
10919
  try {
10914
- await $o(i.Email, E?.subject || "Please verify your email address", void 0, E?.html || `Please verify your email address by clicking the link:
10920
+ await Fo(i.Email, E?.subject || "Please verify your email address", void 0, E?.html || `Please verify your email address by clicking the link:
10915
10921
  </br>
10916
10922
  </br>
10917
10923
  <a href="${O}">${O}</a>`);
@@ -10929,7 +10935,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10929
10935
  }
10930
10936
  if (v)
10931
10937
  return v;
10932
- }, Gc = async (n, e, t) => {
10938
+ }, Jc = async (n, e, t) => {
10933
10939
  const s = Xe(), r = ce(), i = [e];
10934
10940
  t && t.trim() !== "" && i.push(t), i.sort();
10935
10941
  const o = [];
@@ -10941,7 +10947,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10941
10947
  }
10942
10948
  for (const a of o)
10943
10949
  n.set(a, { locked: !0 });
10944
- }, ti = async (n, e) => {
10950
+ }, ni = async (n, e) => {
10945
10951
  const t = Xe(), s = ce(), r = [n];
10946
10952
  e && e.trim() !== "" && r.push(e), r.sort();
10947
10953
  const i = s.batch();
@@ -10950,7 +10956,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10950
10956
  i.delete(a);
10951
10957
  }
10952
10958
  await i.commit();
10953
- }, Yc = async (n, e, t, s) => {
10959
+ }, Qc = async (n, e, t, s) => {
10954
10960
  const r = s?.userId;
10955
10961
  let i = s?.user, o = s?.context;
10956
10962
  const a = Xe(), l = Zt();
@@ -10968,7 +10974,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
10968
10974
  throw new Error("COLLECTION_NOT_FOUND");
10969
10975
  const f = c.collections[d], { labels: g, fields: v, enableWriteLog: y } = f, w = et(g.collection, c), R = await ie(l.appName), O = Et(), I = ce();
10970
10976
  let E;
10971
- r && await tr(n, f);
10977
+ r && await nr(n, f);
10972
10978
  const C = Ce(I, n, a);
10973
10979
  o = o || {}, o.collection = g.collection;
10974
10980
  let _ = s?.originalRecord || await Ye(n, e, {
@@ -10997,13 +11003,13 @@ const Fo = async (n, e, t, s, r, i, o) => {
10997
11003
  throw new Error("VALIDATION_ERROR: User operations are only permitted for auth collections");
10998
11004
  if (i?.operation === "delete" && i.permissions)
10999
11005
  throw new Error("VALIDATION_ERROR: Permissions are not allowed for delete operations");
11000
- const k = f.fields.filter((x) => x.saveToAuthToken && !er(x.name)), p = f.auth && i?.operation === "create", $ = f.auth && i?.operation === "delete", A = f.auth && !p && !$ && (i?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL || // eslint-disable-next-line security/detect-object-injection
11001
- k.some((x) => t[x.name] !== void 0)), j = (x) => x.User_ID && (f.auth && !p && !$ && i?.operation === "update" || t.Role && t.Role !== x.Role || t.Enabled !== void 0 && t.Enabled !== x.Enabled || t.Name && t.Name !== x.Name || t.Email && t.Email !== x.Email || t.Photo_URL && t.Photo_URL !== x.Photo_URL || k.some(
11006
+ const k = f.fields.filter((x) => x.saveToAuthToken && !tr(x.name)), p = f.auth && i?.operation === "create", F = f.auth && i?.operation === "delete", A = f.auth && !p && !F && (i?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL || // eslint-disable-next-line security/detect-object-injection
11007
+ k.some((x) => t[x.name] !== void 0)), j = (x) => x.User_ID && (f.auth && !p && !F && i?.operation === "update" || t.Role && t.Role !== x.Role || t.Enabled !== void 0 && t.Enabled !== x.Enabled || t.Name && t.Name !== x.Name || t.Email && t.Email !== x.Email || t.Photo_URL && t.Photo_URL !== x.Photo_URL || k.some(
11002
11008
  // eslint-disable-next-line security/detect-object-injection
11003
11009
  (Q) => t[Q.name] !== void 0 && t[Q.name] !== x[Q.name]
11004
11010
  ));
11005
- delete t.id, Po(t), nr(t);
11006
- const h = Ws("update", n, t, c, R, "Online", r || "System", ut.now(), he.serverTimestamp()), S = fe(h);
11011
+ delete t.id, Po(t), sr(t);
11012
+ const h = js("update", n, t, c, R, "Online", r || "System", ut.now(), he.serverTimestamp()), S = fe(h);
11007
11013
  for (const x of v)
11008
11014
  !X(x) && Re(h[x.name]) && x.nullable && (h[x.name] = null);
11009
11015
  Ue(h), Ue(_), y && !s?.providedTransaction && await Lt("update", "started", h, a, n, e, f, void 0, _);
@@ -11077,7 +11083,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
11077
11083
  if (!E.Enabled)
11078
11084
  throw new Error("PERMISSION_DENIED");
11079
11085
  }
11080
- if (B && (B.size += Io(a, n, e, c, E).length), p && _.User_ID || $ && !_.User_ID)
11086
+ if (B && (B.size += Io(a, n, e, c, E).length), p && _.User_ID || F && !_.User_ID)
11081
11087
  throw new Error("USER_ERROR");
11082
11088
  if (j(_)) {
11083
11089
  const Oe = await x.get(I.collection("tenants").doc(a).collection("system_user_permissions").doc(_.User_ID));
@@ -11104,11 +11110,11 @@ const Fo = async (n, e, t, s, r, i, o) => {
11104
11110
  ]) : !0))
11105
11111
  throw new Error("PERMISSION_DENIED");
11106
11112
  const Kn = h[we.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
11107
- if (Ks(Kn)) {
11113
+ if (Xs(Kn)) {
11108
11114
  if (B && B.size++, B && B.size > 500)
11109
11115
  throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks.");
11110
- const sr = await x.get(I.collection("tenants").doc(a).collection("system_unique").doc(g.collection).collection(`Unique-${g.collection}-${we.name}`).doc(Kn));
11111
- if (sr.exists && sr.data().id !== e)
11116
+ const rr = await x.get(I.collection("tenants").doc(a).collection("system_unique").doc(g.collection).collection(`Unique-${g.collection}-${we.name}`).doc(Kn));
11117
+ if (rr.exists && rr.data().id !== e)
11112
11118
  throw new Error(`VALIDATION_ERROR: ${we.name} "${h[we.name]}" already exists`);
11113
11119
  } else
11114
11120
  throw new Error(`VALIDATION_ERROR: ${we.name} "${h[we.name]}" is invalid`);
@@ -11130,12 +11136,12 @@ const Fo = async (n, e, t, s, r, i, o) => {
11130
11136
  throw new Error("PERMISSION_DENIED");
11131
11137
  }
11132
11138
  }
11133
- or(h, _, e, f, c, r, E, i?.operation ? i.operation : A ? "update" : void 0, i?.permissions, N), i?.permissions && r && E && await Wo(x, i.permissions, r, E, c, N, B), or(h, _, e, f, c, r, E, i?.operation ? i.operation : A ? "update" : void 0, i?.permissions, N), Q && (p || j(_) || $) && await Gc(x, e, _.User_ID);
11139
+ ar(h, _, e, f, c, r, E, i?.operation ? i.operation : A ? "update" : void 0, i?.permissions, N), i?.permissions && r && E && await Wo(x, i.permissions, r, E, c, N, B), ar(h, _, e, f, c, r, E, i?.operation ? i.operation : A ? "update" : void 0, i?.permissions, N), Q && (p || j(_) || F) && await Jc(x, e, _.User_ID);
11134
11140
  };
11135
- (p || A || $) && await I.runTransaction(async (x) => {
11141
+ (p || A || F) && await I.runTransaction(async (x) => {
11136
11142
  await q(x, !0);
11137
11143
  }, { maxAttempts: 10 });
11138
- const F = async (x, Q) => {
11144
+ const M = async (x, Q) => {
11139
11145
  if (!_)
11140
11146
  throw new Error("NOT_FOUND");
11141
11147
  try {
@@ -11143,8 +11149,8 @@ const Fo = async (n, e, t, s, r, i, o) => {
11143
11149
  await q(x, !1, B);
11144
11150
  let Ve;
11145
11151
  !s?.noTwoWay && !s?.providedTransaction && (Ve = await Lo("Update", a, e, ve, h, f, c, x, B, r, E, _));
11146
- const ze = Us(c);
11147
- Qs("update", x, n, e, h, c, f, s, ze, he.arrayUnion, he.arrayRemove, he.delete, (me) => I.collection("tenants").doc(a).collection("system_fields").doc(g.collection).collection(`${g.collection}-${me.name}`).doc(e), (me, qe) => I.collection("tenants").doc(a).collection("system_unique").doc(g.collection).collection(`Unique-${g.collection}-${me.name}`).doc(qe), (me) => I.collection("tenants").doc(a).collection("system_fields").doc(g.collection).collection(`${g.collection}-${me}`).doc(e), (me, qe) => Ce(I, me, a).doc(qe), (me, qe, Oe) => I.collection("tenants").doc(a).collection("system_fields").doc(me.collection).collection(`${me.collection}-${qe}`).doc(Oe), (me, qe, Oe) => I.collection("tenants").doc(a).collection("system_fields").doc(me.collection).collection(`${me.collection}-${qe.replaceAll(" ", "-")}`).doc(Oe), _, Ve, B), x.update(C.doc(e), h);
11152
+ const ze = Ws(c);
11153
+ Ks("update", x, n, e, h, c, f, s, ze, he.arrayUnion, he.arrayRemove, he.delete, (me) => I.collection("tenants").doc(a).collection("system_fields").doc(g.collection).collection(`${g.collection}-${me.name}`).doc(e), (me, qe) => I.collection("tenants").doc(a).collection("system_unique").doc(g.collection).collection(`Unique-${g.collection}-${me.name}`).doc(qe), (me) => I.collection("tenants").doc(a).collection("system_fields").doc(g.collection).collection(`${g.collection}-${me}`).doc(e), (me, qe) => Ce(I, me, a).doc(qe), (me, qe, Oe) => I.collection("tenants").doc(a).collection("system_fields").doc(me.collection).collection(`${me.collection}-${qe}`).doc(Oe), (me, qe, Oe) => I.collection("tenants").doc(a).collection("system_fields").doc(me.collection).collection(`${me.collection}-${qe.replaceAll(" ", "-")}`).doc(Oe), _, Ve, B), x.update(C.doc(e), h);
11148
11154
  } catch (B) {
11149
11155
  if (s?.providedTransaction)
11150
11156
  throw B;
@@ -11160,16 +11166,16 @@ const Fo = async (n, e, t, s, r, i, o) => {
11160
11166
  if (y && (await new Promise((ze) => {
11161
11167
  setTimeout(ze, 250);
11162
11168
  }), await Lt("update", Ve?.resolved ? "success" : "failed", h, a, n, e, f, Ve?.resolved ? void 0 : B, _)), !Ve?.resolved)
11163
- throw p && await dn(_), j(_) && await Kt(_.User_ID, Q, N, "USER_ERROR"), $ && await I.collection("tenants").doc(a).collection(g.collection).doc(e).update({ User_ID: he.delete() }), B;
11169
+ throw p && await dn(_), j(_) && await Kt(_.User_ID, Q, N, "USER_ERROR"), F && await I.collection("tenants").doc(a).collection(g.collection).doc(e).update({ User_ID: he.delete() }), B;
11164
11170
  }
11165
11171
  }
11166
- (p || j(_) || $) && await Qr(ti, [e, _.User_ID]).catch(() => {
11172
+ (p || j(_) || F) && await Kr(ni, [e, _.User_ID]).catch(() => {
11167
11173
  throw new Error("USER_ERROR");
11168
11174
  });
11169
11175
  };
11170
11176
  try {
11171
11177
  let x;
11172
- if (p || j(_) || $) {
11178
+ if (p || j(_) || F) {
11173
11179
  if (j(_)) {
11174
11180
  x = await O.getUser(_.User_ID);
11175
11181
  const ve = x.customClaims;
@@ -11178,14 +11184,14 @@ const Fo = async (n, e, t, s, r, i, o) => {
11178
11184
  }
11179
11185
  const Q = { ..._, ...h };
11180
11186
  it(Q);
11181
- const B = await Hc(i?.operation || "update", a, e, l, f, Q, _, x, i?.permissions, N, i?.password);
11182
- p && (h.User_ID = B), $ && (h.User_ID = he.delete());
11187
+ const B = await Yc(i?.operation || "update", a, e, l, f, Q, _, x, i?.permissions, N, i?.password);
11188
+ p && (h.User_ID = B), F && (h.User_ID = he.delete());
11183
11189
  }
11184
- s?.providedTransaction ? await F(s.providedTransaction, x) : await I.runTransaction(async (Q) => {
11185
- await F(Q, x);
11190
+ s?.providedTransaction ? await M(s.providedTransaction, x) : await I.runTransaction(async (Q) => {
11191
+ await M(Q, x);
11186
11192
  }, { maxAttempts: 10 });
11187
11193
  } catch (x) {
11188
- throw (p || j(_) || $) && await Qr(ti, [e, _.User_ID]).catch(() => {
11194
+ throw (p || j(_) || F) && await Kr(ni, [e, _.User_ID]).catch(() => {
11189
11195
  throw new Error("USER_ERROR");
11190
11196
  }), x;
11191
11197
  }
@@ -11201,7 +11207,7 @@ const Fo = async (n, e, t, s, r, i, o) => {
11201
11207
  }
11202
11208
  const G = { ..._, ...h };
11203
11209
  return it(G), { id: e, ...G };
11204
- }, _u = async (n, e, t) => {
11210
+ }, vu = async (n, e, t) => {
11205
11211
  const s = t?.userId;
11206
11212
  let r = t?.context;
11207
11213
  const i = Xe(), o = Zt();
@@ -11213,14 +11219,14 @@ const Fo = async (n, e, t, s, r, i, o) => {
11213
11219
  throw new Error("COLLECTION_NOT_FOUND");
11214
11220
  const m = a.collections[l], { labels: u, auth: f, enableWriteLog: g, softDelete: v } = m, y = et(u.collection, a), w = await ie(o.appName);
11215
11221
  if (v && !f && !t?.force)
11216
- return await Yc(n, e, { [v.archivedField]: !0, [v.timestampField]: he.serverTimestamp() }, { userId: s });
11222
+ return await Qc(n, e, { [v.archivedField]: !0, [v.timestampField]: he.serverTimestamp() }, { userId: s });
11217
11223
  const R = ce();
11218
11224
  let O;
11219
- s && await tr(n, m);
11225
+ s && await nr(n, m);
11220
11226
  const I = Ce(R, n, i);
11221
11227
  r = r || {}, r.collection = u.collection;
11222
11228
  const E = await Ye(n, e, { userId: s });
11223
- let C = Ws("delete", n, E, a, w, "Online", s || "System", ut.now(), he.serverTimestamp());
11229
+ let C = js("delete", n, E, a, w, "Online", s || "System", ut.now(), he.serverTimestamp());
11224
11230
  const _ = Rn(C);
11225
11231
  Ue(C), g && await Lt("delete", "started", C, i, n, e, m), await oe("preOperation", o, y, { operation: "delete", data: C, recordId: e, context: r }), await oe("preWrite", o, y, { operation: "delete", data: C, recordId: e, context: r }), Ue(C);
11226
11232
  const p = async (h) => {
@@ -11243,11 +11249,11 @@ const Fo = async (n, e, t, s, r, i, o) => {
11243
11249
  throw new Error("USER_ERROR");
11244
11250
  if (!O.Enabled)
11245
11251
  throw new Error("PERMISSION_DENIED");
11246
- Ko(C, e, m, a, s, O);
11252
+ Xo(C, e, m, a, s, O);
11247
11253
  }
11248
11254
  if (s && O?.Role) {
11249
- const F = O.Role;
11250
- if (!(y.custom?.serverAccess?.delete !== void 0 ? await ie(y.custom.serverAccess.delete, [F, C]) : !0))
11255
+ const M = O.Role;
11256
+ if (!(y.custom?.serverAccess?.delete !== void 0 ? await ie(y.custom.serverAccess.delete, [M, C]) : !0))
11251
11257
  throw new Error("PERMISSION_DENIED");
11252
11258
  }
11253
11259
  };
@@ -11257,8 +11263,8 @@ const Fo = async (n, e, t, s, r, i, o) => {
11257
11263
  try {
11258
11264
  await R.runTransaction(async (h) => {
11259
11265
  await p(h);
11260
- const S = Us(a);
11261
- Qs("delete", h, n, e, C, a, m, t, S, he.arrayUnion, he.arrayRemove, he.delete, (b) => R.collection("tenants").doc(i).collection("system_fields").doc(u.collection).collection(`${u.collection}-${b.name}`).doc(e), (b, T) => R.collection("tenants").doc(i).collection("system_unique").doc(u.collection).collection(`Unique-${u.collection}-${b.name}`).doc(T), (b) => R.collection("tenants").doc(i).collection("system_fields").doc(u.collection).collection(`${u.collection}-${b}`).doc(e), (b, T) => Ce(R, b, i).doc(T), (b, T, N) => R.collection("tenants").doc(i).collection("system_fields").doc(b.collection).collection(`${b.collection}-${T}`).doc(N), (b, T, N) => R.collection("tenants").doc(i).collection("system_fields").doc(b.collection).collection(`${b.collection}-${T.replaceAll(" ", "-")}`).doc(N)), h.delete(I.doc(e));
11266
+ const S = Ws(a);
11267
+ Ks("delete", h, n, e, C, a, m, t, S, he.arrayUnion, he.arrayRemove, he.delete, (b) => R.collection("tenants").doc(i).collection("system_fields").doc(u.collection).collection(`${u.collection}-${b.name}`).doc(e), (b, T) => R.collection("tenants").doc(i).collection("system_unique").doc(u.collection).collection(`Unique-${u.collection}-${b.name}`).doc(T), (b) => R.collection("tenants").doc(i).collection("system_fields").doc(u.collection).collection(`${u.collection}-${b}`).doc(e), (b, T) => Ce(R, b, i).doc(T), (b, T, N) => R.collection("tenants").doc(i).collection("system_fields").doc(b.collection).collection(`${b.collection}-${T}`).doc(N), (b, T, N) => R.collection("tenants").doc(i).collection("system_fields").doc(b.collection).collection(`${b.collection}-${T.replaceAll(" ", "-")}`).doc(N)), h.delete(I.doc(e));
11262
11268
  }, { maxAttempts: 10 });
11263
11269
  } catch (h) {
11264
11270
  const b = await oe("postWriteError", o, y, {
@@ -11273,9 +11279,9 @@ const Fo = async (n, e, t, s, r, i, o) => {
11273
11279
  }), await Lt("delete", b?.resolved ? "success" : "failed", C, i, n, e, m, b?.resolved ? void 0 : h)), !b?.resolved)
11274
11280
  throw m.auth && C.User_ID && await R.collection("tenants").doc(i).collection(u.collection).doc(e).update({ User_ID: he.delete() }), h;
11275
11281
  }
11276
- const $ = { operation: "delete", data: C, recordId: e, context: r }, A = { ...$ };
11277
- return await oe("postWrite", o, y, $), await oe("postOperation", o, y, A), { id: e, ...C };
11278
- }, Eu = async (n, e) => {
11282
+ const F = { operation: "delete", data: C, recordId: e, context: r }, A = { ...F };
11283
+ return await oe("postWrite", o, y, F), await oe("postOperation", o, y, A), { id: e, ...C };
11284
+ }, Ou = async (n, e) => {
11279
11285
  const t = ce(), s = So(), r = process.env.ADMIN_SMS;
11280
11286
  if (s === "development")
11281
11287
  if (r)
@@ -11284,72 +11290,73 @@ const Fo = async (n, e, t, s, r, i, o) => {
11284
11290
  throw new Error("Admin phone not set");
11285
11291
  const i = { to: n, body: e };
11286
11292
  await t.collection("system_messages").add(i);
11287
- }, Jc = (n) => n !== null && typeof n == "object", vu = (n) => {
11293
+ }, Kc = (n) => n !== null && typeof n == "object", ku = (n) => {
11288
11294
  const e = (t) => {
11289
11295
  Object.entries(t).forEach(([s, r]) => {
11290
11296
  r instanceof ut ? t[s] = {
11291
11297
  _seconds: r.seconds,
11292
11298
  _nanoseconds: r.nanoseconds
11293
- } : Jc(r) && e(r);
11299
+ } : Kc(r) && e(r);
11294
11300
  });
11295
11301
  };
11296
11302
  e(n);
11297
- }, Ou = async (n) => await Et().getUser(n), ku = (n) => {
11303
+ }, bu = async (n) => await Et().getUser(n), Tu = (n) => {
11298
11304
  const e = Ro();
11299
11305
  return L.fromJSDate(n).setZone(e);
11300
- }, Qc = (n) => {
11306
+ }, Xc = (n) => {
11301
11307
  const e = Ro();
11302
11308
  return L.fromJSDate(n.toDate()).setZone(e);
11303
- }, bu = (n, e) => {
11309
+ }, Su = (n, e) => {
11304
11310
  const s = L.fromJSDate(n, { zone: e }).offset, i = L.fromJSDate(n).offset, o = s - i;
11305
11311
  return L.fromJSDate(n).plus({ minutes: o }).toJSDate();
11306
- }, Tu = (n, e) => {
11312
+ }, Ru = (n, e) => {
11307
11313
  const s = L.fromJSDate(n, { zone: e }).offset, i = L.fromJSDate(n).offset, o = s - i;
11308
11314
  return L.fromJSDate(n).minus({ minutes: o }).toJSDate();
11309
- }, Su = (n) => "seconds" in n && "nanoseconds" in n ? Qc(new ut(n.seconds, n.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
11315
+ }, Iu = (n) => "seconds" in n && "nanoseconds" in n ? Xc(new ut(n.seconds, n.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
11310
11316
  export {
11311
- wu as addRecord,
11312
- Fo as addUser,
11313
- ku as convertDateToTimezone,
11314
- Qc as convertTimestampToTimezone,
11315
- _u as deleteRecord,
11317
+ Eu as addRecord,
11318
+ Mo as addUser,
11319
+ Tu as convertDateToTimezone,
11320
+ Xc as convertTimestampToTimezone,
11321
+ vu as deleteRecord,
11316
11322
  dn as deleteUser,
11317
- nr as deserializeDeleteSentinels,
11323
+ sr as deserializeDeleteSentinels,
11318
11324
  Po as deserializeTimestamps,
11319
- gu as deserializeTimestampsWithoutUnderscores,
11320
- Su as displayDate,
11325
+ _u as deserializeTimestampsWithoutUnderscores,
11326
+ Iu as displayDate,
11321
11327
  Ke as fetchCurrentSchema,
11322
- yu as fetchLastSchema,
11323
- lu as getCachedConfigValue,
11324
- Uc as getCollectionRefs,
11328
+ wu as fetchLastSchema,
11329
+ uu as getCachedConfigValue,
11330
+ jc as getCollectionRefs,
11325
11331
  et as getCustomizationFile,
11326
- Vc as getCustomizationFiles,
11332
+ Wc as getCustomizationFiles,
11327
11333
  Io as getDocumentRefs,
11328
11334
  Ce as getFirestorePathRef,
11329
11335
  Zt as getGlobalConfigModule,
11330
- cu as getInputSchema,
11331
- hu as getMaintenanceInfo,
11336
+ du as getInputSchema,
11337
+ pu as getMaintenanceInfo,
11332
11338
  So as getMode,
11333
11339
  Ye as getOne,
11334
11340
  No as getSome,
11341
+ ce as getStokerFirestore,
11335
11342
  Xe as getTenant,
11336
11343
  Ro as getTimezone,
11337
- Ou as getUser,
11338
- fu as getVersionInfo,
11339
- Fa as getZodSchema,
11340
- pu as initializeFirebase,
11341
- uu as initializeStoker,
11344
+ bu as getUser,
11345
+ mu as getVersionInfo,
11346
+ Pa as getZodSchema,
11347
+ gu as initializeFirebase,
11348
+ fu as initializeStoker,
11342
11349
  Re as isDeleteSentinel,
11343
- bu as keepTimezone,
11344
- Tu as removeTimezone,
11345
- mu as runChildProcess,
11346
- $o as sendMail,
11347
- Eu as sendMessage,
11348
- vu as serializeTimestamps,
11349
- du as setTenant,
11350
+ Su as keepTimezone,
11351
+ Ru as removeTimezone,
11352
+ yu as runChildProcess,
11353
+ Fo as sendMail,
11354
+ Ou as sendMessage,
11355
+ ku as serializeTimestamps,
11356
+ hu as setTenant,
11350
11357
  ie as tryPromise,
11351
- Yc as updateRecord,
11352
- Hc as updateUser,
11358
+ Qc as updateRecord,
11359
+ Yc as updateUser,
11353
11360
  Lo as validateRelations,
11354
11361
  Uo as validateSoftDelete,
11355
11362
  Lt as writeLog