@spiffcommerce/core 20.1.0-beta.3 → 20.2.0

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.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { createHttpLink as Et, InMemoryCache as ht, ApolloClient as Ct, from as Qt, gql as F } from "@apollo/client/core";
2
- import { fetch as $A, getAttributesFromArrayBuffer as ye, AssetType as Be, StepType as D, getFrameData as _A, frameDataCache as ut, GroupCommand as G, UpdateFramePattern as Ye, UpdateFrameThresholdSettingsCommand as mt, calculateOffsets as Ae, LayoutElementType as v, generate as J, CreateElementCommand as L, generateSVGWithUnknownColors as Se, svgObjectURL as pA, fetchAsString as q, DeleteElementCommand as Z, generateDefaultRectangleFrameSvg as de, GetSVGDimensions as It, patternImageDataCache as we, fetchAsArrayBuffer as pt, findElement as fA, modifySVGWithElementProperties as ft, IllustrationColorCommand as zA, IllustrationCacheCommand as Dt, getFontMetrics as Ft, getPatternImageData as KA, FontAlignmentCommand as Mt, FontColorCommand as yt, FontImageFillCommand as kA, applyTextTransformations as jA, determineCorrectFontSizeAndLines as uA, FontSourceCommand as Ee, loadFont as ee, TextChangeCommand as Yt, FontSizeCommand as St, createElementNS as xt, createElement as lA, _loadFontExternalDataURL as te, UpdateWorkflowStateCommand as he, CommandContext as Pt, createCanvas as DA, getSvgElement as xe, LayoutRenderingPurpose as Pe, renderPapyrusComponentAsString as Ne, loadImage as He, getDomParser as Re, toBase64 as Ce, getVariant as Nt, generateFrameSVG as Ht, getDefaultVariant as NA, domParser as Ue, sanitizeSvgTree as Ge, traverse as Rt, xmlSerializer as ve, CreateLayoutCommand as Ut, AspectType as mA, rehydrateSerializedLayout as _ } from "@spiffcommerce/papyrus";
3
- import { AssetType as ji, BringForwardCommand as Vi, BringToBackCommand as Wi, BringToFrontCommand as Xi, CanvasCommand as qi, CommandContext as Zi, CreateElementCommand as $i, CreateLayoutCommand as _i, DeleteElementCommand as As, FontAlignmentCommand as es, FontColorCommand as ts, FontSizeCommand as ns, FontSourceCommand as as, GroupCommand as is, LayoutElementFactory as ss, LayoutElementType as os, MoveCommand as rs, ResizeCommand as cs, RotateCommand as gs, SendBackwardsCommand as ls, StepAspectType as Bs, StepType as ds, TextChangeCommand as ws, UnitOfMeasurement as Es, dataUrlFromExternalUrl as hs, determineCorrectFontSizeAndLines as Cs, findElement as Qs, frameDataCache as us, generate as ms, generateSVGWithUnknownColors as Is, getAttributesFromArrayBuffer as ps, getAxisAlignedBoundingBox as fs, getFrameData as Ds, getSvgElement as Fs, loadFont as Ms, patternImageDataCache as ys, registerFetchImplementation as Ys, registerWindowImplementation as Ss, rehydrateSerializedLayout as xs, setCanvasModule as Ps } from "@spiffcommerce/papyrus";
2
+ import { fetch as $A, getAttributesFromArrayBuffer as ye, AssetType as Be, StepType as D, getFrameData as _A, frameDataCache as ut, GroupCommand as G, UpdateFramePattern as Ye, UpdateFrameThresholdSettingsCommand as mt, calculateOffsets as Ae, LayoutElementType as v, generate as J, CreateElementCommand as L, generateSVGWithUnknownColors as Se, svgObjectURL as fA, fetchAsString as Z, DeleteElementCommand as $, generateDefaultRectangleFrameSvg as de, GetSVGDimensions as It, patternImageDataCache as we, fetchAsArrayBuffer as pt, findElement as DA, modifySVGWithElementProperties as ft, IllustrationColorCommand as KA, IllustrationCacheCommand as Dt, getFontMetrics as Ft, getPatternImageData as jA, FontAlignmentCommand as Mt, FontColorCommand as yt, FontImageFillCommand as JA, applyTextTransformations as VA, determineCorrectFontSizeAndLines as mA, FontSourceCommand as Ee, loadFont as ee, TextChangeCommand as Yt, FontSizeCommand as St, createElementNS as xt, createElement as BA, _loadFontExternalDataURL as te, UpdateWorkflowStateCommand as he, CommandContext as Pt, createCanvas as FA, getSvgElement as xe, LayoutRenderingPurpose as Pe, renderPapyrusComponentAsString as Ne, loadImage as He, getDomParser as Re, toBase64 as Ce, getVariant as Nt, generateFrameSVG as Ht, getDefaultVariant as HA, domParser as Ue, sanitizeSvgTree as Ge, traverse as Rt, xmlSerializer as ve, CreateLayoutCommand as Ut, AspectType as IA, rehydrateSerializedLayout as AA } from "@spiffcommerce/papyrus";
3
+ import { AssetType as Oi, BringForwardCommand as zi, BringToBackCommand as Ki, BringToFrontCommand as ji, CanvasCommand as Vi, CommandContext as Wi, CreateElementCommand as Xi, CreateLayoutCommand as qi, DeleteElementCommand as Zi, FontAlignmentCommand as $i, FontColorCommand as _i, FontSizeCommand as As, FontSourceCommand as es, GroupCommand as ts, LayoutElementFactory as ns, LayoutElementType as as, MoveCommand as is, ResizeCommand as ss, RotateCommand as os, SendBackwardsCommand as rs, StepAspectType as cs, StepType as gs, TextChangeCommand as ls, UnitOfMeasurement as Bs, dataUrlFromExternalUrl as ds, determineCorrectFontSizeAndLines as ws, findElement as Es, frameDataCache as hs, generate as Cs, generateSVGWithUnknownColors as Qs, getAttributesFromArrayBuffer as us, getAxisAlignedBoundingBox as ms, getFrameData as Is, getSvgElement as ps, loadFont as fs, patternImageDataCache as Ds, registerFetchImplementation as Fs, registerWindowImplementation as Ms, rehydrateSerializedLayout as ys, setCanvasModule as Ys } from "@spiffcommerce/papyrus";
4
4
  import { setContext as Gt } from "@apollo/client/link/context";
5
5
  import { onError as vt } from "@apollo/client/link/error";
6
6
  import { Pith as ke } from "pith";
7
7
  import Je from "lodash.debounce";
8
8
  import be from "lodash.isequal";
9
- import HA from "lodash.clonedeep";
9
+ import RA from "lodash.clonedeep";
10
10
  import { toString as Le } from "qrcode";
11
- import { split as VA } from "unicode-default-word-boundary";
11
+ import { split as WA } from "unicode-default-word-boundary";
12
12
  import ne from "svg-path-bbox";
13
13
  import Qe from "lodash.chunk";
14
14
  class Te extends Error {
@@ -16,57 +16,57 @@ class Te extends Error {
16
16
  super(A), this.name = this.constructor.name;
17
17
  }
18
18
  }
