@spiffcommerce/core 28.0.1-beta.dfd45d89-6b78-5804-8247-b45fe6487531 → 28.0.1-beta.ecd0c9f9-3452-55d8-9a01-b4ec364f53fb

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/index.mjs CHANGED
@@ -11,7 +11,7 @@ import yt from "lodash.clonedeep";
11
11
  import { toString as on } from "qrcode";
12
12
  import gr from "svg-path-bbox";
13
13
  import { parse as Xe } from "opentype.js";
14
- import { jsx as x, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
14
+ import { jsx as x, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
15
15
  import pr from "handlebars";
16
16
  import { dataUriToBuffer as fr } from "data-uri-to-buffer";
17
17
  import xa from "lodash.chunk";
@@ -23,7 +23,7 @@ import { split as Ze } from "unicode-default-word-boundary";
23
23
  import cn from "lodash.debounce";
24
24
  import "fs";
25
25
  import "path";
26
- var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), Sr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Sr || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), vr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(vr || {}), Er = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Er || {}), br = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(br || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Br = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Br || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), kt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(kt || {}), H = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(H || {}), Ir = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Ir || {});
26
+ var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), z = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(z || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), Sr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Sr || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), vr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(vr || {}), Er = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Er || {}), br = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(br || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Br = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Br || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), kt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(kt || {}), H = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(H || {}), Ir = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Ir || {});
27
27
  class dn extends Error {
28
28
  constructor(t) {
29
29
  super(t), this.name = this.constructor.name;
@@ -64,7 +64,7 @@ class De extends dn {
64
64
  super(`ImplementationError - ${t}`);
65
65
  }
66
66
  }
67
- class z extends De {
67
+ class G extends De {
68
68
  constructor(t) {
69
69
  super(`Unhandled Behavior Encountered: ${t}`);
70
70
  }
@@ -303,7 +303,7 @@ const Lr = (r) => {
303
303
  a.origin === t && (window.removeEventListener("message", e), r(a.data));
304
304
  };
305
305
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
306
- }), Gr = async () => {
306
+ }), zr = async () => {
307
307
  const r = {
308
308
  applicationKey: ma,
309
309
  customerToken: Or,
@@ -311,7 +311,7 @@ const Lr = (r) => {
311
311
  };
312
312
  return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Vr(), ...r } : r;
313
313
  };
