@moonbase.sh/storefront 0.2.54 → 0.2.56

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/moonbase.js CHANGED
@@ -5430,7 +5430,7 @@ function mm(e, t) {
5430
5430
  Ko("app:init", e, t, {
5431
5431
  Fragment: Se,
5432
5432
  Text: Jo,
5433
- Comment: Je,
5433
+ Comment: Ge,
5434
5434
  Static: go
5435
5435
  });
5436
5436
  }
@@ -5786,20 +5786,20 @@ const It = [Function, Array], Xc = {
5786
5786
  // #11061, ensure enterHooks is fresh after clone
5787
5787
  (f) => u = f
5788
5788
  );
5789
- l.type !== Je && Mo(l, u);
5789
+ l.type !== Ge && Mo(l, u);
5790
5790
  const c = n.subTree, d = c && Ll(c);
5791
- if (d && d.type !== Je && !cr(l, d) && Qc(n).type !== Je) {
5791
+ if (d && d.type !== Ge && !cr(l, d) && Qc(n).type !== Ge) {
5792
5792
  const f = ta(
5793
5793
  d,
5794
5794
  i,
5795
5795
  r,
5796
5796
  n
5797
5797
  );
5798
- if (Mo(d, f), a === "out-in" && l.type !== Je)
5798
+ if (Mo(d, f), a === "out-in" && l.type !== Ge)
5799
5799
  return r.isLeaving = !0, f.afterLeave = () => {
5800
5800
  r.isLeaving = !1, n.job.flags & 8 || n.update(), delete f.afterLeave;
5801
5801
  }, Ti(s);
5802
- a === "in-out" && l.type !== Je && (f.delayLeave = (m, b, O) => {
5802
+ a === "in-out" && l.type !== Ge && (f.delayLeave = (m, b, O) => {
5803
5803
  const w = td(
5804
5804
  r,
5805
5805
  d
@@ -5818,7 +5818,7 @@ function ed(e) {
5818
5818
  if (e.length > 1) {
5819
5819
  let n = !1;
5820
5820
  for (const r of e)
5821
- if (r.type !== Je) {
5821
+ if (r.type !== Ge) {
5822
5822
  if (g.NODE_ENV !== "production" && n) {
5823
5823
  F(
5824
5824
  "<transition> can only be used on a single element or component. Use <transition-group> for lists."
@@ -5947,7 +5947,7 @@ function nd(e, t = !1, n) {
5947
5947
  const a = n == null ? i.key : String(n) + String(i.key != null ? i.key : s);
5948
5948
  i.type === Se ? (i.patchFlag & 128 && o++, r = r.concat(
5949
5949
  nd(i.children, t, a)
5950
- )) : (t || i.type !== Je) && r.push(a != null ? Wt(i, { key: a }) : i);
5950
+ )) : (t || i.type !== Ge) && r.push(a != null ? Wt(i, { key: a }) : i);
5951
5951
  }
5952
5952
  if (o > 1)
5953
5953
  for (let s = 0; s < r.length; s++)
@@ -6159,7 +6159,7 @@ function Wa(e, t, n = {}, r, o) {
6159
6159
  return a.scopeId && (a.slotScopeIds = [a.scopeId + "-s"]), s && s._c && (s._d = !0), a;
6160
6160
  }
6161
6161
  function id(e) {
6162
- return e.some((t) => qr(t) ? !(t.type === Je || t.type === Se && !id(t.children)) : !0) ? e : null;
6162
+ return e.some((t) => qr(t) ? !(t.type === Ge || t.type === Se && !id(t.children)) : !0) ? e : null;
6163
6163
  }
6164
6164
  const oa = (e) => e ? Td(e) ? el(e) : oa(e.parent) : null, br = (
6165
6165
  // Move PURE marker to new line to workaround compiler discarding it
@@ -7088,7 +7088,7 @@ function vv(e, t) {
7088
7088
  case Jo:
7089
7089
  w(p, h, k, L);
7090
7090
  break;
7091
- case Je:
7091
+ case Ge:
7092
7092
  $(p, h, k, L);
7093
7093
  break;
7094
7094
  case go:
@@ -7427,7 +7427,7 @@ function vv(e, t) {
7427
7427
  );
7428
7428
  if (g.NODE_ENV !== "production" && z.type.__hmrId && dm(z), g.NODE_ENV !== "production" && (bs(p), hn(z, "mount")), Go(p) && (z.ctx.renderer = Gr), g.NODE_ENV !== "production" && hn(z, "init"), jv(z, !1, G), g.NODE_ENV !== "production" && mn(z, "init"), z.asyncDep) {
7429
7429
  if (I && I.registerDep(z, Y, G), !p.el) {
7430
- const W = z.subTree = Z(Je);
7430
+ const W = z.subTree = Z(Ge);
7431
7431
  $(null, W, h, k);
7432
7432
  }
7433
7433
  } else
@@ -7827,7 +7827,7 @@ function vv(e, t) {
7827
7827
  const { type: h, el: k, anchor: L, transition: I } = p;
7828
7828
  if (h === Se) {
7829
7829
  g.NODE_ENV !== "production" && p.patchFlag > 0 && p.patchFlag & 2048 && I && !I.persisted ? p.children.forEach((G) => {
7830
- G.type === Je ? o(G.el) : Ot(G);
7830
+ G.type === Ge ? o(G.el) : Ot(G);
7831
7831
  }) : kn(k, L);
7832
7832
  return;
7833
7833
  }
@@ -7910,7 +7910,7 @@ function vo(e, t, n = !1) {
7910
7910
  for (let s = 0; s < r.length; s++) {
7911
7911
  const i = r[s];
7912
7912
  let a = o[s];
7913
- a.shapeFlag & 1 && !a.dynamicChildren && ((a.patchFlag <= 0 || a.patchFlag === 32) && (a = o[s] = An(o[s]), a.el = i.el), !n && a.patchFlag !== -2 && vo(i, a)), a.type === Jo && (a.el = i.el), g.NODE_ENV !== "production" && a.type === Je && !a.el && (a.el = i.el);
7913
+ a.shapeFlag & 1 && !a.dynamicChildren && ((a.patchFlag <= 0 || a.patchFlag === 32) && (a = o[s] = An(o[s]), a.el = i.el), !n && a.patchFlag !== -2 && vo(i, a)), a.type === Jo && (a.el = i.el), g.NODE_ENV !== "production" && a.type === Ge && !a.el && (a.el = i.el);
7914
7914
  }
7915
7915
  }
7916
7916
  function yv(e) {
@@ -8151,7 +8151,7 @@ function Di(e) {
8151
8151
  ), B = t.props ? a : Nv(a);
8152
8152
  }
8153
8153
  } catch (x) {
8154
- yo.length = 0, zo(x, e, 1), $ = Z(Je);
8154
+ yo.length = 0, zo(x, e, 1), $ = Z(Ge);
8155
8155
  }
8156
8156
  let T = $, te;
8157
8157
  if (g.NODE_ENV !== "production" && $.patchFlag > 0 && $.patchFlag & 2048 && ([T, te] = Ed($)), B && O !== !1) {
@@ -8162,7 +8162,7 @@ function Di(e) {
8162
8162
  B,
8163
8163
  s
8164
8164
  )), T = Wt(T, B, !1, !0);
8165
- else if (g.NODE_ENV !== "production" && !ua && T.type !== Je) {
8165
+ else if (g.NODE_ENV !== "production" && !ua && T.type !== Ge) {
8166
8166
  const j = Object.keys(a), ve = [], q = [];
8167
8167
  for (let A = 0, V = j.length; A < V; A++) {
8168
8168
  const D = j[A];
@@ -8198,7 +8198,7 @@ function Ya(e, t = !0) {
8198
8198
  for (let r = 0; r < e.length; r++) {
8199
8199
  const o = e[r];
8200
8200
  if (qr(o)) {
8201
- if (o.type !== Je || o.children === "v-if") {
8201
+ if (o.type !== Ge || o.children === "v-if") {
8202
8202
  if (n)
8203
8203
  return;
8204
8204
  if (n = o, g.NODE_ENV !== "production" && t && n.patchFlag > 0 && n.patchFlag & 2048)
@@ -8219,7 +8219,7 @@ const Nv = (e) => {
8219
8219
  for (const r in e)
8220
8220
  (!Ls(r) || !(r.slice(9) in t)) && (n[r] = e[r]);
8221
8221
  return n;
8222
- }, Kl = (e) => e.shapeFlag & 7 || e.type === Je;
8222
+ }, Kl = (e) => e.shapeFlag & 7 || e.type === Ge;
8223
8223
  function xv(e, t, n) {
8224
8224
  const { props: r, children: o, component: s } = e, { props: i, children: a, patchFlag: l } = t, u = s.emitsOptions;
8225
8225
  if (g.NODE_ENV !== "production" && (o || a) && Fn || t.dirs || t.transition)
@@ -8265,7 +8265,7 @@ const Od = (e) => e.__isSuspense;
8265
8265
  function Tv(e, t) {
8266
8266
  t && t.pendingBranch ? ue(e) ? t.effects.push(...e) : t.effects.push(e) : Uc(e);
8267
8267
  }
8268
- const Se = Symbol.for("v-fgt"), Jo = Symbol.for("v-txt"), Je = Symbol.for("v-cmt"), go = Symbol.for("v-stc"), yo = [];
8268
+ const Se = Symbol.for("v-fgt"), Jo = Symbol.for("v-txt"), Ge = Symbol.for("v-cmt"), go = Symbol.for("v-stc"), yo = [];
8269
8269
  let Ct = null;
8270
8270
  function y(e = !1) {
8271
8271
  yo.push(Ct = e ? null : []);
@@ -8365,7 +8365,7 @@ function N(e, t = null, n = null, r = 0, o = null, s = e === Se ? 0 : 1, i = !1,
8365
8365
  }
8366
8366
  const Z = g.NODE_ENV !== "production" ? Pv : xd;
8367
8367
  function xd(e, t = null, n = null, r = 0, o = null, s = !1) {
8368
- if ((!e || e === sd) && (g.NODE_ENV !== "production" && !e && F(`Invalid vnode type when creating vnode: ${e}.`), e = Je), qr(e)) {
8368
+ if ((!e || e === sd) && (g.NODE_ENV !== "production" && !e && F(`Invalid vnode type when creating vnode: ${e}.`), e = Ge), qr(e)) {
8369
8369
  const a = Wt(
8370
8370
  e,
8371
8371
  t,
@@ -8460,10 +8460,10 @@ function $v(e, t) {
8460
8460
  return n.staticCount = t, n;
8461
8461
  }
8462
8462
  function ce(e = "", t = !1) {
8463
- return t ? (y(), Ne(Je, null, e)) : Z(Je, null, e);
8463
+ return t ? (y(), Ne(Ge, null, e)) : Z(Ge, null, e);
8464
8464
  }
8465
8465
  function Ut(e) {
8466
- return e == null || typeof e == "boolean" ? Z(Je) : ue(e) ? Z(
8466
+ return e == null || typeof e == "boolean" ? Z(Ge) : ue(e) ? Z(
8467
8467
  Se,
8468
8468
  null,
8469
8469
  // #3666, avoid reference pollution when reusing vnode
@@ -9515,7 +9515,7 @@ function Id(e) {
9515
9515
  }
9516
9516
  };
9517
9517
  }
9518
- var Xo = class Ge {
9518
+ var Xo = class Je {
9519
9519
  constructor(t, n, r) {
9520
9520
  this.configuration = t, this.client = n, this.stateFactory = r, this.currentUser = P(null), this.loadedUser = P(!1), this.debouncedPushOrderContent = Vg((l) => this.client.orders.pushContent(l, void 0, this.hasUtm ? this.utm.value : void 0), 500);
9521
9521
  var o;
@@ -9526,16 +9526,16 @@ var Xo = class Ge {
9526
9526
  currency: "",
9527
9527
  items: [],
9528
9528
  couponsApplied: []
9529
- }), this.storefront = r(Ge.storefrontKey, {
9529
+ }), this.storefront = r(Je.storefrontKey, {
9530
9530
  suggestedCurrency: "",
9531
9531
  bundles: [],
9532
9532
  products: []
9533
- }), this.loadedStorefront = r(`${Ge.storefrontKey}_loaded`, !1), this.utm = r(Ge.utmKey, void 0);
9533
+ }), this.loadedStorefront = r(`${Je.storefrontKey}_loaded`, !1), this.utm = r(Je.utmKey, void 0);
9534
9534
  return;
9535
9535
  }
9536
9536
  window.addEventListener("storage", (l) => this.handleStorageUpdate(l));
9537
9537
  const s = new URLSearchParams(window.location.search);
9538
- if (this.utm = r(Ge.utmKey, {
9538
+ if (this.utm = r(Je.utmKey, {
9539
9539
  referrer: ((o = window.document.referrer) == null ? void 0 : o.replace(/https?:\/\//g, "").split("/")[0]) || void 0,
9540
9540
  source: s.get("utm_source") || void 0,
9541
9541
  medium: s.get("utm_medium") || void 0,
@@ -9543,29 +9543,29 @@ var Xo = class Ge {
9543
9543
  term: s.get("utm_term") || void 0,
9544
9544
  content: s.get("utm_content") || void 0
9545
9545
  }), this.hasUtm)
9546
- localStorage.setItem(Ge.utmKey, JSON.stringify(this.utm.value));
9546
+ localStorage.setItem(Je.utmKey, JSON.stringify(this.utm.value));
9547
9547
  else {
9548
- const l = localStorage.getItem(Ge.utmKey);
9548
+ const l = localStorage.getItem(Je.utmKey);
9549
9549
  if (l)
9550
9550
  try {
9551
- this.utm = r(Ge.utmKey, JSON.parse(l));
9551
+ this.utm = r(Je.utmKey, JSON.parse(l));
9552
9552
  } catch {
9553
9553
  }
9554
9554
  }
9555
- const i = localStorage.getItem(Ge.sessionKey);
9556
- i ? (this.currentOrder = P(JSON.parse(i)), this.refreshOrder()) : this.currentOrder = P({
9555
+ const i = localStorage.getItem(Je.sessionKey);
9556
+ i ? (this.currentOrder = P(JSON.parse(i)), this.refreshOrder()) : (this.currentOrder = P({
9557
9557
  id: Vi(),
9558
9558
  status: ao.Open,
9559
9559
  currency: "",
9560
9560
  items: [],
9561
9561
  couponsApplied: []
9562
- });
9563
- const a = localStorage.getItem(Ge.storefrontKey);
9564
- if (a ? (this.storefront = r(Ge.storefrontKey, JSON.parse(a)), this.loadedStorefront = r(`${Ge.storefrontKey}_loaded`, !0)) : (this.storefront = r(Ge.storefrontKey, {
9562
+ }), this.hasUtm && this.pushOrderContent());
9563
+ const a = localStorage.getItem(Je.storefrontKey);
9564
+ if (a ? (this.storefront = r(Je.storefrontKey, JSON.parse(a)), this.loadedStorefront = r(`${Je.storefrontKey}_loaded`, !0)) : (this.storefront = r(Je.storefrontKey, {
9565
9565
  suggestedCurrency: "",
9566
9566
  bundles: [],
9567
9567
  products: []
9568
- }), this.loadedStorefront = r(`${Ge.storefrontKey}_loaded`, !1)), this.client.tokenStore.hasAccessToken && (this.currentUser.value = this.client.tokenStore.user), this.updateStorefront(), this.updateUser(), window.location) {
9568
+ }), this.loadedStorefront = r(`${Je.storefrontKey}_loaded`, !1)), this.client.tokenStore.hasAccessToken && (this.currentUser.value = this.client.tokenStore.user), this.updateStorefront(), this.updateUser(), window.location) {
9569
9569
  const l = new URLSearchParams(window.location.search), u = l.get("mb_intent"), c = l.get("mb_endpoint");
9570
9570
  if (u === "checkout" && l.get("mb_complete") && c) {
9571
9571
  const d = Object.fromEntries([...l.entries()].filter(([m]) => !m.startsWith("mb_"))), f = new URL(decodeURIComponent(c));
@@ -9617,17 +9617,17 @@ var Xo = class Ge {
9617
9617
  }
9618
9618
  async updateStorefront() {
9619
9619
  const t = await this.client.storefront.get(this.hasUtm ? this.utm.value : void 0);
9620
- return t && (typeof window < "u" && localStorage.setItem(Ge.storefrontKey, JSON.stringify(t)), this.storefront.value = t, this.loadedStorefront.value = !0, this.currentOrder.value.currency || (this.currentOrder.value.currency = t.suggestedCurrency)), t;
9620
+ return t && (typeof window < "u" && localStorage.setItem(Je.storefrontKey, JSON.stringify(t)), this.storefront.value = t, this.loadedStorefront.value = !0, this.currentOrder.value.currency || (this.currentOrder.value.currency = t.suggestedCurrency)), t;
9621
9621
  }
9622
9622
  async pushOrderContent() {
9623
- typeof window < "u" && localStorage.setItem(Ge.sessionKey, JSON.stringify(this.currentOrder.value)), this.debouncedPushOrderContent(this.currentOrder.value);
9623
+ typeof window < "u" && localStorage.setItem(Je.sessionKey, JSON.stringify(this.currentOrder.value)), this.debouncedPushOrderContent(this.currentOrder.value);
9624
9624
  }
9625
9625
  handleStorageUpdate(t) {
9626
9626
  switch (t.key) {
9627
- case Ge.sessionKey:
9627
+ case Je.sessionKey:
9628
9628
  this.currentOrder.value = JSON.parse(t.newValue);
9629
9629
  break;
9630
- case Ge.storefrontKey:
9630
+ case Je.storefrontKey:
9631
9631
  this.storefront.value = JSON.parse(t.newValue);
9632
9632
  break;
9633
9633
  }
@@ -9635,7 +9635,7 @@ var Xo = class Ge {
9635
9635
  async refreshOrder() {
9636
9636
  try {
9637
9637
  const t = await this.client.orders.get(this.currentOrder.value.id);
9638
- t && (t.status !== ao.Open ? this.resetOrder() : (typeof window < "u" && localStorage.setItem(Ge.sessionKey, JSON.stringify(t)), this.currentOrder.value = t));
9638
+ t && (t.status !== ao.Open ? this.resetOrder() : (typeof window < "u" && localStorage.setItem(Je.sessionKey, JSON.stringify(t)), this.currentOrder.value = t));
9639
9639
  } catch (t) {
9640
9640
  t != null && this.resetOrder();
9641
9641
  }
@@ -9648,7 +9648,7 @@ var Xo = class Ge {
9648
9648
  status: ao.Open,
9649
9649
  items: [],
9650
9650
  couponsApplied: []
9651
- }, typeof window < "u" && (localStorage.removeItem(Ge.sessionKey), localStorage.removeItem(Ge.utmKey));
9651
+ }, typeof window < "u" && localStorage.removeItem(Je.sessionKey);
9652
9652
  }
9653
9653
  async surrenderOrder() {
9654
9654
  try {