@spiffcommerce/core 27.2.1-beta.5756496b-3a49-5000-b986-4209fb32572c → 27.2.1-beta.6052719b-af8d-5bf1-8a8e-b0e595b7c178

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 St from "lodash.clonedeep";
11
11
  import { toString as sn } from "qrcode";
12
12
  import mr from "svg-path-bbox";
13
13
  import { parse as Xe } from "opentype.js";
14
- import { jsx as F, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
14
+ import { jsx as F, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
15
15
  import gr from "handlebars";
16
16
  import { dataUriToBuffer as pr } from "data-uri-to-buffer";
17
17
  import Fa from "lodash.chunk";
@@ -21,7 +21,7 @@ import { split as Ze } from "unicode-default-word-boundary";
21
21
  import ln from "lodash.debounce";
22
22
  import "fs";
23
23
  import "path";
24
- 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 || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), 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 || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), q = /* @__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))(q || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
24
+ 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 || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), qt = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(qt || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), 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 || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
25
25
  class cn extends Error {
26
26
  constructor(t) {
27
27
  super(t), this.name = this.constructor.name;
@@ -47,7 +47,7 @@ class vt extends _t {
47
47
  super(`Asset not found for variant: ${t.name}`), this.variant = t;
48
48
  }
49
49
  }
50
- class qt extends _t {
50
+ class Ht extends _t {
51
51
  constructor(t) {
52
52
  super(`Resource not found for asset: ${t.name}`), this.asset = t;
53
53
  }
@@ -62,7 +62,7 @@ class De extends cn {
62
62
  super(`ImplementationError - ${t}`);
63
63
  }
64
64
  }
65
- class G extends De {
65
+ class z extends De {
66
66
  constructor(t) {
67
67
  super(`Unhandled Behavior Encountered: ${t}`);
68
68
  }
@@ -296,25 +296,25 @@ const Rr = (r) => {
296
296
  let mn;
297
297
  const $r = (r) => {
298
298
  mn = r;
299
- }, Ur = () => new Promise((r) => {
299
+ }, Lr = () => new Promise((r) => {
300
300
  const t = mt.getHubUrl(), e = (a) => {
301
301
  a.origin === t && (window.removeEventListener("message", e), r(a.data));
302
302
  };
303
303
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
304
- }), Lr = async () => {
304
+ }), Ur = async () => {
305
305
  const r = {
306
306
  applicationKey: ma,
307
307
  customerToken: Qr,
308
308
  bearer: mn
309
309
  };
310
- return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Ur(), ...r } : r;
310
+ return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Lr(), ...r } : r;
311
311
  };
312
312
  async function Vr(r, t) {
313
313
  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";
314
314
  let n = await rt(r, { ...t, redirect: "manual" });
315
315
  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;
316
316
  }
317
- class zr {
317
+ class Gr {
318
318
  constructor() {
319
319
  this.shadowGraphqlClient = this.constructShadowGraphqlClient(), mt.addServerUrlCallback(() => {
320
320
  this.shadowGraphqlClient = this.constructShadowGraphqlClient();
@@ -331,7 +331,7 @@ class zr {
331
331
  uri: `${mt.getServerUrl()}/graphql`,
332
332
  fetch: Vr
333
333
  }), e = lr(async (i, s) => {
334
- const { headers: o } = s, l = o || {}, c = await Lr();
334
+ const { headers: o } = s, l = o || {}, c = await Ur();
335
335
  let d = s.bearer ?? c.bearer;
336
336
  if (this.spiffClient)
337
337
  try {
@@ -366,7 +366,7 @@ class zr {
366
366
  });
367
367
  }
368
368
  }
369
- const b = new zr();
369
+ const b = new Gr();
370
370
  let aa, na;
371
371
  const gt = (r, t, e) => {
372
372
  if (aa !== void 0)
@@ -415,7 +415,7 @@ function ga() {
415
415
  return $e === void 0 && ($e = Fr()), $e;
416
416
  }
417
417
  let se = null;
418
- const Gr = (r) => new Promise((t) => {
418
+ const zr = (r) => new Promise((t) => {
419
419
  if (ke(r) !== "image/jpeg")
420
420
  return t(1);
421
421
  ur(r).then((a) => t(a || 1)).catch(() => t(1));
@@ -427,14 +427,14 @@ const Gr = (r) => new Promise((t) => {
427
427
  }, jr = (r) => {
428
428
  const e = r.naturalWidth / r.naturalHeight;
429
429
  return r.naturalHeight <= 8192 && r.naturalWidth <= 8192 ? [r.naturalWidth, r.naturalHeight] : r.naturalHeight > r.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
430
- }, Hr = async (r) => {
430
+ }, qr = async (r) => {
431
431
  var A;
432
432
  const t = await Tr(r), e = await Zt(t), [a, n] = jr(e);
433
433
  if (!await Wr()) {
434
434
  const u = gt(a, n);
435
435
  return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
436
436
  }
437
- const s = await Gr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
437
+ const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
438
438
  switch (s) {
439
439
  case 2:
440
440
  d.translate(o, 0), d.scale(-1, 1);
@@ -460,7 +460,7 @@ const Gr = (r) => new Promise((t) => {
460
460
  }
461
461
  return d.drawImage(e, 0, 0, o, l), c;
462
462
  }, Me = async (r) => {
463
- const t = await Hr(r);
463
+ const t = await qr(r);
464
464
  return ke(r) === "image/jpeg" ? {
465
465
  dataUrl: t.toDataURL("image/jpeg", 1),
466
466
  height: t.height,
@@ -3154,7 +3154,7 @@ const Gr = (r) => new Promise((t) => {
3154
3154
  "3E2B2E",
3155
3155
  "101820",
3156
3156
  "3D3935"
3157
- ], Ue = Ft.map((r) => [
3157
+ ], Le = Ft.map((r) => [
3158
3158
  parseInt(r.substring(0, 2), 16),
3159
3159
  parseInt(r.substring(2, 4), 16),
3160
3160
  parseInt(r.substring(4, 6), 16)
@@ -3163,12 +3163,12 @@ function Ic(r) {
3163
3163
  const t = Yt.indexOf(r);
3164
3164
  return t >= 0 ? Ft[t] : "";
3165
3165
  }
3166
- function qr(r) {
3166
+ function Hr(r) {
3167
3167
  const t = Ft.indexOf(r);
3168
3168
  return t >= 0 ? Yt[t] : "";
3169
3169
  }
3170
3170
  function Pc(r, t = 64) {
3171
- const e = [], a = [], n = qr(r);
3171
+ const e = [], a = [], n = Hr(r);
3172
3172
  n && e.push({
3173
3173
  pms: n,
3174
3174
  hex: r,
@@ -3177,7 +3177,7 @@ function Pc(r, t = 64) {
3177
3177
  const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
3178
3178
  let l, c, d;
3179
3179
  for (let A = 0; A < Ft.length; A++) {
3180
- l = Ue[A][0], c = Ue[A][1], d = Ue[A][2];
3180
+ l = Le[A][0], c = Le[A][1], d = Le[A][2];
3181
3181
  const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
3182
3182
  a.push(u);
3183
3183
  }
@@ -3556,7 +3556,7 @@ class di {
3556
3556
  if (this.cache.has(t)) {
3557
3557
  const n = this.cache.get(t);
3558
3558
  if (!n)
3559
- throw new G("Failed to get asset from cache!");
3559
+ throw new z("Failed to get asset from cache!");
3560
3560
  return n;
3561
3561
  }
3562
3562
  const a = (async () => (await ve([t]))[0])();
@@ -3583,7 +3583,7 @@ class di {
3583
3583
  */
3584
3584
  cacheAsset(t) {
3585
3585
  if (!t.key)
3586
- throw new G("Asset has no key!");
3586
+ throw new z("Asset has no key!");
3587
3587
  this.cache.has(t.key) || this.cache.set(t.key, Promise.resolve(t));
3588
3588
  }
3589
3589
  /**
@@ -3591,7 +3591,7 @@ class di {
3591
3591
  */
3592
3592
  cacheMaterial(t) {
3593
3593
  if (!t.id)
3594
- throw new G("Material has no id!");
3594
+ throw new z("Material has no id!");
3595
3595
  this.materialCache.has(t.id) || this.materialCache.set(t.id, Promise.resolve(t));
3596
3596
  }
3597
3597
  /**
@@ -3709,7 +3709,7 @@ class di {
3709
3709
  case "mkv":
3710
3710
  return "video/x-matroska";
3711
3711
  default:
3712
- throw new G("Unexpected mimetype: " + e);
3712
+ throw new z("Unexpected mimetype: " + e);
3713
3713
  }
3714
3714
  }
3715
3715
  }
@@ -3799,7 +3799,7 @@ class K {
3799
3799
  N.setMap($a, t);
3800
3800
  }
3801
3801
  }
3802
- const U = new di();
3802
+ const L = new di();
3803
3803
  class Ai {
3804
3804
  constructor() {
3805
3805
  this.cache = {}, this.disabled = !1;
@@ -3887,8 +3887,8 @@ const Jt = new Ai(), vn = v`
3887
3887
  });
3888
3888
  return t.data.options.forEach((e) => {
3889
3889
  var a, n;
3890
- (a = e.defaultVariant) != null && a.asset && U.cacheAsset(e.defaultVariant.asset), e.colorProfile && U.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
- i.asset && U.cacheAsset(i.asset), i.thumbnail && U.cacheAsset(i.thumbnail), i.material && U.cacheMaterial(i.material);
3890
+ (a = e.defaultVariant) != null && a.asset && L.cacheAsset(e.defaultVariant.asset), e.colorProfile && L.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
+ i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
3892
3892
  });
3893
3893
  }), t.data.options;
3894
3894
  }, mi = async (r, t) => (await t).find((a) => a.id === r), gi = async (r) => {
@@ -5134,7 +5134,7 @@ const Y = new pi(), En = v`
5134
5134
  internalId
5135
5135
  }
5136
5136
  }
5137
- `, Ot = [P.SilentIllustration, P.ProductOverlay], Ui = async (r) => {
5137
+ `, Ot = [P.SilentIllustration, P.ProductOverlay], Li = async (r) => {
5138
5138
  const t = [];
5139
5139
  r.introduction && t.push({
5140
5140
  name: "Introduction",
@@ -5152,7 +5152,7 @@ const Y = new pi(), En = v`
5152
5152
  silentSteps: []
5153
5153
  });
5154
5154
  for (const a of r.steps) {
5155
- const n = Li(a.stepName, r.stepGroups);
5155
+ const n = Ui(a.stepName, r.stepGroups);
5156
5156
  if (!n)
5157
5157
  t.push({
5158
5158
  name: a.stepName,
@@ -5189,7 +5189,7 @@ const Y = new pi(), En = v`
5189
5189
  ],
5190
5190
  silentSteps: []
5191
5191
  }), t;
5192
- }, Li = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5192
+ }, Ui = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5193
5193
  const a = t[e.targetStepName];
5194
5194
  if (a && a.selectedVariants) {
5195
5195
  const n = a.selectedVariants;
@@ -5206,7 +5206,7 @@ const Y = new pi(), En = v`
5206
5206
  silentSteps: r.silentSteps.filter((a) => yt(a, t))
5207
5207
  };
5208
5208
  return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
5209
- }, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null), zi = async (r, t, e = !1) => {
5209
+ }, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null), Gi = async (r, t, e = !1) => {
5210
5210
  var s;
5211
5211
  const a = Dt(r, t), n = [];
5212
5212
  for (const o of a)
@@ -5301,7 +5301,7 @@ class xn {
5301
5301
  const Q = () => {
5302
5302
  const r = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
5303
5303
  return r() + r() + "-" + r() + "-" + r() + "-" + r() + "-" + r() + r() + r();
5304
- }, Gi = ({
5304
+ }, zi = ({
5305
5305
  backgroundColor: r,
5306
5306
  outlineColor: t,
5307
5307
  borderRadius: e,
@@ -5317,7 +5317,7 @@ const Q = () => {
5317
5317
  width: u
5318
5318
  }) => {
5319
5319
  var E;
5320
- 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__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
5320
+ 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 === qt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
5321
5321
  /* @ts-ignore */
5322
5322
  /* @__PURE__ */ F("color-profile", { name: B.name, xlinkHref: B.key, children: " " }, I)
