@moonbase.sh/storefront 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/moonbase.js CHANGED
@@ -9796,22 +9796,40 @@ function ul(e) {
9796
9796
  return;
9797
9797
  const n = (t = document.head.querySelector('meta[name="color-scheme"]')) == null ? void 0 : t.getAttribute("content");
9798
9798
  n && (e += `${e.includes("?") ? "&" : "?"}color_scheme=${encodeURIComponent(n)}`);
9799
- const r = Hh();
9800
- r !== null && (e += `${e.includes("?") ? "&" : "?"}scale=${encodeURIComponent(r)}`);
9801
- const o = document.createElement("iframe");
9802
- o.id = "moonbase-checkout", o.src = e, o.style.position = "fixed", o.style.top = "0px", o.style.left = "0px", o.style.right = "0px", o.style.border = "none", o.style.colorScheme = "normal", o.style.backgroundColor = "transparent", o.style.zIndex = Number.MAX_SAFE_INTEGER.toString(), o.setAttribute("background", "transparent"), o.setAttribute("frameborder", "0"), o.setAttribute("allowtransparency", "true"), o.setAttribute("allow", "payment"), o.height = "100%", o.width = "100%", document.body.append(o), document.documentElement.style.overflow = "hidden", window.onmessage = function(s) {
9803
- var i;
9799
+ const r = document.createElement("iframe");
9800
+ r.id = "moonbase-checkout", r.src = e, r.style.border = "none", r.style.colorScheme = "normal", r.style.backgroundColor = "transparent", r.style.zIndex = Number.MAX_SAFE_INTEGER.toString(), r.setAttribute("background", "transparent"), r.setAttribute("frameborder", "0"), r.setAttribute("allowtransparency", "true"), r.setAttribute("allow", "payment"), r.style.setProperty("position", "fixed", "important"), r.style.setProperty("top", "0px", "important"), r.style.setProperty("left", "0px", "important"), r.style.setProperty("max-width", "none", "important"), r.style.setProperty("max-height", "none", "important"), r.style.setProperty("min-width", "0", "important"), r.style.setProperty("min-height", "0", "important"), r.style.setProperty("transform-origin", "0 0", "important");
9801
+ const o = () => {
9802
+ const a = Hh();
9803
+ if (a === null) {
9804
+ r.style.removeProperty("transform"), r.style.setProperty("width", "100%", "important"), r.style.setProperty("height", "100%", "important");
9805
+ return;
9806
+ }
9807
+ r.style.setProperty("transform", `scale(${a})`, "important"), r.style.setProperty("width", `${window.innerWidth / a}px`, "important"), r.style.setProperty("height", `${window.innerHeight / a}px`, "important");
9808
+ };
9809
+ o(), document.body.append(r), document.documentElement.style.overflow = "hidden";
9810
+ const s = new MutationObserver(o);
9811
+ s.observe(document.head, {
9812
+ childList: !0,
9813
+ subtree: !0,
9814
+ attributes: !0,
9815
+ attributeFilter: ["content", "name"]
9816
+ }), window.addEventListener("resize", o), window.addEventListener("orientationchange", o);
9817
+ const i = () => {
9818
+ s.disconnect(), window.removeEventListener("resize", o), window.removeEventListener("orientationchange", o);
9819
+ };
9820
+ window.onmessage = function(a) {
9821
+ var l;
9804
9822
  try {
9805
- const a = S1.parse(s.data);
9806
- a.event === "close" && (document.body.contains(o) && (document.documentElement.style.removeProperty("overflow"), document.body.removeChild(o)), window.dispatchEvent(new CustomEvent("moonbase-checkout-closed", {
9807
- detail: a
9808
- }))), a.event === "billing-details-updated" && window.dispatchEvent(new CustomEvent("moonbase-checkout-billing-details-updated", {
9809
- detail: a
9810
- })), a.event === "completed" && window.dispatchEvent(new CustomEvent("moonbase-checkout-completed", {
9811
- detail: a
9823
+ const u = S1.parse(a.data);
9824
+ u.event === "close" && (document.body.contains(r) && (i(), document.documentElement.style.removeProperty("overflow"), document.body.removeChild(r)), window.dispatchEvent(new CustomEvent("moonbase-checkout-closed", {
9825
+ detail: u
9826
+ }))), u.event === "billing-details-updated" && window.dispatchEvent(new CustomEvent("moonbase-checkout-billing-details-updated", {
9827
+ detail: u
9828
+ })), u.event === "completed" && window.dispatchEvent(new CustomEvent("moonbase-checkout-completed", {
9829
+ detail: u
9812
9830
  }));
9813
- } catch (a) {
9814
- ((i = s.data) == null ? void 0 : i.source) === "moonbase-checkout" && console.error("Could not parse event:", s.data, a);
9831
+ } catch (u) {
9832
+ ((l = a.data) == null ? void 0 : l.source) === "moonbase-checkout" && console.error("Could not parse event:", a.data, u);
9815
9833
  }
9816
9834
  };
9817
9835
  }
@@ -17651,7 +17669,7 @@ const ge = /* @__PURE__ */ br(Mk, [["render", Rk]]), Lk = { class: "moonbase:abo
17651
17669
  }, Uk = /* @__PURE__ */ ae({
17652
17670
  __name: "About",
17653
17671
  setup(e) {
17654
- const t = we(), n = typeof window < "u" && window.__moonbaseTestVersionOverride || "2.4.0", r = W(() => {
17672
+ const t = we(), n = typeof window < "u" && window.__moonbaseTestVersionOverride || "2.4.1", r = W(() => {
17655
17673
  const o = n.match(/-(next)-/);
17656
17674
  if (o)
17657
17675
  return o[1];