@spiffcommerce/core 34.1.0-beta.af48b4bc-f77e-5542-857a-72db59fb2fc9 → 34.1.0-beta.b737d236-4f23-52f6-9704-e61e958b8bf8

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
@@ -1,8 +1,8 @@
1
1
  import { createHttpLink as Ei, ApolloClient as bi, InMemoryCache as Ii, from as Bi, gql as C } from "@apollo/client/core";
2
2
  import { setContext as Pi } from "@apollo/client/link/context";
3
3
  import { onError as xi } from "@apollo/client/link/error";
4
- import { renderToStaticMarkup as Di } from "preact-render-to-string";
5
- import { removeTypenameFromVariables as Fi } from "@apollo/client/link/remove-typename";
4
+ import { renderToStaticMarkup as Fi } from "preact-render-to-string";
5
+ import { removeTypenameFromVariables as Di } from "@apollo/client/link/remove-typename";
6
6
  import { orientation as ki } from "exifr/dist/mini.umd.cjs";
7
7
  import { parse as yn } from "css";
8
8
  import Mi from "fuse.js";
@@ -24,7 +24,7 @@ import vn from "lodash.debounce";
24
24
  import "fs";
25
25
  import "path";
26
26
  import Ui from "lodash.omit";
27
- var Ee = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), b = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(b || {}), Li = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Li || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}), D = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(D || {}), Vi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Vi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), zi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(zi || {}), Gi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(Gi || {}), ba = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(ba || {}), Wi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Wi || {}), be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(be || {}), kt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(kt || {}), j = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(j || {}), qi = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(qi || {});
27
+ var Ee = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), b = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(b || {}), Li = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Li || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}), F = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(F || {}), Vi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Vi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), zi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(zi || {}), Gi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(Gi || {}), ba = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(ba || {}), Wi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Wi || {}), be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(be || {}), kt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(kt || {}), j = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(j || {}), qi = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(qi || {});
28
28
  class In extends Error {
29
29
  constructor(t) {
30
30
  super(t), this.name = this.constructor.name;
@@ -217,7 +217,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
217
217
  t ? Ji(n).then(e).catch(a) : nt(n).then((i) => {
218
218
  i.text().then(e).catch(a);
219
219
  }).catch(a);
220
- }), xn = (n) => Di(n), je = /* @__PURE__ */ new Map(), Xi = async (n, t) => {
220
+ }), xn = (n) => Fi(n), je = /* @__PURE__ */ new Map(), Xi = async (n, t) => {
221
221
  if (Mt([typeof FontFace])) {
222
222
  if (je.has(t))
223
223
  return je.get(t);
@@ -269,7 +269,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
269
269
  }, tr = async (n) => {
270
270
  const t = Oe(n), e = new Uint8Array(n), a = Zi(e), i = btoa(a);
271
271
  return `data:${t};base64,${i}`;
272
- }, Ia = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Dn = (n) => {
272
+ }, Ia = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Fn = (n) => {
273
273
  const t = n.replace(/\r?\n/g, ""), e = t.indexOf(",");
274
274
  if (e === -1 || e <= 4)
275
275
  throw new TypeError("malformed data: URI");
@@ -292,9 +292,9 @@ let ar, Ba;
292
292
  const nr = (n) => {
293
293
  Ba = n;
294
294
  }, ir = () => Ba;
295
- let Fn;
295
+ let Dn;
296
296
  const rr = (n) => {
297
- Fn = n;
297
+ Dn = n;
298
298
  }, or = () => new Promise((n) => {
299
299
  const t = pt.getHubUrl(), e = (a) => {
300
300
  a.origin === t && (window.removeEventListener("message", e), n(a.data));
@@ -304,7 +304,7 @@ const rr = (n) => {
304
304
  const n = {
305
305
  applicationKey: Ba,
306
306
  customerToken: ar,
307
- bearer: Fn
307
+ bearer: Dn
308
308
  };
309
309
  return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await or(), ...n } : n;
310
310
  };
@@ -356,7 +356,7 @@ class cr {
356
356
  }), a = xi(({ operation: r, graphQLErrors: o, networkError: s }) => {
357
357
  const l = o || [], c = r.getContext();
358
358
  s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
359
- }), i = Fi();
359
+ }), i = Di();
360
360
  return new bi({
361
361
  link: Bi([i, a, e, t]),
362
362
  cache: new Ii(),
@@ -1808,7 +1808,7 @@ const dr = (n) => new Promise((t) => {
1808
1808
  "Black 5 C",
1809
1809
  "Black 6 C",
1810
1810
  "Black 7 C"
1811
- ], Dt = [
1811
+ ], Ft = [
1812
1812
  "FEDD00",
1813
1813
  "FFD700",
1814
1814
  "FE5000",
@@ -3150,17 +3150,17 @@ const dr = (n) => new Promise((t) => {
3150
3150
  "3E2B2E",
3151
3151
  "101820",
3152
3152
  "3D3935"
3153
- ], Je = Dt.map((n) => [
3153
+ ], Je = Ft.map((n) => [
3154
3154
  parseInt(n.substring(0, 2), 16),
3155
3155
  parseInt(n.substring(2, 4), 16),
3156
3156
  parseInt(n.substring(4, 6), 16)
3157
3157
  ]);
3158
3158
  function od(n) {
3159
3159
  const t = Kt.indexOf(n);
3160
- return t >= 0 ? Dt[t] : "";
3160
+ return t >= 0 ? Ft[t] : "";
3161
3161
  }
3162
3162
  function gr(n) {
3163
- const t = Dt.indexOf(n);
3163
+ const t = Ft.indexOf(n);
3164
3164
  return t >= 0 ? Kt[t] : "";
3165
3165
  }
3166
3166
  function sd(n, t = 64) {
@@ -3172,16 +3172,16 @@ function sd(n, t = 64) {
3172
3172
  });
3173
3173
  const r = parseInt(n.substring(0, 2), 16), o = parseInt(n.substring(2, 4), 16), s = parseInt(n.substring(4, 6), 16);
3174
3174
  let l, c, d;
3175
- for (let A = 0; A < Dt.length; A++) {
3175
+ for (let A = 0; A < Ft.length; A++) {
3176
3176
  l = Je[A][0], c = Je[A][1], d = Je[A][2];
3177
3177
  const u = Math.sqrt(Math.pow(r - l, 2) + Math.pow(o - c, 2) + Math.pow(s - d, 2));
3178
3178
  a.push(u);
3179
3179
  }
3180
3180
  for (let A = 0; A < a.length; A++)
3181
- a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex: Dt[A], distance: a[A] });
3181
+ a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex: Ft[A], distance: a[A] });
3182
3182
  return e.sort((A, u) => A.distance - u.distance);
3183
3183
  }
3184
- const mr = Kt.map((n, t) => ({ pms: n, hex: Dt[t] })), pr = new Mi(mr, { keys: ["pms"] });
3184
+ const mr = Kt.map((n, t) => ({ pms: n, hex: Ft[t] })), pr = new Mi(mr, { keys: ["pms"] });
3185
3185
  function ld(n, t) {
3186
3186
  return pr.search(n, t ? { limit: t } : void 0);
3187
3187
  }
@@ -3238,8 +3238,8 @@ const de = (n) => {
3238
3238
  "textPath",
3239
3239
  "tref",
3240
3240
  "tspan"
3241
- ], wr = ["fill", "stroke"], Ft = (n, t) => {
3242
- t(n), n.children.length > 0 && Array.from(n.children).forEach((e) => Ft(e, t));
3241
+ ], wr = ["fill", "stroke"], Dt = (n, t) => {
3242
+ t(n), n.children.length > 0 && Array.from(n.children).forEach((e) => Dt(e, t));
3243
3243
  }, Nn = (n, t) => {
3244
3244
  const e = t(n);
3245
3245
  if (e)
@@ -3256,7 +3256,7 @@ const de = (n) => {
3256
3256
  }, xa = (n, t = !1) => {
3257
3257
  !t && n.setAttribute("preserveAspectRatio", "none");
3258
3258
  const e = [];
3259
- Ft(n, (a) => {
3259
+ Dt(n, (a) => {
3260
3260
  if (a.tagName === "script") {
3261
3261
  a.remove();
3262
3262
  return;
@@ -3282,7 +3282,7 @@ const de = (n) => {
3282
3282
  }
3283
3283
  }), r.length > 0 ? a.setAttribute("style", r.join(";")) : a.removeAttribute("style");
3284
3284
  }
3285
- }), Ft(n, (a) => {
3285
+ }), Dt(n, (a) => {
3286
3286
  e.forEach((i) => {
3287
3287
  i.selectors?.forEach((r) => {
3288
3288
  yr(a, r) && i.declarations?.forEach((o) => {
@@ -3298,7 +3298,7 @@ const de = (n) => {
3298
3298
  }, Qn = (n) => dt().parseFromString(n, "image/svg+xml").firstElementChild, vr = (n, t, e) => {
3299
3299
  n.setAttribute("height", `${e}px`), n.setAttribute("width", `${t}px`);
3300
3300
  }, Rn = (n, t, e) => {
3301
- Ft(n, (a) => {
3301
+ Dt(n, (a) => {
3302
3302
  const i = a.attributes.getNamedItem("fill");
3303
3303
  i && i.value !== "none" && a.classList.forEach((o) => {
3304
3304
  if (o.startsWith("spiff-fill")) {
@@ -3336,12 +3336,12 @@ const de = (n) => {
3336
3336
  }
3337
3337
  });
3338
3338
  });
3339
- }, On = (n) => It().serializeToString(n), Da = (n, t, e, a, i) => {
3339
+ }, On = (n) => It().serializeToString(n), Fa = (n, t, e, a, i) => {
3340
3340
  const r = Qn(n);
3341
3341
  if (!r)
3342
3342
  throw new Error("Failed to read SVG.");
3343
3343
  return vr(r, t, e), Rn(r, a, i), On(r);
3344
- }, Fa = (n, t, e) => {
3344
+ }, Da = (n, t, e) => {
3345
3345
  const a = Qn(n);
3346
3346
  if (!a)
3347
3347
  throw new Error("Failed to read SVG.");
@@ -3355,7 +3355,7 @@ const de = (n) => {
3355
3355
  throw new Error("Failed to read SVG.");
3356
3356
  xa(e);
3357
3357
  const a = {};
3358
- Ft(e, (o) => {
3358
+ Dt(e, (o) => {
3359
3359
  if (Cr.includes(o.tagName) && !o.attributes.getNamedItem("fill")) {
3360
3360
  let c = "black";
3361
3361
  const d = o.parentElement;
@@ -3527,13 +3527,13 @@ const de = (n) => {
3527
3527
  variables: {
3528
3528
  keys: n
3529
3529
  }
3530
- })).data.assets, Dr = async (n) => (await y.getShadowGraphqlClient().query({
3530
+ })).data.assets, Fr = async (n) => (await y.getShadowGraphqlClient().query({
3531
3531
  query: Br,
3532
3532
  errorPolicy: "all",
3533
3533
  variables: {
3534
3534
  ids: n
3535
3535
  }
3536
- })).data.materials, Fr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
3536
+ })).data.materials, Dr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
3537
3537
  mutation: Pr,
3538
3538
  errorPolicy: "all",
3539
3539
  fetchPolicy: "no-cache",
@@ -3609,7 +3609,7 @@ class kr {
3609
3609
  async getMaterialLocalOrFromServer(t) {
3610
3610
  if (this.materialCache.has(t))
3611
3611
  return this.materialCache.get(t);
3612
- const a = (async () => (await Dr([t]))[0])();
3612
+ const a = (async () => (await Fr([t]))[0])();
3613
3613
  return this.materialCache.set(t, a), a;
3614
3614
  }
3615
3615
  /**
@@ -3698,7 +3698,7 @@ class kr {
3698
3698
  * @param assetType The type of asset we're expecting to upload
3699
3699
  */
3700
3700
  async dispatchCreateAssetRequest(t, e, a, i) {
3701
- const r = t.blob.type ? t.blob.type : this.guessMIME(t.name), o = await Fr(t.name, e, r, a, i);
3701
+ const r = t.blob.type ? t.blob.type : this.guessMIME(t.name), o = await Dr(t.name, e, r, a, i);
3702
3702
  if (o)
3703
3703
  return {
3704
3704
  assetResponse: o,
@@ -5529,7 +5529,7 @@ const M = () => {
5529
5529
  if (!n.pattern)
5530
5530
  return "";
5531
5531
  if (n.pattern.svg) {
5532
- const A = Fa(n.pattern.svg, n.pattern.colors || {}, !1);
5532
+ const A = Da(n.pattern.svg, n.pattern.colors || {}, !1);
5533
5533
  return Ia(A);
5534
5534
  }
5535
5535
  return n.pattern.src;
@@ -5559,7 +5559,7 @@ const M = () => {
5559
5559
  const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, g = n.pattern?.height || 0, m = n.pattern?.scaleX || 1, p = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
5560
5560
  return [n.pattern?.svg ? {
5561
5561
  id: `${t}-contents`,
5562
- type: D.Illustration,
5562
+ type: F.Illustration,
5563
5563
  x: A,
5564
5564
  y: u,
5565
5565
  rotation: f,
@@ -5570,7 +5570,7 @@ const M = () => {
5570
5570
  colors: n.pattern?.colors
5571
5571
  } : {
5572
5572
  id: `${t}-contents`,
5573
- type: D.Image,
5573
+ type: F.Image,
5574
5574
  x: A,
5575
5575
  y: u,
5576
5576
  rotation: f,
@@ -5673,7 +5673,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5673
5673
  return wt(n).getFont();
5674
5674
  } catch {
5675
5675
  if (wo(n)) {
5676
- const a = Dn(n), i = la(a);
5676
+ const a = Fn(n), i = la(a);
5677
5677
  return ma(n, i), i;
5678
5678
  } else {
5679
5679
  const a = await Re(n, !0), i = la(a);
@@ -5683,7 +5683,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5683
5683
  })();
5684
5684
  return Ke.set(n, e), e;
5685
5685
  }, yo = (n) => {
5686
- const t = Dn(n), e = la(t);
5686
+ const t = Fn(n), e = la(t);
5687
5687
  return ma(n, e), e;
5688
5688
  }, wt = (n) => {
5689
5689
  const t = Yn.get(n);
@@ -5835,7 +5835,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5835
5835
  stripControlCharacters: !0,
5836
5836
  vertical: !1,
5837
5837
  uppercase: !1
5838
- }, De = (n, t = _a) => {
5838
+ }, Fe = (n, t = _a) => {
5839
5839
  const e = { ..._a, ...t };
5840
5840
  let a = n || "";
5841
5841
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
@@ -5930,7 +5930,7 @@ const Po = (n) => {
5930
5930
  },
5931
5931
  stroke: A,
5932
5932
  strokeWidth: u,
5933
- children: n.curved ? /* @__PURE__ */ P(Do, { text: c, curvedPathId: r, align: n.align }) : d.map((g, m) => /* @__PURE__ */ P(
5933
+ children: n.curved ? /* @__PURE__ */ P(Fo, { text: c, curvedPathId: r, align: n.align }) : d.map((g, m) => /* @__PURE__ */ P(
5934
5934
  xo,
5935
5935
  {
5936
5936
  align: n.vertical ? "center" : n.align,
@@ -5968,7 +5968,7 @@ const Po = (n) => {
5968
5968
  return (n.thisLineIdx - o) * i + n.fontSize / 4;
5969
5969
  };
5970
5970
  return /* @__PURE__ */ P("tspan", { textAnchor: Kn(n.align), x: e(), y: `${a()}px`, children: n.text });
5971
- }, Do = (n) => {
5971
+ }, Fo = (n) => {
5972
5972
  const t = `#${n.curvedPathId}`;
5973
5973
  return /* @__PURE__ */ P(
5974
5974
  "textPath",
@@ -5980,7 +5980,7 @@ const Po = (n) => {
5980
5980
  children: n.text
5981
5981
  }
5982
5982
  );
5983
- }, Fo = (n) => {
5983
+ }, Do = (n) => {
5984
5984
  if (n.cachedObjectURL && !n._renderingConfiguration?.omitCachedFields)
5985
5985
  return /* @__PURE__ */ P(
5986
5986
  Hn,
@@ -6012,7 +6012,7 @@ const Po = (n) => {
6012
6012
  {
6013
6013
  transform: r,
6014
6014
  dangerouslySetInnerHTML: {
6015
- __html: Da(
6015
+ __html: Fa(
6016
6016
  n.svg,
6017
6017
  n.width,
6018
6018
  n.height,
@@ -6113,7 +6113,7 @@ class ko {
6113
6113
  return { ...t, transaction: e.apply(a) };
6114
6114
  }
6115
6115
  }
6116
- const Zn = (n) => n.type === D.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === D.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === D.Illustration ? /* @__PURE__ */ P(Fo, { ...n }, n.id) : n.type === D.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === D.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, Ma = (n, t, e) => {
6116
+ const Zn = (n) => n.type === F.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === F.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === F.Illustration ? /* @__PURE__ */ P(Do, { ...n }, n.id) : n.type === F.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === F.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, Ma = (n, t, e) => {
6117
6117
  const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
6118
6118
  return /* @__PURE__ */ P(
6119
6119
  po,
@@ -6329,17 +6329,17 @@ const re = (n) => {
6329
6329
  rotation: 0,
6330
6330
  panelId: n.layoutState.layout.panelId
6331
6331
  };
6332
- if (e && t === D.Illustration) {
6332
+ if (e && t === F.Illustration) {
6333
6333
  const l = await st(await ai(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
6334
6334
  if (!u) throw new Error("SVG missing viewBox.");
6335
6335
  const h = s.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
6336
6336
  s.height = s.width / f, s.top += (h - s.height) / 2;
6337
6337
  }
6338
- if (e && t === D.Image) {
6338
+ if (e && t === F.Image) {
6339
6339
  const l = s.height, c = await Re(e), d = await $e(c), A = d.width / d.height;
6340
6340
  s.height = s.width / A, s.top += (l - s.height) / 2;
6341
6341
  }
6342
- if (e && t === D.Textbox && a?.text && a?.fontScale) {
6342
+ if (e && t === F.Textbox && a?.text && a?.fontScale) {
6343
6343
  await Tt(e);
6344
6344
  const l = wt(e), c = mt(a.text, a?.fontScale, l);
6345
6345
  s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
@@ -6348,7 +6348,7 @@ const re = (n) => {
6348
6348
  };
6349
6349
  class vd {
6350
6350
  static async getFrame(t, e) {
6351
- const a = await ti(e.region, e.src), i = await Ve(a), r = e.region || await Ut(t, D.Frame);
6351
+ const a = await ti(e.region, e.src), i = await Ve(a), r = e.region || await Ut(t, F.Frame);
6352
6352
  return {
6353
6353
  id: M(),
6354
6354
  x: r.left,
@@ -6363,7 +6363,7 @@ class vd {
6363
6363
  path: i.path,
6364
6364
  dataWidth: i.width,
6365
6365
  dataHeight: i.height,
6366
- type: D.Frame,
6366
+ type: F.Frame,
6367
6367
  disablePlaceholder: e.configuration.disablePlaceholder,
6368
6368
  focalBlur: e.configuration.focalBlur,
6369
6369
  focalBlurStrength: e.configuration.focalBlurStrength,
@@ -6374,11 +6374,11 @@ class vd {
6374
6374
  };
6375
6375
  }
6376
6376
  static async getImage(t, e) {
6377
- const a = e.region || await Ut(t, D.Image, e.src);
6377
+ const a = e.region || await Ut(t, F.Image, e.src);
6378
6378
  return {
6379
6379
  id: M(),
6380
6380
  src: e.src,
6381
- type: D.Image,
6381
+ type: F.Image,
6382
6382
  y: a.top,
6383
6383
  x: a.left,
6384
6384
  rotation: a.rotation,
@@ -6394,16 +6394,16 @@ class vd {
6394
6394
  const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await Tt(i), s = {
6395
6395
  assetUrl: i,
6396
6396
  name: o.names.fullName.en
6397
- }, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = De(c, {
6397
+ }, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Fe(c, {
6398
6398
  vertical: a.vertical,
6399
6399
  uppercase: a.uppercase
6400
- }), A = e.region || await Ut(t, D.Textbox, i, {
6400
+ }), A = e.region || await Ut(t, F.Textbox, i, {
6401
6401
  text: d,
6402
6402
  fontScale: a.size ? a.size / o.unitsPerEm : void 0
6403
6403
  }), u = ie(
6404
6404
  {
6405
6405
  id: M(),
6406
- type: D.Textbox,
6406
+ type: F.Textbox,
6407
6407
  x: A.left,
6408
6408
  y: A.top,
6409
6409
  width: A.width,
@@ -6463,14 +6463,14 @@ class vd {
6463
6463
  </svg>
6464
6464
  `, i = {};
6465
6465
  i["spiff-fill-shape"] = { browserValue: e.color };
6466
- const r = e.region?.item || await Ut(t, D.Illustration), o = M();
6466
+ const r = e.region?.item || await Ut(t, F.Illustration), o = M();
6467
6467
  return {
6468
6468
  stepRegion: e.region?.item,
6469
6469
  stepRegionIndex: e.region?.index,
6470
6470
  colors: i,
6471
6471
  id: o,
6472
6472
  svg: a,
6473
- type: D.Illustration,
6473
+ type: F.Illustration,
6474
6474
  y: r.top,
6475
6475
  x: r.left,
6476
6476
  rotation: r.rotation,
@@ -6482,7 +6482,7 @@ class vd {
6482
6482
  };
6483
6483
  }
6484
6484
  static async getIllustration(t, e) {
6485
- const a = e.region?.item || await Ut(t, D.Illustration, e.src), i = await st(await ai(e.src)), r = await Xt(i.svg), o = M();
6485
+ const a = e.region?.item || await Ut(t, F.Illustration, e.src), i = await st(await ai(e.src)), r = await Xt(i.svg), o = M();
6486
6486
  return {
6487
6487
  cachedObjectURL: r,
6488
6488
  stepRegion: e.region?.item,
@@ -6491,7 +6491,7 @@ class vd {
6491
6491
  id: o,
6492
6492
  src: e.src,
6493
6493
  svg: i.svg,
6494
- type: D.Illustration,
6494
+ type: F.Illustration,
6495
6495
  y: a.top,
6496
6496
  x: a.left,
6497
6497
  rotation: a.rotation,
@@ -6530,7 +6530,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
6530
6530
  const s = o;
6531
6531
  if (s.src && !s.svg) {
6532
6532
  const l = await at(s.src), c = await st(l);
6533
- s.svg = Da(
6533
+ s.svg = Fa(
6534
6534
  c.svg,
6535
6535
  s.width,
6536
6536
  s.height,
@@ -6550,7 +6550,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
6550
6550
  }
6551
6551
  for (const a in n.layouts) {
6552
6552
  const i = n.layouts[a].elements.filter(
6553
- (o) => o.type === D.Illustration
6553
+ (o) => o.type === F.Illustration
6554
6554
  );
6555
6555
  for (let o = 0; o < i.length; ++o) {
6556
6556
  const s = i[o];
@@ -6562,7 +6562,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
6562
6562
  }
6563
6563
  }
6564
6564
  const r = n.layouts[a].elements.filter(
6565
- (o) => o.type === D.Textbox
6565
+ (o) => o.type === F.Textbox
6566
6566
  );
6567
6567
  for (let o = 0; o < r.length; ++o) {
6568
6568
  const s = r[o];
@@ -7126,7 +7126,7 @@ class xd extends O {
7126
7126
  };
7127
7127
  }
7128
7128
  }
7129
- class Dd extends O {
7129
+ class Fd extends O {
7130
7130
  /**
7131
7131
  * @param id The targeted element to bring to the front.
7132
7132
  */
@@ -7153,7 +7153,7 @@ class Dd extends O {
7153
7153
  };
7154
7154
  }
7155
7155
  }
7156
- class Fd extends O {
7156
+ class Dd extends O {
7157
7157
  /**
7158
7158
  * @param id The targeted element to bring to the front.
7159
7159
  */
@@ -7193,7 +7193,7 @@ class an {
7193
7193
  throw new Be(this.configuration, "Couldn't find an asset for product overlay step");
7194
7194
  }
7195
7195
  const s = this.evaluateAssetType();
7196
- if (s === D.Image) {
7196
+ if (s === F.Image) {
7197
7197
  const l = this.configuration.type === b.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
7198
7198
  if (!l)
7199
7199
  throw new Error("Undefined raster silent step source");
@@ -7275,7 +7275,7 @@ class an {
7275
7275
  }
7276
7276
  evaluateAssetType() {
7277
7277
  const t = this.configuration.type === b.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
7278
- return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? D.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), D.Illustration);
7278
+ return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? F.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), F.Illustration);
7279
7279
  }
7280
7280
  }
7281
7281
  const Lo = async (n) => {
@@ -7396,7 +7396,7 @@ class Vo {
7396
7396
  stepName: i,
7397
7397
  id: c.id,
7398
7398
  src: s,
7399
- type: D.Image,
7399
+ type: F.Image,
7400
7400
  y: d.top,
7401
7401
  x: d.left,
7402
7402
  width: d.width,
@@ -7411,7 +7411,7 @@ class Vo {
7411
7411
  }
7412
7412
  }
7413
7413
  const ri = new Vo();
7414
- class Fe {
7414
+ class De {
7415
7415
  constructor() {
7416
7416
  this.frameSourceSvg = async (t, e) => {
7417
7417
  if (!t)
@@ -7522,7 +7522,7 @@ class Fe {
7522
7522
  })) ?? [];
7523
7523
  }
7524
7524
  selectImage(t, e, a, i = !0) {
7525
- const r = Fe.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
7525
+ const r = De.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
7526
7526
  if (o && o === r)
7527
7527
  return Promise.resolve();
7528
7528
  a.setEditedStatus(t.stepName, !0);
@@ -7562,7 +7562,7 @@ class Fe {
7562
7562
  return new W(
7563
7563
  {
7564
7564
  id: t,
7565
- type: D.Frame,
7565
+ type: F.Frame,
7566
7566
  x: e.left,
7567
7567
  y: e.top,
7568
7568
  width: e.width,
@@ -7755,7 +7755,7 @@ class Fe {
7755
7755
  throw new Jt(t);
7756
7756
  }
7757
7757
  async loadPatternFromAsset(t, e, a, i) {
7758
- const r = Fe.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
7758
+ const r = De.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
7759
7759
  if (!s)
7760
7760
  throw a.markUpdateCompleted(o), new Error("Frame service unavailable, cannot load pattern!");
7761
7761
  try {
@@ -7782,7 +7782,7 @@ class Fe {
7782
7782
  ), this.validateColorCount(e, a);
7783
7783
  }
7784
7784
  }
7785
- const St = new Fe();
7785
+ const St = new De();
7786
7786
  class zo {
7787
7787
  async getIllustrationBody(t) {
7788
7788
  return new Promise((e) => {
@@ -7802,7 +7802,7 @@ class zo {
7802
7802
  src: r.src,
7803
7803
  svg: r.svg.svg,
7804
7804
  cachedObjectURL: r.objectURL,
7805
- type: D.Illustration,
7805
+ type: F.Illustration,
7806
7806
  y: e.top,
7807
7807
  x: e.left,
7808
7808
  rotation: e.rotation,
@@ -7892,7 +7892,7 @@ class zo {
7892
7892
  spotColor: A.spotColor,
7893
7893
  pmsValue: A.pmsValue
7894
7894
  };
7895
- const s = Da(t, e, a, o), l = await Xt(s), c = [];
7895
+ const s = Fa(t, e, a, o), l = await Xt(s), c = [];
7896
7896
  for (const d of i) {
7897
7897
  for (const [A, u] of r.entries())
7898
7898
  c.push(new Ca(d, A, u));
@@ -8236,7 +8236,7 @@ class qo {
8236
8236
  colors: {},
8237
8237
  id: g,
8238
8238
  svg: d,
8239
- type: D.Illustration,
8239
+ type: F.Illustration,
8240
8240
  y: A.top,
8241
8241
  x: A.left,
8242
8242
  rotation: A.rotation,
@@ -8372,7 +8372,7 @@ class Ho {
8372
8372
  stepRegionIndex: u,
8373
8373
  id: m,
8374
8374
  src: o,
8375
- type: D.Image,
8375
+ type: F.Image,
8376
8376
  y: A.top,
8377
8377
  x: A.left,
8378
8378
  rotation: A.rotation,
@@ -8596,7 +8596,7 @@ class Yo {
8596
8596
  colors: f,
8597
8597
  id: S,
8598
8598
  svg: p,
8599
- type: D.Illustration,
8599
+ type: F.Illustration,
8600
8600
  y: u.top,
8601
8601
  x: u.left,
8602
8602
  rotation: u.rotation,
@@ -8919,7 +8919,7 @@ class Xo {
8919
8919
  }
8920
8920
  getProcessedInput(t, e, a) {
8921
8921
  const i = a ? t : this.injectReplaceableText(t, e);
8922
- return De(i, {
8922
+ return Fe(i, {
8923
8923
  vertical: e.vertical,
8924
8924
  uppercase: e.uppercase
8925
8925
  });
@@ -9196,8 +9196,8 @@ class Xo {
9196
9196
  const f = a.colorOption;
9197
9197
  let S;
9198
9198
  if (f && f.variants) {
9199
- const F = f.variants.find((q) => q.id === f.defaultVariant?.id) || f.variants[0];
9200
- S = this.createTextFillSpotColor(f, F), o.updateStorage(t, {
9199
+ const D = f.variants.find((q) => q.id === f.defaultVariant?.id) || f.variants[0];
9200
+ S = this.createTextFillSpotColor(f, D), o.updateStorage(t, {
9201
9201
  colorProfileAssetKey: f.colorProfile?.key
9202
9202
  });
9203
9203
  }
@@ -9215,7 +9215,7 @@ class Xo {
9215
9215
  rotation: u.rotation,
9216
9216
  text: c,
9217
9217
  input: s,
9218
- type: D.Textbox,
9218
+ type: F.Textbox,
9219
9219
  vertical: a.vertical,
9220
9220
  x: u.left,
9221
9221
  y: u.top,
@@ -9552,7 +9552,7 @@ const ls = [
9552
9552
  {
9553
9553
  id: m,
9554
9554
  src: d,
9555
- type: D.Image,
9555
+ type: F.Image,
9556
9556
  y: h.top,
9557
9557
  x: h.left,
9558
9558
  width: h.width,
@@ -9591,7 +9591,7 @@ const ls = [
9591
9591
  {
9592
9592
  id: u,
9593
9593
  path: A.path,
9594
- type: D.Frame,
9594
+ type: F.Frame,
9595
9595
  forceImageCover: a.data.forceImageCover,
9596
9596
  x: c.left,
9597
9597
  y: c.top,
@@ -9642,7 +9642,7 @@ const ls = [
9642
9642
  return console.error("Failed to read SVG."), [];
9643
9643
  xa(g);
9644
9644
  const m = {};
9645
- Ft(g, (v) => {
9645
+ Dt(g, (v) => {
9646
9646
  ls.includes(v.tagName) && !v.attributes.getNamedItem("fill") && v.setAttribute("fill", "#000000");
9647
9647
  const E = v.attributes.getNamedItem("fill");
9648
9648
  if (E && E.value !== "none") {
@@ -9674,7 +9674,7 @@ const ls = [
9674
9674
  colors: m,
9675
9675
  id: I,
9676
9676
  svg: f,
9677
- type: D.Illustration,
9677
+ type: F.Illustration,
9678
9678
  y: v.top,
9679
9679
  x: v.left,
9680
9680
  rotation: v.rotation,
@@ -9703,7 +9703,7 @@ const ls = [
9703
9703
  colors: {},
9704
9704
  id: d,
9705
9705
  svg: s,
9706
- type: D.Illustration,
9706
+ type: F.Illustration,
9707
9707
  y: l.top,
9708
9708
  x: l.left,
9709
9709
  rotation: l.rotation,
@@ -9744,7 +9744,7 @@ const ls = [
9744
9744
  {
9745
9745
  id: u,
9746
9746
  src: s,
9747
- type: D.Image,
9747
+ type: F.Image,
9748
9748
  y: d.top,
9749
9749
  x: d.left,
9750
9750
  rotation: d.rotation,
@@ -9801,7 +9801,7 @@ const ls = [
9801
9801
  colors: h,
9802
9802
  id: g,
9803
9803
  svg: A,
9804
- type: D.Illustration,
9804
+ type: F.Illustration,
9805
9805
  y: c.top,
9806
9806
  x: c.left,
9807
9807
  rotation: c.rotation,
@@ -9820,7 +9820,7 @@ const ls = [
9820
9820
  return console.error(c), [];
9821
9821
  }
9822
9822
  }, ms = async (n, t, e) => {
9823
- const a = [], r = t.type === b.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? D.Image : (r.endsWith(".svg"), D.Illustration), l = t.data.regions;
9823
+ const a = [], r = t.type === b.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? F.Image : (r.endsWith(".svg"), F.Illustration), l = t.data.regions;
9824
9824
  if (s === "image")
9825
9825
  try {
9826
9826
  l.forEach((c) => {
@@ -9904,7 +9904,7 @@ const ls = [
9904
9904
  assetUrl: p,
9905
9905
  name: f.names.fullName.en
9906
9906
  };
9907
- })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = De(A, {
9907
+ })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = Fe(A, {
9908
9908
  vertical: a.data.vertical,
9909
9909
  uppercase: a.data.uppercase
9910
9910
  }), h = async (p) => {
@@ -9929,7 +9929,7 @@ const ls = [
9929
9929
  paths: a.data.paths,
9930
9930
  rotation: p.rotation,
9931
9931
  text: u,
9932
- type: D.Textbox,
9932
+ type: F.Textbox,
9933
9933
  vertical: a.data.vertical,
9934
9934
  verticalAlign: a.data.verticalAlign || "middle",
9935
9935
  width: p.width,
@@ -9942,7 +9942,7 @@ const ls = [
9942
9942
  d,
9943
9943
  p,
9944
9944
  [
9945
- De(u, {
9945
+ Fe(u, {
9946
9946
  vertical: a.data.vertical,
9947
9947
  uppercase: a.data.uppercase
9948
9948
  })
@@ -10515,7 +10515,7 @@ const kd = (n, t) => {
10515
10515
  }
10516
10516
  }
10517
10517
  }
10518
- `, Ds = C`
10518
+ `, Fs = C`
10519
10519
  query GetBundlesForCustomer($id: String!) {
10520
10520
  customers(ids: [$id]) {
10521
10521
  bundleStakeholders {
@@ -10544,7 +10544,7 @@ const kd = (n, t) => {
10544
10544
  }
10545
10545
  }
10546
10546
  }
10547
- `, Fs = C`
10547
+ `, Ds = C`
10548
10548
  ${Ra(!1)}
10549
10549
  query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
10550
10550
  productCollections(ids: [$id], productIds: $productIds) {
@@ -12612,22 +12612,22 @@ const pl = async (n, t) => {
12612
12612
  for (const R of Object.keys(r)) {
12613
12613
  const B = r[R], T = t.steps.find((L) => L.stepName === R);
12614
12614
  for (let L = 0; L < B.selections.length; ++L) {
12615
- const F = B.selections[L];
12615
+ const D = B.selections[L];
12616
12616
  if (T && (!E || T.option && (T.option.variants || []).length > 1 && !T.data.hideSelectionInCart && !T.data.hideSelectionsInCart)) {
12617
12617
  const q = T.stepTitle;
12618
12618
  I[q] ? I[q].push({
12619
- id: F.id || "",
12620
- name: F.name,
12621
- priceModifier: F.priceModifier
12619
+ id: D.id || "",
12620
+ name: D.name,
12621
+ priceModifier: D.priceModifier
12622
12622
  }) : I[q] = [
12623
12623
  {
12624
- id: F.id || "",
12625
- name: F.name,
12626
- priceModifier: F.priceModifier
12624
+ id: D.id || "",
12625
+ name: D.name,
12626
+ priceModifier: D.priceModifier
12627
12627
  }
12628
12628
  ];
12629
12629
  }
12630
- N += F.priceModifier;
12630
+ N += D.priceModifier;
12631
12631
  }
12632
12632
  }
12633
12633
  return [I, N];
@@ -13539,7 +13539,7 @@ class Pl {
13539
13539
  return e?.type === "Color" ? new cn(this.bundle, t, e) : new gi(this.bundle, t, e);
13540
13540
  }
13541
13541
  case z.Text:
13542
- return new Dl(this.bundle, t);
13542
+ return new Fl(this.bundle, t);
13543
13543
  default:
13544
13544
  throw new Error("Unhandled Global Property Aspect Type");
13545
13545
  }
@@ -13698,7 +13698,7 @@ class xl extends Oa {
13698
13698
  return U.getLocalOrFromServer(t);
13699
13699
  }
13700
13700
  async getImageWithColors() {
13701
- return await this.loadImageData(), this.imageData?.svg ? Ia(Fa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
13701
+ return await this.loadImageData(), this.imageData?.svg ? Ia(Da(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
13702
13702
  }
13703
13703
  /**
13704
13704
  * Retrieves the original, unmodified image selection, if one exists.
@@ -13832,7 +13832,7 @@ class xl extends Oa {
13832
13832
  );
13833
13833
  }
13834
13834
  }
13835
- class Dl extends Oa {
13835
+ class Fl extends Oa {
13836
13836
  constructor(t, e) {
13837
13837
  super(t, e);
13838
13838
  }
@@ -13983,8 +13983,8 @@ class cn extends gi {
13983
13983
  return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor || this.getCurrentVariant()?.getColor() || "#ffffff";
13984
13984
  }
13985
13985
  }
13986
- const Fl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlobalPropertyAspects(t).includes(e) && i.getType() === a), kl = (n, t, e) => {
13987
- const i = Fl(
13986
+ const Dl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlobalPropertyAspects(t).includes(e) && i.getType() === a), kl = (n, t, e) => {
13987
+ const i = Dl(
13988
13988
  n,
13989
13989
  t,
13990
13990
  e,
@@ -14437,7 +14437,7 @@ class pi {
14437
14437
  if (this.fullFetched)
14438
14438
  return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new ge(a));
14439
14439
  const e = await y.getShadowGraphqlClient().query({
14440
- query: Fs,
14440
+ query: Ds,
14441
14441
  variables: {
14442
14442
  id: this.getId(),
14443
14443
  productIds: t
@@ -15110,21 +15110,13 @@ class dn {
15110
15110
  }
15111
15111
  }
15112
15112
  async addWorkflowExperience(t) {
15113
- console.log(`log: awe 1 ${Date.now()}`), await this.initializeAdditionalRequiredColorChannels(t), console.log(`log: awe 2 ${Date.now()}`), t.setBundle(this), console.log(`log: awe 3 ${Date.now()}`), await this.appendWorkflowExperience(t), console.log(`log: awe 4 ${Date.now()}`), await this.injectExperienceIntoPreviewService(t), console.log(`log: awe 5 ${Date.now()}`), await t.getWorkflowManager().getInitializationPromise(), console.log(`log: awe 6 ${Date.now()}`);
15113
+ await this.initializeAdditionalRequiredColorChannels(t), t.setBundle(this), await this.appendWorkflowExperience(t), await this.injectExperienceIntoPreviewService(t), await t.getWorkflowManager().getInitializationPromise();
15114
15114
  const e = await this.getGlobalProperties();
15115
- console.log(`log: awe 7 ${Date.now()}`);
15116
15115
  for (const a of e)
15117
- await a.applyGlobalState([t]), console.log(`log: awe global ${Date.now()}`);
15116
+ await a.applyGlobalState([t]);
15118
15117
  this.fireEvent("workflow-experience-added", {
15119
15118
  workflowExperiences: [t]
15120
- }), console.log(`log: awe 8 ${Date.now()}`), Promise.resolve().then(
15121
- () => console.log("f microtask:", Date.now())
15122
- ), setTimeout(
15123
- () => console.log("f timeout:", Date.now()),
15124
- 0
15125
- ), requestAnimationFrame(
15126
- () => console.log("f raf:", Date.now())
15127
- );
15119
+ });
15128
15120
  }
15129
15121
  async addWorkflowExperiences(t) {
15130
15122
  for (const s of t)
@@ -15496,17 +15488,27 @@ class dn {
15496
15488
  async loadExistingWorkflowExperiences(t, e, a) {
15497
15489
  if (t.length === 0) return;
15498
15490
  const i = await this.client.getWorkflowExperiences(
15499
- t.map((r) => ({
15491
+ t.map((s) => ({
15500
15492
  type: "transaction",
15501
- transactionId: r
15493
+ transactionId: s
15502
15494
  })),
15503
15495
  e,
15504
15496
  void 0,
15505
15497
  a
15506
15498
  );
15507
- if (i.forEach((r) => r.setBundle(this)), i.forEach((r) => r.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15508
- for (const r of i)
15509
- await this.injectExperienceIntoPreviewService(r);
15499
+ if (i.forEach((s) => s.setBundle(this)), i.forEach((s) => s.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15500
+ for (const s of i)
15501
+ await this.injectExperienceIntoPreviewService(s);
15502
+ const r = this.getIntegrationProductIds() || [], o = this.getProductCollection();
15503
+ if (o) {
15504
+ const s = o.getProducts();
15505
+ for (const l of r)
15506
+ if (!s.find((d) => d.getCurrentIntegration().id === l)) {
15507
+ for (const d of i)
15508
+ d.getProduct()?.integrationProducts?.map((A) => A.id)?.includes(l) && await d.clearProduct();
15509
+ await this.removeIntegrationProductIds([l]);
15510
+ }
15511
+ }
15510
15512
  }
15511
15513
  async updateBundle() {
15512
15514
  if (!(await y.getShadowGraphqlClient().mutate({
@@ -16166,7 +16168,7 @@ class Od {
16166
16168
  } catch (a) {
16167
16169
  throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
16168
16170
  }
16169
- }, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.1.0-beta.e726c178-ca4d-5f86-9fa4-962d8fc2d6fc"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16171
+ }, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.1.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16170
16172
  }
16171
16173
  configure(t) {
16172
16174
  pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.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 && rr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16589,7 +16591,7 @@ class Od {
16589
16591
  if (!this.customer)
16590
16592
  throw new Error("Customer not authenticated.");
16591
16593
  const t = await y.getShadowGraphqlClient().query({
16592
- query: Ds,
16594
+ query: Fs,
16593
16595
  variables: {
16594
16596
  id: this.customer.id
16595
16597
  },
@@ -16638,12 +16640,12 @@ class Od {
16638
16640
  },
16639
16641
  errorPolicy: "all",
16640
16642
  fetchPolicy: "no-cache"
16641
- }), F = L.data.transactions;
16642
- if (A = A + F.length, i && i(A, o.length), F.length !== B.length) {
16643
+ }), D = L.data.transactions;
16644
+ if (A = A + D.length, i && i(A, o.length), D.length !== B.length) {
16643
16645
  const q = L.errors?.[0]?.message || "Unknown error";
16644
16646
  throw new gt(`Not all transactions were found: ${q}`);
16645
16647
  }
16646
- return !this.activeIntegration && F[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(F[0].integrationProduct.integration)), F.map((q, qe) => ({
16648
+ return !this.activeIntegration && D[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(D[0].integrationProduct.integration)), D.map((q, qe) => ({
16647
16649
  transaction: q,
16648
16650
  workflowId: q.workflowId,
16649
16651
  readOnly: B.find((At) => At.option.transactionId === q.id)?.option.readOnly ?? !1,
@@ -16655,15 +16657,15 @@ class Od {
16655
16657
  const T = await u.mutate({
16656
16658
  mutation: $r,
16657
16659
  variables: {
16658
- inputs: B.map((F) => ({
16659
- integrationProductId: F.option.type === "integration" ? F.option.integrationProductId : void 0,
16660
- externalIntegrationId: F.option.type === "external" ? F.option.externalIntegrationId : void 0,
16661
- externalProductId: F.option.type === "external" ? F.option.externalProductId : void 0,
16662
- workflowId: F.option.workflowId,
16663
- designName: F.option.designName,
16660
+ inputs: B.map((D) => ({
16661
+ integrationProductId: D.option.type === "integration" ? D.option.integrationProductId : void 0,
16662
+ externalIntegrationId: D.option.type === "external" ? D.option.externalIntegrationId : void 0,
16663
+ externalProductId: D.option.type === "external" ? D.option.externalProductId : void 0,
16664
+ workflowId: D.option.workflowId,
16665
+ designName: D.option.designName,
16664
16666
  claim: !0,
16665
- quantity: F.option.quantity,
16666
- recipient: F.option.recipient
16667
+ quantity: D.option.quantity,
16668
+ recipient: D.option.recipient
16667
16669
  })),
16668
16670
  marketplaceThemeInstallId: this.marketplaceThemeInstallId,
16669
16671
  marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
@@ -16672,12 +16674,12 @@ class Od {
16672
16674
  fetchPolicy: "no-cache"
16673
16675
  }), L = T.data?.transactionCreateMany;
16674
16676
  if (!L || L.length === 0) {
16675
- const F = T.errors?.[0]?.message || "Unknown error";
16676
- throw new gt(`Failed to create transactions: ${F}`);
16677
+ const D = T.errors?.[0]?.message || "Unknown error";
16678
+ throw new gt(`Failed to create transactions: ${D}`);
16677
16679
  }
16678
- return A = A + L.length, i && i(A, o.length), L.map((F, q) => ({
16679
- transaction: F,
16680
- workflowId: F.workflowId,
16680
+ return A = A + L.length, i && i(A, o.length), L.map((D, q) => ({
16681
+ transaction: D,
16682
+ workflowId: D.workflowId,
16681
16683
  readOnly: !1,
16682
16684
  index: B[q].index
16683
16685
  }));
@@ -16692,7 +16694,7 @@ class Od {
16692
16694
  (async () => p.length > 0 ? await sc(p) : [])(),
16693
16695
  (async () => f.length > 0 ? await Ci(f, e) : [])()
16694
16696
  ]), x = new Map(S.map((B) => [B.id, B])), v = new Map(w.map((B) => [B.id, B])), E = m.map(async (B) => {
16695
- const { transaction: T, workflowId: L, readOnly: F, index: q } = B, qe = L ? v.get(L) : void 0, At = t[q];
16697
+ const { transaction: T, workflowId: L, readOnly: D, index: q } = B, qe = L ? v.get(L) : void 0, At = t[q];
16696
16698
  if (T.integrationProductId) {
16697
16699
  const it = x.get(T.integrationProductId);
16698
16700
  T.integrationProduct = it, T.product = it?.product, T.integrationProduct || console.error("failed to find transaction's product");
@@ -16706,20 +16708,20 @@ class Od {
16706
16708
  workflow: qe,
16707
16709
  transaction: T,
16708
16710
  singleVariantsRenderable: At?.workflowConfiguration?.singleVariantsRenderable,
16709
- stateMutationFunc: F ? async () => {
16711
+ stateMutationFunc: D ? async () => {
16710
16712
  throw new Q("State mutation is forbidden in read only mode!");
16711
16713
  } : async (it) => this.updateTransactionState({
16712
16714
  ...it,
16713
16715
  context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId }
16714
16716
  }),
16715
16717
  graphQlClient: () => vi,
16716
- readOnly: F,
16718
+ readOnly: D,
16717
16719
  isReloadedTransaction: At.type === "transaction"
16718
16720
  };
16719
16721
  if (At.type === "transaction" && T.workflowState) {
16720
16722
  const it = JSON.parse(T.workflowState);
16721
16723
  await Za(it), se.reloadedState = it;
16722
- } else if (!F && At.workflowState) {
16724
+ } else if (!D && At.workflowState) {
16723
16725
  const it = JSON.parse(At.workflowState);
16724
16726
  await Za(it), se.reloadedState = it;
16725
16727
  }
@@ -16727,8 +16729,8 @@ class Od {
16727
16729
  }), N = (await Promise.all(E)).sort((B, T) => B.index - T.index);
16728
16730
  let R = [];
16729
16731
  for (const B of N) {
16730
- const { experienceOptions: T, options: L } = B, F = new bl(this, T);
16731
- await F.getWorkflowManager().getInitializationPromise(), a && a(), L.type !== "transaction" && this.customer && await F.attachCustomerDetails({ email: this.customer.emailAddress }), R = [...R, F], F.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
16732
+ const { experienceOptions: T, options: L } = B, D = new bl(this, T);
16733
+ await D.getWorkflowManager().getInitializationPromise(), a && a(), L.type !== "transaction" && this.customer && await D.attachCustomerDetails({ email: this.customer.emailAddress }), R = [...R, D], D.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
16732
16734
  }
16733
16735
  return R;
16734
16736
  }
@@ -16960,7 +16962,7 @@ class dc {
16960
16962
  getImageSrc() {
16961
16963
  if (this.imageData) {
16962
16964
  if (this.imageData.svg) {
16963
- const t = Fa(this.imageData.svg, this.imageData.colors || {}, !1);
16965
+ const t = Da(this.imageData.svg, this.imageData.colors || {}, !1);
16964
16966
  return Ia(t);
16965
16967
  }
16966
16968
  return this.imageData.src;
@@ -17828,7 +17830,7 @@ const Si = C`
17828
17830
  }
17829
17831
  }
17830
17832
  `;
17831
- var Dc = /* @__PURE__ */ ((n) => (n.Confirmed = "Confirmed", n.Plausible = "Plausible", n.Unlikely = "Unlikely", n))(Dc || {}), Fc = /* @__PURE__ */ ((n) => (n.Created = "Created", n.Processing = "Processing", n.Completed = "Completed", n.Failed = "Failed", n.Cancelled = "Cancelled", n))(Fc || {});
17833
+ var Fc = /* @__PURE__ */ ((n) => (n.Confirmed = "Confirmed", n.Plausible = "Plausible", n.Unlikely = "Unlikely", n))(Fc || {}), Dc = /* @__PURE__ */ ((n) => (n.Created = "Created", n.Processing = "Processing", n.Completed = "Completed", n.Failed = "Failed", n.Cancelled = "Cancelled", n))(Dc || {});
17832
17834
  const eA = async (n) => {
17833
17835
  const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().query({
17834
17836
  query: Ic,
@@ -17901,14 +17903,14 @@ const eA = async (n) => {
17901
17903
  })).data.integrationProducts;
17902
17904
  export {
17903
17905
  ba as AddonHandle,
17904
- Fc as AddressValidationJobStatus,
17905
- Dc as AddressValidationResultConfirmationLevel,
17906
+ Dc as AddressValidationJobStatus,
17907
+ Fc as AddressValidationResultConfirmationLevel,
17906
17908
  bn as AddressValidationStatus,
17907
17909
  Rd as ArrayInput,
17908
17910
  z as AspectType,
17909
17911
  bt as AssetNotFoundError,
17910
17912
  Ee as AssetType,
17911
- Dd as BringForwardCommand,
17913
+ Fd as BringForwardCommand,
17912
17914
  xd as BringToBackCommand,
17913
17915
  Pd as BringToFrontCommand,
17914
17916
  Vi as BundleDesignCreationCartAddMode,
@@ -17943,7 +17945,7 @@ export {
17943
17945
  An as IntegrationProduct,
17944
17946
  Gi as IntegrationType,
17945
17947
  vd as LayoutElementFactory,
17946
- D as LayoutElementType,
17948
+ F as LayoutElementType,
17947
17949
  J as LayoutNotFoundError,
17948
17950
  Yt as LayoutRenderingPurpose,
17949
17951
  rl as MaterialStepHandle,
@@ -17970,7 +17972,7 @@ export {
17970
17972
  Jt as ResourceNotFoundError,
17971
17973
  bd as RotateCommand,
17972
17974
  j as ScaleAxis,
17973
- Fd as SendBackwardsCommand,
17975
+ Dd as SendBackwardsCommand,
17974
17976
  cl as ShapeStepHandle,
17975
17977
  zi as ShareActionType,
17976
17978
  Od as SpiffCommerceClient,
@@ -17980,7 +17982,7 @@ export {
17980
17982
  b as StepType,
17981
17983
  kt as TextAlgorithm,
17982
17984
  $o as TextChangeCommand,
17983
- Dl as TextGlobalPropertyHandle,
17985
+ Fl as TextGlobalPropertyHandle,
17984
17986
  Qd as TextInput,
17985
17987
  dl as TextStepHandle,
17986
17988
  Vl as Transform,
@@ -18052,7 +18054,7 @@ export {
18052
18054
  $l as metafieldManager,
18053
18055
  wd as mmPerPixel,
18054
18056
  si as modelStepService,
18055
- Fa as modifySVGColors,
18057
+ Da as modifySVGColors,
18056
18058
  li as moduleStepService,
18057
18059
  Wd as nameBundle,
18058
18060
  qd as nameTransaction,