5323
5323
  )), S = n.map((B) => ({
@@ -5360,7 +5360,7 @@ const Q = () => {
5360
5360
  "g",
5361
5361
  {
5362
5362
  id: "element-group",
5363
- clipPath: a.purpose === Ht.FreeDesign ? "url(#viewboxClip)" : void 0,
5363
+ clipPath: a.purpose === qt.FreeDesign ? "url(#viewboxClip)" : void 0,
5364
5364
  children: y.map((B) => Qn(B)).filter((B) => !!B)
5365
5365
  }
5366
5366
  ),
@@ -5433,22 +5433,22 @@ const Q = () => {
5433
5433
  y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
5434
5434
  }), Pt = (r) => {
5435
5435
  switch (r) {
5436
- case q.North:
5437
- return q.East;
5438
- case q.East:
5439
- return q.South;
5440
- case q.South:
5441
- return q.West;
5442
- case q.West:
5443
- return q.North;
5444
- case q.Northwest:
5445
- return q.Northeast;
5446
- case q.Northeast:
5447
- return q.Southeast;
5448
- case q.Southeast:
5449
- return q.Southwest;
5450
- case q.Southwest:
5451
- return q.Northwest;
5436
+ case H.North:
5437
+ return H.East;
5438
+ case H.East:
5439
+ return H.South;
5440
+ case H.South:
5441
+ return H.West;
5442
+ case H.West:
5443
+ return H.North;
5444
+ case H.Northwest:
5445
+ return H.Northeast;
5446
+ case H.Northeast:
5447
+ return H.Southeast;
5448
+ case H.Southeast:
5449
+ return H.Southwest;
5450
+ case H.Southwest:
5451
+ return H.Northwest;
5452
5452
  }
5453
5453
  }, Oc = (r, t) => t > 45 && t <= 135 ? Pt(r) : t > 135 && t <= 225 ? Pt(Pt(r)) : t > 225 && t <= 315 ? Pt(Pt(Pt(r))) : r, $c = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
5454
5454
  const a = pt(r.rotation), n = {
@@ -5480,7 +5480,7 @@ const Q = () => {
5480
5480
  x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
5481
5481
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
5482
5482
  };
5483
- }, Uc = 0.352778, Lc = 0.035277, Fn = (r) => {
5483
+ }, Lc = 0.352778, Uc = 0.035277, Fn = (r) => {
5484
5484
  const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
5485
5485
  return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
5486
5486
  "g",
@@ -5505,7 +5505,7 @@ const Q = () => {
5505
5505
  }, kn = (r) => {
5506
5506
  var l;
5507
5507
  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);
5508
- return /* @__PURE__ */ ct(Gt, { children: [
5508
+ return /* @__PURE__ */ ct(zt, { children: [
5509
5509
  /* @__PURE__ */ F("defs", { children: (() => /* @__PURE__ */ F("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ F("path", { d: r.clipPath }) : /* @__PURE__ */ F("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5510
5510
  /* @__PURE__ */ ct(
5511
5511
  "g",
@@ -5545,8 +5545,8 @@ const Q = () => {
5545
5545
  return r.pattern.src;
5546
5546
  };
5547
5547
  if (!a())
5548
- return /* @__PURE__ */ F(Gt, {});
5549
- 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__ */ F(Gt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5548
+ return /* @__PURE__ */ F(zt, {});
5549
+ 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__ */ F(zt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5550
5550
  /* @__PURE__ */ F(
5551
5551
  "feColorMatrix",
5552
5552
  {
@@ -5590,7 +5590,7 @@ const Q = () => {
5590
5590
  src: a()
5591
5591
  }];
5592
5592
  };
5593
- return /* @__PURE__ */ ct(Gt, { children: [
5593
+ return /* @__PURE__ */ ct(zt, { children: [
5594
5594
  i(),
5595
5595
  /* @__PURE__ */ F(
5596
5596
  "g",
@@ -5677,14 +5677,14 @@ class ji {
5677
5677
  }), a - n;
5678
5678
  }
5679
5679
  }
5680
- const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
- if (Le.has(r))
5682
- return Le.get(r);
5680
+ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
+ if (Ue.has(r))
5682
+ return Ue.get(r);
5683
5683
  const e = (async () => {
5684
5684
  try {
5685
5685
  return Et(r).getFont();
5686
5686
  } catch {
5687
- if (Hi(r)) {
5687
+ if (qi(r)) {
5688
5688
  const a = hn(r), n = Xe(a);
5689
5689
  return ra(r, n), n;
5690
5690
  } else {
@@ -5693,8 +5693,8 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5693
5693
  }
5694
5694
  }
5695
5695
  })();
5696
- return Le.set(r, e), e;
5697
- }, qi = (r) => {
5696
+ return Ue.set(r, e), e;
5697
+ }, Hi = (r) => {
5698
5698
  const t = hn(r), e = Xe(t);
5699
5699
  return ra(r, e), e;
5700
5700
  }, Et = (r) => {
@@ -5742,7 +5742,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5742
5742
  }
5743
5743
  return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
5744
5744
  }, Ee = (r, t, e, a) => Math.max(_i(r.join(`
5745
- `), e, a), t), Ua = (r, t, e, a, n, i) => {
5745
+ `), e, a), t), La = (r, t, e, a, n, i) => {
5746
5746
  const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
5747
5747
  `);
5748
5748
  try {
@@ -5800,7 +5800,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5800
5800
  var c;
5801
5801
  const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5802
5802
  if (!e)
5803
- return Ua(t, r, t.fontSize, s, n, a);
5803
+ return La(t, r, t.fontSize, s, n, a);
5804
5804
  let o;
5805
5805
  if (t.text ? o = t.text.split(`
5806
5806
  `) : o = ((c = t.input) == null ? void 0 : c.split(`
@@ -5817,7 +5817,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5817
5817
  requiredHeight: t.height,
5818
5818
  requiredWidth: Ee(o, t.width, s, n),
5819
5819
  fontSize: Yi(o, n, i, t.width, t.height, a)
5820
- } : Ua(t, r, t.fontSize, s, n, a);
5820
+ } : La(t, r, t.fontSize, s, n, a);
5821
5821
  }, Ki = (r, t, e, a, n) => {
5822
5822
  const s = Et(t.assetUrl).getFont();
5823
5823
  let o = { ...r };
@@ -5846,12 +5846,12 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5846
5846
  return r.forEach((n) => {
5847
5847
  a = Math.max(a, ht(n, t, e));
5848
5848
  }), a;
5849
- }, La = {
5849
+ }, Ua = {
5850
5850
  stripControlCharacters: !0,
5851
5851
  vertical: !1,
5852
5852
  uppercase: !1
5853
- }, Be = (r, t = La) => {
5854
- const e = { ...La, ...t };
5853
+ }, Be = (r, t = Ua) => {
5854
+ const e = { ...Ua, ...t };
5855
5855
  let a = r || "";
5856
5856
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
5857
5857
  `)), a;
@@ -5890,7 +5890,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5890
5890
  var w;
5891
5891
  return r.textFillImage ? `url("#${s}")` : (w = r._renderingConfiguration) != null && w.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${fn(r.fillSpotColorDefinition)}` : r.fill;
5892
5892
  };
5893
- return /* @__PURE__ */ ct(Gt, { children: [
5893
+ return /* @__PURE__ */ ct(zt, { children: [
5894
5894
  /* @__PURE__ */ ct("defs", { children: [
5895
5895
  r.textFillImage && /* @__PURE__ */ F(
5896
5896
  "pattern",
@@ -6046,7 +6046,7 @@ class rs {
6046
6046
  return this.state;
6047
6047
  }
6048
6048
  runStateCallbacks() {
6049
- console.log("LOG: running callbacks"), this.stateCallbacks.forEach((t) => t());
6049
+ this.stateCallbacks.forEach((t) => t());
6050
6050
  }
6051
6051
  apply(t, e) {
6052
6052
  if (!this.state)
@@ -6114,7 +6114,7 @@ class rs {
6114
6114
  layouts: {}
6115
6115
  };
6116
6116
  t.forEach((n) => {
6117
- a = new Un(n).apply(a);
6117
+ a = new Ln(n).apply(a);
6118
6118
  }), this.runStateCallbacks(), this.state = {
6119
6119
  transaction: a
6120
6120
  };
@@ -6127,7 +6127,7 @@ class rs {
6127
6127
  const Qn = (r) => r.type === M.Image ? /* @__PURE__ */ F(Fn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ F(Wi, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ F(ns, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ F(ts, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ F(kn, { ...r }, r.id) : null, Sa = (r, t, e) => {
6128
6128
  const a = e.renderingConfiguration, n = a != null && a.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
6129
6129
  return /* @__PURE__ */ F(
6130
- Gi,
6130
+ zi,
6131
6131
  {
6132
6132
  preserveAspectRatio: void 0,
6133
6133
  elements: n,
@@ -6174,7 +6174,7 @@ const ae = (r) => {
6174
6174
  if (r.defaultVariant !== void 0)
6175
6175
  return t.find((e) => e.id === r.defaultVariant);
6176
6176
  }
6177
- }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map(), Rn = async (r, t) => {
6177
+ }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Rn = async (r, t) => {
6178
6178
  if (!t) {
6179
6179
  if (!r)
6180
6180
  throw new Error("No region or src supplied. Cannot construct frame!");
@@ -6198,8 +6198,8 @@ const ae = (r) => {
6198
6198
  throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
6199
6199
  return e;
6200
6200
  }, Qe = async (r) => {
6201
- if (ze.has(r))
6202
- return ze.get(r);
6201
+ if (Ge.has(r))
6202
+ return Ge.get(r);
6203
6203
  const e = (async () => {
6204
6204
  if (Vt.has(r))
6205
6205
  return Vt.get(r);
@@ -6235,7 +6235,7 @@ const ae = (r) => {
6235
6235
  }
6236
6236
  throw new Error("Malformed frame SVG");
6237
6237
  })();
6238
- return ze.set(r, e), e;
6238
+ return Ge.set(r, e), e;
6239
6239
  }, Ea = (r, t, e, a) => {
6240
6240
  const n = t.width / t.height, i = r.width / r.height;
6241
6241
  let s;
@@ -6297,9 +6297,9 @@ const ae = (r) => {
6297
6297
  at(r).then((e) => {
6298
6298
  t(e);
6299
6299
  }).catch((e) => console.error(e));
6300
- }), Ge = /* @__PURE__ */ new Map(), Kt = async (r) => {
6301
- if (Ge.has(r))
6302
- return Ge.get(r);
6300
+ }), ze = /* @__PURE__ */ new Map(), Kt = async (r) => {
6301
+ if (ze.has(r))
6302
+ return ze.get(r);
6303
6303
  const t = async (n) => new Promise((i, s) => {
6304
6304
  try {
6305
6305
  if (!(!!URL && !!URL.createObjectURL))
@@ -6331,8 +6331,8 @@ const ae = (r) => {
6331
6331
  A.resize(m, m);
6332
6332
  return await A.render(), await t(c);
6333
6333
  })();
6334
- return Ge.set(r, a), a;
6335
- }, Ut = async (r, t, e, a) => {
6334
+ return ze.set(r, a), a;
6335
+ }, Lt = async (r, t, e, a) => {
6336
6336
  const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
6337
6337
  width: r.layoutState.layout.width,
6338
6338
  height: r.layoutState.layout.height,
@@ -6364,9 +6364,9 @@ const ae = (r) => {
6364
6364
  }
6365
6365
  return o;
6366
6366
  };
6367
- class zc {
6367
+ class Gc {
6368
6368
  static async getFrame(t, e) {
6369
- const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Ut(t, M.Frame);
6369
+ const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Lt(t, M.Frame);
6370
6370
  return {
6371
6371
  id: Q(),
6372
6372
  x: i.left,
@@ -6392,7 +6392,7 @@ class zc {
6392
6392
  };
6393
6393
  }
6394
6394
  static async getImage(t, e) {
6395
- const a = e.region || await Ut(t, M.Image, e.src);
6395
+ const a = e.region || await Lt(t, M.Image, e.src);
6396
6396
  return {
6397
6397
  id: Q(),
6398
6398
  src: e.src,
@@ -6416,7 +6416,7 @@ class zc {
6416
6416
  }, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
6417
6417
  vertical: a.vertical,
6418
6418
  uppercase: a.uppercase
6419
- }), A = e.region || await Ut(t, M.Textbox, n, {
6419
+ }), A = e.region || await Lt(t, M.Textbox, n, {
6420
6420
  text: d,
6421
6421
  fontScale: a.size ? a.size / s.unitsPerEm : void 0
6422
6422
  }), u = ee(
@@ -6482,7 +6482,7 @@ class zc {
6482
6482
  </svg>
6483
6483
  `, n = {};
6484
6484
  n["spiff-fill-shape"] = { browserValue: e.color };
6485
- const i = e.region || await Ut(t, M.Illustration), s = Q();
6485
+ const i = e.region || await Lt(t, M.Illustration), s = Q();
6486
6486
  return {
6487
6487
  stepRegion: e.region,
6488
6488
  colors: n,
@@ -6500,7 +6500,7 @@ class zc {
6500
6500
  };
6501
6501
  }
6502
6502
  static async getIllustration(t, e) {
6503
- const a = e.region || await Ut(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6503
+ const a = e.region || await Lt(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6504
6504
  return {
6505
6505
  cachedObjectURL: i,
6506
6506
  stepRegion: e.region,
@@ -6525,7 +6525,7 @@ class V extends Error {
6525
6525
  super("Element not found!"), Object.setPrototypeOf(this, V.prototype);
6526
6526
  }
6527
6527
  }
6528
- const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6528
+ const U = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6529
6529
  const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
6530
6530
  if (!e)
6531
6531
  throw new V();
@@ -6537,7 +6537,7 @@ const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6537
6537
  elements: a,
6538
6538
  modificationID: Q()
6539
6539
  };
6540
- }, za = async (r) => {
6540
+ }, Ga = async (r) => {
6541
6541
  var a;
6542
6542
  const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
6543
6543
  for (let n = 0; n < e.length; n++) {
@@ -6599,7 +6599,7 @@ class O {
6599
6599
  this.oldState = t;
6600
6600
  }
6601
6601
  }
6602
- class Ga extends O {
6602
+ class za extends O {
6603
6603
  constructor(t) {
6604
6604
  super(), this.serializableWorkflow = t;
6605
6605
  }
@@ -6610,13 +6610,13 @@ class Ga extends O {
6610
6610
  };
6611
6611
  }
6612
6612
  }
6613
- class Gc extends O {
6613
+ class zc extends O {
6614
6614
  constructor(t, e, a) {
6615
6615
  super(), this.id = t, this.x = e, this.y = a;
6616
6616
  }
6617
6617
  apply(t) {
6618
6618
  this.oldState = t;
6619
- const e = L(this.id, Object.values(t.layouts));
6619
+ const e = U(this.id, Object.values(t.layouts));
6620
6620
  if (!e.id)
6621
6621
  throw new V();
6622
6622
  const a = {
@@ -6639,7 +6639,7 @@ class Wc extends O {
6639
6639
  }
6640
6640
  apply(t) {
6641
6641
  this.oldState = t;
6642
- const e = L(this.id, Object.values(t.layouts));
6642
+ const e = U(this.id, Object.values(t.layouts));
6643
6643
  if (!e.id)
6644
6644
  throw new V();
6645
6645
  const a = {
@@ -6661,7 +6661,7 @@ class jc extends O {
6661
6661
  }
6662
6662
  apply(t) {
6663
6663
  this.oldState = t;
6664
- const e = L(this.id, Object.values(t.layouts));
6664
+ const e = U(this.id, Object.values(t.layouts));
6665
6665
  if (!e.id)
6666
6666
  throw new V();
6667
6667
  let a = {
@@ -6694,7 +6694,7 @@ class $ extends O {
6694
6694
  return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
6695
6695
  }
6696
6696
  }
6697
- class Un extends O {
6697
+ class Ln extends O {
6698
6698
  constructor(t) {
6699
6699
  super(), this.layout = t;
6700
6700
  }
@@ -6800,7 +6800,7 @@ class ss extends O {
6800
6800
  }
6801
6801
  apply(t) {
6802
6802
  this.oldState = t;
6803
- const e = L(this.id, Object.values(t.layouts));
6803
+ const e = U(this.id, Object.values(t.layouts));
6804
6804
  if (!e.id)
6805
6805
  throw new V();
6806
6806
  const a = {
@@ -6824,7 +6824,7 @@ class We extends O {
6824
6824
  }
6825
6825
  apply(t) {
6826
6826
  this.oldState = t;
6827
- const e = L(this.id, Object.values(t.layouts));
6827
+ const e = U(this.id, Object.values(t.layouts));
6828
6828
  if (!e.id)
6829
6829
  throw new V();
6830
6830
  const a = {
@@ -6846,7 +6846,7 @@ class os extends O {
6846
6846
  }
6847
6847
  apply(t) {
6848
6848
  this.oldState = t;
6849
- const e = L(this.id, Object.values(t.layouts));
6849
+ const e = U(this.id, Object.values(t.layouts));
6850
6850
  if (!e.id)
6851
6851
  throw new V();
6852
6852
  const a = {
@@ -6868,7 +6868,7 @@ class Wa extends O {
6868
6868
  }
6869
6869
  apply(t) {
6870
6870
  this.oldState = t;
6871
- const e = L(this.id, Object.values(t.layouts));
6871
+ const e = U(this.id, Object.values(t.layouts));
6872
6872
  if (!e.id)
6873
6873
  throw new V();
6874
6874
  const a = {
@@ -6890,7 +6890,7 @@ class ls extends O {
6890
6890
  }
6891
6891
  apply(t) {
6892
6892
  this.oldState = t;
6893
- const e = L(this.id, Object.values(t.layouts));
6893
+ const e = U(this.id, Object.values(t.layouts));
6894
6894
  if (!e.id)
6895
6895
  throw new V();
6896
6896
  const a = {
@@ -6948,7 +6948,7 @@ class ds extends O {
6948
6948
  }
6949
6949
  apply(t) {
6950
6950
  this.oldState = t;
6951
- const e = L(this.id, Object.values(t.layouts));
6951
+ const e = U(this.id, Object.values(t.layouts));
6952
6952
  if (!e.id)
6953
6953
  throw new V();
6954
6954
  const a = {
@@ -6967,13 +6967,13 @@ class ds extends O {
6967
6967
  };
6968
6968
  }
6969
6969
  }
6970
- class Hc extends O {
6970
+ class qc extends O {
6971
6971
  constructor(t, e) {
6972
6972
  super(), this.id = t, this.src = e;
6973
6973
  }
6974
6974
  apply(t) {
6975
6975
  this.oldState = t;
6976
- const e = L(this.id, Object.values(t.layouts));
6976
+ const e = U(this.id, Object.values(t.layouts));
6977
6977
  if (!e.id)
6978
6978
  throw new V();
6979
6979
  const a = {
@@ -6995,7 +6995,7 @@ class As extends O {
6995
6995
  }
6996
6996
  apply(t) {
6997
6997
  this.oldState = t;
6998
- const e = L(this.id, Object.values(t.layouts));
6998
+ const e = U(this.id, Object.values(t.layouts));
6999
6999
  if (!e.id)
7000
7000
  throw new V();
7001
7001
  const a = X(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
@@ -7014,7 +7014,7 @@ class je extends O {
7014
7014
  }
7015
7015
  apply(t) {
7016
7016
  this.oldState = t;
7017
- const e = L(this.id, Object.values(t.layouts));
7017
+ const e = U(this.id, Object.values(t.layouts));
7018
7018
  if (!e.id)
7019
7019
  throw new V();
7020
7020
  const a = {
@@ -7037,7 +7037,7 @@ class oa extends O {
7037
7037
  }
7038
7038
  apply(t) {
7039
7039
  this.oldState = t;
7040
- const e = L(this.id, Object.values(t.layouts));
7040
+ const e = U(this.id, Object.values(t.layouts));
7041
7041
  if (!e.id)
7042
7042
  throw new V();
7043
7043
  const a = e.colors || {}, n = a[this.className];
@@ -7069,7 +7069,7 @@ class us extends O {
7069
7069
  }
7070
7070
  apply(t) {
7071
7071
  this.oldState = t;
7072
- const e = L(this.id, Object.values(t.layouts));
7072
+ const e = U(this.id, Object.values(t.layouts));
7073
7073
  if (!e.id)
7074
7074
  throw new V();
7075
7075
  const a = {
@@ -7086,7 +7086,7 @@ class us extends O {
7086
7086
  };
7087
7087
  }
7088
7088
  }
7089
- class qc extends O {
7089
+ class Hc extends O {
7090
7090
  /**
7091
7091
  * @param id The targeted element to bring to the front.
7092
7092
  */
@@ -7094,7 +7094,7 @@ class qc extends O {
7094
7094
  super(), this.id = t;
7095
7095
  }
7096
7096
  apply(t) {
7097
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7097
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7098
7098
  throw new V();
7099
7099
  const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
7100
7100
  if (!a)
@@ -7124,7 +7124,7 @@ class Yc extends O {
7124
7124
  }
7125
7125
  apply(t) {
7126
7126
  this.oldState = t;
7127
- const e = L(this.id, Object.values(t.layouts));
7127
+ const e = U(this.id, Object.values(t.layouts));
7128
7128
  if (!e.id)
7129
7129
  throw new V();
7130
7130
  const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
@@ -7154,7 +7154,7 @@ class Jc extends O {
7154
7154
  super(), this.id = t;
7155
7155
  }
7156
7156
  apply(t) {
7157
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7157
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7158
7158
  throw new V();
7159
7159
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7160
7160
  if (!a)
@@ -7181,7 +7181,7 @@ class Kc extends O {
7181
7181
  super(), this.id = t;
7182
7182
  }
7183
7183
  apply(t) {
7184
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7184
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7185
7185
  throw new V();
7186
7186
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7187
7187
  if (!a)
@@ -7315,7 +7315,7 @@ const hs = async (r) => {
7315
7315
  throw console.error(e), new xe("Failed to shorten URL, see console.");
7316
7316
  }
7317
7317
  };
7318
- class Ln {
7318
+ class Un {
7319
7319
  async poll() {
7320
7320
  try {
7321
7321
  if (await this.predicate()) {
@@ -7362,12 +7362,12 @@ class ms {
7362
7362
  const h = (await ve([e]))[0], m = (p = (g = h == null ? void 0 : h.versions) == null ? void 0 : g.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
7363
7363
  return { asset: h, link: m };
7364
7364
  }, s = await new Promise((h, m) => {
7365
- new Ln(
7365
+ new Un(
7366
7366
  async () => !!(await i()).link,
7367
7367
  async () => {
7368
7368
  const g = await i();
7369
7369
  if (!g.link || !g.link)
7370
- throw new qt(g.asset);
7370
+ throw new Ht(g.asset);
7371
7371
  h({
7372
7372
  rel: "mpeg4",
7373
7373
  href: g.link
@@ -7442,7 +7442,7 @@ class be {
7442
7442
  const n = a.fileLink;
7443
7443
  if (n)
7444
7444
  return at(n, !0);
7445
- throw new qt(a);
7445
+ throw new Ht(a);
7446
7446
  };
7447
7447
  }
7448
7448
  async init(t, e, a) {
@@ -7456,7 +7456,7 @@ class be {
7456
7456
  const s = e.getWorkflowExperience().getBundle();
7457
7457
  if (s && t.globalPropertyAspectConfigurations) {
7458
7458
  const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
7459
- c && c.originalAssetKey && (i = (await U.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7459
+ c && c.originalAssetKey && (i = (await L.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7460
7460
  }
7461
7461
  if (t.option && t.option.variants && t.option.variants.length > 0) {
7462
7462
  const o = t.option, l = Y.getDefaultVariant(o);
@@ -7552,14 +7552,14 @@ class be {
7552
7552
  const o = e.fileLink || "";
7553
7553
  return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((c) => {
7554
7554
  a.addPoller(
7555
- new Ln(
7555
+ new Un(
7556
7556
  async () => {
7557
7557
  var h;
7558
- const A = (h = (await U.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7558
+ const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7559
7559
  return A ? (await rt(A.link)).status === 200 : !1;
7560
7560
  },
7561
7561
  () => {
7562
- U.getLocalOrFromServer(e.key || "").then((d) => {
7562
+ L.getLocalOrFromServer(e.key || "").then((d) => {
7563
7563
  this.loadPatternFromAsset(d, t, a, n).then(
7564
7564
  c
7565
7565
  );
@@ -7786,7 +7786,7 @@ class be {
7786
7786
  const a = t.fileLink;
7787
7787
  if (a)
7788
7788
  return a;
7789
- throw new qt(t);
7789
+ throw new Ht(t);
7790
7790
  }
7791
7791
  async loadPatternFromAsset(t, e, a, n) {
7792
7792
  var c, d;
@@ -7854,7 +7854,7 @@ class gs {
7854
7854
  if (a.length === 0)
7855
7855
  return [];
7856
7856
  try {
7857
- return L(
7857
+ return U(
7858
7858
  a[0].id,
7859
7859
  e.getAllLayoutData()
7860
7860
  ).colors;
@@ -7939,7 +7939,7 @@ class gs {
7939
7939
  var h, m;
7940
7940
  if (e.length === 0)
7941
7941
  return;
7942
- const s = L(
7942
+ const s = U(
7943
7943
  e[0].id,
7944
7944
  n().map((g) => g.layoutState)
7945
7945
  ), o = { ...s.colors }, l = {};
@@ -7991,7 +7991,7 @@ class gs {
7991
7991
  throw new vt(e);
7992
7992
  const l = o.fileLink;
7993
7993
  if (!l)
7994
- throw new qt(o);
7994
+ throw new Ht(o);
7995
7995
  const c = await lt(await this.getIllustrationBody(l)), d = await Kt(c.svg), A = (C) => {
7996
7996
  const w = i.getLayouts().find((y) => y.panelId === C.panelId);
7997
7997
  if (!w)
@@ -8143,7 +8143,7 @@ class ps {
8143
8143
  };
8144
8144
  }
8145
8145
  }
8146
- const zn = new ps();
8146
+ const Gn = new ps();
8147
8147
  class fs {
8148
8148
  async init(t, e, a) {
8149
8149
  const n = t.option;
@@ -8229,7 +8229,7 @@ class fs {
8229
8229
  };
8230
8230
  }
8231
8231
  }
8232
- const Gn = new fs();
8232
+ const zn = new fs();
8233
8233
  class Cs {
8234
8234
  async init(t, e, a) {
8235
8235
  if (a)
@@ -8472,31 +8472,31 @@ class ys {
8472
8472
  }
8473
8473
  }
8474
8474
  async selectVariant(t, e, a) {
8475
- await a.getInitializationPromise();
8475
+ console.log("LOG: q select variant"), await a.getInitializationPromise();
8476
8476
  const n = await this.selectVariantLambda(t, e, a);
8477
- n && (n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
8477
+ n && (console.log("LOG: q select variant result"), n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
8478
8478
  }
8479
8479
  async selectVariantLambda(t, e, a) {
8480
8480
  const n = t.option;
8481
8481
  if (!n)
8482
- return null;
8482
+ return console.log("LOG: q select variant no option"), null;
8483
8483
  const i = n.variants;
8484
8484
  if (!i)
8485
- return null;
8485
+ return console.log("LOG: q select variant no variants"), null;
8486
8486
  const s = i.length > 1 ? i.find((o) => o.id === e) : i[0];
8487
8487
  if (!s)
8488
- throw new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
8488
+ throw console.log("LOG: q select variant no variant"), new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
8489
8489
  return {
8490
8490
  command: void 0,
8491
8491
  followup: async () => {
8492
- await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
8492
+ console.log("LOG: q select variant follow up"), await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
8493
8493
  a.setMandatoryFulfilled(t.stepName, !0);
8494
8494
  });
8495
8495
  }
8496
8496
  };
8497
8497
  }
8498
8498
  }
8499
- const Hn = new ys();
8499
+ const qn = new ys();
8500
8500
  class Ss {
8501
8501
  constructor() {
8502
8502
  this.shapeFillId = "spiff-fill-shape";
@@ -8669,7 +8669,7 @@ class Ss {
8669
8669
  }
8670
8670
  }
8671
8671
  }
8672
- const zt = new Ss();
8672
+ const Gt = new Ss();
8673
8673
  class vs {
8674
8674
  constructor() {
8675
8675
  this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
@@ -8695,7 +8695,7 @@ class vs {
8695
8695
  );
8696
8696
  }
8697
8697
  }
8698
- const Es = new vs(), He = (r, t, e, a, n) => {
8698
+ const Es = new vs(), qe = (r, t, e, a, n) => {
8699
8699
  if (t.some((d) => d == null))
8700
8700
  throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
8701
8701
  let i = t.map((d) => d.split(`
@@ -8727,19 +8727,19 @@ const Es = new vs(), He = (r, t, e, a, n) => {
8727
8727
  const o = Et(t.assetUrl), l = o.getFont();
8728
8728
  if (n.size) {
8729
8729
  const u = r / l.unitsPerEm;
8730
- return [i, s] = He(e, a, r, u, o), [n.size, i, s];
8730
+ return [i, s] = qe(e, a, r, u, o), [n.size, i, s];
8731
8731
  }
8732
8732
  const c = 6;
8733
8733
  let d = c - Ve;
8734
8734
  if (a.length > 0) {
8735
8735
  let u = a, h = 0;
8736
8736
  for (; (!n.maxSize || d <= n.maxSize) && u; )
8737
- d += Ve, h = d / l.unitsPerEm, [u, s] = He(e, a, d, h, o);
8737
+ d += Ve, h = d / l.unitsPerEm, [u, s] = qe(e, a, d, h, o);
8738
8738
  }
8739
8739
  d > c && (d -= Ve), n.minSize && d < n.minSize && (d = n.minSize);
8740
8740
  const A = d / l.unitsPerEm;
8741
- return [i, s] = He(e, a, d, A, o), [d, i, s];
8742
- }, qe = 30;
8741
+ return [i, s] = qe(e, a, d, A, o), [d, i, s];
8742
+ }, He = 30;
8743
8743
  class Ie extends Error {
8744
8744
  constructor(t) {
8745
8745
  super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ie.name;
@@ -8786,12 +8786,14 @@ class bs {
8786
8786
  }
8787
8787
  async init(t, e, a) {
8788
8788
  var i, s, o, l;
8789
+ console.log(`LOG: t (${t.stepName}) init`);
8789
8790
  const n = t.option;
8790
8791
  if (!n)
8791
- return null;
8792
+ return console.log(`LOG: t (${t.stepName}) no option`), null;
8792
8793
  if (a)
8793
- await this.reload(t, e, a);
8794
+ console.log(`LOG: t (${t.stepName}) reload`), await this.reload(t, e, a);
8794
8795
  else {
8796
+ console.log(`LOG: t (${t.stepName}) no reload`);
8795
8797
  const c = this.getDefaultImageFillVariant(t.data), d = (i = c == null ? void 0 : c.asset) == null ? void 0 : i.fileLink, A = d ? await sa(d) : void 0, u = A ? {
8796
8798
  src: A.src,
8797
8799
  height: A.height,
@@ -8806,7 +8808,7 @@ class bs {
8806
8808
  if (p && t.globalPropertyAspectConfigurations) {
8807
8809
  const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
8808
8810
  var y;
8809
- return S.type === z.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
8811
+ return S.type === G.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
8810
8812
  });
8811
8813
  if (w) {
8812
8814
  const y = p.getGlobalPropertyStateManager().getAspect(w.name);
@@ -8827,7 +8829,7 @@ class bs {
8827
8829
  });
8828
8830
  const f = Y.getDefaultVariant(n);
8829
8831
  if (f)
8830
- return this.selectVariantCommand(
8832
+ return console.log(`LOG: t (${t.stepName}) variant`), this.selectVariantCommand(
8831
8833
  t,
8832
8834
  f,
8833
8835
  { text: g },
@@ -8841,10 +8843,10 @@ class bs {
8841
8843
  m
8842
8844
  );
8843
8845
  }
8844
- return null;
8846
+ return console.log(`LOG: t (${t.stepName}) end`), null;
8845
8847
  }
8846
8848
  findLayoutElements(t, e) {
8847
- return t.getRegionElements(e.stepName).map((i) => L(i.id, t.getAllLayoutData()));
8849
+ return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
8848
8850
  }
8849
8851
  /**
8850
8852
  * Get the colors that can be used for a given text step.
@@ -8992,7 +8994,7 @@ class bs {
8992
8994
  const l = [], c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
8993
8995
  for (const A of e) {
8994
8996
  if (!A.fontData)
8995
- throw new G("Failed to resolve font data for text.");
8997
+ throw new z("Failed to resolve font data for text.");
8996
8998
  const [u, h] = pe(
8997
8999
  A.fontSize,
8998
9000
  A.fontData,
@@ -9040,17 +9042,19 @@ class bs {
9040
9042
  a.serializableWorkflow.steps
9041
9043
  ), o = Object.values(a.layouts).map((m) => m.elements).flat().filter((m) => m.stepName === t.stepName), l = t.option;
9042
9044
  if (n != null && n.selectedVariants) {
9045
+ console.log(`LOG: text (${t.stepName}) reload selections`);
9043
9046
  const m = n.selectedVariants[0].id;
9044
9047
  if (l && m) {
9045
9048
  const g = (c = l.variants) == null ? void 0 : c.find((p) => p.id === m);
9046
9049
  if (g) {
9050
+ console.log(`LOG: text (${t.stepName}) reload selections variant`);
9047
9051
  const p = await this.fontDataFromVariant(g), f = o.map((y) => ({ id: y.id, region: y.stepRegion })), C = (d = n.storage) == null ? void 0 : d.color;
9048
9052
  let w = (A = n.storage) == null ? void 0 : A.text;
9049
9053
  const S = e.getWorkflowExperience().getBundle();
9050
9054
  if (S && t.globalPropertyAspectConfigurations) {
9051
9055
  const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, E = y == null ? void 0 : y.find((B) => {
9052
9056
  var I;
9053
- return B.type === z.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
9057
+ return B.type === G.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
9054
9058
  });
9055
9059
  if (E) {
9056
9060
  const I = S.getGlobalPropertyStateManager().getAspect(E.name);
@@ -9067,8 +9071,10 @@ class bs {
9067
9071
  e.getCommandDispatcher()(E);
9068
9072
  }
9069
9073
  ), o.length === 0 && l) {
9074
+ console.log(`LOG: text (${t.stepName}) reload cond`);
9070
9075
  const y = Y.getDefaultVariant(l);
9071
9076
  if (y) {
9077
+ console.log(`LOG: text (${t.stepName}) reload cond default`);
9072
9078
  const E = await this.selectVariantCommand(
9073
9079
  t,
9074
9080
  y,
@@ -9083,6 +9089,7 @@ class bs {
9083
9089
  e.getCommandDispatcher()(E.command);
9084
9090
  }
9085
9091
  } else {
9092
+ console.log(`LOG: text (${t.stepName}) reload noncond`);
9086
9093
  const { command: y } = j.updateInputText(
9087
9094
  w || "",
9088
9095
  o,
@@ -9094,16 +9101,18 @@ class bs {
9094
9101
  }
9095
9102
  }
9096
9103
  } else {
9104
+ console.log(`LOG: text (${t.stepName}) reload else`);
9097
9105
  const m = e.getWorkflowExperience().getBundle();
9098
9106
  if (m && t.globalPropertyAspectConfigurations) {
9099
9107
  const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
9100
9108
  var C;
9101
- return f.type === z.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9109
+ return f.type === G.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9102
9110
  });
9103
9111
  if (p) {
9104
9112
  const C = m.getGlobalPropertyStateManager().getAspect(p.name);
9105
- if (C)
9113
+ if (console.log(`LOG: text (${t.stepName}) reload else aspect, aspect text ${C}`), C)
9106
9114
  if (o.length === 0 && l) {
9115
+ console.log(`LOG: text (${t.stepName}) reload else aspect text a`);
9107
9116
  const w = Y.getDefaultVariant(l);
9108
9117
  if (w) {
9109
9118
  const S = await this.selectVariantCommand(
@@ -9120,6 +9129,7 @@ class bs {
9120
9129
  e.getCommandDispatcher()(S.command);
9121
9130
  }
9122
9131
  } else {
9132
+ console.log(`LOG: text (${t.stepName}) reload else aspect text b`);
9123
9133
  const { command: w } = j.updateInputText(
9124
9134
  C,
9125
9135
  o,
@@ -9160,7 +9170,7 @@ class bs {
9160
9170
  throw new vt(t);
9161
9171
  const a = e.fileLink;
9162
9172
  if (!a)
9163
- throw new qt(e);
9173
+ throw new Ht(e);
9164
9174
  const n = await Nt(a);
9165
9175
  return {
9166
9176
  assetUrl: a,
@@ -9184,7 +9194,7 @@ class bs {
9184
9194
  }
9185
9195
  const m = await this.changeInputTextWithRegion(
9186
9196
  t,
9187
- t.data.size || qe,
9197
+ t.data.size || He,
9188
9198
  A,
9189
9199
  a.text || "",
9190
9200
  a,
@@ -9209,7 +9219,7 @@ class bs {
9209
9219
  i
9210
9220
  ), m = await this.changeInputTextWithRegion(
9211
9221
  t,
9212
- t.data.size || qe,
9222
+ t.data.size || He,
9213
9223
  A,
9214
9224
  ((u = h[0]) == null ? void 0 : u.newElement.input) || a.text || t.data.defaultText || "",
9215
9225
  a,
@@ -9271,7 +9281,7 @@ class bs {
9271
9281
  stepName: t,
9272
9282
  align: this.textAlign(a),
9273
9283
  fill: i.color ? i.color : w,
9274
- fontSize: a.size || qe,
9284
+ fontSize: a.size || He,
9275
9285
  fontData: n,
9276
9286
  id: m,
9277
9287
  layer: A.layer,
@@ -9292,7 +9302,7 @@ class bs {
9292
9302
  fillSpotColorDefinition: f
9293
9303
  }, y = [], E = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
9294
9304
  if (!S.fontData)
9295
- throw new G("Failed to resolve font data for text.");
9305
+ throw new z("Failed to resolve font data for text.");
9296
9306
  const [I, D] = pe(
9297
9307
  S.fontSize,
9298
9308
  S.fontData,
@@ -9326,7 +9336,7 @@ class bs {
9326
9336
  }, d = await Promise.all(a.regions.map(c)).catch((A) => {
9327
9337
  throw A instanceof Ie ? (Es.setLatestToast("Failed to load font.", Re.Error), A) : A instanceof Pe ? A : new Error(A);
9328
9338
  });
9329
- return await s.setSelectionsAndElements(
9339
+ return console.log(`LOG: step (${t}) created ${d.length} new text elements for ${a.regions.length} regions`), await s.setSelectionsAndElements(
9330
9340
  t,
9331
9341
  [e],
9332
9342
  d.map((A) => A.regionElement),
@@ -9436,7 +9446,7 @@ function Ms(r, t, e, a) {
9436
9446
  const n = e / r, i = a / t;
9437
9447
  return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
9438
9448
  }
9439
- const Ha = {
9449
+ const qa = {
9440
9450
  m: ["x", "y"],
9441
9451
  z: [],
9442
9452
  l: ["x", "y"],
@@ -9466,7 +9476,7 @@ class Ts {
9466
9476
  const n = (i) => {
9467
9477
  const s = [], o = i.relative ? i.type : i.type.toUpperCase();
9468
9478
  let l = e !== o;
9469
- const c = Ha[i.type];
9479
+ const c = qa[i.type];
9470
9480
  l && (s.push(o), e = o);
9471
9481
  for (const d of c) {
9472
9482
  const A = i[d];
@@ -9491,7 +9501,7 @@ class Ts {
9491
9501
  const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
9492
9502
  let i;
9493
9503
  for (e.lastIndex = 0; i = e.exec(t); ) {
9494
- const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = Ha[s];
9504
+ const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = qa[s];
9495
9505
  if (o.length < c.length)
9496
9506
  throw new xt(
9497
9507
  `Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
@@ -9557,7 +9567,7 @@ class Ns extends Is {
9557
9567
  return this.svgElement(t, e);
9558
9568
  }
9559
9569
  svgElement(t, e) {
9560
- const a = qi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
9570
+ const a = Hi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
9561
9571
  const w = et("g");
9562
9572
  w.classList.add("module-text-group");
9563
9573
  const S = et("defs");
@@ -9588,10 +9598,10 @@ class Ns extends Is {
9588
9598
  return ks(p, C, e.height, e.width, 0.35, 0.65), Fs(u.outerHTML);
9589
9599
  }
9590
9600
  }
9591
- async function qn(r) {
9601
+ async function Hn(r) {
9592
9602
  if (r === "Vegemite")
9593
9603
  return new Ns();
9594
- throw new G(`Failed to resolve Module, Module ${r} not found`);
9604
+ throw new z(`Failed to resolve Module, Module ${r} not found`);
9595
9605
  }
9596
9606
  const ne = v`
9597
9607
  fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
@@ -9765,7 +9775,7 @@ const ne = v`
9765
9775
  }
9766
9776
  }
9767
9777
  }
9768
- `, Us = (r) => v`
9778
+ `, Ls = (r) => v`
9769
9779
  ${ne}
9770
9780
  ${re(r)}
9771
9781
  query GetBundle($id: String!) {
@@ -9809,7 +9819,7 @@ const ne = v`
9809
9819
  quoteId
9810
9820
  }
9811
9821
  }
9812
- `, qa = v`
9822
+ `, Ha = v`
9813
9823
  query GetBundleStakeholders($id: String!) {
9814
9824
  bundles(ids: [$id]) {
9815
9825
  id
@@ -9854,7 +9864,7 @@ const ne = v`
9854
9864
  }
9855
9865
  }
9856
9866
  }
9857
- `, Ls = v`
9867
+ `, Us = v`
9858
9868
  query GetBundlesForCustomer($id: String!) {
9859
9869
  customers(ids: [$id]) {
9860
9870
  bundleStakeholders {
@@ -9893,7 +9903,7 @@ const ne = v`
9893
9903
  }
9894
9904
  }
9895
9905
  }
9896
- `, zs = v`
9906
+ `, Gs = v`
9897
9907
  query GetProductCollectionForFilteredProducts(
9898
9908
  $id: String!
9899
9909
  $filters: ProductCollectionProductFilterInput
@@ -9916,7 +9926,7 @@ const ne = v`
9916
9926
  }
9917
9927
  }
9918
9928
  }
9919
- `, Gs = v`
9929
+ `, zs = v`
9920
9930
  ${ba}
9921
9931
  query GetProductCollectionForProductsFeed(
9922
9932
  $id: String!
@@ -10015,7 +10025,7 @@ const ne = v`
10015
10025
  }
10016
10026
  }
10017
10027
  }
10018
- `, Hs = v`
10028
+ `, qs = v`
10019
10029
  mutation UpdateBundle(
10020
10030
  $id: String!
10021
10031
  $name: String
@@ -10035,7 +10045,7 @@ const ne = v`
10035
10045
  id
10036
10046
  }
10037
10047
  }
10038
- `, qs = v`
10048
+ `, Hs = v`
10039
10049
  mutation BundleAddTransaction($id: String!, $transactionId: String!) {
10040
10050
  bundleAddTransaction(id: $id, transactionId: $transactionId) {
10041
10051
  id
@@ -10283,11 +10293,10 @@ class mo {
10283
10293
  var w;
10284
10294
  this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10285
10295
  var E;
10286
- if (console.log("LOG: render layouts"), !this.previewService)
10296
+ if (!this.previewService)
10287
10297
  return;
10288
- console.log("LOG: render layouts: service exists");
10289
10298
  const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
10290
- if (console.log(`LOG: render layouts: ${y == null ? void 0 : y.size} handles`), !!y)
10299
+ if (y)
10291
10300
  for (const [, B] of y)
10292
10301
  B.render(S);
10293
10302
  }, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = g, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, (w = this.renderableContextService) == null || w.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((S) => {
@@ -10394,7 +10403,7 @@ class mo {
10394
10403
  };
10395
10404
  this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
10396
10405
  this.storage[o.stepName] = o.storage || {};
10397
- }), this.allScenes = await Ui(t);
10406
+ }), this.allScenes = await Li(t);
10398
10407
  const n = Dt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
10399
10408
  this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
10400
10409
  }
@@ -10613,7 +10622,7 @@ class mo {
10613
10622
  const l = o[0];
10614
10623
  if (s.type === P.Model) {
10615
10624
  if (!this.modelContainer)
10616
- throw new G(
10625
+ throw new z(
10617
10626
  "We should always have a model container when injecting a preview!"
10618
10627
  );
10619
10628
  const u = (A = l.asset) == null ? void 0 : A.fileLink;
@@ -10638,7 +10647,7 @@ class mo {
10638
10647
  }
10639
10648
  s.data.targetMaterials.forEach((m) => {
10640
10649
  if (!this.modelContainer)
10641
- throw new G(
10650
+ throw new z(
10642
10651
  "We should always have a model container when injecting a preview!"
10643
10652
  );
10644
10653
  this.modelContainer.applyMaterialVariant(m, s.option.id, u);
@@ -10661,7 +10670,7 @@ class mo {
10661
10670
  };
10662
10671
  if (!on(a, this.storage)) {
10663
10672
  this.storage = a;
10664
- const n = new Ga(this.constructSerializableWorkflow());
10673
+ const n = new za(this.constructSerializableWorkflow());
10665
10674
  this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
10666
10675
  }
10667
10676
  }
@@ -10712,7 +10721,7 @@ class mo {
10712
10721
  serialize() {
10713
10722
  const t = this.getCommandContext().getState();
10714
10723
  if (!t)
10715
- throw new G("Attempted to serialize state before it was initialized.");
10724
+ throw new z("Attempted to serialize state before it was initialized.");
10716
10725
  const e = St(t.transaction), a = this.dehydrateState(e);
10717
10726
  return JSON.stringify(a);
10718
10727
  }
@@ -10850,6 +10859,9 @@ class mo {
10850
10859
  })
10851
10860
  ), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
10852
10861
  }
10862
+ unsetInitialized() {
10863
+ this.stepInitialised = {};
10864
+ }
10853
10865
  async setSelectionsAndElements(t, e, a, n) {
10854
10866
  var y;
10855
10867
  const i = this.stepSelections;
@@ -10876,7 +10888,7 @@ class mo {
10876
10888
  const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
10877
10889
  E == null || E.setTargetElements(a.map((B) => B.id));
10878
10890
  }
10879
- const p = u.map((E) => new Bt(E.id)), f = new Ga(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10891
+ const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10880
10892
  C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10881
10893
  const w = this.getInvalidModelVariants(), S = this.modelContainer;
10882
10894
  if (S) {
@@ -10896,7 +10908,7 @@ class mo {
10896
10908
  async ensureStepsAreLoaded() {
10897
10909
  const e = Dt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
10898
10910
  for (const l of n)
10899
- if (!this.stepInitialised[l.stepName])
10911
+ if (l.stepTitle === "Sleeve Message" && console.log(`LOG: is ${l.stepTitle} (${l.stepName}) inited? ${this.stepInitialised[l.stepName]}`), !this.stepInitialised[l.stepName])
10900
10912
  switch (this.stepInitialised[l.stepName] = !0, l.type) {
10901
10913
  case P.DigitalContent:
10902
10914
  a.push(
@@ -10917,15 +10929,15 @@ class mo {
10917
10929
  break;
10918
10930
  case P.Material:
10919
10931
  a.push(
10920
- zn.init(l, this, this.reloadedState)
10932
+ Gn.init(l, this, this.reloadedState)
10921
10933
  );
10922
10934
  break;
10923
10935
  case P.Model:
10924
- a.push(Gn.init(l, this, this.reloadedState));
10936
+ a.push(zn.init(l, this, this.reloadedState));
10925
10937
  break;
10926
10938
  case P.Module:
10927
10939
  this.stepSpecificServices[l.stepName] = {
10928
- module: await qn(l.data.module)
10940
+ module: await Hn(l.data.module)
10929
10941
  }, a.push(
10930
10942
  Wn.init(l, this, this.reloadedState)
10931
10943
  );
@@ -10937,14 +10949,14 @@ class mo {
10937
10949
  break;
10938
10950
  case P.Question:
10939
10951
  a.push(
10940
- Hn.init(l, this, this.reloadedState)
10952
+ qn.init(l, this, this.reloadedState)
10941
10953
  );
10942
10954
  break;
10943
10955
  case P.Shape:
10944
- a.push(zt.init(l, this, this.reloadedState));
10956
+ a.push(Gt.init(l, this, this.reloadedState));
10945
10957
  break;
10946
10958
  case P.Text:
10947
- a.push(j.init(l, this, this.reloadedState));
10959
+ console.log("LOG: ensure text loaded"), a.push(j.init(l, this, this.reloadedState));
10948
10960
  break;
10949
10961
  }
10950
10962
  const i = (await Promise.allSettled(a)).map((l) => {
@@ -11004,7 +11016,7 @@ class mo {
11004
11016
  this.validationCallbacks.forEach((t) => t(this.validationErrors));
11005
11017
  }
11006
11018
  traversableScenes() {
11007
- return zi(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
11019
+ return Gi(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
11008
11020
  }
11009
11021
  }
11010
11022
  class st {
@@ -11251,7 +11263,7 @@ class go extends it {
11251
11263
  const t = this.manager.getRegionElements(this.step.stepName) || [];
11252
11264
  if (t.length === 0)
11253
11265
  return;
11254
- const a = L(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11266
+ const a = U(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11255
11267
  if (s.length !== 0) {
11256
11268
  const l = {};
11257
11269
  return s.forEach((c) => {
@@ -11306,7 +11318,7 @@ class po extends it {
11306
11318
  super(t, e, a);
11307
11319
  }
11308
11320
  selectVariant(t) {
11309
- return zn.selectVariant(
11321
+ return Gn.selectVariant(
11310
11322
  this.step,
11311
11323
  t.getResource(),
11312
11324
  this.manager,
@@ -11319,7 +11331,7 @@ class fo extends it {
11319
11331
  super(t, e, a);
11320
11332
  }
11321
11333
  selectVariant(t) {
11322
- return Gn.selectVariant(
11334
+ return zn.selectVariant(
11323
11335
  this.step,
11324
11336
  t.getResource(),
11325
11337
  this.manager,
@@ -11352,7 +11364,7 @@ class wo extends it {
11352
11364
  async selectVariant(t) {
11353
11365
  if (!t.getId())
11354
11366
  throw new Error("Unable to select variant with a null ID");
11355
- await Hn.selectVariant(this.step, t.getId(), this.manager);
11367
+ await qn.selectVariant(this.step, t.getId(), this.manager);
11356
11368
  }
11357
11369
  /**
11358
11370
  * The way that this step expects to be rendered.
@@ -11368,7 +11380,7 @@ class yo extends it {
11368
11380
  }
11369
11381
  selectVariant(t) {
11370
11382
  const e = t.getResource();
11371
- return zt.selectVariant(
11383
+ return Gt.selectVariant(
11372
11384
  this.step,
11373
11385
  {
11374
11386
  fill: e.color,
@@ -11386,7 +11398,7 @@ class yo extends it {
11386
11398
  * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
11387
11399
  */
11388
11400
  setColor(t) {
11389
- return zt.selectVariant(
11401
+ return Gt.selectVariant(
11390
11402
  this.step,
11391
11403
  t,
11392
11404
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11398,7 +11410,7 @@ class yo extends it {
11398
11410
  * @returns A list of color definitions that are currently applied to the illustration.
11399
11411
  */
11400
11412
  getColors() {
11401
- return zt.availableColours(this.step);
11413
+ return Gt.availableColours(this.step);
11402
11414
  }
11403
11415
  /**
11404
11416
  * Allows for setting a custom color when the custom variant is selected. Will
@@ -11406,7 +11418,7 @@ class yo extends it {
11406
11418
  */
11407
11419
  setCustomColor(t) {
11408
11420
  var e, a;
11409
- 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);
11421
+ 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);
11410
11422
  }
11411
11423
  getCustomColor() {
11412
11424
  var e, a, n;
@@ -11514,7 +11526,9 @@ class So extends it {
11514
11526
  helperData: {}
11515
11527
  }, a = j.findLayoutElements(this.manager, this.step), n = j.filterUnsupportedCharacters(t, (d = a[0]) == null ? void 0 : d.fontData), i = !!this.step.data && !!this.step.data.maxLength && n.length > this.step.data.maxLength;
11516
11528
  i || (e.input = n);
11517
- const s = a.length <= 0, o = s ? { inputText: n, text: n } : { inputText: n };
11529
+ const s = a.length <= 0;
11530
+ console.log(`LOG: setting text ${t} to ${a.length} regions`);
11531
+ const o = s ? { inputText: n, text: n } : { inputText: n };
11518
11532
  this.manager.updateStorage(this.step.stepName, o);
11519
11533
  const l = this.manager.getStepStorage(this.step.stepName), c = j.getProcessedInput(
11520
11534
  n,
@@ -11732,7 +11746,7 @@ class ce {
11732
11746
  case P.Module:
11733
11747
  return new Bo(t, e, t.getStepTags(e.stepName));
11734
11748
  default:
11735
- throw new G(`Step type ${e.type} not yet supported in Core SDK`);
11749
+ throw new z(`Step type ${e.type} not yet supported in Core SDK`);
11736
11750
  }
11737
11751
  }
11738
11752
  }
@@ -11983,22 +11997,22 @@ const Po = async (r, t) => {
11983
11997
  for (const T of Object.keys(i)) {
11984
11998
  const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
11985
11999
  for (let tt = 0; tt < nt.selections.length; ++tt) {
11986
- const H = nt.selections[tt];
12000
+ const q = nt.selections[tt];
11987
12001
  if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
11988
12002
  const ft = R.stepTitle;
11989
12003
  x[ft] ? x[ft].push({
11990
- id: H.id || "",
11991
- name: H.name,
11992
- priceModifier: H.priceModifier
12004
+ id: q.id || "",
12005
+ name: q.name,
12006
+ priceModifier: q.priceModifier
11993
12007
  }) : x[ft] = [
11994
12008
  {
11995
- id: H.id || "",
11996
- name: H.name,
11997
- priceModifier: H.priceModifier
12009
+ id: q.id || "",
12010
+ name: q.name,
12011
+ priceModifier: q.priceModifier
11998
12012
  }
11999
12013
  ];
12000
12014
  }
12001
- k += H.priceModifier;
12015
+ k += q.priceModifier;
12002
12016
  }
12003
12017
  }
12004
12018
  return [x, k];
@@ -12013,7 +12027,7 @@ const Po = async (r, t) => {
12013
12027
  let E = await o(m, n.id);
12014
12028
  if (E) {
12015
12029
  const D = await (await rt(E)).blob();
12016
- E = (await U.uploadAsset(
12030
+ E = (await L.uploadAsset(
12017
12031
  { name: `${n.id}-preview-image.png`, blob: D },
12018
12032
  Ce.Image,
12019
12033
  !0,
@@ -12154,7 +12168,7 @@ class Mo {
12154
12168
  const t = N.get(this.localPersistenceKey);
12155
12169
  return t ? JSON.parse(t) : [];
12156
12170
  }
12157
- throw new G("Unexpected storage method requested");
12171
+ throw new z("Unexpected storage method requested");
12158
12172
  }
12159
12173
  /**
12160
12174
  * Search for a transaction that has been saved.
@@ -12194,7 +12208,7 @@ class Mo {
12194
12208
  N.set(this.localPersistenceKey, JSON.stringify(t));
12195
12209
  return;
12196
12210
  }
12197
- throw new G("Unexpected storage method requested");
12211
+ throw new z("Unexpected storage method requested");
12198
12212
  }
12199
12213
  }
12200
12214
  const Ye = new Mo(), To = v`
@@ -12371,7 +12385,7 @@ class Oo {
12371
12385
  throw new xe("Failed to obtain 2D context for preview image creation");
12372
12386
  const m = Sa(u.layoutState.layout, u.layoutState.elements, {
12373
12387
  renderingConfiguration: {
12374
- purpose: Ht.Print,
12388
+ purpose: qt.Print,
12375
12389
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
12376
12390
  templatingContext: this.workflowManager.getTemplatingContext()
12377
12391
  }
@@ -12544,7 +12558,7 @@ class Oo {
12544
12558
  }
12545
12559
  async save(t) {
12546
12560
  if (!this.getCommandContext().getState())
12547
- throw new G("State undefined!");
12561
+ throw new z("State undefined!");
12548
12562
  const n = {
12549
12563
  title: await (async () => {
12550
12564
  var l;
@@ -12567,10 +12581,10 @@ class Oo {
12567
12581
  var s;
12568
12582
  const t = St(this.getCommandContext().getState());
12569
12583
  if (!t)
12570
- throw new G("Internal state is undefined! Cannot copy experience!");
12584
+ throw new z("Internal state is undefined! Cannot copy experience!");
12571
12585
  const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
12572
12586
  if (!n)
12573
- throw new G("Integration product id is undefined!");
12587
+ throw new z("Integration product id is undefined!");
12574
12588
  return await this.getClient().getWorkflowExperience({
12575
12589
  type: "integration",
12576
12590
  integrationProductId: n,
@@ -12681,7 +12695,7 @@ const $o = [
12681
12695
  "textPath",
12682
12696
  "tref",
12683
12697
  "tspan"
12684
- ], Uo = async (r, t, e) => {
12698
+ ], Lo = async (r, t, e) => {
12685
12699
  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);
12686
12700
  o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12687
12701
  const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
@@ -12708,7 +12722,7 @@ const $o = [
12708
12722
  } catch (h) {
12709
12723
  return console.error(h), [];
12710
12724
  }
12711
- }, Lo = async (r, t, e, a) => {
12725
+ }, Uo = async (r, t, e, a) => {
12712
12726
  const n = e.data, i = n.assetUrl, s = await sa(i);
12713
12727
  try {
12714
12728
  const o = is(n, a.option);
@@ -12835,8 +12849,8 @@ const $o = [
12835
12849
  } catch (B) {
12836
12850
  return console.error(B), [];
12837
12851
  }
12838
- }, zo = async (r, t, e) => {
12839
- const a = await qn(e.data.module), n = t.data, i = (o, l) => {
12852
+ }, Go = async (r, t, e) => {
12853
+ const a = await Hn(e.data.module), n = t.data, i = (o, l) => {
12840
12854
  const c = r.find((A) => A.panelId === l.panelId);
12841
12855
  if (!c)
12842
12856
  throw new J(l);
@@ -12865,7 +12879,7 @@ const $o = [
12865
12879
  } catch (o) {
12866
12880
  return console.error(o), [];
12867
12881
  }
12868
- }, Go = async (r, t, e, a) => {
12882
+ }, zo = async (r, t, e, a) => {
12869
12883
  var d, A;
12870
12884
  const n = e.data, i = a.option;
12871
12885
  if (!i)
@@ -13031,7 +13045,7 @@ const $o = [
13031
13045
  });
13032
13046
  }
13033
13047
  return a;
13034
- }, Ho = async (r, t, e, a) => {
13048
+ }, qo = async (r, t, e, a) => {
13035
13049
  const n = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
13036
13050
  var w;
13037
13051
  const p = a.option;
@@ -13120,7 +13134,7 @@ const $o = [
13120
13134
  n.push(new W(C, f));
13121
13135
  }
13122
13136
  return n;
13123
- }, qo = (r, t) => r.conditions ? r.conditions.every((e) => {
13137
+ }, Ho = (r, t) => r.conditions ? r.conditions.every((e) => {
13124
13138
  const a = t[e.targetStepName];
13125
13139
  if (a && a.selectedVariants) {
13126
13140
  const n = a.selectedVariants;
@@ -13137,13 +13151,13 @@ const $o = [
13137
13151
  switch (o.type) {
13138
13152
  case P.DigitalContent:
13139
13153
  n.push(
13140
- ...await Uo(e, s, o)
13154
+ ...await Lo(e, s, o)
13141
13155
  );
13142
13156
  break;
13143
13157
  case P.Frame:
13144
13158
  case P.Photo:
13145
13159
  n.push(
13146
- ...await Lo(e, i, s, o)
13160
+ ...await Uo(e, i, s, o)
13147
13161
  );
13148
13162
  break;
13149
13163
  case P.Illustration:
@@ -13157,11 +13171,11 @@ const $o = [
13157
13171
  );
13158
13172
  break;
13159
13173
  case P.Module:
13160
- n.push(...await zo(e, s, o));
13174
+ n.push(...await Go(e, s, o));
13161
13175
  break;
13162
13176
  case P.Picture:
13163
13177
  n.push(
13164
- ...await Go(e, i, s, o)
13178
+ ...await zo(e, i, s, o)
13165
13179
  );
13166
13180
  break;
13167
13181
  case P.Shape:
@@ -13171,13 +13185,13 @@ const $o = [
13171
13185
  break;
13172
13186
  case P.Text:
13173
13187
  n.push(
13174
- ...await Ho(e, i, s, o)
13188
+ ...await qo(e, i, s, o)
13175
13189
  );
13176
13190
  break;
13177
13191
  }
13178
13192
  }
13179
13193
  for (const s of t.steps)
13180
- s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || qo(s, i) && n.push(
13194
+ s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || Ho(s, i) && n.push(
13181
13195
  ...await jo(e, s, a)
13182
13196
  );
13183
13197
  return n;
@@ -13345,7 +13359,7 @@ class Zo extends Dn {
13345
13359
  l = i.width, c = i.height;
13346
13360
  const d = Sa(t.layoutState.layout, e, {
13347
13361
  renderingConfiguration: {
13348
- purpose: Ht.ThreeD,
13362
+ purpose: qt.ThreeD,
13349
13363
  templatingContext: (m = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : m.getTemplatingContext()
13350
13364
  }
13351
13365
  }), A = un(d), u = await Aa.from(this.ctx, A, {
@@ -13379,7 +13393,7 @@ const Xc = (r, t) => {
13379
13393
  serializableWorkflow: { steps: [] },
13380
13394
  layouts: {}
13381
13395
  };
13382
- n = new $(e.map((l) => new Un(l))).apply(n);
13396
+ n = new $(e.map((l) => new Ln(l))).apply(n);
13383
13397
  const s = await Yo(r, t, e, a);
13384
13398
  return new $(s).apply(n);
13385
13399
  };
@@ -13427,19 +13441,19 @@ class tl {
13427
13441
  }
13428
13442
  async createHandle(t) {
13429
13443
  switch (t.type) {
13430
- case z.FileUpload:
13444
+ case G.FileUpload:
13431
13445
  return new el(this.bundle, t).initialize();
13432
- case z.ColorOption:
13446
+ case G.ColorOption:
13433
13447
  return new Ja(
13434
13448
  this.bundle,
13435
13449
  t,
13436
13450
  t.entityId ? await Y.getOption(t.entityId) : void 0
13437
13451
  );
13438
- case z.Option: {
13452
+ case G.Option: {
13439
13453
  const e = t.entityId ? await Y.getOption(t.entityId) : void 0;
13440
13454
  return (e == null ? void 0 : e.type) === "Color" ? new Ja(this.bundle, t, e) : new Xn(this.bundle, t, e);
13441
13455
  }
13442
- case z.Text:
13456
+ case G.Text:
13443
13457
  return new al(this.bundle, t);
13444
13458
  default:
13445
13459
  throw new Error("Unhandled Global Property Aspect Type");
@@ -13484,18 +13498,16 @@ class Ia {
13484
13498
  * Returns all steps that share this property.
13485
13499
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
13486
13500
  */
13487
- getSharedSteps(t) {
13488
- return (t ?? this.bundle.getWorkflowExperiences()).flatMap(
13489
- (n) => n.getStepsConditionallyActive().filter((i) => {
13490
- var s;
13491
- return i.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (s = i.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : s.some(
13492
- (o) => {
13493
- var l, c;
13494
- return o.globalPropertyConfigurationId === ((c = (l = this.bundle.getProductCollection()) == null ? void 0 : l.getResource().globalPropertyConfiguration) == null ? void 0 : c.id) && o.aspectName === this.property.name;
13495
- }
13496
- );
13497
- })
13498
- );
13501
+ getSharedSteps(t, e) {
13502
+ return (t ?? this.bundle.getWorkflowExperiences()).flatMap((i) => (e ? i.getSteps() : i.getStepsConditionallyActive()).filter((o) => {
13503
+ var l;
13504
+ return o.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (l = o.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : l.some(
13505
+ (c) => {
13506
+ var d, A;
13507
+ return c.globalPropertyConfigurationId === ((A = (d = this.bundle.getProductCollection()) == null ? void 0 : d.getResource().globalPropertyConfiguration) == null ? void 0 : A.id) && c.aspectName === this.property.name;
13508
+ }
13509
+ );
13510
+ }));
13499
13511
  }
13500
13512
  getStateValue() {
13501
13513
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
@@ -13567,7 +13579,7 @@ class el extends Ia {
13567
13579
  const e = await this.getOriginalImage();
13568
13580
  if (!e)
13569
13581
  throw new Error("You must supply an image selection before attempting to remove the background.");
13570
- const a = this.bundle.getGlobalPropertyStateManager(), n = await U.removeBackgroundFromAsset(e), s = {
13582
+ const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
13571
13583
  ...a.getAspectStorage(this.property.name),
13572
13584
  backgroundRemovedAssetKey: n.key,
13573
13585
  useOriginalAsset: !t
@@ -13587,7 +13599,7 @@ class el extends Ia {
13587
13599
  async getImage() {
13588
13600
  const t = this.getStateValue();
13589
13601
  if (t)
13590
- return U.getLocalOrFromServer(t);
13602
+ return L.getLocalOrFromServer(t);
13591
13603
  }
13592
13604
  async getImageWithColors() {
13593
13605
  var t, e;
@@ -13600,7 +13612,7 @@ class el extends Ia {
13600
13612
  async getOriginalImage() {
13601
13613
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13602
13614
  if (t != null && t.originalAssetKey)
13603
- return U.getLocalOrFromServer(t.originalAssetKey);
13615
+ return L.getLocalOrFromServer(t.originalAssetKey);
13604
13616
  }
13605
13617
  /**
13606
13618
  * Retrieves the version of the image selection that has the background removed, if one exists.
@@ -13609,7 +13621,7 @@ class el extends Ia {
13609
13621
  async getBackgroundRemovedImage() {
13610
13622
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13611
13623
  if (t != null && t.backgroundRemovedAssetKey)
13612
- return U.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13624
+ return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13613
13625
  }
13614
13626
  getUseOriginalImage() {
13615
13627
  var t;
@@ -13641,26 +13653,26 @@ class el extends Ia {
13641
13653
  }
13642
13654
  o.push(this.loadImageData()), await Promise.all(o), this.updateSharedStepStorage(i);
13643
13655
  }
13644
- async applyGlobalState(t) {
13645
- const e = this.getStateValue();
13646
- if (!e)
13647
- return;
13648
- const a = await U.getLocalOrFromServer(e);
13656
+ async applyGlobalState(t, e) {
13657
+ const a = this.getStateValue();
13649
13658
  if (!a)
13650
13659
  return;
13651
- await this.applyImageSelection(a, t, !1, !0);
13652
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13653
- if (n) {
13654
- if (this.updateSharedStepStorage({ ...n }), n.colors) {
13655
- const i = new Map(
13656
- n.colors.map((s) => [s.key, { browserValue: s.browserValue, pmsValue: s.pmsValue }]) ?? []
13660
+ const n = await L.getLocalOrFromServer(a);
13661
+ if (!n)
13662
+ return;
13663
+ await this.applyImageSelection(n, t, !1, !0);
13664
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13665
+ if (i) {
13666
+ if (this.updateSharedStepStorage({ ...i }), i.colors) {
13667
+ const s = new Map(
13668
+ i.colors.map((o) => [o.key, { browserValue: o.browserValue, pmsValue: o.pmsValue }]) ?? []
13657
13669
  );
13658
- this.getSharedSteps(t).forEach((s) => {
13659
- s.changeColors(i);
13670
+ this.getSharedSteps(t, e).forEach((o) => {
13671
+ o.changeColors(s);
13660
13672
  });
13661
13673
  }
13662
13674
  } else
13663
- this.updateSharedStepStorage({ originalAssetKey: e }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: e });
13675
+ this.updateSharedStepStorage({ originalAssetKey: a }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: a });
13664
13676
  }
13665
13677
  getAvailableColors() {
13666
13678
  var t, e, a, n;
@@ -13687,22 +13699,22 @@ class el extends Ia {
13687
13699
  var e;
13688
13700
  return (e = this.imageData) != null && e.svg ? (await lt(this.imageData.svg)).colors : void 0;
13689
13701
  }
13690
- async changeColors(t) {
13691
- var i;
13692
- if (!((i = this.imageData) != null && i.svg))
13702
+ async changeColors(t, e) {
13703
+ var s;
13704
+ if (!((s = this.imageData) != null && s.svg))
13693
13705
  return;
13694
- const e = this.getSharedSteps(), a = new Map(Object.entries(t));
13695
- e.forEach((s) => {
13696
- s.changeColors(a);
13706
+ const a = this.getSharedSteps(void 0, e), n = new Map(Object.entries(t));
13707
+ a.forEach((o) => {
13708
+ o.changeColors(n);
13697
13709
  });
13698
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13710
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13699
13711
  await Promise.all([
13700
13712
  this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, {
13701
- ...n,
13702
- colors: Object.entries(t).map(([s, o]) => ({
13703
- key: s,
13704
- browserValue: o.browserValue,
13705
- pmsValue: o.pmsValue
13713
+ ...i,
13714
+ colors: Object.entries(t).map(([o, l]) => ({
13715
+ key: o,
13716
+ browserValue: l.browserValue,
13717
+ pmsValue: l.pmsValue
13706
13718
  }))
13707
13719
  }),
13708
13720
  await this.loadImageData()
@@ -13752,10 +13764,10 @@ class al extends Ia {
13752
13764
  /**
13753
13765
  * Set the text.
13754
13766
  */
13755
- async setText(t) {
13767
+ async setText(t, e) {
13756
13768
  await Promise.all([
13757
13769
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13758
- this.applyTextSelection(t)
13770
+ this.applyTextSelection(t, void 0, e)
13759
13771
  ]);
13760
13772
  }
13761
13773
  async applyGlobalState(t) {
@@ -13764,11 +13776,11 @@ class al extends Ia {
13764
13776
  return Promise.resolve();
13765
13777
  await this.applyTextSelection(e, t);
13766
13778
  }
13767
- async applyTextSelection(t, e) {
13768
- const n = this.getSharedSteps(e).map((i) => {
13769
- i.setText(t);
13779
+ async applyTextSelection(t, e, a) {
13780
+ const i = this.getSharedSteps(e, a).map((s) => {
13781
+ s.setText(t);
13770
13782
  });
13771
- await Promise.all(n);
13783
+ await Promise.all(i);
13772
13784
  }
13773
13785
  }
13774
13786
  class Xn extends Ia {
@@ -13827,10 +13839,10 @@ class Xn extends Ia {
13827
13839
  * Select a given variant on the option for all shared steps.
13828
13840
  * @param variant The variant to select.
13829
13841
  */
13830
- async selectVariant(t, e) {
13842
+ async selectVariant(t, e, a) {
13831
13843
  await Promise.all([
13832
13844
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13833
- this.applyVariantSelection(t)
13845
+ this.applyVariantSelection(t, void 0, a)
13834
13846
  ]);
13835
13847
  }
13836
13848
  async applyGlobalState(t) {
@@ -13841,9 +13853,9 @@ class Xn extends Ia {
13841
13853
  const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
13842
13854
  return a ? this.applyVariantSelection(new st(a), t) : Promise.resolve();
13843
13855
  }
13844
- async applyVariantSelection(t, e) {
13845
- const n = this.getSharedSteps(e).map((i) => i.selectVariant(t));
13846
- await Promise.all(n);
13856
+ async applyVariantSelection(t, e, a) {
13857
+ const i = this.getSharedSteps(e, a).map((s) => s.selectVariant(t));
13858
+ await Promise.all(i);
13847
13859
  }
13848
13860
  }
13849
13861
  class Ja extends Xn {
@@ -13892,8 +13904,8 @@ class Ja extends Xn {
13892
13904
  /**
13893
13905
  * Sets a custom color on the global state.
13894
13906
  */
13895
- setCustomColor(t) {
13896
- this.getSharedSteps().forEach((a) => a.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13907
+ setCustomColor(t, e) {
13908
+ this.getSharedSteps(void 0, e).forEach((n) => n.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13897
13909
  }
13898
13910
  /**
13899
13911
  * Gets the custom color used by the global state.
@@ -14039,15 +14051,15 @@ class il {
14039
14051
  let i = n.type && n.storage ? {} : void 0;
14040
14052
  if (i)
14041
14053
  switch (n.type) {
14042
- case z.FileUpload: {
14054
+ case G.FileUpload: {
14043
14055
  i.fileUpload = n.storage;
14044
14056
  break;
14045
14057
  }
14046
- case z.Option: {
14058
+ case G.Option: {
14047
14059
  i.option = n.storage;
14048
14060
  break;
14049
14061
  }
14050
- case z.ColorOption: {
14062
+ case G.ColorOption: {
14051
14063
  i = n.storage;
14052
14064
  break;
14053
14065
  }
@@ -14319,7 +14331,7 @@ class Zn {
14319
14331
  async filterProducts(t, e, a, n) {
14320
14332
  var l, c;
14321
14333
  const i = await b.getShadowGraphqlClient().query({
14322
- query: zs,
14334
+ query: Gs,
14323
14335
  errorPolicy: "all",
14324
14336
  variables: {
14325
14337
  id: this.getId(),
@@ -14359,7 +14371,7 @@ class Zn {
14359
14371
  };
14360
14372
  }
14361
14373
  const o = new AbortController(), { signal: l } = o, c = b.getShadowGraphqlClient().watchQuery({
14362
- query: Gs,
14374
+ query: zs,
14363
14375
  variables: {
14364
14376
  id: this.getId(),
14365
14377
  limit: e,
@@ -14725,7 +14737,7 @@ class Je {
14725
14737
  }
14726
14738
  console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((m) => {
14727
14739
  const g = m.map((p) => {
14728
- if (p.getType() === z.ColorOption || p.getType() === z.Option) {
14740
+ if (p.getType() === G.ColorOption || p.getType() === G.Option) {
14729
14741
  const f = p;
14730
14742
  if (this.globalPropertyStateManager.getGlobalPropertyState())
14731
14743
  return f.initDefaultVariant();
@@ -14855,12 +14867,14 @@ class Je {
14855
14867
  async applyGlobalPropertyState(t) {
14856
14868
  var a;
14857
14869
  const e = await this.globalPropertyHandleService.getHandles();
14858
- console.log(`LOG: ${e.length} handles`);
14859
14870
  for (const n of t.aspects) {
14871
+ console.log(`LOG: unsetting init for ${this.workflowExperiences.length} experiences`);
14872
+ for (const o of this.workflowExperiences)
14873
+ o.getWorkflowManager().unsetInitialized();
14860
14874
  const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
14861
- if (console.log(`LOG: handle for ${i}? ${s}`), s)
14875
+ if (s)
14862
14876
  switch (n.type) {
14863
- case z.FileUpload: {
14877
+ case G.FileUpload: {
14864
14878
  const o = s, l = await ve([n.value]);
14865
14879
  l.length > 0 && await o.selectImage(l[0]);
14866
14880
  const c = (a = n.storage) == null ? void 0 : a.colors;
@@ -14868,26 +14882,26 @@ class Je {
14868
14882
  const d = Object.fromEntries(
14869
14883
  c.map((A) => [A.key, { browserValue: A.browserValue, pmsValue: A.pmsValue }]) ?? []
14870
14884
  );
14871
- await o.changeColors(d);
14885
+ await o.changeColors(d, !0);
14872
14886
  }
14873
14887
  break;
14874
14888
  }
14875
- case z.ColorOption: {
14889
+ case G.ColorOption: {
14876
14890
  const o = s;
14877
- if (n.type === z.ColorOption) {
14891
+ if (n.type === G.ColorOption) {
14878
14892
  const c = o.getAllVariants().find((d) => d.getId() === n.value);
14879
14893
  c && await o.selectVariant(c);
14880
14894
  } else
14881
- o.setCustomColor(n.value);
14895
+ o.setCustomColor(n.value, !0);
14882
14896
  break;
14883
14897
  }
14884
- case z.Option: {
14898
+ case G.Option: {
14885
14899
  const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
14886
- console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c);
14900
+ console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c, void 0, !0);
14887
14901
  break;
14888
14902
  }
14889
- case z.Text: {
14890
- await s.setText(n.value);
14903
+ case G.Text: {
14904
+ console.log(`LOG: text ${n.value}`), await s.setText(n.value, !0);
14891
14905
  break;
14892
14906
  }
14893
14907
  }
@@ -14897,7 +14911,7 @@ class Je {
14897
14911
  return this.globalPropertyStateManager;
14898
14912
  }
14899
14913
  async getGlobalPropertyTotalSubunits() {
14900
- return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === z.Option).map((a) => {
14914
+ return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === G.Option).map((a) => {
14901
14915
  var n;
14902
14916
  return ((n = a.getCurrentVariant()) == null ? void 0 : n.getPrice()) || 0;
14903
14917
  }).reduce((a, n) => a + n, 0);
@@ -14916,7 +14930,7 @@ class Je {
14916
14930
  const c = (e = this.getGlobalPropertyConfiguration()) == null ? void 0 : e.aspects.find(
14917
14931
  (d) => d.name === l
14918
14932
  );
14919
- if (c && c.type === z.ColorOption) {
14933
+ if (c && c.type === G.ColorOption) {
14920
14934
  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 = rl(
14921
14935
  this.getWorkflowExperiences(),
14922
14936
  this.globalConfigurationPropertyId || "",
@@ -14984,7 +14998,7 @@ class Je {
14984
14998
  throw new Error("Unable to add transaction to bundle - Already Exists!");
14985
14999
  const s = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
14986
15000
  await b.getShadowGraphqlClient().mutate({
14987
- mutation: qs,
15001
+ mutation: Hs,
14988
15002
  variables: {
14989
15003
  id: this.id,
14990
15004
  transactionId: a
@@ -15167,7 +15181,7 @@ class Je {
15167
15181
  }
15168
15182
  async getAllStakeholders() {
15169
15183
  const t = await b.getShadowGraphqlClient().query({
15170
- query: qa,
15184
+ query: Ha,
15171
15185
  errorPolicy: "all",
15172
15186
  fetchPolicy: "no-cache",
15173
15187
  variables: {
@@ -15184,7 +15198,7 @@ class Je {
15184
15198
  }
15185
15199
  async getCurrentStakeholder() {
15186
15200
  const t = await b.getShadowGraphqlClient().query({
15187
- query: qa,
15201
+ query: Ha,
15188
15202
  errorPolicy: "all",
15189
15203
  fetchPolicy: "no-cache",
15190
15204
  variables: {
@@ -15339,7 +15353,7 @@ class Je {
15339
15353
  async updateBundle() {
15340
15354
  var e;
15341
15355
  if (!((e = (await b.getShadowGraphqlClient().mutate({
15342
- mutation: Hs,
15356
+ mutation: qs,
15343
15357
  variables: {
15344
15358
  id: this.id,
15345
15359
  name: this.name,
@@ -15839,7 +15853,7 @@ class Il {
15839
15853
  ));
15840
15854
  }
15841
15855
  }
15842
- const Lt = new Il(), Pl = async (r, t) => {
15856
+ const Ut = new Il(), Pl = async (r, t) => {
15843
15857
  var n;
15844
15858
  const e = await b.getShadowGraphqlClient().query({
15845
15859
  query: ki(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
@@ -15858,8 +15872,8 @@ const Lt = new Il(), Pl = async (r, t) => {
15858
15872
  return a.forEach((i) => {
15859
15873
  i.steps.forEach((s) => {
15860
15874
  var o, l, c;
15861
- delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && U.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && U.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15862
- d.asset && U.cacheAsset(d.asset), d.thumbnail && U.cacheAsset(d.thumbnail), d.material && U.cacheMaterial(d.material);
15875
+ delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && L.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && L.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15876
+ d.asset && L.cacheAsset(d.asset), d.thumbnail && L.cacheAsset(d.thumbnail), d.material && L.cacheMaterial(d.material);
15863
15877
  }), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
15864
15878
  }), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
15865
15879
  }), a;
@@ -15905,17 +15919,17 @@ class rd {
15905
15919
  } catch (a) {
15906
15920
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15907
15921
  }
15908
- }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.0e36ff9d-5cc0-5085-abc6-bbccac541a12"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15922
+ }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.d1700123-3835-51b2-8677-b33ff1a4b7e2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15909
15923
  }
15910
15924
  configure(t) {
15911
- 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 && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15925
+ 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 && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15912
15926
  }
15913
15927
  /**
15914
15928
  * @returns The asset manager allows for common operations related to assets
15915
15929
  * and the Spiff Commerce platform.
15916
15930
  */
15917
15931
  getAssetManager() {
15918
- return U;
15932
+ return L;
15919
15933
  }
15920
15934
  getCurrencyCode() {
15921
15935
  if (this.currencyCode === void 0)
@@ -16115,7 +16129,7 @@ class rd {
16115
16129
  return !1;
16116
16130
  const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
16117
16131
  if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
16118
- const l = await Lt.refreshTokens();
16132
+ const l = await Ut.refreshTokens();
16119
16133
  if (l != null && l.AuthenticationResult)
16120
16134
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
16121
16135
  else
@@ -16140,14 +16154,14 @@ class rd {
16140
16154
  variables: {
16141
16155
  emailAddress: t
16142
16156
  }
16143
- }), await Lt.generateCode(t);
16157
+ }), await Ut.generateCode(t);
16144
16158
  }
16145
16159
  /**
16146
16160
  * Verify an email code to log in as a Spiff user.
16147
16161
  * Always returns true if it doesn't throw.
16148
16162
  */
16149
16163
  async verifyCode(t, e) {
16150
- const a = (await this.getIntegration()).partner.id || "", n = await Lt.verifyCode(t, e, a);
16164
+ const a = (await this.getIntegration()).partner.id || "", n = await Ut.verifyCode(t, e, a);
16151
16165
  if (n != null && n.AuthenticationResult) {
16152
16166
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
16153
16167
  const s = (await b.getShadowGraphqlClient().query({
@@ -16177,7 +16191,7 @@ class rd {
16177
16191
  throw new Error("No token data in storage.");
16178
16192
  const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
16179
16193
  if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
16180
- const s = await Lt.refreshTokens();
16194
+ const s = await Ut.refreshTokens();
16181
16195
  if (s != null && s.AuthenticationResult)
16182
16196
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
16183
16197
  else
@@ -16248,7 +16262,7 @@ class rd {
16248
16262
  ...o,
16249
16263
  ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16250
16264
  }, c = await b.getShadowGraphqlClient().query({
16251
- query: Us(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16265
+ query: Ls(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16252
16266
  variables: {
16253
16267
  id: t
16254
16268
  },
@@ -16347,7 +16361,7 @@ class rd {
16347
16361
  if (!this.customer)
16348
16362
  throw new Error("Customer not authenticated.");
16349
16363
  const t = await b.getShadowGraphqlClient().query({
16350
- query: Ls,
16364
+ query: Us,
16351
16365
  variables: {
16352
16366
  id: this.customer.id
16353
16367
  },
@@ -16457,9 +16471,9 @@ class rd {
16457
16471
  layouts: [],
16458
16472
  singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16459
16473
  stateMutationFunc: I ? async () => {
16460
- throw new G("State mutation is forbidden in read only mode!");
16461
- } : async (H) => this.updateTransactionState({
16462
- ...H,
16474
+ throw new z("State mutation is forbidden in read only mode!");
16475
+ } : async (q) => this.updateTransactionState({
16476
+ ...q,
16463
16477
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
16464
16478
  }),
16465
16479
  graphQlClient: () => nt,
@@ -16468,11 +16482,11 @@ class rd {
16468
16482
  isReloadedTransaction: k.type === "transaction"
16469
16483
  };
16470
16484
  if (k.type === "transaction" && E.workflowState) {
16471
- const H = JSON.parse(E.workflowState);
16472
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await za(H), R.reloadedState = H;
16485
+ const q = JSON.parse(E.workflowState);
16486
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16473
16487
  } else if (!I && k.workflowState) {
16474
- const H = JSON.parse(k.workflowState);
16475
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await za(H), R.reloadedState = H;
16488
+ const q = JSON.parse(k.workflowState);
16489
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16476
16490
  } else
16477
16491
  R.layouts = Fl(
16478
16492
  R.transaction,
@@ -16759,7 +16773,7 @@ class Tl {
16759
16773
  if (!n || !this.frameData)
16760
16774
  return;
16761
16775
  if (this.frameData.length !== t.length)
16762
- throw new G(
16776
+ throw new z(
16763
16777
  "Frame data and offsets are not the same length. This is a bug. Please report it."
16764
16778
  );
16765
16779
  if (!this.offsets.some((s, o) => !(t[o].x === s.x && t[o].y === s.y && t[o].zoom === s.zoom)) && !a) {
@@ -16803,9 +16817,9 @@ class Tl {
16803
16817
  */
16804
16818
  updateFrameOffsets(t, e, a, n, i) {
16805
16819
  if (!a || a.length === 0 || a.some((o) => !o))
16806
- throw new G("Frame data not set. This is a bug");
16820
+ throw new z("Frame data not set. This is a bug");
16807
16821
  if (!this.workflowManager)
16808
- throw new G("No workflow manager set, cannot update offsets.");
16822
+ throw new z("No workflow manager set, cannot update offsets.");
16809
16823
  const s = this.workflowManager.getCommandDispatcher();
16810
16824
  this.targetElements.forEach((o, l) => {
16811
16825
  s(
@@ -17077,7 +17091,7 @@ class Ql extends it {
17077
17091
  const e = await this.getOriginalImageSelection();
17078
17092
  if (!e)
17079
17093
  throw new Error("You must supply an image selection before attempting to remove the background.");
17080
- const a = await U.removeBackgroundFromAsset(e);
17094
+ const a = await L.removeBackgroundFromAsset(e);
17081
17095
  t && await wt.selectImage(this.step, a, this.manager, !1);
17082
17096
  const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
17083
17097
  return this.manager.updateStorage(this.step.stepName, {
@@ -17136,13 +17150,13 @@ class Ql extends it {
17136
17150
  var e, a;
17137
17151
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
17138
17152
  if (t)
17139
- return U.getLocalOrFromServer(t);
17153
+ return L.getLocalOrFromServer(t);
17140
17154
  }
17141
17155
  async getBackgroundRemovedImageSelection() {
17142
17156
  var e, a;
17143
17157
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
17144
17158
  if (t)
17145
- return U.getLocalOrFromServer(t);
17159
+ return L.getLocalOrFromServer(t);
17146
17160
  }
17147
17161
  hasOriginalImageSelection() {
17148
17162
  var t, e;
@@ -17239,7 +17253,7 @@ const Rl = v`
17239
17253
  workflowViewerLink
17240
17254
  }
17241
17255
  }
17242
- `, Ul = v`
17256
+ `, Ll = v`
17243
17257
  query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
17244
17258
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
17245
17259
  items {
@@ -17254,7 +17268,7 @@ const Rl = v`
17254
17268
  total
17255
17269
  }
17256
17270
  }
17257
- `, Ll = v`
17271
+ `, Ul = v`
17258
17272
  query GetTransactionsForBundle($id: String!) {
17259
17273
  bundles(ids: [$id]) {
17260
17274
  id
@@ -17282,14 +17296,14 @@ const Rl = v`
17282
17296
  name
17283
17297
  }
17284
17298
  }
17285
- `, zl = v`
17299
+ `, Gl = v`
17286
17300
  mutation DuplicateBundle($id: String!, $template: Boolean!) {
17287
17301
  bundleDuplicate(id: $id, template: $template) {
17288
17302
  id
17289
17303
  workflowViewerLink
17290
17304
  }
17291
17305
  }
17292
- `, Gl = v`
17306
+ `, zl = v`
17293
17307
  query GetBundleTemplates($id: String!, $limit: Int!, $offset: Int!) {
17294
17308
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset, template: true) {
17295
17309
  items {
@@ -17318,7 +17332,7 @@ const Rl = v`
17318
17332
  name: t
17319
17333
  }
17320
17334
  }), ud = async (r, t) => await b.getShadowGraphqlClient().mutate({
17321
- mutation: zl,
17335
+ mutation: Gl,
17322
17336
  errorPolicy: "all",
17323
17337
  variables: {
17324
17338
  id: r,
@@ -17338,7 +17352,7 @@ const Rl = v`
17338
17352
  email: r
17339
17353
  }
17340
17354
  })).data.customer, gd = async (r, t, e) => await b.getShadowGraphqlClient().query({
17341
- query: Ul,
17355
+ query: Ll,
17342
17356
  errorPolicy: "all",
17343
17357
  fetchPolicy: "no-cache",
17344
17358
  variables: {
@@ -17347,7 +17361,7 @@ const Rl = v`
17347
17361
  limit: t
17348
17362
  }
17349
17363
  }), pd = async (r, t) => await b.getShadowGraphqlClient().query({
17350
- query: Ll,
17364
+ query: Ul,
17351
17365
  errorPolicy: "all",
17352
17366
  fetchPolicy: "no-cache",
17353
17367
  variables: {
@@ -17425,7 +17439,7 @@ const Rl = v`
17425
17439
  }, yd = async (r, t, e) => {
17426
17440
  var n;
17427
17441
  const a = await b.getShadowGraphqlClient().query({
17428
- query: Gl,
17442
+ query: zl,
17429
17443
  errorPolicy: "all",
17430
17444
  fetchPolicy: "no-cache",
17431
17445
  variables: {
@@ -17459,7 +17473,7 @@ _ = { __e: function(r, t, e, a) {
17459
17473
  throw r;
17460
17474
  } }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
17461
17475
  var ot, Ke, _a, ar = [], _e = [], Xa = _.__b, Za = _.__r, tn = _.diffed, en = _.__c, an = _.unmount;
17462
- function Hl() {
17476
+ function ql() {
17463
17477
  for (var r; r = ar.shift(); )
17464
17478
  if (r.__P && r.__H)
17465
17479
  try {
@@ -17479,7 +17493,7 @@ _.__b = function(r) {
17479
17493
  }, _.diffed = function(r) {
17480
17494
  tn && tn(r);
17481
17495
  var t = r.__c;
17482
- t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || ql)(Hl)), t.__H.__.forEach(function(e) {
17496
+ t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || Hl)(ql)), t.__H.__.forEach(function(e) {
17483
17497
  e.i && (e.__H = e.i), e.__V !== _e && (e.__ = e.__V), e.i = void 0, e.__V = _e;
17484
17498
  })), Ke = ot = null;
17485
17499
  }, _.__c = function(r, t) {
@@ -17506,7 +17520,7 @@ _.__b = function(r) {
17506
17520
  }), e.__H = void 0, t && _.__e(t, e.__v));
17507
17521
  };
17508
17522
  var nn = typeof requestAnimationFrame == "function";
17509
- function ql(r) {
17523
+ function Hl(r) {
17510
17524
  var t, e = function() {
17511
17525
  clearTimeout(a), nn && cancelAnimationFrame(t), setTimeout(r);
17512
17526
  }, a = setTimeout(e, 100);
@@ -17649,12 +17663,12 @@ export {
17649
17663
  Zl as AddressValidationJobStatus,
17650
17664
  Xl as AddressValidationResultConfirmationLevel,
17651
17665
  ad as ArrayInput,
17652
- z as AspectType,
17666
+ G as AspectType,
17653
17667
  vt as AssetNotFoundError,
17654
17668
  Ce as AssetType,
17655
17669
  Jc as BringForwardCommand,
17656
17670
  Yc as BringToBackCommand,
17657
- qc as BringToFrontCommand,
17671
+ Hc as BringToFrontCommand,
17658
17672
  yr as BundleDesignCreationCartAddMode,
17659
17673
  O as CanvasCommand,
17660
17674
  de as CollectionProduct,
@@ -17663,7 +17677,7 @@ export {
17663
17677
  jl as ConversionDataType,
17664
17678
  Wl as ConversionLocation,
17665
17679
  W as CreateElementCommand,
17666
- Un as CreateLayoutCommand,
17680
+ Ln as CreateLayoutCommand,
17667
17681
  Bt as DeleteElementCommand,
17668
17682
  Eo as DigitalContentStepHandle,
17669
17683
  el as FileUploadGlobalPropertyHandle,
@@ -17684,16 +17698,16 @@ export {
17684
17698
  vo as InformationStepHandle,
17685
17699
  Ka as IntegrationProduct,
17686
17700
  vr as IntegrationType,
17687
- zc as LayoutElementFactory,
17701
+ Gc as LayoutElementFactory,
17688
17702
  M as LayoutElementType,
17689
17703
  J as LayoutNotFoundError,
17690
- Ht as LayoutRenderingPurpose,
17704
+ qt as LayoutRenderingPurpose,
17691
17705
  po as MaterialStepHandle,
17692
17706
  Se as MisconfigurationError,
17693
17707
  cd as MockWorkflowManager,
17694
17708
  fo as ModelStepHandle,
17695
17709
  Bo as ModuleStepHandle,
17696
- Gc as MoveCommand,
17710
+ zc as MoveCommand,
17697
17711
  tr as ObjectInput,
17698
17712
  Sl as ObjectInputType,
17699
17713
  Xn as OptionGlobalPropertyHandle,
@@ -17709,9 +17723,9 @@ export {
17709
17723
  wo as QuestionStepHandle,
17710
17724
  Dn as QueueablePromise,
17711
17725
  jc as ResizeCommand,
17712
- qt as ResourceNotFoundError,
17726
+ Ht as ResourceNotFoundError,
17713
17727
  Wc as RotateCommand,
17714
- q as ScaleAxis,
17728
+ H as ScaleAxis,
17715
17729
  Kc as SendBackwardsCommand,
17716
17730
  yo as ShapeStepHandle,
17717
17731
  Sr as ShareActionType,
@@ -17727,15 +17741,15 @@ export {
17727
17741
  So as TextStepHandle,
17728
17742
  ul as Transform,
17729
17743
  Al as TransformCollection,
17730
- G as UnhandledBehaviorError,
17744
+ z as UnhandledBehaviorError,
17731
17745
  Br as UnitOfMeasurement,
17732
- Hc as UpdateImageSourceCommand,
17746
+ qc as UpdateImageSourceCommand,
17733
17747
  st as Variant,
17734
17748
  Ro as WorkflowExperienceEventType,
17735
17749
  Oo as WorkflowExperienceImpl,
17736
- U as assetService,
17750
+ L as assetService,
17737
17751
  Kr as browserColorToHex,
17738
- Lc as cmPerPixel,
17752
+ Uc as cmPerPixel,
17739
17753
  Fo as createDesign,
17740
17754
  Oc as currentDirection,
17741
17755
  bc as dataUrlFromExternalUrl,
@@ -17747,7 +17761,7 @@ export {
17747
17761
  hd as duplicateTransaction,
17748
17762
  at as fetchAsString,
17749
17763
  Fc as findAngle,
17750
- L as findElement,
17764
+ U as findElement,
17751
17765
  Dc as findPmsColors,
17752
17766
  Vt as frameDataCache,
17753
17767
  wt as frameStepService,
@@ -17789,10 +17803,10 @@ export {
17789
17803
  kc as isCloseToValue,
17790
17804
  Nt as loadFont,
17791
17805
  Pc as matchHexToPms,
17792
- zn as materialStepService,
17806
+ Gn as materialStepService,
17793
17807
  cl as metafieldManager,
17794
- Uc as mmPerPixel,
17795
- Gn as modelStepService,
17808
+ Lc as mmPerPixel,
17809
+ zn as modelStepService,
17796
17810
  Ca as modifySVGColors,
17797
17811
  Wn as moduleStepService,
17798
17812
  dd as nameBundle,
@@ -17803,16 +17817,16 @@ export {
17803
17817
  N as persistenceService,
17804
17818
  jn as pictureStepService,
17805
17819
  Ic as pmsToRgb,
17806
- Hn as questionStepService,
17820
+ qn as questionStepService,
17807
17821
  Bc as registerFetchImplementation,
17808
17822
  Ec as registerWindowImplementation,
17809
- za as rehydrateSerializedLayout,
17810
- qr as rgbToPms,
17823
+ Ga as rehydrateSerializedLayout,
17824
+ Hr as rgbToPms,
17811
17825
  le as rotateAroundPoint,
17812
17826
  pa as sanitizeSvgTree,
17813
17827
  $r as setBearerAuthenticationToken,
17814
17828
  gn as setCanvasModule,
17815
- zt as shapeStepService,
17829
+ Gt as shapeStepService,
17816
17830
  hs as shortenUrl,
17817
17831
  mt as spiffCoreConfiguration,
17818
17832
  Xc as stepAspectValuesToDesignInputSteps,