19
- class gA extends Te {
19
+ class lA extends Te {
20
20
  constructor(A) {
21
21
  super(`ConfigurationError - ${A}`);
22
22
  }
23
23
  }
24
- class FA extends gA {
24
+ class MA extends lA {
25
25
  constructor(A) {
26
26
  super(`Option not Configured: ${A.stepTitle}`), this.optionId = (A == null ? void 0 : A.optionId) || "N/A";
27
27
  }
28
28
  }
29
- class z extends gA {
29
+ class z extends lA {
30
30
  constructor(A) {
31
31
  super(`Panel not Found: ${A.panelId}`), this.panelId = (A == null ? void 0 : A.panelId) || "N/A";
32
32
  }
33
33
  }
34
- class $ extends gA {
34
+ class _ extends lA {
35
35
  constructor(A) {
36
36
  super(`Asset not found for variant: ${A.name}`), this.variant = A;
37
37
  }
38
38
  }
39
- class rA extends gA {
39
+ class cA extends lA {
40
40
  constructor(A) {
41
41
  super(`Resource not found for asset: ${A.name}`), this.asset = A;
42
42
  }
43
43
  }
44
- class MA extends gA {
44
+ class yA extends lA {
45
45
  constructor(A, e) {
46
46
  super(`Workflow Misconfiguration: ${A.stepName} - ${e}`), this.step = A;
47
47
  }
48
48
  }
49
- class RA extends Te {
49
+ class UA extends Te {
50
50
  constructor(A) {
51
51
  super(`ImplementationError - ${A}`);
52
52
  }
53
53
  }
54
- class k extends RA {
54
+ class k extends UA {
55
55
  constructor(A) {
56
56
  super(`Unhandled Behavior Encountered: ${A}`);
57
57
  }
58
58
  }
59
- class sA extends RA {
59
+ class oA extends UA {
60
60
  constructor(A) {
61
61
  super(`Parsing Error: ${A}`);
62
62
  }
63
63
  }
64
- class U extends RA {
64
+ class U extends UA {
65
65
  constructor(A) {
66
66
  super(`Client Error: ${A}`);
67
67
  }
68
68
  }
69
- class UA extends RA {
69
+ class GA extends UA {
70
70
  constructor(A) {
71
71
  super(`Resource Generation Failed: ${A}`);
72
72
  }
@@ -147,7 +147,7 @@ class bt {
147
147
  this.serverUrlCallbacks.push(A);
148
148
  }
149
149
  }
150
- const yA = new bt();
150
+ const q = new bt();
151
151
  let Oe;
152
152
  const me = (c) => {
153
153
  Oe = c;
@@ -156,7 +156,7 @@ let ae;
156
156
  const Lt = (c) => {
157
157
  ae = c;
158
158
  }, Tt = () => ae, Ot = () => new Promise((c) => {
159
- const A = yA.getHubUrl(), e = (t) => {
159
+ const A = q.getHubUrl(), e = (t) => {
160
160
  t.origin === A && (window.removeEventListener("message", e), c(t.data));
161
161
  };
162
162
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", A));
@@ -169,7 +169,7 @@ const Lt = (c) => {
169
169
  };
170
170
  class Kt {
171
171
  constructor() {
172
- this.shadowGraphqlClient = this.constructShadowGraphqlClient(), yA.addServerUrlCallback(() => {
172
+ this.shadowGraphqlClient = this.constructShadowGraphqlClient(), q.addServerUrlCallback(() => {
173
173
  this.shadowGraphqlClient = this.constructShadowGraphqlClient();
174
174
  });
175
175
  }
@@ -178,7 +178,7 @@ class Kt {
178
178
  }
179
179
  constructShadowGraphqlClient() {
180
180
  const A = Et({
181
- uri: `${yA.getServerUrl()}/graphql`,
181
+ uri: `${q.getServerUrl()}/graphql`,
182
182
  fetch: $A
183
183
  }), e = Gt(async (i, s) => {
184
184
  const { headers: o } = s, r = o || {}, g = await zt(), B = s.bearer ?? g.bearer, l = s.partnerId ?? g.partnerId, d = s.activeIntegration ?? g.activeIntegration, w = s.transactionOwnerId, h = s.customerToken ?? g.customerToken, E = s.applicationKey ?? g.applicationKey, Q = s.bundleOwnerId;
@@ -258,7 +258,7 @@ const P = new Kt(), jt = F`
258
258
  value
259
259
  }
260
260
  }
261
- `, GA = (c) => F`
261
+ `, vA = (c) => F`
262
262
  ${c && jt || ""}
263
263
  fragment AssetFields on Asset {
264
264
  name
@@ -274,7 +274,7 @@ const P = new Kt(), jt = F`
274
274
  ${c && "...AssetMetadataFields" || ""}
275
275
  }
276
276
  `, Vt = F`
277
- ${GA(!1)}
277
+ ${vA(!1)}
278
278
  query GetAssets($keys: [String]!) {
279
279
  assets(keys: $keys) {
280
280
  ...AssetFields
@@ -445,7 +445,7 @@ class $t {
445
445
  g.lengthComputable && t(g.loaded * 100 / g.total);
446
446
  }, r.onload = () => {
447
447
  const g = i.assetResponse.asset;
448
- JA.add(i.assetResponse.asset), s(g);
448
+ bA.add(i.assetResponse.asset), s(g);
449
449
  }, r.onerror = o, r.send(A.blob);
450
450
  }), i.assetResponse.asset;
451
451
  }
@@ -463,10 +463,10 @@ class $t {
463
463
  }
464
464
  }
465
465
  removePersistedAsset(A) {
466
- JA.remove(A);
466
+ bA.remove(A);
467
467
  }
468
468
  getPersistedAssets() {
469
- return JA.list();
469
+ return bA.list();
470
470
  }
471
471
  /**
472
472
  * Handles mimeType resolution & asset creation request
@@ -495,8 +495,8 @@ class $t {
495
495
  }
496
496
  }
497
497
  }
498
- const aA = "persistentAssets";
499
- class JA {
498
+ const iA = "persistentAssets";
499
+ class bA {
500
500
  /**
501
501
  * Add a new asset to persistence
502
502
  * @param asset The asset to add.
@@ -508,27 +508,27 @@ class JA {
508
508
  }
509
509
  const e = /* @__PURE__ */ new Map();
510
510
  e.set(A.key || "", A.fileLink);
511
- const t = x.getMap(aA);
511
+ const t = x.getMap(iA);
512
512
  t && t.forEach((n, a) => {
513
513
  e.set(a, n);
514
- }), x.setMap(aA, e);
514
+ }), x.setMap(iA, e);
515
515
  }
516
516
  /**
517
517
  * Remove an existing asset from persistence. Noop if the asset doesn't exist.
518
518
  * @param assetKey The key to remove.
519
519
  */
520
520
  static remove(A) {
521
- const e = x.getMap(aA);
521
+ const e = x.getMap(iA);
522
522
  if (!e)
523
523
  return;
524
524
  const t = Array.from(e.entries()).find((n) => n[0] === A);
525
- t && (e.delete(t[0]), x.setMap(aA, e));
525
+ t && (e.delete(t[0]), x.setMap(iA, e));
526
526
  }
527
527
  /**
528
528
  * Get a list of all persisted assets.
529
529
  */
530
530
  static list() {
531
- const A = x.getMap(aA);
531
+ const A = x.getMap(iA);
532
532
  return A ? Array.from(A.entries()).map((e) => ({ assetKey: e[0], src: e[1] })) : [];
533
533
  }
534
534
  }
@@ -564,7 +564,7 @@ class _t {
564
564
  this.disabled = A;
565
565
  }
566
566
  }
567
- const cA = new _t(), Ke = F`
567
+ const gA = new _t(), Ke = F`
568
568
  fragment OptionFields on Option {
569
569
  id
570
570
  name
@@ -605,7 +605,7 @@ const cA = new _t(), Ke = F`
605
605
  }
606
606
  }
607
607
  `, An = F`
608
- ${GA(!1)}
608
+ ${vA(!1)}
609
609
  ${ie}
610
610
  ${Ke}
611
611
  query GetOptions($ids: [String]!) {
@@ -629,11 +629,11 @@ const cA = new _t(), Ke = F`
629
629
  });
630
630
  }), A.data.options;
631
631
  }, tn = async (c, A) => (await A).find((t) => t.id === c), nn = async (c) => {
632
- const A = c.map((i) => cA.get({ id: i })), e = c.filter((i, s) => A[s] === void 0);
632
+ const A = c.map((i) => gA.get({ id: i })), e = c.filter((i, s) => A[s] === void 0);
633
633
  if (e.length === 0)
634
634
  return Promise.all(A);
635
635
  const t = en(e), n = e.map(
636
- (i) => cA.set({ id: i }, tn(i, t))
636
+ (i) => gA.set({ id: i }, tn(i, t))
637
637
  ), a = A.filter((i) => i !== void 0);
638
638
  return await Promise.all(a.concat(n));
639
639
  };
@@ -692,7 +692,7 @@ class an {
692
692
  }
693
693
  const j = new an();
694
694
  var sn = /* @__PURE__ */ ((c) => (c.Hub = "Hub", c.Shopify = "Shopify", c))(sn || {}), on = /* @__PURE__ */ ((c) => (c[c.Orbit = 0] = "Orbit", c[c.Pan = 1] = "Pan", c))(on || {}), rn = /* @__PURE__ */ ((c) => (c.Manual = "Manual", c.OnStart = "OnStart", c.OnQuit = "OnQuit", c.OnEnd = "OnEnd", c))(rn || {}), cn = /* @__PURE__ */ ((c) => (c.Email = "Email", c.FirstName = "FirstName", c.LastName = "LastName", c.Phone = "Phone", c))(cn || {}), YA = /* @__PURE__ */ ((c) => (c.Owner = "Owner", c.Approver = "Approver", c.Editor = "Editor", c.Viewer = "Viewer", c))(YA || {});
695
- const nA = F`
695
+ const aA = F`
696
696
  fragment AdditionalIntegrationProductFields on IntegrationProduct {
697
697
  id
698
698
  product {
@@ -710,7 +710,7 @@ const nA = F`
710
710
  }
711
711
  }
712
712
  `, Ie = F`
713
- ${nA}
713
+ ${aA}
714
714
  mutation CreateTransaction(
715
715
  $integrationProductId: String
716
716
  $externalIntegrationId: String
@@ -794,7 +794,7 @@ const nA = F`
794
794
  }
795
795
  }
796
796
  `, gn = F`
797
- ${nA}
797
+ ${aA}
798
798
  mutation CreateTransactions($inputs: [TransactionCreateInput]!) {
799
799
  transactionCreateMany(inputs: $inputs) {
800
800
  id
@@ -866,7 +866,7 @@ const nA = F`
866
866
  }
867
867
  }
868
868
  `, ln = F`
869
- ${nA}
869
+ ${aA}
870
870
  mutation ClaimTransaction($id: String!) {
871
871
  transactionClaim(id: $id) {
872
872
  id
@@ -937,8 +937,8 @@ const nA = F`
937
937
  }
938
938
  }
939
939
  }
940
- `, BA = F`
941
- ${nA}
940
+ `, dA = F`
941
+ ${aA}
942
942
  query ReadTransactions($ids: [String]!) {
943
943
  transactions(ids: $ids) {
944
944
  customLogoLink
@@ -1091,7 +1091,7 @@ const je = F`
1091
1091
  }
1092
1092
  }
1093
1093
  `, Ve = F`
1094
- ${nA}
1094
+ ${aA}
1095
1095
  fragment IntegrationProductFields on IntegrationProduct {
1096
1096
  id
1097
1097
  externalProductId
@@ -1149,7 +1149,7 @@ const je = F`
1149
1149
  ...IntegrationProductFields
1150
1150
  }
1151
1151
  }
1152
- `, iA = [D.SilentIllustration, D.ProductOverlay], hn = async (c) => {
1152
+ `, sA = [D.SilentIllustration, D.ProductOverlay], hn = async (c) => {
1153
1153
  const A = [];
1154
1154
  c.introduction && A.push({
1155
1155
  name: "Introduction",
@@ -1172,16 +1172,16 @@ const je = F`
1172
1172
  A.push({
1173
1173
  name: t.stepName,
1174
1174
  title: t.stepTitle,
1175
- renderableSteps: iA.includes(t.type) ? [] : [t],
1176
- silentSteps: iA.includes(t.type) ? [t] : []
1175
+ renderableSteps: sA.includes(t.type) ? [] : [t],
1176
+ silentSteps: sA.includes(t.type) ? [t] : []
1177
1177
  });
1178
1178
  else {
1179
1179
  const a = A.find((i) => i.name === n.name);
1180
- a ? iA.includes(t.type) ? a.silentSteps.push(t) : a.renderableSteps.push(t) : A.push({
1180
+ a ? sA.includes(t.type) ? a.silentSteps.push(t) : a.renderableSteps.push(t) : A.push({
1181
1181
  name: n.name,
1182
1182
  title: n.name,
1183
- renderableSteps: iA.includes(t.type) ? [] : [t],
1184
- silentSteps: iA.includes(t.type) ? [t] : []
1183
+ renderableSteps: sA.includes(t.type) ? [] : [t],
1184
+ silentSteps: sA.includes(t.type) ? [t] : []
1185
1185
  });
1186
1186
  }
1187
1187
  }
@@ -1204,7 +1204,7 @@ const je = F`
1204
1204
  ],
1205
1205
  silentSteps: []
1206
1206
  }), A;
1207
- }, Cn = (c, A) => A.find((e) => e.stepNames.includes(c)), tA = (c, A) => (c.conditions || []).every((e) => {
1207
+ }, Cn = (c, A) => A.find((e) => e.stepNames.includes(c)), nA = (c, A) => (c.conditions || []).every((e) => {
1208
1208
  const t = A[e.targetStepName];
1209
1209
  if (t && t.selectedVariants) {
1210
1210
  const n = t.selectedVariants;
@@ -1217,13 +1217,13 @@ const je = F`
1217
1217
  const e = {
1218
1218
  name: c.name,
1219
1219
  title: c.title,
1220
- renderableSteps: c.renderableSteps.filter((t) => tA(t, A)),
1221
- silentSteps: c.silentSteps.filter((t) => tA(t, A))
1220
+ renderableSteps: c.renderableSteps.filter((t) => nA(t, A)),
1221
+ silentSteps: c.silentSteps.filter((t) => nA(t, A))
1222
1222
  };
1223
1223
  return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
1224
- }, eA = (c, A) => c.map((e) => Qn(e, A)).filter((e) => e !== null), un = async (c, A, e = !1) => {
1224
+ }, tA = (c, A) => c.map((e) => Qn(e, A)).filter((e) => e !== null), un = async (c, A, e = !1) => {
1225
1225
  var i;
1226
- const t = eA(c, A), n = [];
1226
+ const t = tA(c, A), n = [];
1227
1227
  for (const s of t)
1228
1228
  for (const o of s.renderableSteps) {
1229
1229
  const r = (((i = o.option) == null ? void 0 : i.variants) || []).length;
@@ -1319,15 +1319,15 @@ function mn(c, A, e, t) {
1319
1319
  const s = c, o = Math.max(A.width / e.width, A.height / e.height);
1320
1320
  s.zoom = Math.max(o, c.zoom);
1321
1321
  const r = e.width * s.zoom, g = e.height * s.zoom;
1322
- return s.x = dA(c.x, A.width - r, 0), s.y = dA(c.y, A.height - g, 0), s;
1322
+ return s.x = wA(c.x, A.width - r, 0), s.y = wA(c.y, A.height - g, 0), s;
1323
1323
  }
1324
1324
  const i = c;
1325
- return i.x = dA(i.x, -n, A.width), i.y = dA(i.y, -a, A.height), i;
1325
+ return i.x = wA(i.x, -n, A.width), i.y = wA(i.y, -a, A.height), i;
1326
1326
  }
1327
- function dA(c, A, e) {
1327
+ function wA(c, A, e) {
1328
1328
  return Math.min(Math.max(c, A), e);
1329
1329
  }
1330
- let In = class {
1330
+ class In {
1331
1331
  constructor(A) {
1332
1332
  this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = Je(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = A, this.thresholdSettings = { useThreshold: !1, invertThreshold: !1, threshold: 128, thresholdSaturation: 0.5 };
1333
1333
  }
@@ -1511,7 +1511,7 @@ let In = class {
1511
1511
  this.offsets[t] = Ae(A, e);
1512
1512
  }), this._debouncedUpdateFrameOffsets(this.offsets, A, this.frameData, this.thresholdSettings, this.targetElements));
1513
1513
  }
1514
- };
1514
+ }
1515
1515
  class pe {
1516
1516
  constructor(A, e, t) {
1517
1517
  this.processRegion = async (n) => {
@@ -1523,7 +1523,7 @@ class pe {
1523
1523
  if (this.configuration.type === D.ProductOverlay) {
1524
1524
  let l = "";
1525
1525
  if ((o = this.product) != null && o.overlayImageUrl && (l = this.product.overlayImageUrl), i = l, !l)
1526
- throw new MA(this.configuration, "Couldn't find an asset for product overlay step");
1526
+ throw new yA(this.configuration, "Couldn't find an asset for product overlay step");
1527
1527
  }
1528
1528
  const s = this.evaluateAssetType();
1529
1529
  if (s === v.Image) {
@@ -1560,13 +1560,13 @@ class pe {
1560
1560
  Q("Undefined vector silent step source");
1561
1561
  return;
1562
1562
  }
1563
- q(l, !0).then((C) => {
1563
+ Z(l, !0).then((C) => {
1564
1564
  E(C);
1565
1565
  }).catch((C) => console.error(C));
1566
1566
  }))()), h = {
1567
1567
  stepName: this.configuration.stepName,
1568
1568
  id: J(),
1569
- cachedObjectURL: await pA(w.svg),
1569
+ cachedObjectURL: await fA(w.svg),
1570
1570
  src: l,
1571
1571
  svg: w.svg,
1572
1572
  colors: w.colors,
@@ -1594,7 +1594,7 @@ class pe {
1594
1594
  }
1595
1595
  async trigger() {
1596
1596
  if (!this.configuration.data.regions)
1597
- throw new MA(this.configuration, "Missing regions.");
1597
+ throw new yA(this.configuration, "Missing regions.");
1598
1598
  if (this.configuration.type === D.SilentIllustration) {
1599
1599
  const A = this.configuration.data.regions.map(this.processRegion);
1600
1600
  return Promise.all(A);
@@ -1614,7 +1614,7 @@ class pe {
1614
1614
  }
1615
1615
  }
1616
1616
  const pn = async (c) => {
1617
- const A = `${yA.getServicesApiUrl()}/shortener`;
1617
+ const A = `${q.getServicesApiUrl()}/shortener`;
1618
1618
  try {
1619
1619
  return (await (await fetch(A, {
1620
1620
  method: "POST",
@@ -1624,7 +1624,7 @@ const pn = async (c) => {
1624
1624
  }
1625
1625
  })).json()).shortUrl;
1626
1626
  } catch (e) {
1627
- throw console.error(e), new UA("Failed to shorten URL, see console.");
1627
+ throw console.error(e), new GA("Failed to shorten URL, see console.");
1628
1628
  }
1629
1629
  };
1630
1630
  class qe {
@@ -1680,7 +1680,7 @@ class fn {
1680
1680
  async () => {
1681
1681
  const u = await g();
1682
1682
  if (!u.link || !u.link)
1683
- throw new rA(u.asset);
1683
+ throw new cA(u.asset);
1684
1684
  C({
1685
1685
  rel: "mpeg4",
1686
1686
  href: u.link
@@ -1693,15 +1693,15 @@ class fn {
1693
1693
  40
1694
1694
  );
1695
1695
  });
1696
- A.forEach((C) => o(new Z(C.id)));
1696
+ A.forEach((C) => o(new $(C.id)));
1697
1697
  const l = i.data.baseUrl.slice(0, 4) === "http" ? "" : "https://", d = new URL(l + i.data.baseUrl);
1698
1698
  d.searchParams.append("video", btoa(JSON.stringify([B]))), d.pathname = d.pathname + (d.pathname.slice(-1) === "/" ? "" : "/");
1699
1699
  const w = d.toString();
1700
1700
  if (w.length >= 2e3)
1701
- throw new UA("Cannot create QR code, URL too long.");
1701
+ throw new GA("Cannot create QR code, URL too long.");
1702
1702
  const h = await pn(w);
1703
1703
  if (s(h), !i.data || !i.data.regions)
1704
- throw new MA(i, "Missing regions.");
1704
+ throw new yA(i, "Missing regions.");
1705
1705
  const E = await this.regionElements(i), Q = await this.command(h, E, a, i.stepName);
1706
1706
  Q && (Q.command && a.getCommandDispatcher()(Q.command), Q.followup && await Q.followup()), await a.setSelectionsAndElements(i.stepName, [], E, async () => {
1707
1707
  a.updateStorage(i.stepName, {
@@ -1753,11 +1753,11 @@ class Fn {
1753
1753
  return de(e);
1754
1754
  const t = A.asset;
1755
1755
  if (!t)
1756
- throw new $(A);
1756
+ throw new _(A);
1757
1757
  const n = t.fileLink;
1758
1758
  if (n)
1759
- return q(n, !0);
1760
- throw new rA(t);
1759
+ return Z(n, !0);
1760
+ throw new cA(t);
1761
1761
  };
1762
1762
  }
1763
1763
  async init(A, e, t) {
@@ -1852,7 +1852,7 @@ class Fn {
1852
1852
  });
1853
1853
  },
1854
1854
  () => {
1855
- throw new UA("Failed to resolve transcoded PDF");
1855
+ throw new GA("Failed to resolve transcoded PDF");
1856
1856
  }
1857
1857
  )
1858
1858
  ) : this.loadPatternFromAsset(e, A, t);
@@ -1926,7 +1926,7 @@ class Fn {
1926
1926
  a && a(!0);
1927
1927
  const r = await Promise.all(
1928
1928
  A.data.regions.map(async (d, w) => {
1929
- const h = await _A(o[w]), E = s.getImageData(), Q = t.map((p) => new Z(p.id)), C = E ? Ae(E, h) : void 0, f = E ? {
1929
+ const h = await _A(o[w]), E = s.getImageData(), Q = t.map((p) => new $(p.id)), C = E ? Ae(E, h) : void 0, f = E ? {
1930
1930
  id: J(),
1931
1931
  src: E.src,
1932
1932
  x: (C == null ? void 0 : C.x) || 0,
@@ -1990,7 +1990,7 @@ class Fn {
1990
1990
  const t = A.fileLink;
1991
1991
  if (t)
1992
1992
  return t;
1993
- throw new rA(A);
1993
+ throw new cA(A);
1994
1994
  }
1995
1995
  async loadPatternFromAsset(A, e, t) {
1996
1996
  var s;
@@ -2002,11 +2002,11 @@ class Fn {
2002
2002
  }), t.markUpdateCompleted(a);
2003
2003
  }
2004
2004
  }
2005
- const WA = new Fn();
2005
+ const XA = new Fn();
2006
2006
  class Mn {
2007
2007
  async getIllustrationBody(A) {
2008
2008
  return new Promise((e) => {
2009
- q(A, !0).then((t) => {
2009
+ Z(A, !0).then((t) => {
2010
2010
  e(t);
2011
2011
  }).catch((t) => console.error(t));
2012
2012
  });
@@ -2039,7 +2039,7 @@ class Mn {
2039
2039
  if (t.length === 0)
2040
2040
  return [];
2041
2041
  try {
2042
- return fA(
2042
+ return DA(
2043
2043
  t[0].id,
2044
2044
  e.getAllLayoutData()
2045
2045
  ).colors;
@@ -2104,10 +2104,10 @@ class Mn {
2104
2104
  const i = {};
2105
2105
  for (const [B, l] of a.entries())
2106
2106
  i[B] = { browserValue: l, spotColor: (g = i[B]) == null ? void 0 : g.spotColor };
2107
- const s = ft(A, e, t, i), o = await pA(s), r = [];
2107
+ const s = ft(A, e, t, i), o = await fA(s), r = [];
2108
2108
  for (const B of n) {
2109
2109
  for (const [l, d] of a.entries())
2110
- r.push(new zA(B, l, d));
2110
+ r.push(new KA(B, l, d));
2111
2111
  r.push(new Dt(B, s, o));
2112
2112
  }
2113
2113
  return new G(r);
@@ -2116,7 +2116,7 @@ class Mn {
2116
2116
  var d, w;
2117
2117
  if (e.length === 0)
2118
2118
  return;
2119
- const i = fA(
2119
+ const i = DA(
2120
2120
  e[0].id,
2121
2121
  n().map((h) => h.layoutState)
2122
2122
  ), s = { ...i.colors }, o = {};
@@ -2157,17 +2157,17 @@ class Mn {
2157
2157
  async selectVariantCommand(A, e, t, n, a) {
2158
2158
  var Q;
2159
2159
  if (!A.data || !A.data.regions)
2160
- throw new MA(A, "Missing regions.");
2160
+ throw new yA(A, "Missing regions.");
2161
2161
  n(!0);
2162
- const i = t.map((C) => new Z(C.id));
2162
+ const i = t.map((C) => new $(C.id));
2163
2163
  a.setMandatoryFulfilled(A.stepName, !1);
2164
2164
  const s = e.asset;
2165
2165
  if (!s)
2166
- throw new $(e);
2166
+ throw new _(e);
2167
2167
  const o = s.fileLink;
2168
2168
  if (!o)
2169
- throw new rA(s);
2170
- const r = await Se(await this.getIllustrationBody(o)), g = await pA(r.svg), B = (C) => {
2169
+ throw new cA(s);
2170
+ const r = await Se(await this.getIllustrationBody(o)), g = await fA(r.svg), B = (C) => {
2171
2171
  const f = a.getLayouts().find((m) => m.panelId === C.panelId);
2172
2172
  if (!f)
2173
2173
  throw new z(C);
@@ -2215,12 +2215,12 @@ class Mn {
2215
2215
  };
2216
2216
  }
2217
2217
  }
2218
- const IA = new Mn();
2218
+ const pA = new Mn();
2219
2219
  class yn {
2220
2220
  async init(A, e, t) {
2221
2221
  const n = A.option;
2222
2222
  if (!n)
2223
- throw new FA(A);
2223
+ throw new MA(A);
2224
2224
  if (t)
2225
2225
  await this.reload(A, e, t);
2226
2226
  else {
@@ -2238,7 +2238,7 @@ class yn {
2238
2238
  t.serializableWorkflow.steps
2239
2239
  ), s = Object.values(t.layouts).map((g) => g.elements).flat().filter((g) => g.stepName === A.stepName), o = A.option;
2240
2240
  if (!o)
2241
- throw new FA(A);
2241
+ throw new MA(A);
2242
2242
  if (n != null && n.selectedVariants) {
2243
2243
  const g = n.selectedVariants[0].id;
2244
2244
  if (g) {
@@ -2272,7 +2272,7 @@ class yn {
2272
2272
  n(!0);
2273
2273
  const i = e.material;
2274
2274
  if (!i)
2275
- throw n(!1), new $(e);
2275
+ throw n(!1), new _(e);
2276
2276
  return {
2277
2277
  command: void 0,
2278
2278
  followup: async () => {
@@ -2294,7 +2294,7 @@ class Yn {
2294
2294
  async init(A, e, t) {
2295
2295
  const n = A.option;
2296
2296
  if (!n)
2297
- throw new FA(A);
2297
+ throw new MA(A);
2298
2298
  if (t)
2299
2299
  await this.reload(A, e, t);
2300
2300
  else {
@@ -2327,7 +2327,7 @@ class Yn {
2327
2327
  if (d && A.option) {
2328
2328
  const h = (w = B.asset) == null ? void 0 : w.fileLink;
2329
2329
  if (!h)
2330
- throw new $(B);
2330
+ throw new _(B);
2331
2331
  await d.applyModelVariant(
2332
2332
  A.stepName || "",
2333
2333
  {
@@ -2352,7 +2352,7 @@ class Yn {
2352
2352
  n(!0);
2353
2353
  const a = (i = e.asset) == null ? void 0 : i.fileLink;
2354
2354
  if (!a)
2355
- throw new $(e);
2355
+ throw new _(e);
2356
2356
  return {
2357
2357
  command: void 0,
2358
2358
  followup: async () => {
@@ -2415,7 +2415,7 @@ class Sn {
2415
2415
  if (!E)
2416
2416
  return console.error(`Can not find layout for region: ${l.panelId}`), null;
2417
2417
  const Q = [];
2418
- return d && Q.push(new Z(w)), Q.push(
2418
+ return d && Q.push(new $(w)), Q.push(
2419
2419
  new L(
2420
2420
  {
2421
2421
  stepRegion: l,
@@ -2478,7 +2478,7 @@ class Sn {
2478
2478
  }
2479
2479
  if (!/^$|^[a-zA-Z0-9 ]+$/.test(e))
2480
2480
  return n("Unsupported characters."), !1;
2481
- const a = VA(e.toLowerCase());
2481
+ const a = WA(e.toLowerCase());
2482
2482
  for (const i of a)
2483
2483
  for (const s in t) {
2484
2484
  const o = t[s].toLowerCase().replace(/\s/g, "");
@@ -2532,12 +2532,12 @@ class Pn {
2532
2532
  async selectVariantCommand(A, e, t, n) {
2533
2533
  const a = e.asset;
2534
2534
  if (!a)
2535
- throw new $(e);
2535
+ throw new _(e);
2536
2536
  const i = a == null ? void 0 : a.fileLink;
2537
2537
  if (!i)
2538
2538
  return console.error("No URL for picture!"), null;
2539
2539
  n(!0), t.setMandatoryFulfilled(A.stepName, !1);
2540
- const o = t.getRegionElements(A.stepName).map((B) => new Z(B.id)), r = (B) => {
2540
+ const o = t.getRegionElements(A.stepName).map((B) => new $(B.id)), r = (B) => {
2541
2541
  const d = t.getLayouts().find((h) => h.panelId === B.panelId);
2542
2542
  if (!d)
2543
2543
  throw new z(B);
@@ -2659,14 +2659,14 @@ class Hn {
2659
2659
  const o = s.region;
2660
2660
  if (!n.find((g) => g.panelId === (o == null ? void 0 : o.panelId)))
2661
2661
  throw new z(o);
2662
- return new zA(s.id, this.shapeFillId, A);
2662
+ return new KA(s.id, this.shapeFillId, A);
2663
2663
  }).filter((s) => !!s);
2664
2664
  t.getCommandDispatcher()(new G(i)), t.updateStorage(e.stepName, { colour: A });
2665
2665
  }
2666
2666
  async init(A, e, t) {
2667
2667
  const n = A.option;
2668
2668
  if (!n)
2669
- throw new FA(A);
2669
+ throw new MA(A);
2670
2670
  if (t)
2671
2671
  await this.reload(A, e, t);
2672
2672
  else {
@@ -2731,7 +2731,7 @@ class Hn {
2731
2731
  if (!a.find((h) => h.panelId === (l == null ? void 0 : l.panelId)))
2732
2732
  throw new z(l);
2733
2733
  const w = s();
2734
- return new zA(B.id, this.shapeFillId, w);
2734
+ return new KA(B.id, this.shapeFillId, w);
2735
2735
  }, g = t.map(r).filter((B) => !!B);
2736
2736
  return {
2737
2737
  command: new G(g),
@@ -2812,7 +2812,7 @@ class Hn {
2812
2812
  }
2813
2813
  }
2814
2814
  }
2815
- const oA = new Hn();
2815
+ const rA = new Hn();
2816
2816
  class Rn {
2817
2817
  constructor() {
2818
2818
  this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
@@ -2835,7 +2835,7 @@ class Rn {
2835
2835
  );
2836
2836
  }
2837
2837
  }
2838
- const Un = new Rn(), bA = 30;
2838
+ const Un = new Rn(), LA = 30;
2839
2839
  class SA extends Error {
2840
2840
  constructor(A) {
2841
2841
  super(A), Object.setPrototypeOf(this, new.target.prototype), this.name = SA.name;
@@ -2867,7 +2867,7 @@ class vn {
2867
2867
  }, this.textAlign = (A) => A.vertical ? "center" : A.textAlign || "center", this.getErrorsForText = (A, e, t) => {
2868
2868
  const n = [];
2869
2869
  e.data && e.data.maxLength && A.length > e.data.maxLength && n.push({ localizationKey: "workflow.steps.text.characterLimit" });
2870
- const a = t.getProfanities(), i = VA(A.toLowerCase());
2870
+ const a = t.getProfanities(), i = WA(A.toLowerCase());
2871
2871
  for (const o of i)
2872
2872
  for (const r in a) {
2873
2873
  const g = a[r].toLowerCase().replace(/\s/g, "");
@@ -2888,7 +2888,7 @@ class vn {
2888
2888
  if (t)
2889
2889
  await this.reload(A, e, t);
2890
2890
  else {
2891
- const o = this.getDefaultImageFillVariant(A.data), r = (a = o == null ? void 0 : o.asset) == null ? void 0 : a.fileLink, g = r ? await KA(r) : void 0, B = g ? {
2891
+ const o = this.getDefaultImageFillVariant(A.data), r = (a = o == null ? void 0 : o.asset) == null ? void 0 : a.fileLink, g = r ? await jA(r) : void 0, B = g ? {
2892
2892
  src: g.src,
2893
2893
  height: g.height,
2894
2894
  width: g.width,
@@ -2921,7 +2921,7 @@ class vn {
2921
2921
  return null;
2922
2922
  }
2923
2923
  findLayoutElements(A, e) {
2924
- return A.getRegionElements(e.stepName).map((a) => fA(a.id, A.getAllLayoutData()));
2924
+ return A.getRegionElements(e.stepName).map((a) => DA(a.id, A.getAllLayoutData()));
2925
2925
  }
2926
2926
  /**
2927
2927
  * Get the colors that can be used for a given text step.
@@ -2983,7 +2983,7 @@ class vn {
2983
2983
  })) == null ? void 0 : n.filter((i) => !!i)) || [];
2984
2984
  return Promise.all(
2985
2985
  a.map(async (i) => {
2986
- const s = await KA(i);
2986
+ const s = await jA(i);
2987
2987
  return {
2988
2988
  src: i,
2989
2989
  width: s.width,
@@ -3007,13 +3007,13 @@ class vn {
3007
3007
  fillImage: e
3008
3008
  });
3009
3009
  for (const r of t) {
3010
- const g = new kA(r.id, e);
3010
+ const g = new JA(r.id, e);
3011
3011
  a(g);
3012
3012
  }
3013
3013
  }
3014
3014
  getProcessedInput(A, e, t) {
3015
3015
  const n = t ? A : this.injectReplaceableText(A, e);
3016
- return jA(n, {
3016
+ return VA(n, {
3017
3017
  vertical: e.vertical,
3018
3018
  uppercase: e.uppercase
3019
3019
  });
@@ -3032,7 +3032,7 @@ class vn {
3032
3032
  for (const l of e) {
3033
3033
  if (!l.fontData)
3034
3034
  throw new k("Failed to resolve font data for text.");
3035
- const [d, w] = uA(
3035
+ const [d, w] = mA(
3036
3036
  l.fontSize,
3037
3037
  l.fontData,
3038
3038
  { left: l.x, top: l.y, width: l.width, height: l.height, rotation: l.rotation, panelId: "" },
@@ -3125,10 +3125,10 @@ class vn {
3125
3125
  async fontDataFromVariant(A) {
3126
3126
  const e = A.asset;
3127
3127
  if (!e)
3128
- throw new $(A);
3128
+ throw new _(A);
3129
3129
  const t = e.fileLink;
3130
3130
  if (!t)
3131
- throw new rA(e);
3131
+ throw new cA(e);
3132
3132
  const n = await ee(t);
3133
3133
  return {
3134
3134
  assetUrl: t,
@@ -3141,12 +3141,12 @@ class vn {
3141
3141
  if (n.length > 0) {
3142
3142
  const l = n.map((h) => new Ee(h.id, g));
3143
3143
  if (o) {
3144
- const h = n.map((E) => new kA(E.id, o));
3144
+ const h = n.map((E) => new JA(E.id, o));
3145
3145
  l.push(...h);
3146
3146
  }
3147
3147
  const d = await this.changeInputTextWithRegion(
3148
3148
  A,
3149
- A.data.size || bA,
3149
+ A.data.size || LA,
3150
3150
  g,
3151
3151
  t.text || "",
3152
3152
  t,
@@ -3171,7 +3171,7 @@ class vn {
3171
3171
  a
3172
3172
  ), d = await this.changeInputTextWithRegion(
3173
3173
  A,
3174
- A.data.size || bA,
3174
+ A.data.size || LA,
3175
3175
  g,
3176
3176
  ((B = l[0]) == null ? void 0 : B.newElement.input) || t.text || A.data.defaultText || "",
3177
3177
  t,
@@ -3182,7 +3182,7 @@ class vn {
3182
3182
  ), w = l.flatMap((E) => E.commands);
3183
3183
  if (o) {
3184
3184
  const E = l.map(
3185
- (Q) => new kA(Q.regionElement.id, o)
3185
+ (Q) => new JA(Q.regionElement.id, o)
3186
3186
  );
3187
3187
  w.push(...E);
3188
3188
  }
@@ -3227,7 +3227,7 @@ class vn {
3227
3227
  stepName: A,
3228
3228
  align: this.textAlign(t),
3229
3229
  fill: a.color ? a.color : f,
3230
- fontSize: t.size || bA,
3230
+ fontSize: t.size || LA,
3231
3231
  fontData: n,
3232
3232
  id: w,
3233
3233
  layer: B.layer,
@@ -3249,7 +3249,7 @@ class vn {
3249
3249
  }, m = [], I = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
3250
3250
  if (!u.fontData)
3251
3251
  throw new k("Failed to resolve font data for text.");
3252
- const [M, y] = uA(
3252
+ const [M, y] = mA(
3253
3253
  u.fontSize,
3254
3254
  u.fontData,
3255
3255
  {
@@ -3310,7 +3310,7 @@ class vn {
3310
3310
  const B = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), l = this.getProcessedInput(B, A.data, s), d = i.getRegionElements(A.stepName), w = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
3311
3311
  for (const u of d)
3312
3312
  if (u.region) {
3313
- const [m, I] = uA(
3313
+ const [m, I] = mA(
3314
3314
  e,
3315
3315
  t,
3316
3316
  u.region,
@@ -3322,7 +3322,7 @@ class vn {
3322
3322
  const Q = (() => {
3323
3323
  if (A.data && A.data.maxLength && l.length > A.data.maxLength)
3324
3324
  return g && g(!0), { info: "0" };
3325
- const u = i.getProfanities(), m = VA(l.toLowerCase());
3325
+ const u = i.getProfanities(), m = WA(l.toLowerCase());
3326
3326
  for (const I of m)
3327
3327
  for (const p in u) {
3328
3328
  const M = u[p].toLowerCase().replace(/\s/g, "");
@@ -4644,13 +4644,13 @@ function tt(c, A, e) {
4644
4644
  Tn(A, e, `bgdef-${t}`), c.appendChild(Ln(`#bgdef-${t}`));
4645
4645
  }
4646
4646
  const nt = (c, A, e, t) => {
4647
- const n = lA("filter");
4647
+ const n = BA("filter");
4648
4648
  n.setAttribute("id", t), n.setAttribute("height", "200%"), n.setAttribute("width", "200%"), n.setAttribute("x", "-50%"), n.setAttribute("y", "-50%");
4649
- const a = lA("feOffset");
4649
+ const a = BA("feOffset");
4650
4650
  n.appendChild(a), a.setAttribute("result", "offOut"), a.setAttribute("in", "SourceAlpha"), a.setAttribute("dx", `${c}`), a.setAttribute("dy", `${A}`);
4651
- const i = lA("feGaussianBlur");
4651
+ const i = BA("feGaussianBlur");
4652
4652
  n.appendChild(i), i.setAttribute("result", "blurOut"), i.setAttribute("in", "offOut"), i.setAttribute("stdDeviation", `${e}`);
4653
- const s = lA("feBlend");
4653
+ const s = BA("feBlend");
4654
4654
  return n.appendChild(s), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "blurOut"), s.setAttribute("mode", "normal"), n;
4655
4655
  }, at = (c) => {
4656
4656
  let A = c;
@@ -4715,7 +4715,7 @@ class ce {
4715
4715
  l = (B * 100 | 0) / 100;
4716
4716
  break;
4717
4717
  default:
4718
- throw new sA("Failed to encode path.");
4718
+ throw new oA("Failed to encode path.");
4719
4719
  }
4720
4720
  o || i.push(" "), i.push(l), o = !1;
4721
4721
  }
@@ -4729,12 +4729,12 @@ class ce {
4729
4729
  for (e.lastIndex = 0; a = e.exec(A); ) {
4730
4730
  const i = a[1].toLowerCase(), s = (a[2].match(t) || []).map(parseFloat), o = i === a[1], r = fe[i];
4731
4731
  if (s.length < r.length)
4732
- throw new sA(
4732
+ throw new oA(
4733
4733
  `Path type "${i}" given ${s.length} arguments, expected ${r.length}.`
4734
4734
  );
4735
4735
  if (r.length > 0) {
4736
4736
  if (s.length % r.length !== 0)
4737
- throw new sA(
4737
+ throw new oA(
4738
4738
  `Path type "${i}" given ${s.length} arguments, not divisible by ${r.length}`
4739
4739
  );
4740
4740
  for (let g = 0; g < s.length / r.length; g++) {
@@ -4759,7 +4759,7 @@ class ce {
4759
4759
  if (s in a && o in a) {
4760
4760
  const r = [a[s], a[o]], g = e(r);
4761
4761
  if (g.length < 2)
4762
- throw new sA("Transformer must return at least 2 points.");
4762
+ throw new oA("Transformer must return at least 2 points.");
4763
4763
  a[s] = g[0], a[o] = g[1];
4764
4764
  }
4765
4765
  }
@@ -4920,7 +4920,7 @@ async function it(c) {
4920
4920
  if (c === "Favourites")
4921
4921
  return new zn();
4922
4922
  if (c === "Maltesers") {
4923
- const A = q("https://assets.spiff.com.au/public/modules/img/MaltesersBackground.svg"), e = q("https://assets.spiff.com.au/public/modules/img/MaltesersBackgroundShort.svg"), t = await Promise.all([A, e]);
4923
+ const A = Z("https://assets.spiff.com.au/public/modules/img/MaltesersBackground.svg"), e = Z("https://assets.spiff.com.au/public/modules/img/MaltesersBackgroundShort.svg"), t = await Promise.all([A, e]);
4924
4924
  return new jn(t[0], t[1]);
4925
4925
  }
4926
4926
  if (c === "Vegemite")
@@ -4973,7 +4973,7 @@ class qn {
4973
4973
  this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((s) => {
4974
4974
  this.storage[s.stepName] = s.storage || {};
4975
4975
  }), this.allScenes = await hn(A);
4976
- const n = eA(this.allScenes, this.stepSelections).map((s) => s.silentSteps).flat(), { stepElements: a, commands: i } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
4976
+ const n = tA(this.allScenes, this.stepSelections).map((s) => s.silentSteps).flat(), { stepElements: a, commands: i } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
4977
4977
  this.commandContext.apply(new G(i), !0), this.stepElements = { ...this.stepElements, ...a }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
4978
4978
  }
4979
4979
  setWorkflowStateSyncEnabled(A) {
@@ -5142,7 +5142,7 @@ class qn {
5142
5142
  model: this.getProduct().modelUrl,
5143
5143
  contextService: this.getLayoutPreviewService()
5144
5144
  });
5145
- this.setModelContainer(e), eA(this.allScenes, this.stepSelections).filter((a) => a).map((a) => a.renderableSteps).flat().filter((a) => a.type === D.Model || a.type === D.Material).forEach((a) => {
5145
+ this.setModelContainer(e), tA(this.allScenes, this.stepSelections).filter((a) => a).map((a) => a.renderableSteps).flat().filter((a) => a.type === D.Model || a.type === D.Material).forEach((a) => {
5146
5146
  var o, r, g;
5147
5147
  if (!((o = a.option) != null && o.id)) {
5148
5148
  console.error(`Failed to read option id from step: ${a.stepName}`);
@@ -5254,7 +5254,7 @@ class qn {
5254
5254
  const A = this.getCommandContext().getState();
5255
5255
  if (!A)
5256
5256
  throw new k("Attempted to serialize state before it was initialized.");
5257
- return { transaction: JSON.stringify(this.dehydrateState(HA(A.transaction))) };
5257
+ return { transaction: JSON.stringify(this.dehydrateState(RA(A.transaction))) };
5258
5258
  }
5259
5259
  dehydrateState(A) {
5260
5260
  for (const e of Object.values(A.layouts).map((t) => t.elements).flat())
@@ -5281,12 +5281,12 @@ class qn {
5281
5281
  this.stepElements = e(this.stepElements, A);
5282
5282
  }
5283
5283
  getInvalidCanvasRegions() {
5284
- return this.workflow.steps.reduce((A, e) => (tA(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
5284
+ return this.workflow.steps.reduce((A, e) => (nA(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
5285
5285
  (t) => A.push(t)
5286
5286
  ), A), []);
5287
5287
  }
5288
5288
  getInvalidModelVariants() {
5289
- return this.workflow.steps.reduce((A, e) => (e.type === D.Model && !tA(e, this.stepSelections) && A.push(e.stepName), A), []);
5289
+ return this.workflow.steps.reduce((A, e) => (e.type === D.Model && !nA(e, this.stepSelections) && A.push(e.stepName), A), []);
5290
5290
  }
5291
5291
  async stepElementsForIntroducedSilentSteps(A, e) {
5292
5292
  const t = this.product;
@@ -5336,7 +5336,7 @@ class qn {
5336
5336
  async reset() {
5337
5337
  this.commandContext.getAllLayouts().forEach(
5338
5338
  (e) => e.layoutState.elements.forEach((t) => {
5339
- this.getCommandDispatcher()(new Z(t.id));
5339
+ this.getCommandDispatcher()(new $(t.id));
5340
5340
  })
5341
5341
  ), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
5342
5342
  }
@@ -5347,13 +5347,13 @@ class qn {
5347
5347
  ...this.stepSelections,
5348
5348
  [A]: { selectedVariants: e }
5349
5349
  }, this.selectionCost = Object.values(this.stepSelections).reduce((I, p) => I + p.selectedVariants.map((M) => M.priceModifier || 0).reduce((M, y) => M + y, 0), 0), this.workflow.steps.forEach((I) => {
5350
- tA(I, this.stepSelections) || (this.stepInitialised[I.stepName] = !1, delete this.stepMetadata[I.stepName], delete this.stepSelections[I.stepName], delete this.storage[I.stepName]);
5350
+ nA(I, this.stepSelections) || (this.stepInitialised[I.stepName] = !1, delete this.stepMetadata[I.stepName], delete this.stepSelections[I.stepName], delete this.storage[I.stepName]);
5351
5351
  });
5352
- const i = this.allScenes, s = eA(i, a), o = eA(i, this.stepSelections), r = s.map((I) => I.silentSteps).flat(), B = o.map((I) => I.silentSteps).flat().filter(
5352
+ const i = this.allScenes, s = tA(i, a), o = tA(i, this.stepSelections), r = s.map((I) => I.silentSteps).flat(), B = o.map((I) => I.silentSteps).flat().filter(
5353
5353
  (I) => !r.some((p) => p.stepName === I.stepName)
5354
5354
  );
5355
5355
  r.forEach((I) => {
5356
- tA(I, this.stepSelections) || (this.stepInitialised[I.stepName] = !1);
5356
+ nA(I, this.stepSelections) || (this.stepInitialised[I.stepName] = !1);
5357
5357
  });
5358
5358
  const l = this.getInvalidCanvasRegions(), { stepElements: d, commands: w } = await this.stepElementsForIntroducedSilentSteps(B, !1);
5359
5359
  this.stepElements = {
@@ -5366,7 +5366,7 @@ class qn {
5366
5366
  const I = this.getStepSpecificServices(A);
5367
5367
  (m = I == null ? void 0 : I.frameService) == null || m.setTargetElements(t.map((p) => p.id));
5368
5368
  }
5369
- const E = l.map((I) => new Z(I.id)), Q = new he(this.constructSerializableWorkflow()), C = [...w, ...E, Q];
5369
+ const E = l.map((I) => new $(I.id)), Q = new he(this.constructSerializableWorkflow()), C = [...w, ...E, Q];
5370
5370
  C.length > 0 && this.commandContext.apply(new G(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
5371
5371
  const f = this.getInvalidModelVariants(), u = this.modelContainer;
5372
5372
  if (u) {
@@ -5384,7 +5384,7 @@ class qn {
5384
5384
  await this.onSelectionChange(), n && await n();
5385
5385
  }
5386
5386
  async ensureStepsAreLoaded() {
5387
- const e = eA(this.allScenes, this.stepSelections).map((o) => o.renderableSteps), t = [], n = e.flat();
5387
+ const e = tA(this.allScenes, this.stepSelections).map((o) => o.renderableSteps), t = [], n = e.flat();
5388
5388
  for (const o of n)
5389
5389
  if (!this.stepInitialised[o.stepName])
5390
5390
  switch (this.stepInitialised[o.stepName] = !0, o.type) {
@@ -5404,13 +5404,13 @@ class qn {
5404
5404
  r.connectWorkflowManager(this, o.stepName), this.stepSpecificServices[o.stepName] = {
5405
5405
  frameService: r
5406
5406
  }, t.push(
5407
- WA.init(o, this, this.reloadedState)
5407
+ XA.init(o, this, this.reloadedState)
5408
5408
  );
5409
5409
  }
5410
5410
  break;
5411
5411
  case D.Illustration:
5412
5412
  t.push(
5413
- IA.init(o, this, this.reloadedState)
5413
+ pA.init(o, this, this.reloadedState)
5414
5414
  );
5415
5415
  break;
5416
5416
  case D.Material:
@@ -5439,7 +5439,7 @@ class qn {
5439
5439
  );
5440
5440
  break;
5441
5441
  case D.Shape:
5442
- t.push(oA.init(o, this, this.reloadedState));
5442
+ t.push(rA.init(o, this, this.reloadedState));
5443
5443
  break;
5444
5444
  case D.Text:
5445
5445
  t.push(K.init(o, this, this.reloadedState));
@@ -5593,7 +5593,7 @@ class X {
5593
5593
  return this.variantData.enabled;
5594
5594
  }
5595
5595
  }
5596
- const st = class XA {
5596
+ const st = class qA {
5597
5597
  constructor(A, e) {
5598
5598
  this.manager = A, this.step = e;
5599
5599
  }
@@ -5603,13 +5603,13 @@ const st = class XA {
5603
5603
  * @param value The new value
5604
5604
  */
5605
5605
  setUpdateState(A) {
5606
- XA.updateState.set(this.step.stepName, A);
5606
+ qA.updateState.set(this.step.stepName, A);
5607
5607
  }
5608
5608
  /**
5609
5609
  * @returns Gets the current update state of this step. All step handles for this step will see this value.
5610
5610
  */
5611
5611
  getUpdateState() {
5612
- return !!XA.updateState.get(this.step.stepName);
5612
+ return !!qA.updateState.get(this.step.stepName);
5613
5613
  }
5614
5614
  /**
5615
5615
  * Gets the currently selected variant, or undefined if no variant is selected.
@@ -5677,7 +5677,7 @@ const st = class XA {
5677
5677
  */
5678
5678
  executeAnimations() {
5679
5679
  const A = this.manager.getPreviewService(), e = this.manager.getModelContainer(), t = this.step.data.modelAnimation, n = this.step.data.lookAtAnimation;
5680
- A && n && A.executeCameraAnimation(n), e && t && e.executeAnimation(t);
5680
+ A ? n && A.executeCameraAnimation(n) : console.warn("No preview service available, cannot execute camera animations."), e ? t && e.executeAnimation(t) : console.warn("No model container available, cannot execute model animations.");
5681
5681
  }
5682
5682
  };
5683
5683
  st.updateState = /* @__PURE__ */ new Map();
@@ -5693,7 +5693,7 @@ class Zn extends W {
5693
5693
  */
5694
5694
  async selectVariant(A) {
5695
5695
  if (!this.getUpdateState() && this.getCurrentVariant() !== A)
5696
- return IA.selectVariant(
5696
+ return pA.selectVariant(
5697
5697
  this.step,
5698
5698
  A.getResource(),
5699
5699
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -5709,7 +5709,7 @@ class Zn extends W {
5709
5709
  const A = this.manager.getRegionElements(this.step.stepName) || [];
5710
5710
  if (A.length !== 0)
5711
5711
  try {
5712
- return fA(A[0].id, this.manager.getAllLayoutData()).colors;
5712
+ return DA(A[0].id, this.manager.getAllLayoutData()).colors;
5713
5713
  } catch (e) {
5714
5714
  console.error(e);
5715
5715
  }
@@ -5719,7 +5719,7 @@ class Zn extends W {
5719
5719
  */
5720
5720
  setColor(A, e) {
5721
5721
  const t = /* @__PURE__ */ new Map();
5722
- return t.set(A, e), IA.changeColors(
5722
+ return t.set(A, e), pA.changeColors(
5723
5723
  this.step,
5724
5724
  this.manager.getRegionElements(this.step.stepName),
5725
5725
  this.manager,
@@ -5731,7 +5731,7 @@ class Zn extends W {
5731
5731
  return this.step.data.colorOption;
5732
5732
  }
5733
5733
  getAvailableColors() {
5734
- return this.step.data.colorPickerEnabled ? IA.availableColors(this.step, this.manager) : Promise.resolve([]);
5734
+ return this.step.data.colorPickerEnabled ? pA.availableColors(this.step, this.manager) : Promise.resolve([]);
5735
5735
  }
5736
5736
  isColorPickerEnabled() {
5737
5737
  return this.step.data.colorPickerEnabled;
@@ -5804,7 +5804,7 @@ class ta extends W {
5804
5804
  }
5805
5805
  selectVariant(A) {
5806
5806
  const e = A.getResource();
5807
- return oA.selectVariant(
5807
+ return rA.selectVariant(
5808
5808
  this.step,
5809
5809
  {
5810
5810
  fill: e.color,
@@ -5822,7 +5822,7 @@ class ta extends W {
5822
5822
  * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
5823
5823
  */
5824
5824
  setColor(A) {
5825
- return oA.selectVariant(
5825
+ return rA.selectVariant(
5826
5826
  this.step,
5827
5827
  A,
5828
5828
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -5834,7 +5834,7 @@ class ta extends W {
5834
5834
  * @returns A list of color definitions that are currently applied to the illustration.
5835
5835
  */
5836
5836
  getColors() {
5837
- return oA.availableColours(this.step);
5837
+ return rA.availableColours(this.step);
5838
5838
  }
5839
5839
  /**
5840
5840
  * Allows for setting a custom color when the custom variant is selected. Will
@@ -5846,7 +5846,7 @@ class ta extends W {
5846
5846
  throw new Error(
5847
5847
  "Custom colors can only be set on a non-custom variant. Please add a custom variant to the step."
5848
5848
  );
5849
- return oA.setCustomColor(A, this.step, this.manager);
5849
+ return rA.setCustomColor(A, this.step, this.manager);
5850
5850
  }
5851
5851
  getCustomColor() {
5852
5852
  var e, t;
@@ -6045,7 +6045,7 @@ class aa extends W {
6045
6045
  return this.step.data.content;
6046
6046
  }
6047
6047
  }
6048
- class wA {
6048
+ class EA {
6049
6049
  static get(A, e) {
6050
6050
  switch (e.type) {
6051
6051
  case D.Information:
@@ -6172,7 +6172,7 @@ const ot = F`
6172
6172
  }))
6173
6173
  }
6174
6174
  })).data) == null ? void 0 : e.designCreateMany;
6175
- }, qA = (c, A, e) => {
6175
+ }, ZA = (c, A, e) => {
6176
6176
  const t = (a) => {
6177
6177
  const i = {};
6178
6178
  if (a.type === "Frame") {
@@ -6212,7 +6212,7 @@ const ot = F`
6212
6212
  const n = {};
6213
6213
  let a;
6214
6214
  if (e) {
6215
- a = qA(e, A, !1);
6215
+ a = ZA(e, A, !1);
6216
6216
  for (const i of Object.keys(a))
6217
6217
  n[i] = {
6218
6218
  value: a[i],
@@ -6283,7 +6283,7 @@ const ot = F`
6283
6283
  N.errors && console.log("Server Error:", b.message);
6284
6284
  }), null) : H ?? null;
6285
6285
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(t())), await c.updateStateWithServerImmediate(t), console.log("Server state is undefined @ Workflow completion"));
6286
- const l = c.getPreviewService(), d = (M = A == null ? void 0 : A.finalizeStepConfig) == null ? void 0 : M.lookAtAnimation, w = l && A.showModelOnFinishStep && !!d, h = o && qA(o, A, !0), E = o && qA(o, A, !1), Q = async (y) => {
6286
+ const l = c.getPreviewService(), d = (M = A == null ? void 0 : A.finalizeStepConfig) == null ? void 0 : M.lookAtAnimation, w = l && A.showModelOnFinishStep && !!d, h = o && ZA(o, A, !0), E = o && ZA(o, A, !1), Q = async (y) => {
6287
6287
  const S = {};
6288
6288
  let Y = 0;
6289
6289
  if (Object.keys(a).length > 0)
@@ -6292,12 +6292,12 @@ const ot = F`
6292
6292
  for (let b = 0; b < H.selections.length; ++b) {
6293
6293
  const V = H.selections[b];
6294
6294
  if (T && (!y || T.option && (T.option.variants || []).length > 1 && !T.data.hideSelectionInCart && !T.data.hideSelectionsInCart)) {
6295
- const vA = T.stepTitle;
6296
- S[vA] ? S[vA].push({
6295
+ const kA = T.stepTitle;
6296
+ S[kA] ? S[kA].push({
6297
6297
  id: V.id || "",
6298
6298
  name: V.name,
6299
6299
  priceModifier: V.priceModifier
6300
- }) : S[vA] = [
6300
+ }) : S[kA] = [
6301
6301
  {
6302
6302
  id: V.id || "",
6303
6303
  name: V.name,
@@ -6497,7 +6497,7 @@ class Ba {
6497
6497
  throw new k("Unexpected storage method requested");
6498
6498
  }
6499
6499
  }
6500
- const LA = new Ba(), da = F`
6500
+ const TA = new Ba(), da = F`
6501
6501
  mutation AddTransactionStakeholder($id: String!, $type: String!, $details: CustomerDetailsInput!) {
6502
6502
  transactionAddStakeholder(id: $id, details: $details, type: $type) {
6503
6503
  id
@@ -6512,11 +6512,11 @@ const LA = new Ba(), da = F`
6512
6512
  }
6513
6513
  }
6514
6514
  `;
6515
- class EA {
6515
+ class hA {
6516
6516
  constructor(A, e) {
6517
6517
  var n;
6518
6518
  if (this.renderableScenes = [], this.renderableSceneCallbacks = [], this.debouncedSavedDesignUpdate = Je(async () => {
6519
- await LA.getSavedDesignByTransaction(
6519
+ await TA.getSavedDesignByTransaction(
6520
6520
  this.getWorkflowManager().getTransaction().id
6521
6521
  ) && this.save();
6522
6522
  }, 2500), this.getCanvasObjectURLAsync = async (a) => new Promise((i, s) => {
@@ -6591,7 +6591,7 @@ class EA {
6591
6591
  }
6592
6592
  let a = 2048;
6593
6593
  e && e <= 2048 && (a = e);
6594
- const i = DA(a, a), s = this.commandContext.getAllLayouts(), o = t.defaultPreviewPanelIndex || 0, r = t.panels[o], g = s.find((u) => {
6594
+ const i = FA(a, a), s = this.commandContext.getAllLayouts(), o = t.defaultPreviewPanelIndex || 0, r = t.panels[o], g = s.find((u) => {
6595
6595
  var m;
6596
6596
  return ((m = u.layoutState) == null ? void 0 : m.layout.panelId) === (r == null ? void 0 : r.name);
6597
6597
  }) || s[0], B = g.layoutState.layout.previewRegion ? {
@@ -6606,7 +6606,7 @@ class EA {
6606
6606
  height: g.layoutState.layout.height
6607
6607
  }, l = this.commandContext.getLayoutById(g.layoutState.layout.id), d = i.getContext("2d");
6608
6608
  if (!d)
6609
- throw new UA("Failed to obtain 2D context for preview image creation");
6609
+ throw new GA("Failed to obtain 2D context for preview image creation");
6610
6610
  const w = xe(l.layoutState.layout, l.layoutState.elements, {
6611
6611
  renderingConfiguration: {
6612
6612
  purpose: Pe.Print,
@@ -6616,7 +6616,7 @@ class EA {
6616
6616
  await (await ke.from(d, h, {
6617
6617
  anonymousCrossOrigin: !0,
6618
6618
  ignoreDimensions: !1,
6619
- createCanvas: DA,
6619
+ createCanvas: FA,
6620
6620
  createImage: He,
6621
6621
  DOMParser: Re(),
6622
6622
  fetch: $A
@@ -6627,7 +6627,7 @@ class EA {
6627
6627
  getStepById(A) {
6628
6628
  const e = this.getWorkflowManager().getWorkflow().steps.find((t) => t.stepName === A);
6629
6629
  if (!(!e || !this.stepHasHandle(e)))
6630
- return wA.get(this.getWorkflowManager(), e);
6630
+ return EA.get(this.getWorkflowManager(), e);
6631
6631
  }
6632
6632
  getSteps() {
6633
6633
  return this.getScenes().flatMap((A) => this.getStepsByScene(A));
@@ -6687,10 +6687,10 @@ class EA {
6687
6687
  getStepByName(A) {
6688
6688
  const e = this.getWorkflowManager().getWorkflow().steps.find((t) => t.stepTitle === A);
6689
6689
  if (!(!e || !this.stepHasHandle(e)))
6690
- return wA.get(this.getWorkflowManager(), e);
6690
+ return EA.get(this.getWorkflowManager(), e);
6691
6691
  }
6692
6692
  getStepsByType(A) {
6693
- return this.getWorkflowManager().getWorkflow().steps.filter((e) => e.type === A).map((e) => wA.get(this.getWorkflowManager(), e));
6693
+ return this.getWorkflowManager().getWorkflow().steps.filter((e) => e.type === A).map((e) => EA.get(this.getWorkflowManager(), e));
6694
6694
  }
6695
6695
  getStepsByScene(A) {
6696
6696
  if (!this.getWorkflowManager().getWorkflow().stepGroups.find((t) => t.name === A.name))
@@ -6699,7 +6699,7 @@ class EA {
6699
6699
  );
6700
6700
  return A.stepIds.map(
6701
6701
  (t) => this.getWorkflowManager().getWorkflow().steps.find((n) => n.stepName === t)
6702
- ).filter((t) => this.stepHasHandle(t)).map((t) => wA.get(this.getWorkflowManager(), t));
6702
+ ).filter((t) => this.stepHasHandle(t)).map((t) => EA.get(this.getWorkflowManager(), t));
6703
6703
  }
6704
6704
  async attachCustomerDetails(A) {
6705
6705
  return this.assignCustomerDetails({ emailAddress: A.email });
@@ -6742,7 +6742,7 @@ class EA {
6742
6742
  var o;
6743
6743
  if (A)
6744
6744
  return A;
6745
- const a = this.getWorkflowManager().getTransaction().id, s = (o = (await LA.getSavedDesigns()).find((r) => r.transactionId === a)) == null ? void 0 : o.title;
6745
+ const a = this.getWorkflowManager().getTransaction().id, s = (o = (await TA.getSavedDesigns()).find((r) => r.transactionId === a)) == null ? void 0 : o.title;
6746
6746
  return s || "My design";
6747
6747
  })(),
6748
6748
  thumbnail: await this.createPreviewImage(!1, 256),
@@ -6753,11 +6753,11 @@ class EA {
6753
6753
  workflowId: this.getWorkflowManager().getWorkflow().id,
6754
6754
  lastEdited: /* @__PURE__ */ new Date()
6755
6755
  };
6756
- return await LA.addDesign(n), n;
6756
+ return await TA.addDesign(n), n;
6757
6757
  }
6758
6758
  async copy() {
6759
6759
  var s;
6760
- const A = HA(this.getCommandContext().getState());
6760
+ const A = RA(this.getCommandContext().getState());
6761
6761
  if (!A)
6762
6762
  throw new k("Internal state is undefined! Cannot copy experience!");
6763
6763
  const e = JSON.stringify(A.transaction), t = this.getWorkflowManager().getWorkflow(), n = new Ii({}), a = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
@@ -6847,7 +6847,7 @@ const wa = [
6847
6847
  return console.error(d), [];
6848
6848
  }
6849
6849
  }, ha = async (c, A, e, t) => {
6850
- const n = e.data, a = n.assetUrl, i = await KA(a);
6850
+ const n = e.data, a = n.assetUrl, i = await jA(a);
6851
6851
  try {
6852
6852
  const s = Nt(n, t.option);
6853
6853
  s && (A[t.stepName] = { selectedVariants: [s] });
@@ -6904,7 +6904,7 @@ const wa = [
6904
6904
  const n = e.data, a = t.option;
6905
6905
  if (!a)
6906
6906
  return console.error(`No option for step ${t.stepName}.`), [];
6907
- const i = ((m = a.variants) == null ? void 0 : m.find((p) => p.id === n.illustrationVariantId)) || NA(a);
6907
+ const i = ((m = a.variants) == null ? void 0 : m.find((p) => p.id === n.illustrationVariantId)) || HA(a);
6908
6908
  if (!i)
6909
6909
  return console.error(`No variant with ID: ${n.illustrationVariantId}`), [];
6910
6910
  if (!i.asset)
@@ -6913,7 +6913,7 @@ const wa = [
6913
6913
  const s = (I = i.asset) == null ? void 0 : I.fileLink;
6914
6914
  if (!s)
6915
6915
  return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
6916
- const o = await q(s, !0), r = /<svg.*?<\/svg>/s, g = o.match(r) || [], B = (g == null ? void 0 : g.length) > 0 ? g[0] : "", w = Ue().parseFromString(B, "image/svg+xml").firstElementChild;
6916
+ const o = await Z(s, !0), r = /<svg.*?<\/svg>/s, g = o.match(r) || [], B = (g == null ? void 0 : g.length) > 0 ? g[0] : "", w = Ue().parseFromString(B, "image/svg+xml").firstElementChild;
6917
6917
  if (!w)
6918
6918
  return console.error("Failed to read SVG."), [];
6919
6919
  Ge(w);
@@ -7003,7 +7003,7 @@ const wa = [
7003
7003
  const n = e.data, a = t.option;
7004
7004
  if (!a)
7005
7005
  return console.error(`No option for step ${t.stepName}.`), [];
7006
- const i = ((g = a.variants) == null ? void 0 : g.find((l) => l.id === n.pictureVariantId)) || NA(a);
7006
+ const i = ((g = a.variants) == null ? void 0 : g.find((l) => l.id === n.pictureVariantId)) || HA(a);
7007
7007
  if (!i)
7008
7008
  return console.error(`No variant with ID: ${n.pictureVariantId}`), [];
7009
7009
  if (!i.asset)
@@ -7045,7 +7045,7 @@ const wa = [
7045
7045
  const n = e.data, a = t.option;
7046
7046
  if (!a)
7047
7047
  return console.error(`No option for step ${t.stepName}.`), [];
7048
- const i = ((r = a.variants) == null ? void 0 : r.find((g) => g.id === n.colorVariantId)) || NA(a);
7048
+ const i = ((r = a.variants) == null ? void 0 : r.find((g) => g.id === n.colorVariantId)) || HA(a);
7049
7049
  if (!i)
7050
7050
  return console.error(`No variant with ID: ${n.colorVariantId}`), [];
7051
7051
  A[t.stepName] = { selectedVariants: [i] };
@@ -7131,10 +7131,10 @@ const wa = [
7131
7131
  console.error(r);
7132
7132
  }
7133
7133
  else {
7134
- const r = await q(a, !0), g = (B) => {
7134
+ const r = await Z(a, !0), g = (B) => {
7135
7135
  const l = /<svg.*?<\/svg>/s, d = B.match(l) || [], w = (d == null ? void 0 : d.length) > 0 ? d[0] : "", Q = Ue().parseFromString(w, "image/svg+xml").firstElementChild;
7136
7136
  if (!Q)
7137
- throw new sA("Failed to read SVG.");
7137
+ throw new oA("Failed to read SVG.");
7138
7138
  return Ge(Q), ve().serializeToString(Q);
7139
7139
  };
7140
7140
  o.forEach((B) => {
@@ -7170,7 +7170,7 @@ const wa = [
7170
7170
  const E = t.option;
7171
7171
  if (!E)
7172
7172
  return;
7173
- const Q = ((f = E.variants) == null ? void 0 : f.find((u) => u.id === a.fontVariantId)) || NA(E);
7173
+ const Q = ((f = E.variants) == null ? void 0 : f.find((u) => u.id === a.fontVariantId)) || HA(E);
7174
7174
  if (!Q || !Q.asset)
7175
7175
  return;
7176
7176
  A[t.stepName] = { selectedVariants: [Q] };
@@ -7186,7 +7186,7 @@ const wa = [
7186
7186
  assetUrl: E,
7187
7187
  name: Q.names.fullName.en
7188
7188
  };
7189
- })(), B = (t.data.replaceableText ? t.data.replaceableText.replace("{{}}", a.text) : a.text) || "", l = jA(B, {
7189
+ })(), B = (t.data.replaceableText ? t.data.replaceableText.replace("{{}}", a.text) : a.text) || "", l = VA(B, {
7190
7190
  vertical: t.data.vertical,
7191
7191
  uppercase: t.data.uppercase
7192
7192
  }), d = async (E) => {
@@ -7222,12 +7222,12 @@ const wa = [
7222
7222
  y: E.top
7223
7223
  };
7224
7224
  if (g) {
7225
- const [f, u] = uA(
7225
+ const [f, u] = mA(
7226
7226
  t.data.size || i,
7227
7227
  g,
7228
7228
  E,
7229
7229
  [
7230
- jA(l, {
7230
+ VA(l, {
7231
7231
  vertical: t.data.vertical,
7232
7232
  uppercase: t.data.uppercase
7233
7233
  })
@@ -7315,7 +7315,7 @@ const wa = [
7315
7315
  );
7316
7316
  return n;
7317
7317
  };
7318
- class hA {
7318
+ class CA {
7319
7319
  constructor(A) {
7320
7320
  this.handleCompleteRender = null;
7321
7321
  const e = /* @__PURE__ */ new Map();
@@ -7332,7 +7332,7 @@ class hA {
7332
7332
  }
7333
7333
  }
7334
7334
  const Fa = () => new Promise((c, A) => {
7335
- const t = DA().getContext("webgl2");
7335
+ const t = FA().getContext("webgl2");
7336
7336
  c(!!t);
7337
7337
  }), Ma = Fa();
7338
7338
  class ya {
@@ -7386,7 +7386,7 @@ class ya {
7386
7386
  * Actions to perform when a static render event is fired for this canvas.
7387
7387
  */
7388
7388
  async render(A, e, t) {
7389
- const n = HA(e);
7389
+ const n = RA(e);
7390
7390
  this.lastRequestedRenderArguments = {
7391
7391
  workflow: A,
7392
7392
  layouts: n,
@@ -7470,7 +7470,7 @@ class Ya extends We {
7470
7470
  ignoreClear: !0,
7471
7471
  ignoreMouse: !0,
7472
7472
  enableRedraw: !1,
7473
- createCanvas: DA,
7473
+ createCanvas: FA,
7474
7474
  createImage: He,
7475
7475
  DOMParser: Re(),
7476
7476
  fetch: $A
@@ -7478,7 +7478,7 @@ class Ya extends We {
7478
7478
  B.resize(s, o), await B.render(), this.onRender();
7479
7479
  }
7480
7480
  }
7481
- const ki = (c, A) => {
7481
+ const Gi = (c, A) => {
7482
7482
  const e = [];
7483
7483
  return c.forEach((t) => {
7484
7484
  const n = A.steps.find((a) => a.stepName === t.stepName);
@@ -7489,7 +7489,7 @@ const ki = (c, A) => {
7489
7489
  }
7490
7490
  });
7491
7491
  }), e;
7492
- }, Ji = async (c, A, e, t) => {
7492
+ }, vi = async (c, A, e, t) => {
7493
7493
  let n = {
7494
7494
  serializableWorkflow: { steps: [] },
7495
7495
  layouts: {}
@@ -7498,7 +7498,7 @@ const ki = (c, A) => {
7498
7498
  const i = await Da(c, A, e, t);
7499
7499
  return new G(i).apply(n);
7500
7500
  }, Sa = F`
7501
- ${nA}
7501
+ ${aA}
7502
7502
  fragment ProductFields on Product {
7503
7503
  id
7504
7504
  basePrice
@@ -7824,13 +7824,13 @@ class Oa {
7824
7824
  }
7825
7825
  async createHandle(A) {
7826
7826
  switch (A.type) {
7827
- case mA.FileUpload:
7827
+ case IA.FileUpload:
7828
7828
  return new za(this.bundle, A);
7829
- case mA.Option: {
7829
+ case IA.Option: {
7830
7830
  const e = A.entityId ? await j.getOption(A.entityId) : void 0;
7831
7831
  return (e == null ? void 0 : e.type) === "Color" ? new ja(this.bundle, A, e) : new Bt(this.bundle, A, e);
7832
7832
  }
7833
- case mA.Text:
7833
+ case IA.Text:
7834
7834
  return new Ka(this.bundle, A);
7835
7835
  }
7836
7836
  }
@@ -8079,7 +8079,7 @@ class qa {
8079
8079
  async setAspect(A, e) {
8080
8080
  if (!this.globalPropertyState)
8081
8081
  throw new Error("Global property state not initialized");
8082
- const t = HA(this.globalPropertyState), n = this.globalPropertyState.aspects.find((a) => a.name === A);
8082
+ const t = RA(this.globalPropertyState), n = this.globalPropertyState.aspects.find((a) => a.name === A);
8083
8083
  n ? n.value = e : this.globalPropertyState.aspects.push({ name: A, value: e }), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(t, this.globalPropertyState);
8084
8084
  }
8085
8085
  async updateGlobalPropertyState() {
@@ -8235,14 +8235,14 @@ class $a {
8235
8235
  getProducts() {
8236
8236
  if (!this.collection.productCollectionProducts)
8237
8237
  throw new Error("Failed to find products on collection. Ensure you fetch them first!");
8238
- return this.collection.productCollectionProducts.map((A) => new TA(A));
8238
+ return this.collection.productCollectionProducts.map((A) => new OA(A));
8239
8239
  }
8240
8240
  /**
8241
8241
  * A list of products in this collections with useful helpers for interacting with them.
8242
8242
  */
8243
8243
  async fetchProducts() {
8244
8244
  if (this.collection.productCollectionProducts)
8245
- return this.collection.productCollectionProducts.map((e) => new TA(e));
8245
+ return this.collection.productCollectionProducts.map((e) => new OA(e));
8246
8246
  const A = await P.getShadowGraphqlClient().query({
8247
8247
  query: Ha,
8248
8248
  variables: {
@@ -8251,7 +8251,7 @@ class $a {
8251
8251
  errorPolicy: "all",
8252
8252
  fetchPolicy: "no-cache"
8253
8253
  });
8254
- return this.collection.productCollectionProducts = A.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.map((e) => new TA(e));
8254
+ return this.collection.productCollectionProducts = A.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.map((e) => new OA(e));
8255
8255
  }
8256
8256
  getTransformCollection() {
8257
8257
  if (this.collection.transformCollection)
@@ -8264,7 +8264,7 @@ class $a {
8264
8264
  return this.collection;
8265
8265
  }
8266
8266
  }
8267
- class TA {
8267
+ class OA {
8268
8268
  constructor(A) {
8269
8269
  this.product = A.product, this.productResource = A;
8270
8270
  }
@@ -8312,10 +8312,10 @@ class TA {
8312
8312
  if (e) {
8313
8313
  const n = A.find((a) => a.workflowName === e);
8314
8314
  if (n)
8315
- return new ZA(n);
8315
+ return new NA(n);
8316
8316
  }
8317
8317
  const t = A[0];
8318
- return new ZA(t);
8318
+ return new NA(t);
8319
8319
  }
8320
8320
  /**
8321
8321
  * A list of all integrations this product is connected to.
@@ -8362,7 +8362,7 @@ class TA {
8362
8362
  ), (s = t == null ? void 0 : t.additionalIntegrationProduct) != null && s.product ? e + (t.additionalIntegrationProduct.product.basePrice || 0) : e;
8363
8363
  }
8364
8364
  }
8365
- class ZA {
8365
+ class NA {
8366
8366
  constructor(A) {
8367
8367
  this.workflow = A;
8368
8368
  }
@@ -8443,7 +8443,7 @@ class Fe {
8443
8443
  this.id,
8444
8444
  this.ownerId,
8445
8445
  this.checkConditionalHandlesChanged.bind(this)
8446
- ), this.globalPropertyHandleService = new Oa(this), this.setPreviewService(t), this.initializationPromise = this.loadExistingBundles(
8446
+ ), this.globalPropertyHandleService = new Oa(this), this.setPreviewService(t), this.initializationPromise = this.loadExistingWorkflowExperiences(
8447
8447
  ((s = e.transactions) == null ? void 0 : s.map((o) => o.id)) || [],
8448
8448
  n
8449
8449
  );
@@ -8489,7 +8489,7 @@ class Fe {
8489
8489
  return this.globalPropertyStateManager;
8490
8490
  }
8491
8491
  async getGlobalPropertyTotalSubunits() {
8492
- return (await this.globalPropertyHandleService.getHandles()).filter((t) => t.getType() === mA.Option).map((t) => {
8492
+ return (await this.globalPropertyHandleService.getHandles()).filter((t) => t.getType() === IA.Option).map((t) => {
8493
8493
  var n;
8494
8494
  return ((n = t.getCurrentVariant()) == null ? void 0 : n.getPrice()) || 0;
8495
8495
  }).reduce((t, n) => t + n, 0);
@@ -8785,7 +8785,7 @@ class Fe {
8785
8785
  await e;
8786
8786
  }
8787
8787
  }
8788
- async loadExistingBundles(A, e) {
8788
+ async loadExistingWorkflowExperiences(A, e) {
8789
8789
  if (A.length === 0)
8790
8790
  return;
8791
8791
  const t = await this.client.getWorkflowExperiences(
@@ -8938,14 +8938,14 @@ class ni {
8938
8938
  * @returns The nodes contained within the execution.
8939
8939
  */
8940
8940
  getNodes() {
8941
- return this.execution.nodes.map((A) => new CA(A));
8941
+ return this.execution.nodes.map((A) => new QA(A));
8942
8942
  }
8943
8943
  /**
8944
8944
  * @param type The type of node to return.
8945
8945
  * @returns A list of nodes matching the requested type.
8946
8946
  */
8947
8947
  getNodesByType(A) {
8948
- return this.execution.nodes.filter((e) => e.type === A).map((e) => new CA(e));
8948
+ return this.execution.nodes.filter((e) => e.type === A).map((e) => new QA(e));
8949
8949
  }
8950
8950
  /**
8951
8951
  * @returns A list of input nodes that exist in this execution.
@@ -8954,7 +8954,7 @@ class ni {
8954
8954
  return this.execution.nodes.filter(
8955
8955
  (A) => A.type === "StartTerminal"
8956
8956
  /* StartTerminal */
8957
- ).map((A) => new CA(A));
8957
+ ).map((A) => new QA(A));
8958
8958
  }
8959
8959
  /**
8960
8960
  * @returns A list of out put nodes that exist in this execution.
@@ -8963,7 +8963,7 @@ class ni {
8963
8963
  return this.execution.nodes.filter(
8964
8964
  (A) => A.type === "EndTerminal"
8965
8965
  /* EndTerminal */
8966
- ).map((A) => new CA(A));
8966
+ ).map((A) => new QA(A));
8967
8967
  }
8968
8968
  /**
8969
8969
  * @returns A date object representing the point in time this execution completed.
@@ -8980,7 +8980,7 @@ class ni {
8980
8980
  return new Date(this.execution.failedAt);
8981
8981
  }
8982
8982
  }
8983
- class CA {
8983
+ class QA {
8984
8984
  constructor(A) {
8985
8985
  this.node = A;
8986
8986
  }
@@ -9010,7 +9010,7 @@ class le {
9010
9010
  }
9011
9011
  }
9012
9012
  var ai = /* @__PURE__ */ ((c) => (c.Transaction = "Transaction", c.Bundle = "Bundle", c.Product = "Product", c.Variant = "Variant", c.Option = "Option", c.LineItem = "LineItem", c.Asset = "Asset", c))(ai || {});
9013
- class bi extends le {
9013
+ class ki extends le {
9014
9014
  constructor(A) {
9015
9015
  super(`"${A}"`);
9016
9016
  }
@@ -9025,7 +9025,7 @@ class dt extends le {
9025
9025
  return A.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
9026
9026
  }
9027
9027
  }
9028
- class Li extends le {
9028
+ class Ji extends le {
9029
9029
  constructor(A) {
9030
9030
  super(`[${A.map((e) => e.getRaw()).join(",")}]`);
9031
9031
  }
@@ -9059,7 +9059,17 @@ class Me {
9059
9059
  throw new Error(
9060
9060
  "No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product."
9061
9061
  );
9062
- return new ZA(A[0]);
9062
+ return new NA(A[0]);
9063
+ }
9064
+ getAllWorkflows() {
9065
+ if (!this.integrationProduct.product)
9066
+ throw new Error("IntegrationProductResource does not have a product");
9067
+ const A = this.integrationProduct.product.workflows || [];
9068
+ if (A.length === 0)
9069
+ throw new Error(
9070
+ "No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product."
9071
+ );
9072
+ return A.sort((e, t) => (e.index ?? 0) - (t.index ?? 0)).map((e) => new NA(e));
9063
9073
  }
9064
9074
  }
9065
9075
  const ii = F`
@@ -9183,7 +9193,7 @@ const ii = F`
9183
9193
  name
9184
9194
  }
9185
9195
  `, ci = (c) => F`
9186
- ${GA(c)}
9196
+ ${vA(c)}
9187
9197
  ${ie}
9188
9198
  ${Ke}
9189
9199
  ${ii}
@@ -9603,7 +9613,7 @@ const ii = F`
9603
9613
  }
9604
9614
  }
9605
9615
  `, Bi = F`
9606
- ${GA(!1)}
9616
+ ${vA(!1)}
9607
9617
  query GetWorkflowForTheme($id: String!) {
9608
9618
  workflow(id: $id) {
9609
9619
  id
@@ -9703,7 +9713,7 @@ const ii = F`
9703
9713
  }
9704
9714
  }
9705
9715
  }
9706
- `, AA = async (c) => {
9716
+ `, eA = async (c) => {
9707
9717
  var A;
9708
9718
  for (const e in c.layouts) {
9709
9719
  const t = c.layouts[e].elements.filter(
@@ -9711,7 +9721,7 @@ const ii = F`
9711
9721
  );
9712
9722
  for (let a = 0; a < t.length; ++a) {
9713
9723
  const i = t[a];
9714
- i.src && i.svg && (i.cachedObjectURL = await pA(i.svg));
9724
+ i.src && i.svg && (i.cachedObjectURL = await fA(i.svg));
9715
9725
  }
9716
9726
  const n = c.layouts[e].elements.filter((a) => a.type === v.Textbox);
9717
9727
  for (let a = 0; a < n.length; ++a) {
@@ -9736,7 +9746,7 @@ const ii = F`
9736
9746
  var s, o, r;
9737
9747
  delete i.data.__typename, (s = i.option) != null && s.id && ((o = i.option.defaultVariant) != null && o.asset && O.cacheAsset(i.option.defaultVariant.asset), i.option.colorProfile && O.cacheAsset(i.option.colorProfile), (r = i.option.variants) == null || r.forEach((g) => {
9738
9748
  g.asset && O.cacheAsset(g.asset), g.displayImage && O.cacheAsset(g.displayImage), g.thumbnail && O.cacheAsset(g.thumbnail), g.material && O.cacheMaterial(g.material);
9739
- }), cA.set({ id: i.option.id }, Promise.resolve(i.option)));
9749
+ }), gA.set({ id: i.option.id }, Promise.resolve(i.option)));
9740
9750
  });
9741
9751
  }), t;
9742
9752
  }, ui = async (c, A) => {
@@ -9745,14 +9755,14 @@ const ii = F`
9745
9755
  throw new Error(`Workflow not found: ${c}`);
9746
9756
  return t;
9747
9757
  }, wt = async (c, A) => {
9748
- const e = c.map((s) => cA.get({ id: s, options: A })), t = c.filter((s, o) => e[o] === void 0);
9758
+ const e = c.map((s) => gA.get({ id: s, options: A })), t = c.filter((s, o) => e[o] === void 0);
9749
9759
  if (t.length === 0)
9750
9760
  return Promise.all(e);
9751
9761
  const n = Qi(t, A), a = t.map(
9752
- (s) => cA.set({ id: s, options: A }, ui(s, n))
9762
+ (s) => gA.set({ id: s, options: A }, ui(s, n))
9753
9763
  ), i = e.filter((s) => s !== void 0);
9754
9764
  return await Promise.all(i.concat(a));
9755
- }, QA = async (c, A) => (await wt([c], A))[0], mi = (c) => c.sort((A, e) => A.index - e.index).map((A) => ({
9765
+ }, uA = async (c, A) => (await wt([c], A))[0], mi = (c) => c.sort((A, e) => A.index - e.index).map((A) => ({
9756
9766
  id: J(),
9757
9767
  panelId: A.name,
9758
9768
  name: A.name,
@@ -9765,7 +9775,7 @@ const ii = F`
9765
9775
  previewRegion: A.previewRegion,
9766
9776
  useEditableArea: A.useEditableArea,
9767
9777
  editableArea: A.editableArea
9768
- })), OA = (c, A) => {
9778
+ })), zA = (c, A) => {
9769
9779
  const e = c.workflowState, t = e ? JSON.parse(e) : void 0;
9770
9780
  return t ? Object.values(t.layouts).map((n) => n.layout) : mi(A.panels);
9771
9781
  };
@@ -10101,7 +10111,7 @@ class Ii {
10101
10111
  const E = P.getShadowGraphqlClient();
10102
10112
  if (n.type === "transaction") {
10103
10113
  const { transactionId: f, readOnly: u } = n, m = await E.query({
10104
- query: BA,
10114
+ query: dA,
10105
10115
  variables: {
10106
10116
  ids: [f]
10107
10117
  },
@@ -10113,7 +10123,7 @@ class Ii {
10113
10123
  const I = (C = m.data) == null ? void 0 : C.transactions[0];
10114
10124
  if (!I.workflowId)
10115
10125
  throw new U("Existing transaction has no workflow ID.");
10116
- const p = await QA(I.workflowId);
10126
+ const p = await uA(I.workflowId);
10117
10127
  if (!I.product)
10118
10128
  throw new U("Failed to load transaction, product not available.");
10119
10129
  return { transaction: I, workflow: p, readOnly: u };
@@ -10141,7 +10151,7 @@ class Ii {
10141
10151
  if (!y.product)
10142
10152
  throw new U("Failed to create transaction, product not available.");
10143
10153
  return y;
10144
- }, u = QA(n.workflowId, n == null ? void 0 : n.graphql), [m, I] = await Promise.all([f(), u]);
10154
+ }, u = uA(n.workflowId, n == null ? void 0 : n.graphql), [m, I] = await Promise.all([f(), u]);
10145
10155
  return { transaction: m, workflow: I };
10146
10156
  }
10147
10157
  throw new U("No workflow ID provided.");
@@ -10163,16 +10173,16 @@ class Ii {
10163
10173
  };
10164
10174
  if (n.type === "transaction" && i.workflowState) {
10165
10175
  const E = JSON.parse(i.workflowState);
10166
- r.layouts = Object.values(E.layouts).map((Q) => Q.layout), await _(E), await AA(E), r.reloadedState = E;
10176
+ r.layouts = Object.values(E.layouts).map((Q) => Q.layout), await AA(E), await eA(E), r.reloadedState = E;
10167
10177
  } else if (!o && n.workflowState) {
10168
10178
  const E = JSON.parse(n.workflowState);
10169
- r.layouts = Object.values(E.layouts).map((Q) => Q.layout), await _(E), await AA(E), r.reloadedState = E;
10179
+ r.layouts = Object.values(E.layouts).map((Q) => Q.layout), await AA(E), await eA(E), r.reloadedState = E;
10170
10180
  } else
10171
- r.layouts = OA(
10181
+ r.layouts = zA(
10172
10182
  r.transaction,
10173
10183
  r.workflow
10174
10184
  );
10175
- if (r.renderableContextService = new hA(
10185
+ if (r.renderableContextService = new CA(
10176
10186
  r.layouts
10177
10187
  ), n.previewService ? (r.previewService = n.previewService, (d = r.product) != null && d.modelUrl && (r.modelContainer = r.previewService.loadModel({
10178
10188
  model: r.product.modelUrl,
@@ -10186,7 +10196,7 @@ class Ii {
10186
10196
  } else
10187
10197
  r.isReloadedTransaction = !0;
10188
10198
  this.initialized = !0, this.experienceOptions = r;
10189
- const g = new EA(this, r);
10199
+ const g = new hA(this, r);
10190
10200
  return await g.getWorkflowManager().getInitializationPromise(), n.type !== "transaction" && this.customer && await g.attachCustomerDetails({ email: this.customer.emailAddress }), g;
10191
10201
  }
10192
10202
  /**
@@ -10204,7 +10214,7 @@ class Ii {
10204
10214
  if (m.length === 0)
10205
10215
  return [];
10206
10216
  const I = m.map((Y) => Y.option.transactionId), p = await t.query({
10207
- query: BA,
10217
+ query: dA,
10208
10218
  variables: {
10209
10219
  ids: I
10210
10220
  },
@@ -10275,22 +10285,22 @@ class Ii {
10275
10285
  };
10276
10286
  if (Y.type === "transaction" && I.workflowState) {
10277
10287
  const b = JSON.parse(I.workflowState);
10278
- H.layouts = Object.values(b.layouts).map((V) => V.layout), await _(b), await AA(b), H.reloadedState = b;
10288
+ H.layouts = Object.values(b.layouts).map((V) => V.layout), await AA(b), await eA(b), H.reloadedState = b;
10279
10289
  } else if (!M && Y.workflowState) {
10280
10290
  const b = JSON.parse(Y.workflowState);
10281
- H.layouts = Object.values(b.layouts).map((V) => V.layout), await _(b), await AA(b), H.reloadedState = b;
10291
+ H.layouts = Object.values(b.layouts).map((V) => V.layout), await AA(b), await eA(b), H.reloadedState = b;
10282
10292
  } else
10283
- H.layouts = OA(
10293
+ H.layouts = zA(
10284
10294
  H.transaction,
10285
10295
  H.workflow
10286
10296
  );
10287
- return H.renderableContextService = new hA(
10297
+ return H.renderableContextService = new CA(
10288
10298
  H.layouts
10289
10299
  ), H.delayWorkflowStateSync = !0, this.initialized = !0, this.experienceOptions = H, { experienceOptions: H, index: y, options: Y };
10290
10300
  });
10291
10301
  x.setMap("transactionOwnerIds", h);
10292
10302
  const f = (await Promise.all(E)).sort((m, I) => m.index - I.index).map(async (m) => {
10293
- const { experienceOptions: I, options: p } = m, M = new EA(this, I);
10303
+ const { experienceOptions: I, options: p } = m, M = new hA(this, I);
10294
10304
  return await M.getWorkflowManager().getInitializationPromise(), p.type !== "transaction" && this.customer && await M.attachCustomerDetails({ email: this.customer.emailAddress }), M;
10295
10305
  }), u = await Promise.all(f);
10296
10306
  return u.forEach((m) => m.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), u;
@@ -10345,7 +10355,7 @@ class Ii {
10345
10355
  const t = P.getShadowGraphqlClient(), n = async () => {
10346
10356
  var d, w;
10347
10357
  const l = (d = (await t.query({
10348
- query: BA,
10358
+ query: dA,
10349
10359
  variables: { ids: [A] },
10350
10360
  fetchPolicy: "no-cache",
10351
10361
  errorPolicy: "all"
@@ -10369,7 +10379,7 @@ class Ii {
10369
10379
  const a = x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), i = a.get(A);
10370
10380
  if (i) {
10371
10381
  const l = (s = (await t.query({
10372
- query: BA,
10382
+ query: dA,
10373
10383
  variables: {
10374
10384
  ids: [A]
10375
10385
  },
@@ -10420,16 +10430,16 @@ class Ii {
10420
10430
  if (!this.initialized || !this.experienceOptions)
10421
10431
  throw new U("Cannot launch experience: Not initialized.");
10422
10432
  if (this.experienceOptions.transaction.workflowId) {
10423
- const o = await QA(this.experienceOptions.transaction.workflowId);
10433
+ const o = await uA(this.experienceOptions.transaction.workflowId);
10424
10434
  if (this.experienceOptions.workflow = o, this.experienceOptions.transaction.workflowState) {
10425
10435
  const g = JSON.parse(this.experienceOptions.transaction.workflowState);
10426
- this.experienceOptions.layouts = Object.values(g.layouts).map((B) => B.layout), await _(g), await AA(g), this.experienceOptions.reloadedState = g;
10436
+ this.experienceOptions.layouts = Object.values(g.layouts).map((B) => B.layout), await AA(g), await eA(g), this.experienceOptions.reloadedState = g;
10427
10437
  }
10428
- this.experienceOptions.previewService = t && t(o), this.experienceOptions.renderableContextService = new hA(this.experienceOptions.layouts), (n = this.experienceOptions.product) != null && n.modelUrl && (this.experienceOptions.modelContainer = (a = this.experienceOptions.previewService) == null ? void 0 : a.loadModel({
10438
+ this.experienceOptions.previewService = t && t(o), this.experienceOptions.renderableContextService = new CA(this.experienceOptions.layouts), (n = this.experienceOptions.product) != null && n.modelUrl && (this.experienceOptions.modelContainer = (a = this.experienceOptions.previewService) == null ? void 0 : a.loadModel({
10429
10439
  model: this.experienceOptions.product.modelUrl,
10430
10440
  contextService: this.experienceOptions.renderableContextService
10431
10441
  }));
10432
- const r = new EA(this, this.experienceOptions);
10442
+ const r = new hA(this, this.experienceOptions);
10433
10443
  return await r.getWorkflowManager().getInitializationPromise(), r;
10434
10444
  }
10435
10445
  if (A) {
@@ -10442,20 +10452,20 @@ class Ii {
10442
10452
  context: {
10443
10453
  transactionOwnerId: r
10444
10454
  }
10445
- }), B = QA(A);
10455
+ }), B = uA(A);
10446
10456
  if (await Promise.all([g, B]), this.experienceOptions.workflow = await B, e) {
10447
10457
  const d = JSON.parse(e);
10448
- this.experienceOptions.layouts = Object.values(d.layouts).map((w) => w.layout), await _(d), await AA(d), this.experienceOptions.reloadedState = d;
10458
+ this.experienceOptions.layouts = Object.values(d.layouts).map((w) => w.layout), await AA(d), await eA(d), this.experienceOptions.reloadedState = d;
10449
10459
  } else
10450
- this.experienceOptions.layouts = OA(
10460
+ this.experienceOptions.layouts = zA(
10451
10461
  this.experienceOptions.transaction,
10452
10462
  this.experienceOptions.workflow
10453
10463
  );
10454
- this.experienceOptions.previewService = t && t(await B), this.experienceOptions.renderableContextService = new hA(this.experienceOptions.layouts), (i = this.experienceOptions.product) != null && i.modelUrl && (this.experienceOptions.modelContainer = (s = this.experienceOptions.previewService) == null ? void 0 : s.loadModel({
10464
+ this.experienceOptions.previewService = t && t(await B), this.experienceOptions.renderableContextService = new CA(this.experienceOptions.layouts), (i = this.experienceOptions.product) != null && i.modelUrl && (this.experienceOptions.modelContainer = (s = this.experienceOptions.previewService) == null ? void 0 : s.loadModel({
10455
10465
  model: this.experienceOptions.product.modelUrl,
10456
10466
  contextService: this.experienceOptions.renderableContextService
10457
10467
  }));
10458
- const l = new EA(this, this.experienceOptions);
10468
+ const l = new hA(this, this.experienceOptions);
10459
10469
  return await l.getWorkflowManager().getInitializationPromise(), l;
10460
10470
  }
10461
10471
  throw new U("No workflow ID provided.");
@@ -10486,6 +10496,9 @@ class Ii {
10486
10496
  throw new U("Cannot get transaction: Not initialized.");
10487
10497
  return this.experienceOptions.transaction;
10488
10498
  }
10499
+ configureUrls(A, e, t) {
10500
+ q.setHubUrl(A), q.setServerUrl(e), q.setServicesApiUrl(t);
10501
+ }
10489
10502
  storeCustomer(A) {
10490
10503
  const e = x.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();
10491
10504
  e.set(A.partner.id, A.id), x.setMap("partnerCustomerIds", e);
@@ -10519,8 +10532,11 @@ class Ii {
10519
10532
  throw new Error("Integration product not found.");
10520
10533
  return new Me(a);
10521
10534
  }
10535
+ async getIntegrationProduct(A) {
10536
+ return A.type === "integration" ? this.getIntegrationProductById(A.integrationProductId) : this.getIntegrationProductFromExternalIds(A.externalIntegrationId, A.externalProductId);
10537
+ }
10522
10538
  }
10523
- class Ti {
10539
+ class bi {
10524
10540
  getInitializationPromise() {
10525
10541
  return Promise.resolve();
10526
10542
  }
@@ -10653,7 +10669,7 @@ class fi extends W {
10653
10669
  }
10654
10670
  selectVariant(A) {
10655
10671
  const e = this.manager.getRegionElements(this.step.stepName);
10656
- return WA.selectVariant(
10672
+ return XA.selectVariant(
10657
10673
  this.step,
10658
10674
  A.getResource(),
10659
10675
  e,
@@ -10667,7 +10683,7 @@ class fi extends W {
10667
10683
  });
10668
10684
  }
10669
10685
  selectImage(A) {
10670
- return WA.selectImage(this.step, A, this.manager);
10686
+ return XA.selectImage(this.step, A, this.manager);
10671
10687
  }
10672
10688
  getImageData() {
10673
10689
  if (this.frameService)
@@ -10686,129 +10702,116 @@ class fi extends W {
10686
10702
  return this.step.data.overlayImageUrl;
10687
10703
  }
10688
10704
  }
10689
- class Di {
10690
- /**
10691
- * * Send a message to the parent window.
10692
- * We don't currently know the domain of the parent window in a secure way so we use `window.parent.origin` to send the message.
10693
- * FIXME: One day in the future let's build a whitelist or something similar that can be used to validate the origin of the parent window.
10694
- * @param event The event to send. Must be strongly typed as one of the FrameEvent types.
10695
- */
10696
- postMessage(A) {
10697
- window.self !== window.top ? window.parent.postMessage(A, window.parent.origin) : console.warn("The frame service is being used in a context where there is no parent window.");
10698
- }
10699
- }
10700
- const Oi = new Di();
10701
10705
  export {
10702
- Li as ArrayInput,
10703
- $ as AssetNotFoundError,
10704
- ji as AssetType,
10705
- Vi as BringForwardCommand,
10706
- Wi as BringToBackCommand,
10707
- Xi as BringToFrontCommand,
10708
- qi as CanvasCommand,
10709
- TA as CollectionProduct,
10710
- Zi as CommandContext,
10706
+ Ji as ArrayInput,
10707
+ _ as AssetNotFoundError,
10708
+ Oi as AssetType,
10709
+ zi as BringForwardCommand,
10710
+ Ki as BringToBackCommand,
10711
+ ji as BringToFrontCommand,
10712
+ Vi as CanvasCommand,
10713
+ OA as CollectionProduct,
10714
+ Wi as CommandContext,
10711
10715
  cn as ConversionDataType,
10712
10716
  rn as ConversionLocation,
10713
- $i as CreateElementCommand,
10714
- _i as CreateLayoutCommand,
10715
- As as DeleteElementCommand,
10716
- CA as FlowExecutionNodeResult,
10717
+ Xi as CreateElementCommand,
10718
+ qi as CreateLayoutCommand,
10719
+ Zi as DeleteElementCommand,
10720
+ QA as FlowExecutionNodeResult,
10717
10721
  ni as FlowExecutionResult,
10718
10722
  ti as FlowService,
10719
- es as FontAlignmentCommand,
10720
- ts as FontColorCommand,
10721
- ns as FontSizeCommand,
10722
- as as FontSourceCommand,
10723
+ $i as FontAlignmentCommand,
10724
+ _i as FontColorCommand,
10725
+ As as FontSizeCommand,
10726
+ es as FontSourceCommand,
10723
10727
  In as FrameService,
10724
10728
  pi as FrameStep,
10725
10729
  fi as FrameStepHandle,
10726
10730
  ge as GlobalPropertyHandle,
10727
- is as GroupCommand,
10731
+ ts as GroupCommand,
10728
10732
  Zn as IllustrationStepHandle,
10729
10733
  PA as InformationMessageType,
10730
10734
  aa as InformationStepHandle,
10731
10735
  Me as IntegrationProduct,
10732
10736
  sn as IntegrationType,
10733
- ss as LayoutElementFactory,
10734
- os as LayoutElementType,
10737
+ ns as LayoutElementFactory,
10738
+ as as LayoutElementType,
10735
10739
  z as LayoutNotFoundError,
10736
10740
  $n as MaterialStepHandle,
10737
- MA as MisconfigurationError,
10738
- Ti as MockWorkflowManager,
10741
+ yA as MisconfigurationError,
10742
+ bi as MockWorkflowManager,
10739
10743
  _n as ModelStepHandle,
10740
- rs as MoveCommand,
10744
+ is as MoveCommand,
10741
10745
  dt as ObjectInput,
10742
10746
  ai as ObjectInputType,
10743
- FA as OptionNotFoundError,
10744
- sA as ParseError,
10747
+ MA as OptionNotFoundError,
10748
+ oA as ParseError,
10745
10749
  Aa as PictureStepHandle,
10746
10750
  on as ProductCameraRig,
10747
10751
  $a as ProductCollection,
10748
- ZA as ProductWorkflow,
10749
- cA as PromiseCache,
10752
+ NA as ProductWorkflow,
10753
+ gA as PromiseCache,
10750
10754
  Xe as PromiseQueue,
10751
10755
  ea as QuestionStepHandle,
10752
10756
  We as QueueablePromise,
10753
- cs as ResizeCommand,
10754
- rA as ResourceNotFoundError,
10755
- gs as RotateCommand,
10756
- ls as SendBackwardsCommand,
10757
+ ss as ResizeCommand,
10758
+ cA as ResourceNotFoundError,
10759
+ os as RotateCommand,
10760
+ rs as SendBackwardsCommand,
10757
10761
  ta as ShapeStepHandle,
10758
10762
  Ii as SpiffCommerceClient,
10759
10763
  YA as StakeholderType,
10760
- Bs as StepAspectType,
10764
+ cs as StepAspectType,
10761
10765
  W as StepHandle,
10762
- ds as StepType,
10763
- ws as TextChangeCommand,
10764
- bi as TextInput,
10766
+ gs as StepType,
10767
+ ls as TextChangeCommand,
10768
+ ki as TextInput,
10765
10769
  na as TextStepHandle,
10766
10770
  Ai as Transform,
10767
10771
  _a as TransformCollection,
10768
10772
  k as UnhandledBehaviorError,
10769
- Es as UnitOfMeasurement,
10773
+ Bs as UnitOfMeasurement,
10770
10774
  X as Variant,
10771
- EA as WorkflowExperienceImpl,
10775
+ hA as WorkflowExperienceImpl,
10772
10776
  O as assetService,
10773
10777
  ga as createDesign,
10774
- hs as dataUrlFromExternalUrl,
10775
- LA as designService,
10776
- Cs as determineCorrectFontSizeAndLines,
10778
+ ds as dataUrlFromExternalUrl,
10779
+ TA as designService,
10780
+ ws as determineCorrectFontSizeAndLines,
10777
10781
  Dn as digitalContentStepService,
10778
- Qs as findElement,
10779
- us as frameDataCache,
10780
- Oi as frameService,
10781
- WA as frameStepService,
10782
- ms as generate,
10782
+ Es as findElement,
10783
+ hs as frameDataCache,
10784
+ XA as frameStepService,
10785
+ Cs as generate,
10783
10786
  Da as generateCommands,
10784
- Is as generateSVGWithUnknownColors,
10785
- Ji as generateStateFromDesignInputSteps,
10786
- ps as getAttributesFromArrayBuffer,
10787
- fs as getAxisAlignedBoundingBox,
10787
+ Qs as generateSVGWithUnknownColors,
10788
+ vi as generateStateFromDesignInputSteps,
10789
+ us as getAttributesFromArrayBuffer,
10790
+ ms as getAxisAlignedBoundingBox,
10788
10791
  mn as getBoundedOffsets,
10789
- Ds as getFrameData,
10790
- Fs as getSvgElement,
10791
- QA as getWorkflow,
10792
+ Is as getFrameData,
10793
+ ps as getSvgElement,
10794
+ uA as getWorkflow,
10792
10795
  wt as getWorkflows,
10793
10796
  P as graphQlManager,
10794
- IA as illustrationStepService,
10795
- Ms as loadFont,
10797
+ pA as illustrationStepService,
10798
+ fs as loadFont,
10796
10799
  Ze as materialStepService,
10797
10800
  $e as modelStepService,
10798
10801
  xn as moduleStepService,
10799
10802
  j as optionService,
10800
- ys as patternImageDataCache,
10803
+ Ds as patternImageDataCache,
10801
10804
  x as persistenceService,
10802
10805
  _e as pictureStepService,
10803
10806
  At as questionStepService,
10804
- Ys as registerFetchImplementation,
10805
- Ss as registerWindowImplementation,
10806
- xs as rehydrateSerializedLayout,
10807
- Ps as setCanvasModule,
10808
- oA as shapeStepService,
10807
+ Fs as registerFetchImplementation,
10808
+ Ms as registerWindowImplementation,
10809
+ ys as rehydrateSerializedLayout,
10810
+ Ys as setCanvasModule,
10811
+ rA as shapeStepService,
10809
10812
  pn as shortenUrl,
10810
- yA as spiffCoreConfiguration,
10811
- ki as stepAspectValuesToDesignInputSteps,
10813
+ q as spiffCoreConfiguration,
10814
+ Gi as stepAspectValuesToDesignInputSteps,
10812
10815
  K as textStepService,
10813
10816
  Un as toast
10814
10817
  };