@stoker-platform/web-client 0.5.45 → 0.5.46

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.
Files changed (2) hide show
  1. package/dist/bundle.js +84 -84
  2. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -8,7 +8,7 @@ import { getFunctions as Ve, httpsCallable as Je, connectFunctionsEmulator as up
8
8
  import { ReCaptchaEnterpriseProvider as fp, initializeAppCheck as Gn, onTokenChanged as Hn } from "firebase/app-check";
9
9
  import { getPerformance as dp } from "firebase/performance";
10
10
  import { getRemoteConfig as hp, fetchAndActivate as mp } from "firebase/remote-config";
11
- const pp = "0.5.44", gp = (r) => !!r.auth, ct = (r, e) => {
11
+ const pp = "0.5.46", gp = (r) => !!r.auth, ct = (r, e) => {
12
12
  if (e?.operations)
13
13
  return e.operations.includes(r);
14
14
  }, An = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, yp = (r, e) => e ? !e.Role || r.restrictCreate === !0 ? !1 : typeof r.restrictCreate == "object" ? r.restrictCreate?.includes(e.Role) : !0 : !0, _p = (r, e) => e ? !e.Role || r.restrictUpdate === !0 ? !1 : typeof r.restrictUpdate == "object" ? r.restrictUpdate?.includes(e.Role) : !0 : !0, te = (r, e) => r.filter((t) => t.name === e)[0], _e = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type), Rd = (r, e) => {
@@ -4989,7 +4989,7 @@ class ah extends Gt {
4989
4989
  super(`Invalid unit ${e}`);
4990
4990
  }
4991
4991
  }
4992
- class Ne extends Gt {
4992
+ class Fe extends Gt {
4993
4993
  }
4994
4994
  class St extends Gt {
4995
4995
  constructor() {
@@ -6221,9 +6221,9 @@ function Oo(r) {
6221
6221
  if (r == null)
6222
6222
  return null;
6223
6223
  if (typeof r != "object")
6224
- throw new Ne("Week settings must be an object");
6224
+ throw new Fe("Week settings must be an object");
6225
6225
  if (!Ke(r.firstDay, 1, 7) || !Ke(r.minimalDays, 1, 7) || !Array.isArray(r.weekend) || r.weekend.some((e) => !Ke(e, 1, 7)))
6226
- throw new Ne("Invalid week settings");
6226
+ throw new Fe("Invalid week settings");
6227
6227
  return {
6228
6228
  firstDay: r.firstDay,
6229
6229
  minimalDays: r.minimalDays,
@@ -6326,7 +6326,7 @@ function Un(r, e) {
6326
6326
  function qh(r) {
6327
6327
  const e = Number(r);
6328
6328
  if (typeof r == "boolean" || r === "" || !Number.isFinite(e))
6329
- throw new Ne(`Invalid unit value ${r}`);
6329
+ throw new Fe(`Invalid unit value ${r}`);
6330
6330
  return e;
6331
6331
  }
6332
6332
  function Sn(r, e) {
@@ -6499,9 +6499,9 @@ const D_ = {
6499
6499
  FFF: Eh,
6500
6500
  FFFF: Th
6501
6501
  };
6502
- class Fe {
6502
+ class De {
6503
6503
  static create(e, t = {}) {
6504
- return new Fe(e, t);
6504
+ return new De(e, t);
6505
6505
  }
6506
6506
  static parseFormat(e) {
6507
6507
  let t = null, n = "", s = !1;
@@ -6550,7 +6550,7 @@ class Fe {
6550
6550
  p ? { weekday: h } : { weekday: h, month: "long", day: "numeric" },
6551
6551
  "weekday"
6552
6552
  ), u = (h) => {
6553
- const p = Fe.macroTokenToFormatOpts(h);
6553
+ const p = De.macroTokenToFormatOpts(h);
6554
6554
  return p ? this.formatWithSystemDefault(e, p) : h;
6555
6555
  }, f = (h) => n ? N_(e, h) : i({ era: h }, "era"), d = (h) => {
6556
6556
  switch (h) {
@@ -6695,7 +6695,7 @@ class Fe {
6695
6695
  return u(h);
6696
6696
  }
6697
6697
  };
6698
- return Mf(Fe.parseFormat(t), d);
6698
+ return Mf(De.parseFormat(t), d);
6699
6699
  }
6700
6700
  formatDurationFromString(e, t) {
6701
6701
  const n = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, s = (u) => {
@@ -6727,7 +6727,7 @@ class Fe {
6727
6727
  return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ? w = "never" : this.opts.signMode === "all" ? w = "always" : w = "auto", this.num(u.get(h) * p, d.length, w);
6728
6728
  } else
6729
6729
  return d;
6730
- }, a = Fe.parseFormat(t), o = a.reduce(
6730
+ }, a = De.parseFormat(t), o = a.reduce(
6731
6731
  (u, { literal: f, val: d }) => f ? u : u.concat(d),
6732
6732
  []
6733
6733
  ), c = e.shiftTo(...o.map(s).filter((u) => u)), l = {
@@ -7099,7 +7099,7 @@ class le {
7099
7099
  */
7100
7100
  static fromObject(e, t = {}) {
7101
7101
  if (e == null || typeof e != "object")
7102
- throw new Ne(
7102
+ throw new Fe(
7103
7103
  `Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
7104
7104
  );
7105
7105
  return new le({
@@ -7126,7 +7126,7 @@ class le {
7126
7126
  return e;
7127
7127
  if (typeof e == "object")
7128
7128
  return le.fromObject(e);
7129
- throw new Ne(
7129
+ throw new Fe(
7130
7130
  `Unknown duration argument ${e} of type ${typeof e}`
7131
7131
  );
7132
7132
  }
@@ -7176,7 +7176,7 @@ class le {
7176
7176
  */
7177
7177
  static invalid(e, t = null) {
7178
7178
  if (!e)
7179
- throw new Ne("need to specify a reason the Duration is invalid");
7179
+ throw new Fe("need to specify a reason the Duration is invalid");
7180
7180
  const n = e instanceof nt ? e : new nt(e, t);
7181
7181
  if (Ee.throwOnInvalid)
7182
7182
  throw new Zy(n);
@@ -7263,7 +7263,7 @@ class le {
7263
7263
  ...t,
7264
7264
  floor: t.round !== !1 && t.floor !== !1
7265
7265
  };
7266
- return this.isValid ? Fe.create(this.loc, n).formatDurationFromString(this, e) : qf;
7266
+ return this.isValid ? De.create(this.loc, n).formatDurationFromString(this, e) : qf;
7267
7267
  }
7268
7268
  /**
7269
7269
  * Returns a string representation of a Duration with all units included.
@@ -7674,7 +7674,7 @@ class Oe {
7674
7674
  */
7675
7675
  static invalid(e, t = null) {
7676
7676
  if (!e)
7677
- throw new Ne("need to specify a reason the Interval is invalid");
7677
+ throw new Fe("need to specify a reason the Interval is invalid");
7678
7678
  const n = e instanceof nt ? e : new nt(e, t);
7679
7679
  if (Ee.throwOnInvalid)
7680
7680
  throw new By(n);
@@ -8049,7 +8049,7 @@ class Oe {
8049
8049
  * @return {string}
8050
8050
  */
8051
8051
  toLocaleString(e = bn, t = {}) {
8052
- return this.isValid ? Fe.create(this.s.loc.clone(t), e).formatInterval(this) : Yt;
8052
+ return this.isValid ? De.create(this.s.loc.clone(t), e).formatInterval(this) : Yt;
8053
8053
  }
8054
8054
  /**
8055
8055
  * Returns an ISO 8601-compliant string representation of this Interval.
@@ -8599,7 +8599,7 @@ function Dv() {
8599
8599
  function Mv(r, e) {
8600
8600
  if (r.literal)
8601
8601
  return r;
8602
- const t = Fe.macroTokenToFormatOpts(r.val), n = sm(t, e);
8602
+ const t = De.macroTokenToFormatOpts(r.val), n = sm(t, e);
8603
8603
  return n == null || n.includes(void 0) ? r : n;
8604
8604
  }
8605
8605
  function tm(r, e) {
@@ -8607,7 +8607,7 @@ function tm(r, e) {
8607
8607
  }
8608
8608
  class rm {
8609
8609
  constructor(e, t) {
8610
- if (this.locale = e, this.format = t, this.tokens = tm(Fe.parseFormat(t), e), this.units = this.tokens.map((n) => Av(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
8610
+ if (this.locale = e, this.format = t, this.tokens = tm(De.parseFormat(t), e), this.units = this.tokens.map((n) => Av(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
8611
8611
  const [n, s] = xv(this.units);
8612
8612
  this.regex = RegExp(n, "i"), this.handlers = s;
8613
8613
  }
@@ -8649,7 +8649,7 @@ function Pv(r, e, t) {
8649
8649
  function sm(r, e) {
8650
8650
  if (!r)
8651
8651
  return null;
8652
- const n = Fe.create(e, r).dtFormatter(Dv()), s = n.formatToParts(), i = n.resolvedOptions();
8652
+ const n = De.create(e, r).dtFormatter(Dv()), s = n.formatToParts(), i = n.resolvedOptions();
8653
8653
  return s.map((a) => Iv(a, r, i));
8654
8654
  }
8655
8655
  const Ra = "Invalid DateTime", Wf = 864e13;
@@ -8737,7 +8737,7 @@ function Jt(r, e, t, n, s, i) {
8737
8737
  );
8738
8738
  }
8739
8739
  function an(r, e, t = !0) {
8740
- return r.isValid ? Fe.create(he.create("en-US"), {
8740
+ return r.isValid ? De.create(he.create("en-US"), {
8741
8741
  allowZ: t,
8742
8742
  forceSimple: !0
8743
8743
  }).formatDateTimeFromString(r, e) : null;
@@ -9009,7 +9009,7 @@ class B {
9009
9009
  zone: kt(t.zone, Ee.defaultZone),
9010
9010
  loc: he.fromObject(t)
9011
9011
  });
9012
- throw new Ne(
9012
+ throw new Fe(
9013
9013
  `fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`
9014
9014
  );
9015
9015
  }
@@ -9031,7 +9031,7 @@ class B {
9031
9031
  zone: kt(t.zone, Ee.defaultZone),
9032
9032
  loc: he.fromObject(t)
9033
9033
  });
9034
- throw new Ne("fromSeconds requires a numerical input");
9034
+ throw new Fe("fromSeconds requires a numerical input");
9035
9035
  }
9036
9036
  /**
9037
9037
  * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
@@ -9176,7 +9176,7 @@ class B {
9176
9176
  */
9177
9177
  static fromFormat(e, t, n = {}) {
9178
9178
  if (J(e) || J(t))
9179
- throw new Ne("fromFormat requires an input string and a format");
9179
+ throw new Fe("fromFormat requires an input string and a format");
9180
9180
  const { locale: s = null, numberingSystem: i = null } = n, a = he.fromOpts({
9181
9181
  locale: s,
9182
9182
  numberingSystem: i,
@@ -9223,7 +9223,7 @@ class B {
9223
9223
  */
9224
9224
  static invalid(e, t = null) {
9225
9225
  if (!e)
9226
- throw new Ne("need to specify a reason the DateTime is invalid");
9226
+ throw new Fe("need to specify a reason the DateTime is invalid");
9227
9227
  const n = e instanceof nt ? e : new nt(e, t);
9228
9228
  if (Ee.throwOnInvalid)
9229
9229
  throw new zy(n);
@@ -9255,7 +9255,7 @@ class B {
9255
9255
  * @returns {string}
9256
9256
  */
9257
9257
  static expandFormat(e, t = {}) {
9258
- return tm(Fe.parseFormat(e), he.fromObject(t)).map((s) => s.val).join("");
9258
+ return tm(De.parseFormat(e), he.fromObject(t)).map((s) => s.val).join("");
9259
9259
  }
9260
9260
  static resetCache() {
9261
9261
  Ir = void 0, So.clear();
@@ -9619,7 +9619,7 @@ class B {
9619
9619
  * @return {Object}
9620
9620
  */
9621
9621
  resolvedLocaleOptions(e = {}) {
9622
- const { locale: t, numberingSystem: n, calendar: s } = Fe.create(
9622
+ const { locale: t, numberingSystem: n, calendar: s } = De.create(
9623
9623
  this.loc.clone(e),
9624
9624
  e
9625
9625
  ).resolvedOptions(this);
@@ -9825,7 +9825,7 @@ class B {
9825
9825
  * @return {string}
9826
9826
  */
9827
9827
  toFormat(e, t = {}) {
9828
- return this.isValid ? Fe.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) : Ra;
9828
+ return this.isValid ? De.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) : Ra;
9829
9829
  }
9830
9830
  /**
9831
9831
  * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
@@ -9847,7 +9847,7 @@ class B {
9847
9847
  * @return {string}
9848
9848
  */
9849
9849
  toLocaleString(e = bn, t = {}) {
9850
- return this.isValid ? Fe.create(this.loc.clone(t), e).formatDateTime(this) : Ra;
9850
+ return this.isValid ? De.create(this.loc.clone(t), e).formatDateTime(this) : Ra;
9851
9851
  }
9852
9852
  /**
9853
9853
  * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
@@ -9863,7 +9863,7 @@ class B {
9863
9863
  * //=> ]
9864
9864
  */
9865
9865
  toLocaleParts(e = {}) {
9866
- return this.isValid ? Fe.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
9866
+ return this.isValid ? De.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
9867
9867
  }
9868
9868
  /**
9869
9869
  * Returns an ISO 8601-compliant string representation of this DateTime
@@ -10221,7 +10221,7 @@ class B {
10221
10221
  */
10222
10222
  static min(...e) {
10223
10223
  if (!e.every(B.isDateTime))
10224
- throw new Ne("min requires all arguments be DateTimes");
10224
+ throw new Fe("min requires all arguments be DateTimes");
10225
10225
  return Ff(e, (t) => t.valueOf(), Math.min);
10226
10226
  }
10227
10227
  /**
@@ -10231,7 +10231,7 @@ class B {
10231
10231
  */
10232
10232
  static max(...e) {
10233
10233
  if (!e.every(B.isDateTime))
10234
- throw new Ne("max requires all arguments be DateTimes");
10234
+ throw new Fe("max requires all arguments be DateTimes");
10235
10235
  return Ff(e, (t) => t.valueOf(), Math.max);
10236
10236
  }
10237
10237
  // MISC
@@ -10288,7 +10288,7 @@ class B {
10288
10288
  */
10289
10289
  static fromFormatParser(e, t, n = {}) {
10290
10290
  if (J(e) || J(t))
10291
- throw new Ne(
10291
+ throw new Fe(
10292
10292
  "fromFormatParser requires an input string and a format parser"
10293
10293
  );
10294
10294
  const { locale: s = null, numberingSystem: i = null } = n, a = he.fromOpts({
@@ -10297,7 +10297,7 @@ class B {
10297
10297
  defaultToEN: !0
10298
10298
  });
10299
10299
  if (!a.equals(t.locale))
10300
- throw new Ne(
10300
+ throw new Fe(
10301
10301
  `fromFormatParser called with a locale of ${a}, but the format parser was created for ${t.locale}`
10302
10302
  );
10303
10303
  const { result: o, zone: c, specificOffset: l, invalidReason: u } = t.explainFromTokens(e);
@@ -10473,7 +10473,7 @@ function Or(r) {
10473
10473
  return B.fromJSDate(r);
10474
10474
  if (r && typeof r == "object")
10475
10475
  return B.fromObject(r);
10476
- throw new Ne(
10476
+ throw new Fe(
10477
10477
  `Unknown datetime argument: ${r}, of type ${typeof r}`
10478
10478
  );
10479
10479
  }
@@ -10715,44 +10715,44 @@ var Za, hd;
10715
10715
  function nw() {
10716
10716
  if (hd) return Za;
10717
10717
  hd = 1;
10718
- var r = Mo(), e = Uv(), t = Zo(), n = Wv(), s = zv(), i = zd(), a = Zd(), o = Bv(), c = Zv(), l = jd(), u = Gv(), f = qn(), d = Hv(), h = Qv(), p = Gd(), w = Dt(), _ = Mn(), b = ew(), T = wt(), C = rw(), I = Uo(), y = Br(), E = 1, S = 2, v = 4, x = "[object Arguments]", g = "[object Array]", O = "[object Boolean]", A = "[object Date]", m = "[object Error]", R = "[object Function]", k = "[object GeneratorFunction]", P = "[object Map]", N = "[object Number]", F = "[object Object]", U = "[object RegExp]", z = "[object Set]", ee = "[object String]", de = "[object Symbol]", M = "[object WeakMap]", oe = "[object ArrayBuffer]", ie = "[object DataView]", Me = "[object Float32Array]", Se = "[object Float64Array]", Le = "[object Int8Array]", Ot = "[object Int16Array]", G = "[object Int32Array]", K = "[object Uint8Array]", $ = "[object Uint8ClampedArray]", Y = "[object Uint16Array]", j = "[object Uint32Array]", Z = {};
10719
- Z[x] = Z[g] = Z[oe] = Z[ie] = Z[O] = Z[A] = Z[Me] = Z[Se] = Z[Le] = Z[Ot] = Z[G] = Z[P] = Z[N] = Z[F] = Z[U] = Z[z] = Z[ee] = Z[de] = Z[K] = Z[$] = Z[Y] = Z[j] = !0, Z[m] = Z[R] = Z[M] = !1;
10718
+ var r = Mo(), e = Uv(), t = Zo(), n = Wv(), s = zv(), i = zd(), a = Zd(), o = Bv(), c = Zv(), l = jd(), u = Gv(), f = qn(), d = Hv(), h = Qv(), p = Gd(), w = Dt(), _ = Mn(), b = ew(), T = wt(), C = rw(), I = Uo(), y = Br(), E = 1, S = 2, v = 4, x = "[object Arguments]", g = "[object Array]", O = "[object Boolean]", A = "[object Date]", m = "[object Error]", R = "[object Function]", k = "[object GeneratorFunction]", P = "[object Map]", N = "[object Number]", F = "[object Object]", U = "[object RegExp]", z = "[object Set]", ee = "[object String]", de = "[object Symbol]", M = "[object WeakMap]", oe = "[object ArrayBuffer]", ie = "[object DataView]", xe = "[object Float32Array]", Se = "[object Float64Array]", Le = "[object Int8Array]", Ot = "[object Int16Array]", G = "[object Int32Array]", K = "[object Uint8Array]", $ = "[object Uint8ClampedArray]", Y = "[object Uint16Array]", j = "[object Uint32Array]", Z = {};
10719
+ Z[x] = Z[g] = Z[oe] = Z[ie] = Z[O] = Z[A] = Z[xe] = Z[Se] = Z[Le] = Z[Ot] = Z[G] = Z[P] = Z[N] = Z[F] = Z[U] = Z[z] = Z[ee] = Z[de] = Z[K] = Z[$] = Z[Y] = Z[j] = !0, Z[m] = Z[R] = Z[M] = !1;
10720
10720
  function Te(H, ye, re, Xe, dt, Be) {
10721
- var xe, wr = ye & E, Re = ye & S, br = ye & v;
10722
- if (re && (xe = dt ? re(H, Xe, dt, Be) : re(H)), xe !== void 0)
10723
- return xe;
10721
+ var Ne, wr = ye & E, Re = ye & S, br = ye & v;
10722
+ if (re && (Ne = dt ? re(H, Xe, dt, Be) : re(H)), Ne !== void 0)
10723
+ return Ne;
10724
10724
  if (!T(H))
10725
10725
  return H;
10726
10726
  var _c = w(H);
10727
10727
  if (_c) {
10728
- if (xe = d(H), !wr)
10729
- return a(H, xe);
10728
+ if (Ne = d(H), !wr)
10729
+ return a(H, Ne);
10730
10730
  } else {
10731
10731
  var Ht = f(H), vc = Ht == R || Ht == k;
10732
10732
  if (_(H))
10733
10733
  return i(H, wr);
10734
10734
  if (Ht == F || Ht == x || vc && !dt) {
10735
- if (xe = Re || vc ? {} : p(H), !wr)
10736
- return Re ? c(H, s(xe, H)) : o(H, n(xe, H));
10735
+ if (Ne = Re || vc ? {} : p(H), !wr)
10736
+ return Re ? c(H, s(Ne, H)) : o(H, n(Ne, H));
10737
10737
  } else {
10738
10738
  if (!Z[Ht])
10739
10739
  return dt ? H : {};
10740
- xe = h(H, Ht, wr);
10740
+ Ne = h(H, Ht, wr);
10741
10741
  }
10742
10742
  }
10743
10743
  Be || (Be = new r());
10744
10744
  var wc = Be.get(H);
10745
10745
  if (wc)
10746
10746
  return wc;
10747
- Be.set(H, xe), C(H) ? H.forEach(function(Et) {
10748
- xe.add(Te(Et, ye, re, Et, H, Be));
10747
+ Be.set(H, Ne), C(H) ? H.forEach(function(Et) {
10748
+ Ne.add(Te(Et, ye, re, Et, H, Be));
10749
10749
  }) : b(H) && H.forEach(function(Et, Pt) {
10750
- xe.set(Pt, Te(Et, ye, re, Pt, H, Be));
10750
+ Ne.set(Pt, Te(Et, ye, re, Pt, H, Be));
10751
10751
  });
10752
10752
  var Im = br ? Re ? u : l : Re ? y : I, bc = _c ? void 0 : Im(H);
10753
10753
  return e(bc || H, function(Et, Pt) {
10754
- bc && (Pt = Et, Et = H[Pt]), t(xe, Pt, Te(Et, ye, re, Pt, H, Be));
10755
- }), xe;
10754
+ bc && (Pt = Et, Et = H[Pt]), t(Ne, Pt, Te(Et, ye, re, Pt, H, Be));
10755
+ }), Ne;
10756
10756
  }
10757
10757
  return Za = Te, Za;
10758
10758
  }
@@ -10853,7 +10853,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
10853
10853
  throw new Error("Email body is too long");
10854
10854
  return e;
10855
10855
  }, oc = (r, e) => {
10856
- const t = We(), n = Mt(), s = Ue(), i = De(), a = r.at(-1);
10856
+ const t = We(), n = Mt(), s = Ue(), i = Me(), a = r.at(-1);
10857
10857
  if (!a)
10858
10858
  throw new Error("EMPTY_PATH");
10859
10859
  const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, f = ft(a), d = i.collections?.[c.collection];
@@ -11068,7 +11068,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
11068
11068
  n.includes(s) || t.includes(s) || await sr(s, r?.[s].constraints, r?.[s].range, r?.[s].orQueries, r);
11069
11069
  return xr;
11070
11070
  }, To = () => fm, lw = () => xr, uw = async (r, e, t, n, s) => {
11071
- const { labels: i, preloadCache: a } = r, c = Jr()[i.collection], l = Ie(), u = ft(i.collection), f = De();
11071
+ const { labels: i, preloadCache: a } = r, c = Jr()[i.collection], l = Ie(), u = ft(i.collection), f = Me();
11072
11072
  if (!f?.Role)
11073
11073
  throw new Error("PERMISSION_DENIED");
11074
11074
  if (!a?.roles.includes(f.Role))
@@ -11109,7 +11109,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
11109
11109
  });
11110
11110
  });
11111
11111
  }, sr = async (r, e, t, n, s, i) => {
11112
- const a = Ue(), o = De();
11112
+ const a = Ue(), o = Me();
11113
11113
  if (!o?.Role)
11114
11114
  throw new Error("PERMISSION_DENIED");
11115
11115
  const c = a.collections[r], { labels: l, preloadCache: u } = c, f = To();
@@ -11179,7 +11179,7 @@ const fw = async (r, e) => {
11179
11179
  });
11180
11180
  t.push(d);
11181
11181
  }), t;
11182
- }, De = () => $t, dw = () => {
11182
+ }, Me = () => $t, dw = () => {
11183
11183
  $t = null;
11184
11184
  }, cc = (r) => {
11185
11185
  if (typeof r == "object")
@@ -11230,7 +11230,7 @@ const fw = async (r, e) => {
11230
11230
  })), l.length > 0)
11231
11231
  throw new Error(l.join(", "));
11232
11232
  }, dm = (r, e, t) => {
11233
- const n = We(), s = Mt(), i = Ue(), a = De(), o = r.at(-1);
11233
+ const n = We(), s = Mt(), i = Ue(), a = Me(), o = r.at(-1);
11234
11234
  if (!o)
11235
11235
  throw new Error("EMPTY_PATH");
11236
11236
  const c = i.collections[o], { labels: l } = c, u = a.collections?.[l.collection];
@@ -11276,7 +11276,7 @@ const fw = async (r, e) => {
11276
11276
  hm(u);
11277
11277
  return l?.result;
11278
11278
  }, mm = async (r, e, t, n, s, i, a) => {
11279
- const o = De();
11279
+ const o = Me();
11280
11280
  if (!o)
11281
11281
  throw new Error("PERMISSIONS_NOT_FOUND");
11282
11282
  const c = e.at(-2), l = Ad(n.collections[c], n, o).map((d) => d.labels.collection);
@@ -11303,7 +11303,7 @@ const fw = async (r, e) => {
11303
11303
  });
11304
11304
  await Promise.all(f);
11305
11305
  }, uc = async (r, e, t, n, s, i) => {
11306
- if (!De())
11306
+ if (!Me())
11307
11307
  throw new Error("PERMISSIONS_NOT_FOUND");
11308
11308
  const o = e.at(-2);
11309
11309
  t.fields ||= n.collections[o].fields.filter((u) => _e(u));
@@ -11356,7 +11356,7 @@ const fw = async (r, e) => {
11356
11356
  "global",
11357
11357
  "firebase",
11358
11358
  "serverTimestampOptions"
11359
- ]), b = De();
11359
+ ]), b = Me();
11360
11360
  if (!b?.Role)
11361
11361
  throw new Error("PERMISSIONS_DENIED");
11362
11362
  if (f?.includes(b.Role))
@@ -11452,7 +11452,7 @@ const fw = async (r, e) => {
11452
11452
  })).data.result;
11453
11453
  return hm(l), l;
11454
11454
  }, gm = async (r, e, t, n, s, i) => {
11455
- const a = De();
11455
+ const a = Me();
11456
11456
  if (!a)
11457
11457
  throw new Error("PERMISSIONS_NOT_FOUND");
11458
11458
  const o = e.at(-2), c = Ad(n.collections[o], n, a).map((f) => f.labels.collection);
@@ -11478,7 +11478,7 @@ const fw = async (r, e) => {
11478
11478
  });
11479
11479
  await Promise.all(u);
11480
11480
  }, ym = async (r, e, t, n, s, i, a) => {
11481
- if (!De())
11481
+ if (!Me())
11482
11482
  throw new Error("PERMISSIONS_NOT_FOUND");
11483
11483
  const c = e.at(-2);
11484
11484
  t.fields ||= n.collections[c].fields.filter((f) => _e(f));
@@ -11530,7 +11530,7 @@ const fw = async (r, e) => {
11530
11530
  "global",
11531
11531
  "firebase",
11532
11532
  "serverTimestampOptions"
11533
- ]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, w = ft(d.collection), _ = De();
11533
+ ]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, w = ft(d.collection), _ = Me();
11534
11534
  if (!_?.Role)
11535
11535
  throw new Error("PERMISSIONS_DENIED");
11536
11536
  if (p?.includes(_.Role))
@@ -11585,7 +11585,7 @@ const fw = async (r, e) => {
11585
11585
  user: n
11586
11586
  })).data?.result;
11587
11587
  }, fc = async (r, e, t, n) => {
11588
- const s = n?.user, i = Mt(), a = Ue(), o = Ue(!0), c = gc(), l = Ie(), u = dr(), f = We(), d = De();
11588
+ const s = n?.user, i = Mt(), a = Ue(), o = Ue(!0), c = gc(), l = Ie(), u = dr(), f = We(), d = Me();
11589
11589
  if (r.length === 0)
11590
11590
  throw new Error("EMPTY_PATH");
11591
11591
  const h = r.at(-1), p = Object.keys(a.collections).includes(h), w = l.disabledCollections?.includes(h);
@@ -11621,11 +11621,11 @@ const fw = async (r, e) => {
11621
11621
  if (!await ne(l, ["global", "firebase", "enableEmulators"])) {
11622
11622
  N();
11623
11623
  try {
11624
- const { isValid: Me } = await _d(u, s.password);
11625
- if (!Me)
11624
+ const { isValid: xe } = await _d(u, s.password);
11625
+ if (!xe)
11626
11626
  throw new Error("Please create a stronger password");
11627
- } catch (Me) {
11628
- throw new Error(`VALIDATION_ERROR: ${Me.message}`);
11627
+ } catch (xe) {
11628
+ throw new Error(`VALIDATION_ERROR: ${xe.message}`);
11629
11629
  }
11630
11630
  }
11631
11631
  }
@@ -11779,7 +11779,7 @@ const fw = async (r, e) => {
11779
11779
  id: n
11780
11780
  })).data?.result;
11781
11781
  }, vm = async (r, e, t) => {
11782
- const n = t?.user, s = Mt(), i = Ue(), a = gc(), o = Ie(), c = dr(), l = We(), u = De();
11782
+ const n = t?.user, s = Mt(), i = Ue(), a = gc(), o = Ie(), c = dr(), l = We(), u = Me();
11783
11783
  if (r.length === 0)
11784
11784
  throw new Error("EMPTY_PATH");
11785
11785
  const f = r.at(-1), d = Object.keys(i.collections).includes(f), h = o.disabledCollections?.includes(f);
@@ -11848,7 +11848,7 @@ const fw = async (r, e) => {
11848
11848
  id: e
11849
11849
  })).data?.result;
11850
11850
  }, vw = async (r, e, t) => {
11851
- const n = Mt(), s = Ue(), i = gc(), a = dr(), o = We(), c = Ie(), l = De();
11851
+ const n = Mt(), s = Ue(), i = gc(), a = dr(), o = We(), c = Ie(), l = Me();
11852
11852
  if (r.length === 0)
11853
11853
  throw new Error("EMPTY_PATH");
11854
11854
  const u = r.at(-1), f = Object.keys(s.collections).includes(u), d = c.disabledCollections?.includes(u);
@@ -12090,7 +12090,7 @@ const Ya = {
12090
12090
  },
12091
12091
  getVersionInfo: Om,
12092
12092
  getMaintenanceInfo: Tw,
12093
- getCurrentUserPermissions: De,
12093
+ getCurrentUserPermissions: Me,
12094
12094
  getLoadingState: To,
12095
12095
  getAppCheck() {
12096
12096
  return At.main;
@@ -12296,8 +12296,8 @@ const Gw = async (r, e, t, n) => {
12296
12296
  mc = Object.fromEntries(oe), pc = M.data.currentUserRoleGroups, Tm = Sg(Object.keys(Pr.collections), e, "web", Co, n);
12297
12297
  const ie = await fw($e, O);
12298
12298
  Rn.push(...ie), x === "WRITE" && bw(Pr, $e), await ve(pe.postLogin, [$e]);
12299
- const Me = new Event("stoker:ready");
12300
- document.dispatchEvent(Me);
12299
+ const xe = new Event("stoker:ready");
12300
+ document.dispatchEvent(xe);
12301
12301
  } else if ($e) {
12302
12302
  kw(), Iw().forEach((k) => {
12303
12303
  k();
@@ -12416,7 +12416,7 @@ const Gw = async (r, e, t, n) => {
12416
12416
  const i = r.at(-1);
12417
12417
  if (!i)
12418
12418
  throw new Error("EMPTY_PATH");
12419
- const a = De();
12419
+ const a = Me();
12420
12420
  if (!a?.Role)
12421
12421
  throw new Error("PERMISSIONS_NOT_FOUND");
12422
12422
  const o = Ue(!0), l = Jr()[i], u = We(), f = o.collections[i];
@@ -12489,7 +12489,7 @@ const Gw = async (r, e, t, n) => {
12489
12489
  const oe = g[M.name];
12490
12490
  if (!oe)
12491
12491
  continue;
12492
- for (const [ie, Me] of Object.entries(oe))
12492
+ for (const [ie, xe] of Object.entries(oe))
12493
12493
  if (ee.has(`${M.name}_${ie}`)) {
12494
12494
  const Se = async () => {
12495
12495
  oe[ie].id ? (z.set(`${M.name}_${ie}`, !0), Array.from(z.values()).every((Le) => Le) && (F({}), A())) : setTimeout(Se, 100);
@@ -12497,7 +12497,7 @@ const Gw = async (r, e, t, n) => {
12497
12497
  Se();
12498
12498
  } else {
12499
12499
  const Se = o.collections[M.collection], { access: Le } = Se, { serverReadOnly: Ot } = Le;
12500
- Ot?.includes(a.Role) ? vr([...Me.Collection_Path], ie, {
12500
+ Ot?.includes(a.Role) ? vr([...xe.Collection_Path], ie, {
12501
12501
  noComputedFields: s?.noComputedFields,
12502
12502
  noEmbeddingFields: s?.noEmbeddingFields
12503
12503
  }).then((K) => {
@@ -12521,11 +12521,11 @@ const Gw = async (r, e, t, n) => {
12521
12521
  listener: !0
12522
12522
  })));
12523
12523
  }).catch((K) => {
12524
- delete oe[ie], K.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${M.collection} with ID ${e} at location ${Me.Collection_Path?.join("/")}`, {
12524
+ delete oe[ie], K.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${M.collection} with ID ${e} at location ${xe.Collection_Path?.join("/")}`, {
12525
12525
  cause: K
12526
12526
  }));
12527
12527
  }) : km(
12528
- [...Me.Collection_Path],
12528
+ [...xe.Collection_Path],
12529
12529
  ie,
12530
12530
  (K) => {
12531
12531
  if (!K) {
@@ -12550,7 +12550,7 @@ const Gw = async (r, e, t, n) => {
12550
12550
  },
12551
12551
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12552
12552
  (K) => {
12553
- delete oe[ie], K.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${M.collection} with ID ${e} at location ${Me.Collection_Path?.join("/")}`, {
12553
+ delete oe[ie], K.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${M.collection} with ID ${e} at location ${xe.Collection_Path?.join("/")}`, {
12554
12554
  cause: K
12555
12555
  }));
12556
12556
  },
@@ -12623,7 +12623,7 @@ const Gw = async (r, e, t, n) => {
12623
12623
  const s = n?.constraints, i = r.at(-1);
12624
12624
  if (!i)
12625
12625
  throw new Error("EMPTY_PATH");
12626
- const a = De();
12626
+ const a = Me();
12627
12627
  if (!a?.Role)
12628
12628
  throw new Error("PERMISSION_DENIED");
12629
12629
  const o = Ue(!0), l = Jr()[i], u = We(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: w } = p, _ = Ie(), b = Object.keys(o.collections).includes(i), T = _.disabledCollections?.includes(i);
@@ -12691,7 +12691,7 @@ const Gw = async (r, e, t, n) => {
12691
12691
  j[Z.name] = Te;
12692
12692
  })), n?.noEmbeddingFields && Z.type === "Embedding" && delete j[Z.name];
12693
12693
  }), Promise.all(Y).then(() => {
12694
- e(Array.from(P.values()), G, K), K?.fromCache === !1 && P.forEach((j) => {
12694
+ e(Array.from(P.values()), G, K), (xe || K?.fromCache === !1) && P.forEach((j) => {
12695
12695
  const Z = {
12696
12696
  operation: "read",
12697
12697
  data: j,
@@ -12760,8 +12760,8 @@ const Gw = async (r, e, t, n) => {
12760
12760
  };
12761
12761
  dt();
12762
12762
  } else {
12763
- const dt = o.collections[H.collection], { access: Be } = dt, { serverReadOnly: xe } = Be;
12764
- xe?.includes(a.Role) ? vr([...Xe.Collection_Path], re).then((Re) => {
12763
+ const dt = o.collections[H.collection], { access: Be } = dt, { serverReadOnly: Ne } = Be;
12764
+ Ne?.includes(a.Role) ? vr([...Xe.Collection_Path], re).then((Re) => {
12765
12765
  if (!Re) {
12766
12766
  delete ye[re];
12767
12767
  return;
@@ -12825,12 +12825,12 @@ const Gw = async (r, e, t, n) => {
12825
12825
  K.id ||= $.id, K = { ...K, ...Y }, delete K.Collection_Path_String;
12826
12826
  const j = N.get($.id) || /* @__PURE__ */ new Map(), Z = j.get(G) || /* @__PURE__ */ new Set();
12827
12827
  lm(Y, Z), j.set(G, Z), N.set($.id, j), P.set($.id, K);
12828
- }, Me = n?.only === "cache" || y;
12828
+ }, xe = n?.only === "cache" || y;
12829
12829
  y && n?.tempCache && await sr(d.collection, n.tempCache?.constraints, void 0, void 0, void 0, n.tempCache?.label);
12830
12830
  for (const G of S) {
12831
12831
  let K = !0;
12832
- const $ = hr(G, { source: Me ? "cache" : "default", includeMetadataChanges: !0 }, (Y) => {
12833
- (Me || Y.metadata.fromCache === !1) && (m.set(G, !0), v.first.set(S.indexOf(G), Y.docs[0]), v.last.set(S.indexOf(G), Y.docs.at(-1) || Y.docs[0]), A && n?.relations || z(v, Y.metadata)), m.get(G) === !0 && (K ? (Y.docs.forEach((j) => {
12832
+ const $ = hr(G, { source: xe ? "cache" : "default", includeMetadataChanges: !0 }, (Y) => {
12833
+ (xe || Y.metadata.fromCache === !1) && (m.set(G, !0), v.first.set(S.indexOf(G), Y.docs[0]), v.last.set(S.indexOf(G), Y.docs.at(-1) || Y.docs[0]), A && n?.relations || z(v, Y.metadata)), m.get(G) === !0 && (K ? (Y.docs.forEach((j) => {
12834
12834
  const Z = P.get(j.id) || {}, Te = F.get(j.id) || 0;
12835
12835
  F.set(j.id, Te + 1), ie(G, Z, j);
12836
12836
  }), K = !1) : Y.docChanges().forEach((j) => {
@@ -12940,7 +12940,7 @@ export {
12940
12940
  oc as getCollectionRefs,
12941
12941
  zt as getConnectionStatus,
12942
12942
  Hw as getCurrentUser,
12943
- De as getCurrentUserPermissions,
12943
+ Me as getCurrentUserPermissions,
12944
12944
  Jr as getCurrentUserRoleGroups,
12945
12945
  dm as getDocumentRefs,
12946
12946
  ze as getEnv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-client",
3
- "version": "0.5.45",
3
+ "version": "0.5.46",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "files": [