314
- async function zr(r, t) {
314
+ async function Gr(r, t) {
315
315
  const e = mt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
316
316
  let n = await rt(r, { ...t, redirect: "manual" });
317
317
  return n.type === "opaqueredirect" && (typeof r != "string" && "url" in r ? n = await rt({ ...r, url: `${a}/graphql` }, t) : n = await rt(`${a}/graphql`, t)), n;
@@ -331,9 +331,9 @@ class Wr {
331
331
  constructShadowGraphqlClient() {
332
332
  const t = ir({
333
333
  uri: `${mt.getServerUrl()}/graphql`,
334
- fetch: zr
334
+ fetch: Gr
335
335
  }), e = cr(async (i, s) => {
336
- const { headers: o } = s, l = o || {}, c = await Gr();
336
+ const { headers: o } = s, l = o || {}, c = await zr();
337
337
  let d = s.bearer ?? c.bearer;
338
338
  if (this.spiffClient)
339
339
  try {
@@ -3558,7 +3558,7 @@ class ui {
3558
3558
  if (this.cache.has(t)) {
3559
3559
  const n = this.cache.get(t);
3560
3560
  if (!n)
3561
- throw new z("Failed to get asset from cache!");
3561
+ throw new G("Failed to get asset from cache!");
3562
3562
  return n;
3563
3563
  }
3564
3564
  const a = (async () => (await ve([t]))[0])();
@@ -3585,7 +3585,7 @@ class ui {
3585
3585
  */
3586
3586
  cacheAsset(t) {
3587
3587
  if (!t.key)
3588
- throw new z("Asset has no key!");
3588
+ throw new G("Asset has no key!");
3589
3589
  this.cache.has(t.key) || this.cache.set(t.key, Promise.resolve(t));
3590
3590
  }
3591
3591
  /**
@@ -3593,7 +3593,7 @@ class ui {
3593
3593
  */
3594
3594
  cacheMaterial(t) {
3595
3595
  if (!t.id)
3596
- throw new z("Material has no id!");
3596
+ throw new G("Material has no id!");
3597
3597
  this.materialCache.has(t.id) || this.materialCache.set(t.id, Promise.resolve(t));
3598
3598
  }
3599
3599
  /**
@@ -3711,7 +3711,7 @@ class ui {
3711
3711
  case "mkv":
3712
3712
  return "video/x-matroska";
3713
3713
  default:
3714
- throw new z("Unexpected mimetype: " + e);
3714
+ throw new G("Unexpected mimetype: " + e);
3715
3715
  }
3716
3716
  }
3717
3717
  }
@@ -5145,7 +5145,7 @@ const q = new Ci(), bn = v`
5145
5145
  timestamp
5146
5146
  }
5147
5147
  }
5148
- `, Ot = [P.SilentIllustration, P.ProductOverlay], Gi = async (r) => {
5148
+ `, Ot = [P.SilentIllustration, P.ProductOverlay], zi = async (r) => {
5149
5149
  const t = [];
5150
5150
  r.introduction && t.push({
5151
5151
  name: "Introduction",
@@ -5163,7 +5163,7 @@ const q = new Ci(), bn = v`
5163
5163
  silentSteps: []
5164
5164
  });
5165
5165
  for (const a of r.steps) {
5166
- const n = zi(a.stepName, r.stepGroups);
5166
+ const n = Gi(a.stepName, r.stepGroups);
5167
5167
  if (!n)
5168
5168
  t.push({
5169
5169
  name: a.stepName,
@@ -5200,7 +5200,7 @@ const q = new Ci(), bn = v`
5200
5200
  ],
5201
5201
  silentSteps: []
5202
5202
  }), t;
5203
- }, zi = (r, t) => t.find((e) => e.stepNames.includes(r)), wt = (r, t) => (r.conditions || []).every((e) => {
5203
+ }, Gi = (r, t) => t.find((e) => e.stepNames.includes(r)), wt = (r, t) => (r.conditions || []).every((e) => {
5204
5204
  const a = t[e.targetStepName];
5205
5205
  if (a && a.selectedVariants) {
5206
5206
  const n = a.selectedVariants;
@@ -5327,10 +5327,10 @@ const Q = () => {
5327
5327
  viewBox: A,
5328
5328
  width: u
5329
5329
  }) => {
5330
- var I;
5331
- const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ x("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (I = a.colorProfiles) == null ? void 0 : I.map((b, E) => (
5330
+ var E;
5331
+ const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ x("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((b, I) => (
5332
5332
  /* @ts-ignore */
5333
- /* @__PURE__ */ x("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, E)
5333
+ /* @__PURE__ */ x("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, I)
5334
5334
  )), S = n.map((b) => ({
5335
5335
  ...b,
5336
5336
  _renderingConfiguration: a,
@@ -5436,10 +5436,10 @@ const Q = () => {
5436
5436
  }), Vc = (r, t, e, a) => ({
5437
5437
  x: r.x + (t == null ? void 0 : t.x) * e,
5438
5438
  y: r.y + (t == null ? void 0 : t.y) * a
5439
- }), Gc = (r, t, e, a) => ({
5439
+ }), zc = (r, t, e, a) => ({
5440
5440
  x: r.x + ((t == null ? void 0 : t.x) + (t == null ? void 0 : t.width)) * e,
5441
5441
  y: r.y + (t == null ? void 0 : t.y) * a
5442
- }), zc = (r, t, e, a) => ({
5442
+ }), Gc = (r, t, e, a) => ({
5443
5443
  x: r.x + ((t == null ? void 0 : t.x) + (t == null ? void 0 : t.width)) * e,
5444
5444
  y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
5445
5445
  }), It = (r) => {
@@ -5516,7 +5516,7 @@ const Q = () => {
5516
5516
  }, Mn = (r) => {
5517
5517
  var l;
5518
5518
  const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = pt(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
5519
- return /* @__PURE__ */ ct(zt, { children: [
5519
+ return /* @__PURE__ */ ct(Gt, { children: [
5520
5520
  /* @__PURE__ */ x("defs", { children: (() => /* @__PURE__ */ x("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ x("path", { d: r.clipPath }) : /* @__PURE__ */ x("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5521
5521
  /* @__PURE__ */ ct(
5522
5522
  "g",
@@ -5556,8 +5556,8 @@ const Q = () => {
5556
5556
  return r.pattern.src;
5557
5557
  };
5558
5558
  if (!a())
5559
- return /* @__PURE__ */ x(zt, {});
5560
- const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ x(zt, { children: r.useThreshold && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5559
+ return /* @__PURE__ */ x(Gt, {});
5560
+ const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ x(Gt, { children: r.useThreshold && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5561
5561
  /* @__PURE__ */ x(
5562
5562
  "feColorMatrix",
5563
5563
  {
@@ -5577,8 +5577,8 @@ const Q = () => {
5577
5577
  /* @__PURE__ */ x("feFuncB", { type: "discrete", tableValues: n() })
5578
5578
  ] })
5579
5579
  ] }) }) }), s = r.rotation || 0, o = pt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5580
- var w, S, y, I, b, E, D, F, k, T;
5581
- const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0, m = ((I = r.pattern) == null ? void 0 : I.height) || 0, g = ((b = r.pattern) == null ? void 0 : b.scaleX) || 1, p = ((E = r.pattern) == null ? void 0 : E.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
5580
+ var w, S, y, E, b, I, D, F, k, T;
5581
+ const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0, m = ((E = r.pattern) == null ? void 0 : E.height) || 0, g = ((b = r.pattern) == null ? void 0 : b.scaleX) || 1, p = ((I = r.pattern) == null ? void 0 : I.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
5582
5582
  return [(F = r.pattern) != null && F.svg ? {
5583
5583
  id: `${t}-contents`,
5584
5584
  type: M.Illustration,
@@ -5601,7 +5601,7 @@ const Q = () => {
5601
5601
  src: a()
5602
5602
  }];
5603
5603
  };
5604
- return /* @__PURE__ */ ct(zt, { children: [
5604
+ return /* @__PURE__ */ ct(Gt, { children: [
5605
5605
  i(),
5606
5606
  /* @__PURE__ */ x(
5607
5607
  "g",
@@ -5739,8 +5739,8 @@ const Ji = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5739
5739
  parseInt(u.getAttribute("font-size") ?? "72")
5740
5740
  ), S = w.getBoundingBox().x2 - w.getBoundingBox().x1;
5741
5741
  let y = 0;
5742
- const I = A.getAttribute("text-anchor");
5743
- I === "middle" ? y = S / 2 : I === "end" && (y = S);
5742
+ const E = A.getAttribute("text-anchor");
5743
+ E === "middle" ? y = S / 2 : E === "end" && (y = S);
5744
5744
  const b = g.getPath(
5745
5745
  A.innerHTML,
5746
5746
  parseFloat(A.getAttribute("x") ?? "0") - y,
@@ -5748,7 +5748,7 @@ const Ji = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5748
5748
  parseInt(u.getAttribute("font-size") ?? "72")
5749
5749
  );
5750
5750
  b.fill = p, b.stroke = f, b.strokeWidth = parseFloat(C ?? "0");
5751
- const E = b.toSVG(2), F = t.parseFromString(E, "image/svg+xml").firstElementChild;
5751
+ const I = b.toSVG(2), F = t.parseFromString(I, "image/svg+xml").firstElementChild;
5752
5752
  h.appendChild(F);
5753
5753
  }
5754
5754
  return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
@@ -5901,7 +5901,7 @@ const Ji = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5901
5901
  var w;
5902
5902
  return r.textFillImage ? `url("#${s}")` : (w = r._renderingConfiguration) != null && w.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${Cn(r.fillSpotColorDefinition)}` : r.fill;
5903
5903
  };
5904
- return /* @__PURE__ */ ct(zt, { children: [
5904
+ return /* @__PURE__ */ ct(Gt, { children: [
5905
5905
  /* @__PURE__ */ ct("defs", { children: [
5906
5906
  r.textFillImage && /* @__PURE__ */ x(
5907
5907
  "pattern",
@@ -6185,7 +6185,7 @@ const ae = (r) => {
6185
6185
  if (r.defaultVariant !== void 0)
6186
6186
  return t.find((e) => e.id === r.defaultVariant);
6187
6187
  }
6188
- }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), On = async (r, t) => {
6188
+ }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map(), On = async (r, t) => {
6189
6189
  if (!t) {
6190
6190
  if (!r)
6191
6191
  throw new Error("No region or src supplied. Cannot construct frame!");
@@ -6209,8 +6209,8 @@ const ae = (r) => {
6209
6209
  throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
6210
6210
  return e;
6211
6211
  }, Qe = async (r) => {
6212
- if (Ge.has(r))
6213
- return Ge.get(r);
6212
+ if (ze.has(r))
6213
+ return ze.get(r);
6214
6214
  const e = (async () => {
6215
6215
  if (Vt.has(r))
6216
6216
  return Vt.get(r);
@@ -6246,7 +6246,7 @@ const ae = (r) => {
6246
6246
  }
6247
6247
  throw new Error("Malformed frame SVG");
6248
6248
  })();
6249
- return Ge.set(r, e), e;
6249
+ return ze.set(r, e), e;
6250
6250
  }, Ea = (r, t, e, a) => {
6251
6251
  const n = t.width / t.height, i = r.width / r.height;
6252
6252
  let s;
@@ -6290,11 +6290,11 @@ const ae = (r) => {
6290
6290
  }, ba = async (r) => {
6291
6291
  const t = await at(r);
6292
6292
  return $n(t);
6293
- }, Ga = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), $n = (r) => {
6293
+ }, za = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), $n = (r) => {
6294
6294
  const a = dt().parseFromString(r, "image/svg+xml").querySelector("svg");
6295
6295
  if (!a)
6296
6296
  throw new Error("No svg tag found, this svg must be malformed!");
6297
- const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, Ga(i), Ga(s)] : n == null ? void 0 : n.split(" ").map((l) => Number(l));
6297
+ const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, za(i), za(s)] : n == null ? void 0 : n.split(" ").map((l) => Number(l));
6298
6298
  if (!o)
6299
6299
  throw new Error("No viewbox or width/height values detected on SVG file!");
6300
6300
  return {
@@ -6308,9 +6308,9 @@ const ae = (r) => {
6308
6308
  at(r).then((e) => {
6309
6309
  t(e);
6310
6310
  }).catch((e) => console.error(e));
6311
- }), ze = /* @__PURE__ */ new Map(), Kt = async (r) => {
6312
- if (ze.has(r))
6313
- return ze.get(r);
6311
+ }), Ge = /* @__PURE__ */ new Map(), Kt = async (r) => {
6312
+ if (Ge.has(r))
6313
+ return Ge.get(r);
6314
6314
  const t = async (n) => new Promise((i, s) => {
6315
6315
  try {
6316
6316
  if (!(!!URL && !!URL.createObjectURL))
@@ -6342,7 +6342,7 @@ const ae = (r) => {
6342
6342
  A.resize(m, m);
6343
6343
  return await A.render(), await t(c);
6344
6344
  })();
6345
- return ze.set(r, a), a;
6345
+ return Ge.set(r, a), a;
6346
6346
  }, Ut = async (r, t, e, a) => {
6347
6347
  const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
6348
6348
  width: r.layoutState.layout.width,
@@ -6610,7 +6610,7 @@ class O {
6610
6610
  this.oldState = t;
6611
6611
  }
6612
6612
  }
6613
- class za extends O {
6613
+ class Ga extends O {
6614
6614
  constructor(t) {
6615
6615
  super(), this.serializableWorkflow = t;
6616
6616
  }
@@ -7441,7 +7441,7 @@ class Cs {
7441
7441
  } };
7442
7442
  }
7443
7443
  }
7444
- const Gn = new Cs();
7444
+ const zn = new Cs();
7445
7445
  class Be {
7446
7446
  constructor() {
7447
7447
  this.frameSourceSvg = async (t, e) => {
@@ -7733,7 +7733,7 @@ class Be {
7733
7733
  i && i(!0);
7734
7734
  const c = t.data.initialZoomLevel, d = await Promise.all(
7735
7735
  t.data.regions.map(async (m, g) => {
7736
- const p = await Qe(l[g]), f = o.getImageData(), C = a.map((E) => new Et(E.id)), w = f ? Ea(
7736
+ const p = await Qe(l[g]), f = o.getImageData(), C = a.map((I) => new Et(I.id)), w = f ? Ea(
7737
7737
  f,
7738
7738
  p,
7739
7739
  c && !t.data.forceImageCover ? { scale: c } : void 0,
@@ -7748,7 +7748,7 @@ class Be {
7748
7748
  scaleX: (w == null ? void 0 : w.zoom) || 1,
7749
7749
  scaleY: (w == null ? void 0 : w.zoom) || 1,
7750
7750
  rotation: 0
7751
- } : void 0, y = Q(), b = n.getLayouts().find((E) => E.panelId === m.panelId);
7751
+ } : void 0, y = Q(), b = n.getLayouts().find((I) => I.panelId === m.panelId);
7752
7752
  if (!b)
7753
7753
  throw new Y(m);
7754
7754
  return {
@@ -8042,8 +8042,8 @@ class ws {
8042
8042
  const y = {};
8043
8043
  (((S = o.assetConfiguration) == null ? void 0 : S.channelNumbers) || []).forEach((b) => {
8044
8044
  var D;
8045
- const E = C.find((F) => F.channelNumber === b.number);
8046
- E && (y[`${b.id.replace(/\W/g, "")}`] = { browserValue: ((D = E == null ? void 0 : E.variant) == null ? void 0 : D.color) || "" });
8045
+ const I = C.find((F) => F.channelNumber === b.number);
8046
+ I && (y[`${b.id.replace(/\W/g, "")}`] = { browserValue: ((D = I == null ? void 0 : I.variant) == null ? void 0 : D.color) || "" });
8047
8047
  }), await this.changeColors(
8048
8048
  t,
8049
8049
  u.map((b) => b.regionElement),
@@ -8053,20 +8053,20 @@ class ws {
8053
8053
  );
8054
8054
  }
8055
8055
  if (t.data.colorPickerEnabled) {
8056
- const y = await this.availableColors(t, i) || [], I = Object.keys(c.colors), b = y.length === 1 && I.length === 1;
8056
+ const y = await this.availableColors(t, i) || [], E = Object.keys(c.colors), b = y.length === 1 && E.length === 1;
8057
8057
  if (b) {
8058
- const E = y[0], D = I[0];
8058
+ const I = y[0], D = E[0];
8059
8059
  await this.changeColors(
8060
8060
  t,
8061
8061
  u.map((F) => F.regionElement),
8062
8062
  i,
8063
8063
  () => i.getCommandContext().getAllLayouts(),
8064
- /* @__PURE__ */ new Map([[D, E.variant.color]])
8064
+ /* @__PURE__ */ new Map([[D, I.variant.color]])
8065
8065
  );
8066
8066
  }
8067
8067
  !b && C.length === 0 && await this.changeColors(
8068
8068
  t,
8069
- u.map((E) => E.regionElement),
8069
+ u.map((I) => I.regionElement),
8070
8070
  i,
8071
8071
  () => i.getCommandContext().getAllLayouts(),
8072
8072
  /* @__PURE__ */ new Map()
@@ -8154,7 +8154,7 @@ class ys {
8154
8154
  };
8155
8155
  }
8156
8156
  }
8157
- const zn = new ys();
8157
+ const Gn = new ys();
8158
8158
  class Ss {
8159
8159
  async init(t, e, a) {
8160
8160
  const n = t.option;
@@ -8677,7 +8677,7 @@ class Bs {
8677
8677
  }
8678
8678
  }
8679
8679
  }
8680
- const Gt = new Bs();
8680
+ const zt = new Bs();
8681
8681
  class Is {
8682
8682
  constructor() {
8683
8683
  this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
@@ -8814,7 +8814,7 @@ class Fs {
8814
8814
  if (p && t.globalPropertyAspectConfigurations) {
8815
8815
  const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
8816
8816
  var y;
8817
- return S.type === G.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((I) => I.aspectName).includes(S.name));
8817
+ return S.type === z.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
8818
8818
  });
8819
8819
  if (w) {
8820
8820
  const y = p.getGlobalPropertyStateManager().getAspect(w.name);
@@ -9000,7 +9000,7 @@ class Fs {
9000
9000
  const l = [], c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
9001
9001
  for (const A of e) {
9002
9002
  if (!A.fontData)
9003
- throw new z("Failed to resolve font data for text.");
9003
+ throw new G("Failed to resolve font data for text.");
9004
9004
  const [u, h] = pe(
9005
9005
  A.fontSize,
9006
9006
  A.fontData,
@@ -9056,13 +9056,13 @@ class Fs {
9056
9056
  let w = (A = n.storage) == null ? void 0 : A.text;
9057
9057
  const S = e.getWorkflowExperience().getBundle();
9058
9058
  if (S && t.globalPropertyAspectConfigurations) {
9059
- const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, I = y == null ? void 0 : y.find((b) => {
9060
- var E;
9061
- return b.type === G.Text && ((E = t.globalPropertyAspectConfigurations) == null ? void 0 : E.map((D) => D.aspectName).includes(b.name));
9059
+ const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, E = y == null ? void 0 : y.find((b) => {
9060
+ var I;
9061
+ return b.type === z.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(b.name));
9062
9062
  });
9063
- if (I) {
9064
- const E = S.getGlobalPropertyStateManager().getAspect(I.name);
9065
- E && (w = E);
9063
+ if (E) {
9064
+ const I = S.getGlobalPropertyStateManager().getAspect(E.name);
9065
+ I && (w = I);
9066
9066
  }
9067
9067
  }
9068
9068
  if (await e.setSelectionsAndElements(
@@ -9071,13 +9071,13 @@ class Fs {
9071
9071
  f,
9072
9072
  async () => {
9073
9073
  e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
9074
- const y = o.map((b) => new Wa(b.id, p)), I = new $(y);
9075
- e.getCommandDispatcher()(I);
9074
+ const y = o.map((b) => new Wa(b.id, p)), E = new $(y);
9075
+ e.getCommandDispatcher()(E);
9076
9076
  }
9077
9077
  ), o.length === 0 && l) {
9078
9078
  const y = q.getDefaultVariant(l);
9079
9079
  if (y) {
9080
- const I = await this.selectVariantCommand(
9080
+ const E = await this.selectVariantCommand(
9081
9081
  t,
9082
9082
  y,
9083
9083
  { text: w },
@@ -9088,7 +9088,7 @@ class Fs {
9088
9088
  () => {
9089
9089
  }
9090
9090
  );
9091
- e.getCommandDispatcher()(I.command);
9091
+ e.getCommandDispatcher()(E.command);
9092
9092
  }
9093
9093
  } else {
9094
9094
  const { command: y } = j.updateInputText(
@@ -9106,7 +9106,7 @@ class Fs {
9106
9106
  if (m && t.globalPropertyAspectConfigurations) {
9107
9107
  const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
9108
9108
  var C;
9109
- return f.type === G.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9109
+ return f.type === z.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9110
9110
  });
9111
9111
  if (p) {
9112
9112
  const C = m.getGlobalPropertyStateManager().getAspect(p.name);
@@ -9298,10 +9298,10 @@ class Fs {
9298
9298
  curved: a.curved,
9299
9299
  paths: a.paths,
9300
9300
  fillSpotColorDefinition: f
9301
- }, y = [], I = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
9301
+ }, y = [], E = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
9302
9302
  if (!S.fontData)
9303
- throw new z("Failed to resolve font data for text.");
9304
- const [E, D] = pe(
9303
+ throw new G("Failed to resolve font data for text.");
9304
+ const [I, D] = pe(
9305
9305
  S.fontSize,
9306
9306
  S.fontData,
9307
9307
  {
@@ -9315,11 +9315,11 @@ class Fs {
9315
9315
  [l],
9316
9316
  { size: a.size, minSize: a.minSize, maxSize: a.maxSize }
9317
9317
  );
9318
- I.set(S.id, E), b.set(S.id, D);
9318
+ E.set(S.id, I), b.set(S.id, D);
9319
9319
  const F = a.curved || a.vertical ? l : (D || []).join(`
9320
9320
  `);
9321
9321
  y.push(
9322
- this.generateTextChangeCommandsForRegion(E, a, S.id, F)
9322
+ this.generateTextChangeCommandsForRegion(I, a, S.id, F)
9323
9323
  );
9324
9324
  const k = new W(S, h);
9325
9325
  return {
@@ -9362,23 +9362,23 @@ class Fs {
9362
9362
  const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
9363
9363
  for (const S of h)
9364
9364
  if (S.region) {
9365
- const [y, I] = pe(
9365
+ const [y, E] = pe(
9366
9366
  e,
9367
9367
  a,
9368
9368
  S.region,
9369
9369
  [u],
9370
9370
  { size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
9371
9371
  );
9372
- m.set(S.id, y), g.set(S.id, I);
9372
+ m.set(S.id, y), g.set(S.id, E);
9373
9373
  }
9374
9374
  const f = (() => {
9375
9375
  if (t.data && t.data.maxLength && u.length > t.data.maxLength)
9376
9376
  return d && d(!0), { info: "0" };
9377
9377
  const S = s.getProfanities(), y = Ze(u.toLowerCase());
9378
- for (const I of y)
9378
+ for (const E of y)
9379
9379
  for (const b in S) {
9380
- const E = S[b].toLowerCase().replace(/\s/g, "");
9381
- if (I === E)
9380
+ const I = S[b].toLowerCase().replace(/\s/g, "");
9381
+ if (E === I)
9382
9382
  return l(!0), { error: "Blocked profanity." };
9383
9383
  }
9384
9384
  return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
@@ -9572,12 +9572,12 @@ class $s extends xs {
9572
9572
  w.appendChild(S), S.appendChild(Ts(0, 2, 2, "shadow"));
9573
9573
  const y = et("path");
9574
9574
  y.setAttribute("d", d), y.setAttribute("stroke", "black"), y.setAttribute("stroke-width", "3"), S.appendChild(y);
9575
- const I = et("g");
9576
- I.classList.add("module-layer0"), w.appendChild(I), I.setAttribute("filter", "url(#shadow)"), I.innerHTML = y.outerHTML;
9575
+ const E = et("g");
9576
+ E.classList.add("module-layer0"), w.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = y.outerHTML;
9577
9577
  const b = et("g");
9578
9578
  b.classList.add("module-layer1"), w.appendChild(b), b.setAttribute("stroke-width", "3"), b.setAttribute("stroke", "rgb(45,41,38)"), b.setAttribute("fill", "rgb(45,41,38)"), b.setAttribute("transform", "translate(0.5,0)"), b.innerHTML = o;
9579
- const E = et("g");
9580
- E.classList.add("module-layer2"), w.appendChild(E), E.setAttribute("fill", "rgb(255,209,0)"), E.setAttribute("transform", "translate(1,-0.1)"), E.innerHTML = o;
9579
+ const I = et("g");
9580
+ I.classList.add("module-layer2"), w.appendChild(I), I.setAttribute("fill", "rgb(255,209,0)"), I.setAttribute("transform", "translate(1,-0.1)"), I.innerHTML = o;
9581
9581
  const D = et("g");
9582
9582
  return D.classList.add("module-layer3"), w.appendChild(D), D.setAttribute("fill", "white"), D.innerHTML = o, new Os(w).transform(([k, T]) => [k, T + (c / 2 - k) ** 2 / (c * 6)]), w;
9583
9583
  }, u = et("g");
@@ -9599,7 +9599,7 @@ class $s extends xs {
9599
9599
  async function Yn(r) {
9600
9600
  if (r === "Vegemite")
9601
9601
  return new $s();
9602
- throw new z(`Failed to resolve Module, Module ${r} not found`);
9602
+ throw new G(`Failed to resolve Module, Module ${r} not found`);
9603
9603
  }
9604
9604
  const ne = v`
9605
9605
  fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
@@ -9660,7 +9660,7 @@ const ne = v`
9660
9660
  variables: {
9661
9661
  bundleId: r
9662
9662
  }
9663
- })).data.globalPropertyState, Gs = v`
9663
+ })).data.globalPropertyState, zs = v`
9664
9664
  ${Te}
9665
9665
  fragment ProductFields on Product {
9666
9666
  id
@@ -9706,7 +9706,7 @@ const ne = v`
9706
9706
  }
9707
9707
  }
9708
9708
  `, Ba = v`
9709
- ${Gs}
9709
+ ${zs}
9710
9710
  fragment ProductCollectionProductFields on ProductCollectionProduct {
9711
9711
  id
9712
9712
  productId
@@ -9773,7 +9773,7 @@ const ne = v`
9773
9773
  }
9774
9774
  }
9775
9775
  }
9776
- `, zs = (r) => v`
9776
+ `, Gs = (r) => v`
9777
9777
  ${ne}
9778
9778
  ${re(r)}
9779
9779
  query GetBundle($id: String!) {
@@ -10290,10 +10290,10 @@ class Co {
10290
10290
  constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, C = !1) {
10291
10291
  var w;
10292
10292
  this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10293
- var I;
10293
+ var E;
10294
10294
  if (!this.previewService)
10295
10295
  return;
10296
- const S = this.getCommandContext().getAllLayouts(), y = (I = this.getLayoutPreviewService()) == null ? void 0 : I.getAll();
10296
+ const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
10297
10297
  if (y)
10298
10298
  for (const [, b] of y)
10299
10299
  b.render(S);
@@ -10402,7 +10402,7 @@ class Co {
10402
10402
  };
10403
10403
  this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
10404
10404
  this.storage[o.stepName] = o.storage || {};
10405
- }), this.allScenes = await Gi(t);
10405
+ }), this.allScenes = await zi(t);
10406
10406
  const n = Pt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
10407
10407
  this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
10408
10408
  }
@@ -10621,7 +10621,7 @@ class Co {
10621
10621
  const l = o[0];
10622
10622
  if (s.type === P.Model) {
10623
10623
  if (!this.modelContainer)
10624
- throw new z(
10624
+ throw new G(
10625
10625
  "We should always have a model container when injecting a preview!"
10626
10626
  );
10627
10627
  const u = (A = l.asset) == null ? void 0 : A.fileLink;
@@ -10646,7 +10646,7 @@ class Co {
10646
10646
  }
10647
10647
  s.data.targetMaterials.forEach((m) => {
10648
10648
  if (!this.modelContainer)
10649
- throw new z(
10649
+ throw new G(
10650
10650
  "We should always have a model container when injecting a preview!"
10651
10651
  );
10652
10652
  this.modelContainer.applyMaterialVariant(m, s.option.id, u);
@@ -10669,7 +10669,7 @@ class Co {
10669
10669
  };
10670
10670
  if (!ln(a, this.storage)) {
10671
10671
  this.storage = a;
10672
- const n = new za(this.constructSerializableWorkflow());
10672
+ const n = new Ga(this.constructSerializableWorkflow());
10673
10673
  this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
10674
10674
  }
10675
10675
  }
@@ -10720,7 +10720,7 @@ class Co {
10720
10720
  serialize() {
10721
10721
  const t = this.getCommandContext().getState();
10722
10722
  if (!t)
10723
- throw new z("Attempted to serialize state before it was initialized.");
10723
+ throw new G("Attempted to serialize state before it was initialized.");
10724
10724
  const e = yt(t.transaction), a = this.dehydrateState(e);
10725
10725
  return JSON.stringify(a);
10726
10726
  }
@@ -10859,20 +10859,20 @@ class Co {
10859
10859
  ), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
10860
10860
  }
10861
10861
  async setSelectionsAndElements(t, e, a, n) {
10862
- var y, I, b;
10863
- console.log(`LOG: set selection of step ${t} to variant ${(y = e == null ? void 0 : e[0]) == null ? void 0 : y.name} (${(I = e == null ? void 0 : e[0]) == null ? void 0 : I.id})`), console.trace();
10862
+ var y;
10863
+ console.log("LOG: set selections?");
10864
10864
  const i = this.stepSelections;
10865
10865
  this.stepSelections = {
10866
10866
  ...this.stepSelections,
10867
10867
  [t]: { selectedVariants: e }
10868
- }, this.selectionCost = Object.values(this.stepSelections).reduce((E, D) => E + D.selectedVariants.map((F) => F.priceModifier || 0).reduce((F, k) => F + k, 0), 0), this.workflow.steps.forEach((E) => {
10869
- wt(E, this.stepSelections) || (console.log(`LOG: uniniting step ${E.stepTitle} (${E.stepName})`), this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
10868
+ }, this.selectionCost = Object.values(this.stepSelections).reduce((E, b) => E + b.selectedVariants.map((I) => I.priceModifier || 0).reduce((I, D) => I + D, 0), 0), this.workflow.steps.forEach((E) => {
10869
+ wt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
10870
10870
  });
10871
10871
  const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((E) => E.silentSteps).flat(), A = l.map((E) => E.silentSteps).flat().filter(
10872
- (E) => !c.some((D) => D.stepName === E.stepName)
10872
+ (E) => !c.some((b) => b.stepName === E.stepName)
10873
10873
  );
10874
10874
  c.forEach((E) => {
10875
- wt(E, this.stepSelections) || (console.log(`LOG: uniniting silent step ${E.stepTitle} (${E.stepName})`), this.stepInitialised[E.stepName] = !1);
10875
+ wt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
10876
10876
  });
10877
10877
  const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10878
10878
  this.stepElements = {
@@ -10882,16 +10882,16 @@ class Co {
10882
10882
  }, this.removeElements(u);
10883
10883
  const g = this.workflow.steps.find((E) => E.stepName === t);
10884
10884
  if ((g == null ? void 0 : g.type) === P.Frame) {
10885
- const E = (b = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : b.frameService;
10886
- E == null || E.setTargetElements(a.map((D) => D.id));
10885
+ const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
10886
+ E == null || E.setTargetElements(a.map((b) => b.id));
10887
10887
  }
10888
- const p = u.map((E) => new Et(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10888
+ const p = u.map((E) => new Et(E.id)), f = new Ga(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10889
10889
  C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10890
10890
  const w = this.getInvalidModelVariants(), S = this.modelContainer;
10891
10891
  if (S) {
10892
10892
  const E = w.map(
10893
- (D) => S.applyModelVariant(
10894
- D,
10893
+ (b) => S.applyModelVariant(
10894
+ b,
10895
10895
  {
10896
10896
  contextService: this.getLayoutPreviewService()
10897
10897
  },
@@ -10903,14 +10903,14 @@ class Co {
10903
10903
  await this.onSelectionChange(), n && await n();
10904
10904
  }
10905
10905
  async ensureStepsAreLoaded() {
10906
- console.log("LOG: ensure steps loaded");
10906
+ console.log("LOG: ensure steps loaded"), console.trace();
10907
10907
  const e = Pt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
10908
10908
  for (const l of n)
10909
10909
  if (!this.stepInitialised[l.stepName])
10910
10910
  switch (console.log(`LOG: step ${l.stepTitle} (${l.stepName}) was not inited`), this.stepInitialised[l.stepName] = !0, l.type) {
10911
10911
  case P.DigitalContent:
10912
10912
  a.push(
10913
- Gn.init(
10913
+ zn.init(
10914
10914
  l,
10915
10915
  this,
10916
10916
  this.reloadedState
@@ -10927,7 +10927,7 @@ class Co {
10927
10927
  break;
10928
10928
  case P.Material:
10929
10929
  a.push(
10930
- zn.init(l, this, this.reloadedState)
10930
+ Gn.init(l, this, this.reloadedState)
10931
10931
  );
10932
10932
  break;
10933
10933
  case P.Model:
@@ -10951,7 +10951,7 @@ class Co {
10951
10951
  );
10952
10952
  break;
10953
10953
  case P.Shape:
10954
- a.push(Gt.init(l, this, this.reloadedState));
10954
+ a.push(zt.init(l, this, this.reloadedState));
10955
10955
  break;
10956
10956
  case P.Text:
10957
10957
  a.push(j.init(l, this, this.reloadedState));
@@ -11316,7 +11316,7 @@ class yo extends it {
11316
11316
  super(t, e, a);
11317
11317
  }
11318
11318
  selectVariant(t) {
11319
- return zn.selectVariant(
11319
+ return Gn.selectVariant(
11320
11320
  this.step,
11321
11321
  t.getResource(),
11322
11322
  this.manager,
@@ -11378,7 +11378,7 @@ class bo extends it {
11378
11378
  }
11379
11379
  selectVariant(t) {
11380
11380
  const e = t.getResource();
11381
- return Gt.selectVariant(
11381
+ return zt.selectVariant(
11382
11382
  this.step,
11383
11383
  {
11384
11384
  fill: e.color,
@@ -11396,7 +11396,7 @@ class bo extends it {
11396
11396
  * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
11397
11397
  */
11398
11398
  setColor(t) {
11399
- return Gt.selectVariant(
11399
+ return zt.selectVariant(
11400
11400
  this.step,
11401
11401
  t,
11402
11402
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11408,7 +11408,7 @@ class bo extends it {
11408
11408
  * @returns A list of color definitions that are currently applied to the illustration.
11409
11409
  */
11410
11410
  getColors() {
11411
- return Gt.availableColours(this.step);
11411
+ return zt.availableColours(this.step);
11412
11412
  }
11413
11413
  /**
11414
11414
  * Allows for setting a custom color when the custom variant is selected. Will
@@ -11416,7 +11416,7 @@ class bo extends it {
11416
11416
  */
11417
11417
  setCustomColor(t) {
11418
11418
  var e, a;
11419
- return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), Gt.setCustomColor(t, this.step, this.manager);
11419
+ return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), zt.setCustomColor(t, this.step, this.manager);
11420
11420
  }
11421
11421
  getCustomColor() {
11422
11422
  var e, a, n;
@@ -11660,7 +11660,7 @@ class Po extends it {
11660
11660
  * @returns The final URL string for the QR code.
11661
11661
  */
11662
11662
  async selectVideo(t) {
11663
- return Gn.regenerateQRCode(
11663
+ return zn.regenerateQRCode(
11664
11664
  this.manager.getRegionElements(this.step.stepName),
11665
11665
  t.key,
11666
11666
  this.manager,
@@ -11742,7 +11742,7 @@ class ce {
11742
11742
  case P.Module:
11743
11743
  return new Do(t, e, t.getStepTags(e.stepName));
11744
11744
  default:
11745
- throw new z(`Step type ${e.type} not yet supported in Core SDK`);
11745
+ throw new G(`Step type ${e.type} not yet supported in Core SDK`);
11746
11746
  }
11747
11747
  }
11748
11748
  }
@@ -11967,7 +11967,7 @@ const ko = async (r, t) => {
11967
11967
  };
11968
11968
  return i && (h.metadata = i), a && (h.selectedVariants = a), n && (h.sku = n), h;
11969
11969
  }, Xn = async (r, t, e, a, n, i, s, o, l, c) => {
11970
- var E;
11970
+ var I;
11971
11971
  await (async () => {
11972
11972
  var R;
11973
11973
  if (c !== void 0)
@@ -11986,7 +11986,7 @@ const ko = async (r, t) => {
11986
11986
  T.errors && console.log("Server Error:", tt.message);
11987
11987
  }), null) : nt ?? null;
11988
11988
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
11989
- const u = r.getPreviewService(), h = (E = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : E.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && ca(l, t, !0), p = l && ca(l, t, !1), f = async (D) => {
11989
+ const u = r.getPreviewService(), h = (I = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : I.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && ca(l, t, !0), p = l && ca(l, t, !1), f = async (D) => {
11990
11990
  const F = {};
11991
11991
  let k = 0;
11992
11992
  if (Object.keys(i).length > 0)
@@ -12020,10 +12020,10 @@ const ko = async (r, t) => {
12020
12020
  S[D].map((F) => F.id)
12021
12021
  ])
12022
12022
  );
12023
- let I = await o(m, n.id);
12024
- if (I) {
12025
- const D = await (await rt(I)).blob();
12026
- I = (await U.uploadAsset(
12023
+ let E = await o(m, n.id);
12024
+ if (E) {
12025
+ const D = await (await rt(E)).blob();
12026
+ E = (await U.uploadAsset(
12027
12027
  { name: `${n.id}-preview-image.png`, blob: D },
12028
12028
  Ce.Image,
12029
12029
  !0,
@@ -12041,7 +12041,7 @@ const ko = async (r, t) => {
12041
12041
  workflowId: t.id,
12042
12042
  transactionId: n.id,
12043
12043
  useThreeDimPreview: !!m,
12044
- previewImage: I
12044
+ previewImage: E
12045
12045
  };
12046
12046
  if (p) {
12047
12047
  const F = [];
@@ -12164,7 +12164,7 @@ class Ro {
12164
12164
  const t = N.get(this.localPersistenceKey);
12165
12165
  return t ? JSON.parse(t) : [];
12166
12166
  }
12167
- throw new z("Unexpected storage method requested");
12167
+ throw new G("Unexpected storage method requested");
12168
12168
  }
12169
12169
  /**
12170
12170
  * Search for a transaction that has been saved.
@@ -12204,7 +12204,7 @@ class Ro {
12204
12204
  N.set(this.localPersistenceKey, JSON.stringify(t));
12205
12205
  return;
12206
12206
  }
12207
- throw new z("Unexpected storage method requested");
12207
+ throw new G("Unexpected storage method requested");
12208
12208
  }
12209
12209
  }
12210
12210
  const Ye = new Ro(), Oo = v`
@@ -12554,7 +12554,7 @@ class Vo {
12554
12554
  }
12555
12555
  async save(t) {
12556
12556
  if (!this.getCommandContext().getState())
12557
- throw new z("State undefined!");
12557
+ throw new G("State undefined!");
12558
12558
  const n = {
12559
12559
  title: await (async () => {
12560
12560
  var l;
@@ -12577,10 +12577,10 @@ class Vo {
12577
12577
  var s;
12578
12578
  const t = yt(this.getCommandContext().getState());
12579
12579
  if (!t)
12580
- throw new z("Internal state is undefined! Cannot copy experience!");
12580
+ throw new G("Internal state is undefined! Cannot copy experience!");
12581
12581
  const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
12582
12582
  if (!n)
12583
- throw new z("Integration product id is undefined!");
12583
+ throw new G("Integration product id is undefined!");
12584
12584
  return await this.getClient().getWorkflowExperience({
12585
12585
  type: "integration",
12586
12586
  integrationProductId: n,
@@ -12679,7 +12679,7 @@ class Vo {
12679
12679
  (this.eventCallbacks.get(t) || []).forEach((e) => e(this));
12680
12680
  }
12681
12681
  }
12682
- const Go = [
12682
+ const zo = [
12683
12683
  "altGlyph",
12684
12684
  "circle",
12685
12685
  "ellipse",
@@ -12691,7 +12691,7 @@ const Go = [
12691
12691
  "textPath",
12692
12692
  "tref",
12693
12693
  "tspan"
12694
- ], zo = async (r, t, e) => {
12694
+ ], Go = async (r, t, e) => {
12695
12695
  const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
12696
12696
  o.searchParams.append("video", Ra(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12697
12697
  const l = o.toString(), d = `data:image/svg+xml;base64,${Ra(await on(l, { type: "svg" }))}`, A = (h) => {
@@ -12777,7 +12777,7 @@ const Go = [
12777
12777
  return console.error(o), [];
12778
12778
  }
12779
12779
  }, jo = async (r, t, e, a) => {
12780
- var y, I;
12780
+ var y, E;
12781
12781
  const n = e.data, i = a.option;
12782
12782
  if (!i)
12783
12783
  return console.error(`No option for step ${a.stepName}.`), [];
@@ -12787,7 +12787,7 @@ const Go = [
12787
12787
  if (!s.asset)
12788
12788
  return console.error(`No asset for variant with ID: ${n.illustrationVariantId}`), [];
12789
12789
  t[a.stepName] = { selectedVariants: [s] };
12790
- const o = (I = s.asset) == null ? void 0 : I.fileLink;
12790
+ const o = (E = s.asset) == null ? void 0 : E.fileLink;
12791
12791
  if (!o)
12792
12792
  return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
12793
12793
  const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "", m = dt().parseFromString(A, "image/svg+xml").firstElementChild;
@@ -12796,10 +12796,10 @@ const Go = [
12796
12796
  pa(m);
12797
12797
  const g = {};
12798
12798
  xt(m, (b) => {
12799
- Go.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
12800
- const E = b.attributes.getNamedItem("fill");
12801
- if (E && E.value !== "none") {
12802
- const F = E.value, T = `spiff-fill-${F.replace(/\W/g, "")}`;
12799
+ zo.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
12800
+ const I = b.attributes.getNamedItem("fill");
12801
+ if (I && I.value !== "none") {
12802
+ const F = I.value, T = `spiff-fill-${F.replace(/\W/g, "")}`;
12803
12803
  b.classList.add(T), g[T] = { browserValue: F };
12804
12804
  }
12805
12805
  const D = b.attributes.getNamedItem("stroke");
@@ -12810,16 +12810,16 @@ const Go = [
12810
12810
  });
12811
12811
  const f = bt().serializeToString(m), C = n.colors;
12812
12812
  if (C) {
12813
- for (const [b, E] of Object.entries(g))
12813
+ for (const [b, I] of Object.entries(g))
12814
12814
  for (const D of Object.keys(C))
12815
- if (E.browserValue === D) {
12815
+ if (I.browserValue === D) {
12816
12816
  g[b] = { browserValue: C[D] };
12817
12817
  break;
12818
12818
  }
12819
12819
  }
12820
12820
  const w = (b) => {
12821
- const E = r.find((F) => F.panelId === b.panelId);
12822
- if (!E)
12821
+ const I = r.find((F) => F.panelId === b.panelId);
12822
+ if (!I)
12823
12823
  throw new Y(b);
12824
12824
  const D = Q();
12825
12825
  return new W(
@@ -12837,7 +12837,7 @@ const Go = [
12837
12837
  layerIndex: b.layerIndex,
12838
12838
  immutable: b.immutable
12839
12839
  },
12840
- E
12840
+ I
12841
12841
  );
12842
12842
  }, S = a.data.regions;
12843
12843
  try {
@@ -13147,7 +13147,7 @@ const Go = [
13147
13147
  switch (o.type) {
13148
13148
  case P.DigitalContent:
13149
13149
  n.push(
13150
- ...await zo(e, s, o)
13150
+ ...await Go(e, s, o)
13151
13151
  );
13152
13152
  break;
13153
13153
  case P.Frame:
@@ -13437,19 +13437,19 @@ class rl {
13437
13437
  }
13438
13438
  async createHandle(t) {
13439
13439
  switch (t.type) {
13440
- case G.FileUpload:
13440
+ case z.FileUpload:
13441
13441
  return new il(this.bundle, t).initialize();
13442
- case G.ColorOption:
13442
+ case z.ColorOption:
13443
13443
  return new Ja(
13444
13444
  this.bundle,
13445
13445
  t,
13446
13446
  t.entityId ? await q.getOption(t.entityId) : void 0
13447
13447
  );
13448
- case G.Option: {
13448
+ case z.Option: {
13449
13449
  const e = t.entityId ? await q.getOption(t.entityId) : void 0;
13450
13450
  return (e == null ? void 0 : e.type) === "Color" ? new Ja(this.bundle, t, e) : new Zn(this.bundle, t, e);
13451
13451
  }
13452
- case G.Text:
13452
+ case z.Text:
13453
13453
  return new sl(this.bundle, t);
13454
13454
  default:
13455
13455
  throw new Error("Unhandled Global Property Aspect Type");
@@ -13879,7 +13879,7 @@ class Ja extends Zn {
13879
13879
  return Promise.resolve();
13880
13880
  await this.applyColorVariant(new st(a), t);
13881
13881
  const n = (o = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)) == null ? void 0 : o.customColor;
13882
- console.log(`LOG: end of apply global state for color ${this.property.name}`), n && this.setCustomColor(n);
13882
+ console.log(`LOG: custom color ${n}`), n && this.setCustomColor(n);
13883
13883
  }
13884
13884
  async applyColorVariant(t, e, a) {
13885
13885
  const n = this.getSharedSteps(e);
@@ -14050,15 +14050,15 @@ class cl {
14050
14050
  let i = n.type && n.storage ? {} : void 0;
14051
14051
  if (i)
14052
14052
  switch (n.type) {
14053
- case G.FileUpload: {
14053
+ case z.FileUpload: {
14054
14054
  i.fileUpload = n.storage;
14055
14055
  break;
14056
14056
  }
14057
- case G.Option: {
14057
+ case z.Option: {
14058
14058
  i.option = n.storage;
14059
14059
  break;
14060
14060
  }
14061
- case G.ColorOption: {
14061
+ case z.ColorOption: {
14062
14062
  i = n.storage;
14063
14063
  break;
14064
14064
  }
@@ -14738,7 +14738,7 @@ class Je {
14738
14738
  const m = this.globalPropertyStateManager.getGlobalPropertyState();
14739
14739
  m ? this.globalPropertyHandleService.getHandles().then((g) => {
14740
14740
  const p = g.map((f) => {
14741
- if (f.getType() === G.ColorOption || f.getType() === G.Option) {
14741
+ if (f.getType() === z.ColorOption || f.getType() === z.Option) {
14742
14742
  const C = f;
14743
14743
  if (!m.aspects.find((S) => S.name === C.getName()))
14744
14744
  return C.initDefaultVariant();
@@ -14875,7 +14875,7 @@ class Je {
14875
14875
  const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
14876
14876
  if (s)
14877
14877
  switch (n.type) {
14878
- case G.FileUpload: {
14878
+ case z.FileUpload: {
14879
14879
  const o = s, l = await ve([n.value]);
14880
14880
  l.length > 0 && await o.selectImage(l[0]);
14881
14881
  const c = (a = n.storage) == null ? void 0 : a.colors;
@@ -14887,21 +14887,21 @@ class Je {
14887
14887
  }
14888
14888
  break;
14889
14889
  }
14890
- case G.ColorOption: {
14890
+ case z.ColorOption: {
14891
14891
  const o = s;
14892
- if (n.type === G.ColorOption) {
14892
+ if (n.type === z.ColorOption) {
14893
14893
  const c = o.getAllVariants().find((d) => d.getId() === n.value);
14894
14894
  c && await o.selectVariant(c);
14895
14895
  } else
14896
14896
  o.setCustomColor(n.value);
14897
14897
  break;
14898
14898
  }
14899
- case G.Option: {
14899
+ case z.Option: {
14900
14900
  const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
14901
14901
  c && await o.selectVariant(c);
14902
14902
  break;
14903
14903
  }
14904
- case G.Text: {
14904
+ case z.Text: {
14905
14905
  await s.setText(n.value);
14906
14906
  break;
14907
14907
  }
@@ -14912,7 +14912,7 @@ class Je {
14912
14912
  return this.globalPropertyStateManager;
14913
14913
  }
14914
14914
  async getGlobalPropertyTotalSubunits() {
14915
- return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === G.Option).map((a) => {
14915
+ return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === z.Option).map((a) => {
14916
14916
  var n;
14917
14917
  return ((n = a.getCurrentVariant()) == null ? void 0 : n.getPrice()) || 0;
14918
14918
  }).reduce((a, n) => a + n, 0);
@@ -14931,7 +14931,7 @@ class Je {
14931
14931
  const c = (e = this.getGlobalPropertyConfiguration()) == null ? void 0 : e.aspects.find(
14932
14932
  (d) => d.name === l
14933
14933
  );
14934
- if (c && c.type === G.ColorOption) {
14934
+ if (c && c.type === z.ColorOption) {
14935
14935
  const d = (a = s.getCurrentVariant()) == null ? void 0 : a.getAssetResource(), A = ((n = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : n.channelNumbers) || [], u = ((i = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : i.defaultColorVariants) || [], h = ll(
14936
14936
  this.getWorkflowExperiences(),
14937
14937
  this.globalConfigurationPropertyId || "",
@@ -15996,7 +15996,7 @@ class Ad {
15996
15996
  } catch (a) {
15997
15997
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15998
15998
  }
15999
- }, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1-beta.ecd0c9f9-3452-55d8-9a01-b4ec364f53fb"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15999
+ }, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1-beta.c0ca606a-6b3b-564d-94a5-be05027cc197"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16000
16000
  }
16001
16001
  configure(t) {
16002
16002
  mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && Lr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16105,7 +16105,7 @@ class Ad {
16105
16105
  const C = ((h = (u = this.customer) == null ? void 0 : u.bundleStakeholders) == null ? void 0 : h.find(
16106
16106
  (w) => {
16107
16107
  var S, y;
16108
- return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((I) => I.id === t);
16108
+ return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((E) => E.id === t);
16109
16109
  }
16110
16110
  )) || ((g = (m = this.customer) == null ? void 0 : m.stakeholders) == null ? void 0 : g.find(
16111
16111
  (w) => {
@@ -16332,11 +16332,11 @@ class Ad {
16332
16332
  * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
16333
16333
  */
16334
16334
  async getExistingBundle(t, e, a, n) {
16335
- var h, m, g, p, f, C, w, S, y, I, b;
16335
+ var h, m, g, p, f, C, w, S, y, E, b;
16336
16336
  const i = N.getMap("bundleOwnerIds"), s = i == null ? void 0 : i.get(t), o = {};
16337
16337
  try {
16338
- const E = await this.loggedInBearerToken();
16339
- o.Authorization = `Bearer ${E}`;
16338
+ const I = await this.loggedInBearerToken();
16339
+ o.Authorization = `Bearer ${I}`;
16340
16340
  } catch {
16341
16341
  const F = ((h = Object.entries(localStorage).find(([T, nt]) => T.startsWith("CognitoIdentityServiceProvider") && T.endsWith("idToken"))) == null ? void 0 : h[0]) || "", k = localStorage.getItem(F);
16342
16342
  k && !Wt(k) && (o.Authorization = `Bearer ${k}`);
@@ -16346,7 +16346,7 @@ class Ad {
16346
16346
  ...o,
16347
16347
  ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16348
16348
  }, c = await B.getShadowGraphqlClient().query({
16349
- query: zs(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16349
+ query: Gs(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16350
16350
  variables: {
16351
16351
  id: t
16352
16352
  },
@@ -16361,7 +16361,7 @@ class Ad {
16361
16361
  A.set(d.id, d.partner.id), N.setMap("bundlePartnerIds", A);
16362
16362
  const u = new Je(this, d, e, a, s, {
16363
16363
  additionalHeaders: (y = n == null ? void 0 : n.graphql) == null ? void 0 : y.additionalHeaders,
16364
- eagerFetchProducts: (b = (I = n == null ? void 0 : n.graphql) == null ? void 0 : I.productCollection) == null ? void 0 : b.eagerFetchProducts,
16364
+ eagerFetchProducts: (b = (E = n == null ? void 0 : n.graphql) == null ? void 0 : E.productCollection) == null ? void 0 : b.eagerFetchProducts,
16365
16365
  existingGlobalPropertyState: c.data.globalPropertyState,
16366
16366
  readonly: n == null ? void 0 : n.readonly
16367
16367
  });
@@ -16380,7 +16380,7 @@ class Ad {
16380
16380
  const C = await this.loggedInBearerToken();
16381
16381
  s.Authorization = `Bearer ${C}`;
16382
16382
  } catch {
16383
- const S = ((h = Object.entries(localStorage).find(([I, b]) => I.startsWith("CognitoIdentityServiceProvider") && I.endsWith("idToken"))) == null ? void 0 : h[0]) || "", y = localStorage.getItem(S);
16383
+ const S = ((h = Object.entries(localStorage).find(([E, b]) => E.startsWith("CognitoIdentityServiceProvider") && E.endsWith("idToken"))) == null ? void 0 : h[0]) || "", y = localStorage.getItem(S);
16384
16384
  y && !Wt(y) && (s.Authorization = `Bearer ${y}`);
16385
16385
  }
16386
16386
  const o = {
@@ -16487,19 +16487,19 @@ class Ad {
16487
16487
  var D, F, k;
16488
16488
  if (y.length === 0)
16489
16489
  return [];
16490
- const I = y.map((T) => T.option.transactionId), b = await a.query({
16490
+ const E = y.map((T) => T.option.transactionId), b = await a.query({
16491
16491
  query: yi,
16492
16492
  variables: {
16493
- ids: I
16493
+ ids: E
16494
16494
  },
16495
16495
  errorPolicy: "all",
16496
16496
  fetchPolicy: "no-cache"
16497
- }), E = b.data.transactions;
16498
- if (E.length !== y.length) {
16497
+ }), I = b.data.transactions;
16498
+ if (I.length !== y.length) {
16499
16499
  const T = ((F = (D = b.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16500
16500
  throw new ut(`Not all transactions were found: ${T}`);
16501
16501
  }
16502
- return !this.activeIntegration && ((k = E[0].integrationProduct) != null && k.integration) && (this.activeIntegration = Promise.resolve(E[0].integrationProduct.integration)), E.map((T, nt) => {
16502
+ return !this.activeIntegration && ((k = I[0].integrationProduct) != null && k.integration) && (this.activeIntegration = Promise.resolve(I[0].integrationProduct.integration)), I.map((T, nt) => {
16503
16503
  var R;
16504
16504
  return {
16505
16505
  transaction: T,
@@ -16509,10 +16509,10 @@ class Ad {
16509
16509
  };
16510
16510
  });
16511
16511
  }, i = async (y) => {
16512
- var E, D, F;
16512
+ var I, D, F;
16513
16513
  if (y.length === 0)
16514
16514
  return [];
16515
- const I = await a.mutate({
16515
+ const E = await a.mutate({
16516
16516
  mutation: wi,
16517
16517
  variables: {
16518
16518
  inputs: y.map((k) => ({
@@ -16528,9 +16528,9 @@ class Ad {
16528
16528
  },
16529
16529
  errorPolicy: "all",
16530
16530
  fetchPolicy: "no-cache"
16531
- }), b = (E = I.data) == null ? void 0 : E.transactionCreateMany;
16531
+ }), b = (I = E.data) == null ? void 0 : I.transactionCreateMany;
16532
16532
  if (!b || b.length === 0) {
16533
- const k = ((F = (D = I.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16533
+ const k = ((F = (D = E.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16534
16534
  throw new ut(`Failed to create transactions: ${k}`);
16535
16535
  }
16536
16536
  return b.map((k, T) => ({
@@ -16539,35 +16539,35 @@ class Ad {
16539
16539
  readOnly: !1,
16540
16540
  index: y[T].index
16541
16541
  }));
16542
- }, s = t.map((y, I) => ({ option: y, index: I })), o = s.filter((y) => y.option.type === "transaction"), l = s.filter(
16542
+ }, s = t.map((y, E) => ({ option: y, index: E })), o = s.filter((y) => y.option.type === "transaction"), l = s.filter(
16543
16543
  (y) => y.option.type === "integration" || y.option.type === "external"
16544
16544
  ), c = xa(o, 10), d = xa(l, 10), A = (await Promise.all([
16545
16545
  ...c.map(n),
16546
16546
  ...d.map(i)
16547
16547
  ])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await ar(u, e), m = new Map(h.map((y) => [y.id, y])), g = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
16548
16548
  var tt;
16549
- const { transaction: I, workflowId: b, readOnly: E, index: D } = y, F = m.get(b), k = t[D];
16550
- !g.get(I.id) && I.transactionOwnerId && g.set(I.id, I.transactionOwnerId);
16551
- const T = g.get(I.id) || void 0, nt = new Fl({
16549
+ const { transaction: E, workflowId: b, readOnly: I, index: D } = y, F = m.get(b), k = t[D];
16550
+ !g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
16551
+ const T = g.get(E.id) || void 0, nt = new Fl({
16552
16552
  onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
16553
16553
  onQuery: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } })
16554
16554
  }), R = {
16555
- product: I.product,
16556
- transaction: I,
16555
+ product: E.product,
16556
+ transaction: E,
16557
16557
  layouts: [],
16558
16558
  singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16559
- stateMutationFunc: E ? async () => {
16560
- throw new z("State mutation is forbidden in read only mode!");
16561
- } : async (Z) => (console.log("LOG: updating transaction"), this.updateTransactionState({
16559
+ stateMutationFunc: I ? async () => {
16560
+ throw new G("State mutation is forbidden in read only mode!");
16561
+ } : async (Z) => (console.log("LOG: updating transaction"), console.trace(), this.updateTransactionState({
16562
16562
  ...Z,
16563
16563
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
16564
16564
  })),
16565
16565
  graphQlClient: () => nt,
16566
- readOnly: E,
16566
+ readOnly: I,
16567
16567
  workflow: F,
16568
16568
  isReloadedTransaction: k.type === "transaction"
16569
16569
  };
16570
- if (!E && k.workflowState) {
16570
+ if (!I && k.workflowState) {
16571
16571
  const Z = JSON.parse(k.workflowState);
16572
16572
  R.layouts = Object.values(Z.layouts || {}).map((Nt) => Nt.layout), await cs(Z), R.reloadedState = Z;
16573
16573
  } else
@@ -16580,9 +16580,9 @@ class Ad {
16580
16580
  ), R.delayWorkflowStateSync = !0, { experienceOptions: R, index: D, options: k };
16581
16581
  }), f = await Promise.all(p);
16582
16582
  N.setMap("transactionOwnerIds", g);
16583
- const w = f.sort((y, I) => y.index - I.index).map(async (y) => {
16584
- const { experienceOptions: I, options: b } = y, E = new Vo(this, I);
16585
- return await E.getWorkflowManager().getInitializationPromise(), b.type !== "transaction" && this.customer && await E.attachCustomerDetails({ email: this.customer.emailAddress }), E;
16583
+ const w = f.sort((y, E) => y.index - E.index).map(async (y) => {
16584
+ const { experienceOptions: E, options: b } = y, I = new Vo(this, E);
16585
+ return await I.getWorkflowManager().getInitializationPromise(), b.type !== "transaction" && this.customer && await I.attachCustomerDetails({ email: this.customer.emailAddress }), I;
16586
16586
  }), S = await Promise.all(w);
16587
16587
  return S.forEach((y) => y.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), S;
16588
16588
  }
@@ -16856,7 +16856,7 @@ class Ul {
16856
16856
  if (!n || !this.frameData)
16857
16857
  return;
16858
16858
  if (this.frameData.length !== t.length)
16859
- throw new z(
16859
+ throw new G(
16860
16860
  "Frame data and offsets are not the same length. This is a bug. Please report it."
16861
16861
  );
16862
16862
  if (!this.offsets.some((s, o) => !(t[o].x === s.x && t[o].y === s.y && t[o].zoom === s.zoom)) && !a) {
@@ -16900,9 +16900,9 @@ class Ul {
16900
16900
  */
16901
16901
  updateFrameOffsets(t, e, a, n, i) {
16902
16902
  if (!a || a.length === 0 || a.some((o) => !o))
16903
- throw new z("Frame data not set. This is a bug");
16903
+ throw new G("Frame data not set. This is a bug");
16904
16904
  if (!this.workflowManager)
16905
- throw new z("No workflow manager set, cannot update offsets.");
16905
+ throw new G("No workflow manager set, cannot update offsets.");
16906
16906
  const s = this.workflowManager.getCommandDispatcher();
16907
16907
  this.targetElements.forEach((o, l) => {
16908
16908
  s(
@@ -17279,7 +17279,7 @@ class Vl extends it {
17279
17279
  return this.manager.getStepStorage(this.step.stepName);
17280
17280
  }
17281
17281
  }
17282
- const Gl = v`
17282
+ const zl = v`
17283
17283
  query GetLoggedInCustomer($email: String!) {
17284
17284
  customer(emailAddress: $email) {
17285
17285
  id
@@ -17322,7 +17322,7 @@ const Gl = v`
17322
17322
  total
17323
17323
  }
17324
17324
  }
17325
- `, zl = v`
17325
+ `, Gl = v`
17326
17326
  mutation SetTransactionDesignName($id: String!, $name: String!) {
17327
17327
  transactionUpdate(id: $id, designName: $name) {
17328
17328
  id
@@ -17408,7 +17408,7 @@ const Gl = v`
17408
17408
  },
17409
17409
  context: e
17410
17410
  }), Cd = async (r, t) => await B.getShadowGraphqlClient().mutate({
17411
- mutation: zl,
17411
+ mutation: Gl,
17412
17412
  errorPolicy: "all",
17413
17413
  variables: {
17414
17414
  id: r,
@@ -17429,7 +17429,7 @@ const Gl = v`
17429
17429
  template: t
17430
17430
  }
17431
17431
  }), Sd = async (r) => (await B.getShadowGraphqlClient().query({
17432
- query: Gl,
17432
+ query: zl,
17433
17433
  errorPolicy: "all",
17434
17434
  variables: {
17435
17435
  email: r
@@ -17746,7 +17746,7 @@ export {
17746
17746
  ic as AddressValidationJobStatus,
17747
17747
  rc as AddressValidationResultConfirmationLevel,
17748
17748
  cd as ArrayInput,
17749
- G as AspectType,
17749
+ z as AspectType,
17750
17750
  St as AssetNotFoundError,
17751
17751
  Ce as AssetType,
17752
17752
  ad as BringForwardCommand,
@@ -17826,7 +17826,7 @@ export {
17826
17826
  Bo as TextStepHandle,
17827
17827
  pl as Transform,
17828
17828
  gl as TransformCollection,
17829
- z as UnhandledBehaviorError,
17829
+ G as UnhandledBehaviorError,
17830
17830
  Ir as UnitOfMeasurement,
17831
17831
  Zc as UpdateImageSourceCommand,
17832
17832
  st as Variant,
@@ -17840,7 +17840,7 @@ export {
17840
17840
  Mc as dataUrlFromExternalUrl,
17841
17841
  Ye as designService,
17842
17842
  pe as determineCorrectFontSizeAndLines,
17843
- Gn as digitalContentStepService,
17843
+ zn as digitalContentStepService,
17844
17844
  dt as domParser,
17845
17845
  wd as duplicateBundle,
17846
17846
  yd as duplicateTransaction,
@@ -17865,13 +17865,13 @@ export {
17865
17865
  Qe as getFrameData,
17866
17866
  rd as getGlobalPropertyStateForBundle,
17867
17867
  Ol as getIntegration,
17868
- Gc as getNEPoint,
17868
+ zc as getNEPoint,
17869
17869
  Vc as getNWPoint,
17870
17870
  Bd as getOrderedTransactions,
17871
17871
  hd as getOverrideThemeConfiguration,
17872
17872
  Lc as getPointOfRotation,
17873
17873
  od as getProductCollections,
17874
- zc as getSEPoint,
17874
+ Gc as getSEPoint,
17875
17875
  Sa as getSvgElement,
17876
17876
  Pd as getTemplateBundles,
17877
17877
  Id as getTemplateTransactions,
@@ -17888,7 +17888,7 @@ export {
17888
17888
  $c as isCloseToValue,
17889
17889
  Tt as loadFont,
17890
17890
  Nc as matchHexToPms,
17891
- zn as materialStepService,
17891
+ Gn as materialStepService,
17892
17892
  hl as metafieldManager,
17893
17893
  Hc as mmPerPixel,
17894
17894
  Wn as modelStepService,
@@ -17911,7 +17911,7 @@ export {
17911
17911
  pa as sanitizeSvgTree,
17912
17912
  Lr as setBearerAuthenticationToken,
17913
17913
  pn as setCanvasModule,
17914
- Gt as shapeStepService,
17914
+ zt as shapeStepService,
17915
17915
  fs as shortenUrl,
17916
17916
  mt as spiffCoreConfiguration,
17917
17917
  id as stepAspectValuesToDesignInputSteps,