@spiffcommerce/core 29.1.2 → 29.2.0-beta.75bdea81-46bb-57ec-a9e3-e7dff64e45a7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import yt from "lodash.clonedeep";
11
11
  import { toString as ln } from "qrcode";
12
12
  import fr from "svg-path-bbox";
13
13
  import { parse as Ze } from "opentype.js";
14
- import { jsx as F, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
14
+ import { jsx as x, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
15
15
  import Cr from "handlebars";
16
16
  import { dataUriToBuffer as wr } from "data-uri-to-buffer";
17
17
  import ka from "lodash.chunk";
@@ -59,32 +59,32 @@ class ve extends Xt {
59
59
  super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
60
60
  }
61
61
  }
62
- class xe extends An {
62
+ class Fe extends An {
63
63
  constructor(t) {
64
64
  super(`ImplementationError - ${t}`);
65
65
  }
66
66
  }
67
- class G extends xe {
67
+ class G extends Fe {
68
68
  constructor(t) {
69
69
  super(`Unhandled Behavior Encountered: ${t}`);
70
70
  }
71
71
  }
72
- class Dt extends xe {
72
+ class Dt extends Fe {
73
73
  constructor(t) {
74
74
  super(`Parsing Error: ${t}`);
75
75
  }
76
76
  }
77
- class ut extends xe {
77
+ class ut extends Fe {
78
78
  constructor(t) {
79
79
  super(`Client Error: ${t}`);
80
80
  }
81
81
  }
82
- class Fe extends xe {
82
+ class xe extends Fe {
83
83
  constructor(t) {
84
84
  super(`Resource Generation Failed: ${t}`);
85
85
  }
86
86
  }
87
- class xr {
87
+ class Fr {
88
88
  get(t) {
89
89
  return localStorage.getItem(t) || void 0;
90
90
  }
@@ -127,13 +127,13 @@ class Na {
127
127
  this.set(t, a);
128
128
  }
129
129
  }
130
- const Fr = () => {
130
+ const xr = () => {
131
131
  try {
132
- return localStorage ? new xr() : new Na();
132
+ return localStorage ? new Fr() : new Na();
133
133
  } catch {
134
134
  return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Na();
135
135
  }
136
- }, N = Fr();
136
+ }, N = xr();
137
137
  class kr {
138
138
  constructor() {
139
139
  this.defaultServerUrl = "https://api.au.spiffcommerce.com", this.defaultServicesApiUrl = "https://services.au.spiffcommerce.com", this.defaultHubUrl = "https://hub.au.spiffcommerce.com", this.serverUrl = this.defaultServerUrl, this.servicesApiUrl = this.defaultServicesApiUrl, this.hubUrl = this.defaultHubUrl, this.serverUrlCallbacks = [];
@@ -1814,7 +1814,7 @@ const jr = (r) => new Promise((t) => {
1814
1814
  "Black 5 C",
1815
1815
  "Black 6 C",
1816
1816
  "Black 7 C"
1817
- ], xt = [
1817
+ ], Ft = [
1818
1818
  "FEDD00",
1819
1819
  "FFD700",
1820
1820
  "FE5000",
@@ -3156,17 +3156,17 @@ const jr = (r) => new Promise((t) => {
3156
3156
  "3E2B2E",
3157
3157
  "101820",
3158
3158
  "3D3935"
3159
- ], Le = xt.map((r) => [
3159
+ ], Le = Ft.map((r) => [
3160
3160
  parseInt(r.substring(0, 2), 16),
3161
3161
  parseInt(r.substring(2, 4), 16),
3162
3162
  parseInt(r.substring(4, 6), 16)
3163
3163
  ]);
3164
3164
  function Oc(r) {
3165
3165
  const t = Yt.indexOf(r);
3166
- return t >= 0 ? xt[t] : "";
3166
+ return t >= 0 ? Ft[t] : "";
3167
3167
  }
3168
3168
  function _r(r) {
3169
- const t = xt.indexOf(r);
3169
+ const t = Ft.indexOf(r);
3170
3170
  return t >= 0 ? Yt[t] : "";
3171
3171
  }
3172
3172
  function $c(r, t = 64) {
@@ -3178,16 +3178,16 @@ function $c(r, t = 64) {
3178
3178
  });
3179
3179
  const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
3180
3180
  let l, c, d;
3181
- for (let A = 0; A < xt.length; A++) {
3181
+ for (let A = 0; A < Ft.length; A++) {
3182
3182
  l = Le[A][0], c = Le[A][1], d = Le[A][2];
3183
3183
  const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
3184
3184
  a.push(u);
3185
3185
  }
3186
3186
  for (let A = 0; A < a.length; A++)
3187
- a[A] <= t && !e.some((u) => u.pms === Yt[A]) && e.push({ pms: Yt[A], hex: xt[A], distance: a[A] });
3187
+ a[A] <= t && !e.some((u) => u.pms === Yt[A]) && e.push({ pms: Yt[A], hex: Ft[A], distance: a[A] });
3188
3188
  return e.sort((A, u) => A.distance - u.distance);
3189
3189
  }
3190
- const Xr = Yt.map((r, t) => ({ pms: r, hex: xt[t] })), Zr = new pr(Xr, { keys: ["pms"] });
3190
+ const Xr = Yt.map((r, t) => ({ pms: r, hex: Ft[t] })), Zr = new pr(Xr, { keys: ["pms"] });
3191
3191
  function Uc(r, t) {
3192
3192
  return Zr.search(r, t ? { limit: t } : void 0);
3193
3193
  }
@@ -3244,8 +3244,8 @@ const le = (r) => {
3244
3244
  "textPath",
3245
3245
  "tref",
3246
3246
  "tspan"
3247
- ], ai = ["fill", "stroke"], Ft = (r, t) => {
3248
- t(r), r.children.length > 0 && Array.from(r.children).forEach((e) => Ft(e, t));
3247
+ ], ai = ["fill", "stroke"], xt = (r, t) => {
3248
+ t(r), r.children.length > 0 && Array.from(r.children).forEach((e) => xt(e, t));
3249
3249
  }, ni = (r, t) => {
3250
3250
  try {
3251
3251
  return r.matches(t);
@@ -3255,7 +3255,7 @@ const le = (r) => {
3255
3255
  }, fa = (r, t = !1) => {
3256
3256
  !t && r.setAttribute("preserveAspectRatio", "none");
3257
3257
  const e = [];
3258
- Ft(r, (a) => {
3258
+ xt(r, (a) => {
3259
3259
  var i, s, o;
3260
3260
  if (a.tagName === "script") {
3261
3261
  a.remove();
@@ -3282,7 +3282,7 @@ const le = (r) => {
3282
3282
  }
3283
3283
  }), l.length > 0 ? a.setAttribute("style", l.join(";")) : a.removeAttribute("style");
3284
3284
  }
3285
- }), Ft(r, (a) => {
3285
+ }), xt(r, (a) => {
3286
3286
  e.forEach((n) => {
3287
3287
  var i;
3288
3288
  (i = n.selectors) == null || i.forEach((s) => {
@@ -3301,7 +3301,7 @@ const le = (r) => {
3301
3301
  }, yn = (r) => dt().parseFromString(r, "image/svg+xml").firstElementChild, ii = (r, t, e) => {
3302
3302
  r.setAttribute("height", `${e}px`), r.setAttribute("width", `${t}px`);
3303
3303
  }, Sn = (r, t, e) => {
3304
- Ft(r, (a) => {
3304
+ xt(r, (a) => {
3305
3305
  const n = a.attributes.getNamedItem("fill");
3306
3306
  n && n.value !== "none" && a.classList.forEach((s) => {
3307
3307
  if (s.startsWith("spiff-fill")) {
@@ -3358,7 +3358,7 @@ const le = (r) => {
3358
3358
  throw new Error("Failed to read SVG.");
3359
3359
  fa(e);
3360
3360
  const a = {};
3361
- Ft(e, (s) => {
3361
+ xt(e, (s) => {
3362
3362
  ei.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
3363
3363
  const o = s.attributes.getNamedItem("fill");
3364
3364
  if (o && o.value !== "none" && !o.value.startsWith("url(")) {
@@ -4349,7 +4349,7 @@ const j = new yi(), Bn = v`
4349
4349
  workflowState
4350
4350
  }
4351
4351
  }
4352
- `, xn = (r) => v`
4352
+ `, Fn = (r) => v`
4353
4353
  ${Ne}
4354
4354
  fragment IntegrationProductFields on IntegrationProduct {
4355
4355
  id
@@ -4433,14 +4433,14 @@ const j = new yi(), Bn = v`
4433
4433
  }
4434
4434
  }
4435
4435
  `, Pi = (r) => v`
4436
- ${xn(r)}
4436
+ ${Fn(r)}
4437
4437
  query GetIntegrationProducts($ids: [String!]!) {
4438
4438
  integrationProducts(ids: $ids) {
4439
4439
  ...IntegrationProductFields
4440
4440
  }
4441
4441
  }
4442
4442
  `, Di = (r) => v`
4443
- ${xn(r)}
4443
+ ${Fn(r)}
4444
4444
  query GetIntegrationProductFromExternalIds($externalIntegrationId: String!, $externalProductId: String!) {
4445
4445
  integrationProductFromExternalIds(
4446
4446
  externalIntegrationId: $externalIntegrationId
@@ -4449,7 +4449,7 @@ const j = new yi(), Bn = v`
4449
4449
  ...IntegrationProductFields
4450
4450
  }
4451
4451
  }
4452
- `, xi = v`
4452
+ `, Fi = v`
4453
4453
  ${In}
4454
4454
  query ReadTransactionForStakeholders($id: String!) {
4455
4455
  transactions(ids: [$id]) {
@@ -4461,7 +4461,7 @@ const j = new yi(), Bn = v`
4461
4461
  }
4462
4462
  }
4463
4463
  }
4464
- `, Fi = v`
4464
+ `, xi = v`
4465
4465
  mutation FinalizeUpdateTransaction($transactionId: String!) {
4466
4466
  transactionFinalizeUpdate(transactionId: $transactionId)
4467
4467
  }
@@ -5246,7 +5246,7 @@ const j = new yi(), Bn = v`
5246
5246
  );
5247
5247
  return i;
5248
5248
  };
5249
- class Fn {
5249
+ class xn {
5250
5250
  constructor() {
5251
5251
  this.timestamp = Date.now();
5252
5252
  }
@@ -5340,9 +5340,9 @@ const Q = () => {
5340
5340
  width: u
5341
5341
  }) => {
5342
5342
  var E;
5343
- const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((b, P) => (
5343
+ const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ x("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((b, P) => (
5344
5344
  /* @ts-ignore */
5345
- /* @__PURE__ */ F("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, P)
5345
+ /* @__PURE__ */ x("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, P)
5346
5346
  )), S = n.map((b) => ({
5347
5347
  ...b,
5348
5348
  _renderingConfiguration: a,
@@ -5369,7 +5369,7 @@ const Q = () => {
5369
5369
  children: [
5370
5370
  w,
5371
5371
  C,
5372
- !!r && /* @__PURE__ */ F(
5372
+ !!r && /* @__PURE__ */ x(
5373
5373
  "rect",
5374
5374
  {
5375
5375
  id: "layout-background",
@@ -5379,7 +5379,7 @@ const Q = () => {
5379
5379
  rx: h
5380
5380
  }
5381
5381
  ),
5382
- /* @__PURE__ */ F(
5382
+ /* @__PURE__ */ x(
5383
5383
  "g",
5384
5384
  {
5385
5385
  id: "element-group",
@@ -5387,7 +5387,7 @@ const Q = () => {
5387
5387
  children: y.map((b) => $n(b)).filter((b) => !!b)
5388
5388
  }
5389
5389
  ),
5390
- l && /* @__PURE__ */ F(
5390
+ l && /* @__PURE__ */ x(
5391
5391
  "rect",
5392
5392
  {
5393
5393
  x: l.x,
@@ -5401,7 +5401,7 @@ const Q = () => {
5401
5401
  }
5402
5402
  ),
5403
5403
  l && /* @__PURE__ */ ct("mask", { id: `viewmask-${f}`, children: [
5404
- /* @__PURE__ */ F(
5404
+ /* @__PURE__ */ x(
5405
5405
  "rect",
5406
5406
  {
5407
5407
  x: g.x,
@@ -5411,7 +5411,7 @@ const Q = () => {
5411
5411
  fill: "black"
5412
5412
  }
5413
5413
  ),
5414
- /* @__PURE__ */ F(
5414
+ /* @__PURE__ */ x(
5415
5415
  "rect",
5416
5416
  {
5417
5417
  x: l.x,
@@ -5505,7 +5505,7 @@ const Q = () => {
5505
5505
  };
5506
5506
  }, Kc = 0.352778, _c = 0.035277, Mn = (r) => {
5507
5507
  const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
5508
- return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
5508
+ return /* @__PURE__ */ x("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ x(
5509
5509
  "g",
5510
5510
  {
5511
5511
  transform: `
@@ -5514,7 +5514,7 @@ const Q = () => {
5514
5514
  matrix(${a}, ${-n}, ${n}, ${a}, 0, 0)
5515
5515
  matrix(1, 0, 0, 1, ${-r.width / 2}, ${-r.height / 2})
5516
5516
  `,
5517
- children: /* @__PURE__ */ F(
5517
+ children: /* @__PURE__ */ x(
5518
5518
  "image",
5519
5519
  {
5520
5520
  xlinkHref: r.src,
@@ -5529,7 +5529,7 @@ const Q = () => {
5529
5529
  var l;
5530
5530
  const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = pt(e), n = Math.cos(a), i = -Math.sin(a), s = Ea(r.children);
5531
5531
  return /* @__PURE__ */ ct(Gt, { children: [
5532
- /* @__PURE__ */ F("defs", { children: (() => /* @__PURE__ */ F("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ F("path", { d: r.clipPath }) : /* @__PURE__ */ F("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5532
+ /* @__PURE__ */ x("defs", { children: (() => /* @__PURE__ */ x("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ x("path", { d: r.clipPath }) : /* @__PURE__ */ x("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5533
5533
  /* @__PURE__ */ ct(
5534
5534
  "g",
5535
5535
  {
@@ -5540,7 +5540,7 @@ const Q = () => {
5540
5540
  matrix(1, 0, 0, 1, ${-r.width / 2}, ${-r.height / 2})
5541
5541
  `,
5542
5542
  children: [
5543
- (l = r._renderingConfiguration) != null && l.debug ? /* @__PURE__ */ F(
5543
+ (l = r._renderingConfiguration) != null && l.debug ? /* @__PURE__ */ x(
5544
5544
  "rect",
5545
5545
  {
5546
5546
  stroke: "red",
@@ -5552,7 +5552,7 @@ const Q = () => {
5552
5552
  height: r.height
5553
5553
  }
5554
5554
  ) : void 0,
5555
- s.map((c) => $n(c)).filter((c) => !!c).map((c) => /* @__PURE__ */ F("g", { clipPath: `url(#${t})`, children: c }))
5555
+ s.map((c) => $n(c)).filter((c) => !!c).map((c) => /* @__PURE__ */ x("g", { clipPath: `url(#${t})`, children: c }))
5556
5556
  ]
5557
5557
  }
5558
5558
  )
@@ -5568,9 +5568,9 @@ const Q = () => {
5568
5568
  return r.pattern.src;
5569
5569
  };
5570
5570
  if (!a())
5571
- return /* @__PURE__ */ F(Gt, {});
5572
- const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(Gt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5573
- /* @__PURE__ */ F(
5571
+ return /* @__PURE__ */ x(Gt, {});
5572
+ const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ x(Gt, { children: r.useThreshold && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5573
+ /* @__PURE__ */ x(
5574
5574
  "feColorMatrix",
5575
5575
  {
5576
5576
  type: "matrix",
@@ -5584,14 +5584,14 @@ const Q = () => {
5584
5584
  }
5585
5585
  ),
5586
5586
  /* @__PURE__ */ ct("feComponentTransfer", { in: "greyscale", children: [
5587
- /* @__PURE__ */ F("feFuncR", { type: "discrete", tableValues: n() }),
5588
- /* @__PURE__ */ F("feFuncG", { type: "discrete", tableValues: n() }),
5589
- /* @__PURE__ */ F("feFuncB", { type: "discrete", tableValues: n() })
5587
+ /* @__PURE__ */ x("feFuncR", { type: "discrete", tableValues: n() }),
5588
+ /* @__PURE__ */ x("feFuncG", { type: "discrete", tableValues: n() }),
5589
+ /* @__PURE__ */ x("feFuncB", { type: "discrete", tableValues: n() })
5590
5590
  ] })
5591
5591
  ] }) }) }), s = r.rotation || 0, o = pt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5592
- var w, S, y, E, b, P, D, x, k, T;
5592
+ var w, S, y, E, b, P, D, F, k, T;
5593
5593
  const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0, m = ((E = r.pattern) == null ? void 0 : E.height) || 0, g = ((b = r.pattern) == null ? void 0 : b.scaleX) || 1, p = ((P = r.pattern) == null ? void 0 : P.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
5594
- return [(x = r.pattern) != null && x.svg ? {
5594
+ return [(F = r.pattern) != null && F.svg ? {
5595
5595
  id: `${t}-contents`,
5596
5596
  type: M.Illustration,
5597
5597
  x: A,
@@ -5615,13 +5615,13 @@ const Q = () => {
5615
5615
  };
5616
5616
  return /* @__PURE__ */ ct(Gt, { children: [
5617
5617
  i(),
5618
- /* @__PURE__ */ F(
5618
+ /* @__PURE__ */ x(
5619
5619
  "g",
5620
5620
  {
5621
5621
  opacity: r.opacity,
5622
5622
  mask: r.stepName ? void 0 : r.mask,
5623
5623
  filter: r.useThreshold ? `url(#${e})` : void 0,
5624
- children: /* @__PURE__ */ F(
5624
+ children: /* @__PURE__ */ x(
5625
5625
  "g",
5626
5626
  {
5627
5627
  transform: `
@@ -5631,7 +5631,7 @@ const Q = () => {
5631
5631
  matrix(1, 0, 0, 1, ${-r.width / 2}, ${-r.height / 2})
5632
5632
  matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
5633
5633
  `,
5634
- children: /* @__PURE__ */ F(
5634
+ children: /* @__PURE__ */ x(
5635
5635
  Tn,
5636
5636
  {
5637
5637
  id: t,
@@ -5760,8 +5760,8 @@ const _i = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
5760
5760
  parseInt(u.getAttribute("font-size") ?? "72")
5761
5761
  );
5762
5762
  b.fill = p, b.stroke = f, b.strokeWidth = parseFloat(C ?? "0");
5763
- const P = b.toSVG(2), x = t.parseFromString(P, "image/svg+xml").firstElementChild;
5764
- h.appendChild(x);
5763
+ const P = b.toSVG(2), F = t.parseFromString(P, "image/svg+xml").firstElementChild;
5764
+ h.appendChild(F);
5765
5765
  }
5766
5766
  return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
5767
5767
  }, be = (r, t, e, a) => Math.max(as(r.join(`
@@ -5920,7 +5920,7 @@ const is = (r) => {
5920
5920
  };
5921
5921
  return /* @__PURE__ */ ct(Gt, { children: [
5922
5922
  /* @__PURE__ */ ct("defs", { children: [
5923
- r.textFillImage && /* @__PURE__ */ F(
5923
+ r.textFillImage && /* @__PURE__ */ x(
5924
5924
  "pattern",
5925
5925
  {
5926
5926
  id: s,
@@ -5929,7 +5929,7 @@ const is = (r) => {
5929
5929
  height: r.textFillImage.scale * r.textFillImage.height,
5930
5930
  x: 0,
5931
5931
  y: 0,
5932
- children: /* @__PURE__ */ F(
5932
+ children: /* @__PURE__ */ x(
5933
5933
  "image",
5934
5934
  {
5935
5935
  href: r.textFillImage.src,
@@ -5940,7 +5940,7 @@ const is = (r) => {
5940
5940
  )
5941
5941
  }
5942
5942
  ),
5943
- /* @__PURE__ */ F(
5943
+ /* @__PURE__ */ x(
5944
5944
  "style",
5945
5945
  {
5946
5946
  type: "text/css",
@@ -5954,10 +5954,10 @@ const is = (r) => {
5954
5954
  }
5955
5955
  }
5956
5956
  ),
5957
- r.curved && r.paths ? /* @__PURE__ */ F("path", { id: i, d: r.paths[0] }) : void 0
5957
+ r.curved && r.paths ? /* @__PURE__ */ x("path", { id: i, d: r.paths[0] }) : void 0
5958
5958
  ] }),
5959
- (C = r._renderingConfiguration) != null && C.debug ? /* @__PURE__ */ F("rect", { stroke: "blue", fill: "none", x: r.x, y: r.y, width: r.width, height: r.height }) : void 0,
5960
- /* @__PURE__ */ F("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ F("g", { transform: `matrix(${a}, ${-n}, ${n}, ${a}, ${o}, ${l})`, children: /* @__PURE__ */ F(
5959
+ (C = r._renderingConfiguration) != null && C.debug ? /* @__PURE__ */ x("rect", { stroke: "blue", fill: "none", x: r.x, y: r.y, width: r.width, height: r.height }) : void 0,
5960
+ /* @__PURE__ */ x("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ x("g", { transform: `matrix(${a}, ${-n}, ${n}, ${a}, ${o}, ${l})`, children: /* @__PURE__ */ x(
5961
5961
  "text",
5962
5962
  {
5963
5963
  xmlSpace: "preserve",
@@ -5972,7 +5972,7 @@ const is = (r) => {
5972
5972
  },
5973
5973
  stroke: A,
5974
5974
  strokeWidth: u,
5975
- children: r.curved ? /* @__PURE__ */ F(os, { text: c, curvedPathId: i, align: r.align }) : d.map((w, S) => /* @__PURE__ */ F(
5975
+ children: r.curved ? /* @__PURE__ */ x(os, { text: c, curvedPathId: i, align: r.align }) : d.map((w, S) => /* @__PURE__ */ x(
5976
5976
  ss,
5977
5977
  {
5978
5978
  align: r.vertical ? "center" : r.align,
@@ -6003,10 +6003,10 @@ const is = (r) => {
6003
6003
  const s = (r.amountLines - 1) / 2;
6004
6004
  return (r.thisLineIdx - s) * n + r.fontSize / 4;
6005
6005
  };
6006
- return /* @__PURE__ */ F("tspan", { textAnchor: Rn(r.align), x: e(), y: `${a()}px`, children: r.text });
6006
+ return /* @__PURE__ */ x("tspan", { textAnchor: Rn(r.align), x: e(), y: `${a()}px`, children: r.text });
6007
6007
  }, os = (r) => {
6008
6008
  const t = `#${r.curvedPathId}`;
6009
- return /* @__PURE__ */ F(
6009
+ return /* @__PURE__ */ x(
6010
6010
  "textPath",
6011
6011
  {
6012
6012
  startOffset: (() => r.align === "left" ? "0%" : r.align === "right" ? "100%" : "50%")(),
@@ -6019,7 +6019,7 @@ const is = (r) => {
6019
6019
  }, ls = (r) => {
6020
6020
  var s, o;
6021
6021
  if (r.cachedObjectURL && !((s = r._renderingConfiguration) != null && s.omitCachedFields))
6022
- return /* @__PURE__ */ F(
6022
+ return /* @__PURE__ */ x(
6023
6023
  Mn,
6024
6024
  {
6025
6025
  id: r.id,
@@ -6044,7 +6044,7 @@ const is = (r) => {
6044
6044
  throw new Error(
6045
6045
  `Illustration element ${r.id} (stepName ${r.stepName}) lacked svg from src ${r.src} at render time.`
6046
6046
  );
6047
- return /* @__PURE__ */ F("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ F(
6047
+ return /* @__PURE__ */ x("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ x(
6048
6048
  "g",
6049
6049
  {
6050
6050
  transform: i,
@@ -6152,9 +6152,9 @@ class cs {
6152
6152
  return { ...t, transaction: e.apply(a) };
6153
6153
  }
6154
6154
  }
6155
- const $n = (r) => r.type === M.Image ? /* @__PURE__ */ F(Mn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ F(Ji, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ F(ls, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ F(is, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ F(Tn, { ...r }, r.id) : null, va = (r, t, e) => {
6155
+ const $n = (r) => r.type === M.Image ? /* @__PURE__ */ x(Mn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ x(Ji, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ x(ls, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ x(is, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ x(Tn, { ...r }, r.id) : null, va = (r, t, e) => {
6156
6156
  const a = e.renderingConfiguration, n = a != null && a.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
6157
- return /* @__PURE__ */ F(
6157
+ return /* @__PURE__ */ x(
6158
6158
  Yi,
6159
6159
  {
6160
6160
  preserveAspectRatio: void 0,
@@ -7340,7 +7340,7 @@ const ws = async (r) => {
7340
7340
  }
7341
7341
  })).json()).shortUrl;
7342
7342
  } catch (e) {
7343
- throw console.error(e), new Fe("Failed to shorten URL, see console.");
7343
+ throw console.error(e), new xe("Failed to shorten URL, see console.");
7344
7344
  }
7345
7345
  };
7346
7346
  class Gn {
@@ -7413,7 +7413,7 @@ class ys {
7413
7413
  l.searchParams.append("video", btoa(JSON.stringify([s]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
7414
7414
  const c = l.toString();
7415
7415
  if (c.length >= 2e3)
7416
- throw new Fe("Cannot create QR code, URL too long.");
7416
+ throw new xe("Cannot create QR code, URL too long.");
7417
7417
  const d = await ws(c);
7418
7418
  if (!n.data || !n.data.regions)
7419
7419
  throw new ve(n, "Missing regions.");
@@ -7594,7 +7594,7 @@ class Ie {
7594
7594
  });
7595
7595
  },
7596
7596
  () => {
7597
- throw new Fe("Failed to resolve transcoded PDF");
7597
+ throw new xe("Failed to resolve transcoded PDF");
7598
7598
  }
7599
7599
  )
7600
7600
  );
@@ -8059,7 +8059,7 @@ class Ss {
8059
8059
  const y = {};
8060
8060
  (((S = o.assetConfiguration) == null ? void 0 : S.channelNumbers) || []).forEach((b) => {
8061
8061
  var D;
8062
- const P = C.find((x) => x.channelNumber === b.number);
8062
+ const P = C.find((F) => F.channelNumber === b.number);
8063
8063
  P && (y[`${b.id.replace(/\W/g, "")}`] = { browserValue: ((D = P == null ? void 0 : P.variant) == null ? void 0 : D.color) || "" });
8064
8064
  }), await this.changeColors(
8065
8065
  t,
@@ -8075,7 +8075,7 @@ class Ss {
8075
8075
  const P = y[0], D = E[0];
8076
8076
  await this.changeColors(
8077
8077
  t,
8078
- u.map((x) => x.regionElement),
8078
+ u.map((F) => F.regionElement),
8079
8079
  i,
8080
8080
  () => i.getCommandContext().getAllLayouts(),
8081
8081
  /* @__PURE__ */ new Map([[D, P.variant.color]])
@@ -8720,7 +8720,7 @@ class Ds {
8720
8720
  );
8721
8721
  }
8722
8722
  }
8723
- const xs = new Ds(), je = (r, t, e, a, n) => {
8723
+ const Fs = new Ds(), je = (r, t, e, a, n) => {
8724
8724
  if (t.some((d) => d == null))
8725
8725
  throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
8726
8726
  let i = t.map((d) => d.split(`
@@ -8770,7 +8770,7 @@ class Pe extends Error {
8770
8770
  super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Pe.name;
8771
8771
  }
8772
8772
  }
8773
- const Fs = ["‘", "’", "“", "”", `
8773
+ const xs = ["‘", "’", "“", "”", `
8774
8774
  `];
8775
8775
  class De extends Error {
8776
8776
  constructor(t) {
@@ -8786,7 +8786,7 @@ class ks {
8786
8786
  );
8787
8787
  const n = [], i = e ? vt(e.assetUrl) : void 0;
8788
8788
  if (i) {
8789
- const s = a.split("").filter((l) => !Fs.includes(l)).join(""), o = s.split("").map((l) => i.getFont().charToGlyph(l));
8789
+ const s = a.split("").filter((l) => !xs.includes(l)).join(""), o = s.split("").map((l) => i.getFont().charToGlyph(l));
8790
8790
  for (let l = 0; l < o.length; l++)
8791
8791
  o[l].name === ".notdef" && n.push(String.fromCharCode(s.charCodeAt(l)));
8792
8792
  }
@@ -9339,10 +9339,10 @@ class ks {
9339
9339
  { size: a.size, minSize: a.minSize, maxSize: a.maxSize }
9340
9340
  );
9341
9341
  E.set(S.id, P), b.set(S.id, D);
9342
- const x = a.curved || a.vertical ? l : (D || []).join(`
9342
+ const F = a.curved || a.vertical ? l : (D || []).join(`
9343
9343
  `);
9344
9344
  y.push(
9345
- this.generateTextChangeCommandsForRegion(P, a, S.id, x)
9345
+ this.generateTextChangeCommandsForRegion(P, a, S.id, F)
9346
9346
  );
9347
9347
  const k = new W(S, h);
9348
9348
  return {
@@ -9355,7 +9355,7 @@ class ks {
9355
9355
  throw console.log(p), new Pe("Error adding font to region");
9356
9356
  }
9357
9357
  }, d = await Promise.all(a.regions.map(c)).catch((A) => {
9358
- throw A instanceof Pe ? (xs.setLatestToast("Failed to load font.", Oe.Error), A) : A instanceof De ? A : new Error(A);
9358
+ throw A instanceof Pe ? (Fs.setLatestToast("Failed to load font.", Oe.Error), A) : A instanceof De ? A : new Error(A);
9359
9359
  });
9360
9360
  return await s.setSelectionsAndElements(
9361
9361
  t,
@@ -9760,6 +9760,7 @@ const re = v`
9760
9760
  title
9761
9761
  description
9762
9762
  entityId
9763
+ mandatory
9763
9764
  conditions {
9764
9765
  targetAspectName
9765
9766
  action
@@ -9771,6 +9772,9 @@ const re = v`
9771
9772
  pmsPickerEnabled
9772
9773
  colorOptionId
9773
9774
  }
9775
+ text {
9776
+ templatingEnabled
9777
+ }
9774
9778
  }
9775
9779
  }
9776
9780
  }
@@ -10302,7 +10306,7 @@ const re = v`
10302
10306
  `;
10303
10307
  var Oe = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Warning = "Warning", r.Info = "Info", r))(Oe || {});
10304
10308
  const wo = 1e3;
10305
- class Ja extends Fn {
10309
+ class Ja extends xn {
10306
10310
  constructor(t) {
10307
10311
  super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
10308
10312
  }
@@ -10847,7 +10851,7 @@ class yo {
10847
10851
  async updateTransactionStakeholders() {
10848
10852
  var e;
10849
10853
  const t = await B.getShadowGraphqlClient().query({
10850
- query: xi,
10854
+ query: Fi,
10851
10855
  errorPolicy: "all",
10852
10856
  fetchPolicy: "no-cache",
10853
10857
  variables: {
@@ -11666,7 +11670,7 @@ class Do extends it {
11666
11670
  return this.step.data.content;
11667
11671
  }
11668
11672
  }
11669
- class xo extends it {
11673
+ class Fo extends it {
11670
11674
  constructor(t, e, a) {
11671
11675
  super(t, e, a);
11672
11676
  }
@@ -11693,7 +11697,7 @@ class xo extends it {
11693
11697
  );
11694
11698
  }
11695
11699
  }
11696
- class Fo extends it {
11700
+ class xo extends it {
11697
11701
  constructor(t, e, a) {
11698
11702
  super(t, e, a);
11699
11703
  }
@@ -11745,7 +11749,7 @@ class de {
11745
11749
  static get(t, e) {
11746
11750
  switch (e.type) {
11747
11751
  case I.DigitalContent:
11748
- return new xo(t, e, t.getStepTags(e.stepName));
11752
+ return new Fo(t, e, t.getStepTags(e.stepName));
11749
11753
  case I.Information:
11750
11754
  return new Do(t, e, t.getStepTags(e.stepName));
11751
11755
  case I.Question:
@@ -11765,7 +11769,7 @@ class de {
11765
11769
  case I.Frame:
11766
11770
  return new ql(t, e, t.getStepTags(e.stepName));
11767
11771
  case I.Module:
11768
- return new Fo(t, e, t.getStepTags(e.stepName));
11772
+ return new xo(t, e, t.getStepTags(e.stepName));
11769
11773
  default:
11770
11774
  throw new G(`Step type ${e.type} not yet supported in Core SDK`);
11771
11775
  }
@@ -11998,13 +12002,13 @@ const To = async (r, t) => {
11998
12002
  if (c !== void 0)
11999
12003
  return c;
12000
12004
  await r.outstandingRequestsPromise();
12001
- const x = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await B.getShadowGraphqlClient().query({
12005
+ const F = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await B.getShadowGraphqlClient().query({
12002
12006
  query: Dn,
12003
12007
  variables: { ids: [n.id] },
12004
12008
  fetchPolicy: "no-cache",
12005
12009
  errorPolicy: "all",
12006
12010
  context: {
12007
- transactionOwnerId: x
12011
+ transactionOwnerId: F
12008
12012
  }
12009
12013
  }), Z = (R = T.data) == null ? void 0 : R.transactions[0].workflowState;
12010
12014
  return T.errors ? (T.errors.forEach((et) => {
@@ -12012,7 +12016,7 @@ const To = async (r, t) => {
12012
12016
  }), null) : Z ?? null;
12013
12017
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
12014
12018
  const u = r.getPreviewService(), h = (P = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : P.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && da(l, t, !0), p = l && da(l, t, !1), f = async (D) => {
12015
- const x = {};
12019
+ const F = {};
12016
12020
  let k = 0;
12017
12021
  if (Object.keys(i).length > 0)
12018
12022
  for (const T of Object.keys(i)) {
@@ -12021,11 +12025,11 @@ const To = async (r, t) => {
12021
12025
  const tt = Z.selections[et];
12022
12026
  if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
12023
12027
  const Nt = R.stepTitle;
12024
- x[Nt] ? x[Nt].push({
12028
+ F[Nt] ? F[Nt].push({
12025
12029
  id: tt.id || "",
12026
12030
  name: tt.name,
12027
12031
  priceModifier: tt.priceModifier
12028
- }) : x[Nt] = [
12032
+ }) : F[Nt] = [
12029
12033
  {
12030
12034
  id: tt.id || "",
12031
12035
  name: tt.name,
@@ -12036,13 +12040,13 @@ const To = async (r, t) => {
12036
12040
  k += tt.priceModifier;
12037
12041
  }
12038
12042
  }
12039
- return [x, k];
12043
+ return [F, k];
12040
12044
  }, [C] = await f(!0), w = Object.fromEntries(
12041
- Object.keys(C).map((D) => [D, C[D].map((x) => x.id)])
12045
+ Object.keys(C).map((D) => [D, C[D].map((F) => F.id)])
12042
12046
  ), [S] = await f(!1), y = Object.fromEntries(
12043
12047
  Object.keys(S).map((D) => [
12044
12048
  D,
12045
- S[D].map((x) => x.id)
12049
+ S[D].map((F) => F.id)
12046
12050
  ])
12047
12051
  );
12048
12052
  let E = await o(m, n.id);
@@ -12059,9 +12063,9 @@ const To = async (r, t) => {
12059
12063
  designDetails: (() => {
12060
12064
  const D = {
12061
12065
  name: s,
12062
- layouts: e.map((x) => ({
12063
- index: x.index,
12064
- panelId: x.panelId
12066
+ layouts: e.map((F) => ({
12067
+ index: F.index,
12068
+ panelId: F.panelId
12065
12069
  })),
12066
12070
  workflowId: t.id,
12067
12071
  transactionId: n.id,
@@ -12069,16 +12073,16 @@ const To = async (r, t) => {
12069
12073
  previewImage: E
12070
12074
  };
12071
12075
  if (p) {
12072
- const x = [];
12076
+ const F = [];
12073
12077
  for (const [k, T] of Object.entries(p))
12074
- x.push({ key: k, value: T });
12075
- D.metadata = x;
12078
+ F.push({ key: k, value: T });
12079
+ D.metadata = F;
12076
12080
  }
12077
12081
  if (w) {
12078
- const x = [];
12082
+ const F = [];
12079
12083
  for (const [k, T] of Object.entries(y))
12080
- x.push({ key: k, ids: T });
12081
- D.selectedVariants = x;
12084
+ F.push({ key: k, ids: T });
12085
+ D.selectedVariants = F;
12082
12086
  }
12083
12087
  return D;
12084
12088
  })(),
@@ -12403,7 +12407,7 @@ class Go {
12403
12407
  height: d.layoutState.layout.height
12404
12408
  }, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
12405
12409
  if (!h)
12406
- throw new Fe("Failed to obtain 2D context for preview image creation");
12410
+ throw new xe("Failed to obtain 2D context for preview image creation");
12407
12411
  const m = va(u.layoutState.layout, u.layoutState.elements, {
12408
12412
  renderingConfiguration: {
12409
12413
  purpose: Ht.Print,
@@ -12616,7 +12620,7 @@ class Go {
12616
12620
  async onDesignFinished(t, e = !0) {
12617
12621
  const a = this.workflowManager.getTransaction();
12618
12622
  return a.completed ? (await this.graphQlClient().mutate({
12619
- mutation: Fi,
12623
+ mutation: xi,
12620
12624
  variables: {
12621
12625
  transactionId: a.id
12622
12626
  }
@@ -12893,17 +12897,17 @@ const Wo = (r) => {
12893
12897
  return console.error("Failed to read SVG."), [];
12894
12898
  fa(m);
12895
12899
  const g = {};
12896
- Ft(m, (b) => {
12900
+ xt(m, (b) => {
12897
12901
  Ho.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
12898
12902
  const P = b.attributes.getNamedItem("fill");
12899
12903
  if (P && P.value !== "none") {
12900
- const x = P.value, T = `spiff-fill-${x.replace(/\W/g, "")}`;
12901
- b.classList.add(T), g[T] = { browserValue: x };
12904
+ const F = P.value, T = `spiff-fill-${F.replace(/\W/g, "")}`;
12905
+ b.classList.add(T), g[T] = { browserValue: F };
12902
12906
  }
12903
12907
  const D = b.attributes.getNamedItem("stroke");
12904
12908
  if (D && D.value !== "none") {
12905
- const x = D.value, T = `spiff-stroke-${x.replace(/\W/g, "")}`;
12906
- b.classList.add(T), g[T] = { browserValue: x };
12909
+ const F = D.value, T = `spiff-stroke-${F.replace(/\W/g, "")}`;
12910
+ b.classList.add(T), g[T] = { browserValue: F };
12907
12911
  }
12908
12912
  });
12909
12913
  const f = bt().serializeToString(m), C = n.colors;
@@ -12916,7 +12920,7 @@ const Wo = (r) => {
12916
12920
  }
12917
12921
  }
12918
12922
  const w = (b) => {
12919
- const P = r.find((x) => x.panelId === b.panelId);
12923
+ const P = r.find((F) => F.panelId === b.panelId);
12920
12924
  if (!P)
12921
12925
  throw new Y(b);
12922
12926
  const D = Q();
@@ -13400,7 +13404,7 @@ class sl {
13400
13404
  );
13401
13405
  }
13402
13406
  }
13403
- class ol extends Fn {
13407
+ class ol extends xn {
13404
13408
  constructor(t, e, a, n, i, s) {
13405
13409
  super(), this.layoutId = t, this.ctx = e, this.nonPOTSupport = a, this.onRender = n, this.layouts = i, this.getWorkflowManager = s;
13406
13410
  }
@@ -13565,13 +13569,13 @@ class Pa {
13565
13569
  return this.property.name;
13566
13570
  }
13567
13571
  /**
13568
- * @returns A human friendly title.
13572
+ * @returns A human-friendly title.
13569
13573
  */
13570
13574
  getTitle() {
13571
13575
  return this.property.title;
13572
13576
  }
13573
13577
  /**
13574
- * @returns A human friendly description.
13578
+ * @returns A human-friendly description.
13575
13579
  */
13576
13580
  getDescription() {
13577
13581
  return this.property.description;
@@ -13588,6 +13592,18 @@ class Pa {
13588
13592
  getRawProperty() {
13589
13593
  return this.property;
13590
13594
  }
13595
+ /**
13596
+ * @returns Whether this aspect has been marked as required to be completed before the user can continue.
13597
+ */
13598
+ isMandatory() {
13599
+ return !!this.property.mandatory;
13600
+ }
13601
+ /**
13602
+ * @returns Whether this aspect has been marked as `completed` for mandatory checks. Note that this function always returns `true` if the aspect has not been marked as mandatory.
13603
+ */
13604
+ isMandatoryFulfilled() {
13605
+ return !this.property.mandatory || !!this.bundle.getGlobalPropertyStateManager().getAspectMandatoryFulfilled(this.property.name);
13606
+ }
13591
13607
  /**
13592
13608
  * Returns all steps that share this property.
13593
13609
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
@@ -13649,12 +13665,18 @@ class cl extends Pa {
13649
13665
  async selectImage(t) {
13650
13666
  const e = this.bundle.getGlobalPropertyStateManager();
13651
13667
  await Promise.all([
13652
- e.setAspect(this.property.name, t.key, {
13653
- ...e.getAspectStorage(this.property.name) || {},
13654
- originalAssetKey: t.key,
13655
- backgroundRemovedAssetKey: void 0,
13656
- useOriginalAsset: void 0
13657
- }),
13668
+ e.setAspect(
13669
+ this.property.name,
13670
+ t.key,
13671
+ {
13672
+ ...e.getAspectStorage(this.property.name) || {},
13673
+ originalAssetKey: t.key,
13674
+ backgroundRemovedAssetKey: void 0,
13675
+ useOriginalAsset: void 0
13676
+ },
13677
+ void 0
13678
+ ),
13679
+ e.setAspectMandatoryFulfilled(this.property.name, !0),
13658
13680
  this.applyImageSelection(t),
13659
13681
  this.loadImageData()
13660
13682
  ]);
@@ -13850,6 +13872,14 @@ class dl extends Pa {
13850
13872
  constructor(t, e) {
13851
13873
  super(t, e);
13852
13874
  }
13875
+ /**
13876
+ * If this returns false, you should not display any templating tools.
13877
+ * Note: Templates will currently still be rendered, regardless of what this function returns.
13878
+ */
13879
+ isTemplatingEnabled() {
13880
+ var t, e;
13881
+ return ((e = (t = this.property.data) == null ? void 0 : t.text) == null ? void 0 : e.templatingEnabled) || !1;
13882
+ }
13853
13883
  /**
13854
13884
  * Gets the current text
13855
13885
  */
@@ -13862,7 +13892,8 @@ class dl extends Pa {
13862
13892
  */
13863
13893
  async setText(t) {
13864
13894
  await Promise.all([
13865
- this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13895
+ this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t, void 0, void 0),
13896
+ this.bundle.getGlobalPropertyStateManager().setAspectMandatoryFulfilled(this.property.name, t.trim() !== ""),
13866
13897
  this.applyTextSelection(t)
13867
13898
  ]);
13868
13899
  }
@@ -13938,6 +13969,7 @@ class er extends Pa {
13938
13969
  async selectVariant(t, e) {
13939
13970
  await Promise.all([
13940
13971
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13972
+ this.bundle.getGlobalPropertyStateManager().setAspectMandatoryFulfilled(this.property.name, !0),
13941
13973
  this.applyVariantSelection(t)
13942
13974
  ]);
13943
13975
  }
@@ -13965,6 +13997,7 @@ class Ka extends er {
13965
13997
  async selectVariant(t, e) {
13966
13998
  await Promise.all([
13967
13999
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
14000
+ this.bundle.getGlobalPropertyStateManager().setAspectMandatoryFulfilled(this.property.name, !0),
13968
14001
  this.applyColorVariant(t, void 0, e)
13969
14002
  ]);
13970
14003
  }
@@ -14026,14 +14059,20 @@ const Al = (r, t, e, a) => r.flatMap((n) => n.getSteps()).filter((n) => n.getGlo
14026
14059
  };
14027
14060
  class hl {
14028
14061
  constructor(t, e, a, n, i) {
14029
- this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = i;
14062
+ this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = i;
14030
14063
  const s = i == null ? void 0 : i.existingGlobalPropertyState;
14031
14064
  this.initPromise = s ? Promise.resolve(s).then(() => {
14032
- console.log("Setting global property state to existing state."), this.globalPropertyState = s;
14065
+ console.log("Setting global property state to existing state."), this.globalPropertyState = s, this.recalculateMandatoryStates();
14033
14066
  }) : this.createGlobalPropertyState().then((o) => {
14034
- console.log("Setting global property state to new state."), this.globalPropertyState = o;
14067
+ console.log("Setting global property state to new state."), this.globalPropertyState = o, this.recalculateMandatoryStates();
14035
14068
  }), this.onGlobalPropertyStateChange = n;
14036
14069
  }
14070
+ recalculateMandatoryStates() {
14071
+ var t;
14072
+ this.mandatoryFulfilledAspects.clear(), (t = this.globalPropertyState) == null || t.aspects.forEach((e) => {
14073
+ e.value !== "" && (this.mandatoryFulfilledAspects[e.name] = !0);
14074
+ });
14075
+ }
14037
14076
  setBundleOptions(t) {
14038
14077
  this.bundleOptions = t;
14039
14078
  }
@@ -14052,7 +14091,13 @@ class hl {
14052
14091
  async setGlobalPropertyState(t) {
14053
14092
  this.globalPropertyState || await this.initPromise;
14054
14093
  const e = yt(this.globalPropertyState);
14055
- this.globalPropertyState = { ...t, id: e.id }, await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
14094
+ this.globalPropertyState = { ...t, id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
14095
+ }
14096
+ getAspectMandatoryFulfilled(t) {
14097
+ return this.mandatoryFulfilledAspects[t];
14098
+ }
14099
+ async setAspectMandatoryFulfilled(t, e) {
14100
+ this.mandatoryFulfilledAspects[t] = e, await this.onGlobalPropertyStateChange(this.globalPropertyState, this.globalPropertyState);
14056
14101
  }
14057
14102
  getAspect(t, e) {
14058
14103
  if (!this.globalPropertyState)
@@ -14083,7 +14128,9 @@ class hl {
14083
14128
  l.value = e, l.type = i.type, l.channel = n, a !== void 0 && (l.storage = a !== null ? a : void 0);
14084
14129
  else {
14085
14130
  if (n === 1) {
14086
- const c = this.globalPropertyState.aspects.findIndex((d) => !d.channel && d.name === t);
14131
+ const c = this.globalPropertyState.aspects.findIndex(
14132
+ (d) => !d.channel && d.name === t
14133
+ );
14087
14134
  c && c > 0 && this.globalPropertyState.aspects.splice(c, 1);
14088
14135
  }
14089
14136
  this.globalPropertyState.aspects.push({
@@ -14839,7 +14886,7 @@ class Ke {
14839
14886
  this.id,
14840
14887
  this.ownerId,
14841
14888
  o,
14842
- this.checkConditionalHandlesChanged.bind(this),
14889
+ this.onGlobalPropertiesChanged.bind(this),
14843
14890
  s
14844
14891
  ), this.globalPropertyHandleService = new ll(this), this.setPreviewService(a);
14845
14892
  const l = new Promise((u, h) => {
@@ -14868,6 +14915,8 @@ class Ke {
14868
14915
  this.globalPropertyStateManager.getInitializationPromise()
14869
14916
  ]).then(() => l), this.initializationPromise.catch((u) => {
14870
14917
  console.error(`Bundle initialization failed: ${u}`);
14918
+ }), this.initializationPromise.then(() => {
14919
+ this.getGlobalProperties().then((u) => this.checkMandatoryHandlesChanged([], u));
14871
14920
  });
14872
14921
  }
14873
14922
  getTemplate() {
@@ -15497,22 +15546,36 @@ class Ke {
15497
15546
  }
15498
15547
  });
15499
15548
  }
15500
- async checkConditionalHandlesChanged(t, e) {
15549
+ async onGlobalPropertiesChanged(t, e) {
15501
15550
  const a = await this.globalPropertyHandleService.getHandles(), n = this.globalPropertyHandleService.applyConditionsFromState(a, t), i = this.globalPropertyHandleService.applyConditionsFromState(a, e);
15502
- if ((() => {
15503
- if (n.length !== i.length)
15551
+ this.checkConditionalHandlesChanged(n, i), this.checkMandatoryHandlesChanged(n, i);
15552
+ const s = i.filter((o) => !n.includes(o));
15553
+ await Promise.all(s.map((o) => o.applyGlobalState()));
15554
+ }
15555
+ checkConditionalHandlesChanged(t, e) {
15556
+ (() => {
15557
+ if (t.length !== e.length)
15504
15558
  return !0;
15505
- for (let o = 0; o < n.length; o++)
15506
- if (n[o].getName() !== i[o].getName())
15559
+ for (let n = 0; n < t.length; n++)
15560
+ if (t[n].getName() !== e[n].getName())
15507
15561
  return !0;
15508
15562
  return !1;
15509
- })()) {
15510
- this.fireEvent("conditional-global-properties-changed", {
15511
- globalProperties: i
15512
- });
15513
- const o = i.filter((l) => !n.includes(l));
15514
- await Promise.all(o.map((l) => l.applyGlobalState()));
15515
- }
15563
+ })() && this.fireEvent("conditional-global-properties-changed", {
15564
+ globalProperties: e
15565
+ });
15566
+ }
15567
+ checkMandatoryHandlesChanged(t, e) {
15568
+ const a = [], n = [], i = [];
15569
+ for (const s of e)
15570
+ if (s.isMandatory()) {
15571
+ const o = t.find((c) => c.getName() == s.getName()), l = s.isMandatoryFulfilled();
15572
+ l ? n.push(s) : i.push(s), (!o || o.isMandatoryFulfilled() !== l) && a.push(s);
15573
+ }
15574
+ a.length > 0 && this.fireEvent("global-properties-mandatory-changed", {
15575
+ changed: a,
15576
+ completed: n,
15577
+ remaining: i
15578
+ });
15516
15579
  }
15517
15580
  fireEvent(t, e) {
15518
15581
  this.eventEmitter.emit(t, e);
@@ -15717,7 +15780,7 @@ class Da {
15717
15780
  return t.startsWith("[") ? JSON.stringify(JSON.parse(t)) : t;
15718
15781
  }
15719
15782
  }
15720
- var xl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(xl || {});
15783
+ var Fl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(Fl || {});
15721
15784
  class ud extends Da {
15722
15785
  constructor(t) {
15723
15786
  super(`"${t}"`);
@@ -15791,7 +15854,7 @@ const he = v`
15791
15854
  }
15792
15855
  }
15793
15856
  }
15794
- `, Fl = v`
15857
+ `, xl = v`
15795
15858
  mutation CustomerCreate($details: CustomerDetailsInput!) {
15796
15859
  customerCreate(details: $details) {
15797
15860
  id
@@ -16113,7 +16176,7 @@ class gd {
16113
16176
  } catch (a) {
16114
16177
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
16115
16178
  }
16116
- }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 29.1.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16179
+ }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 29.2.0-beta.decf8a29-8a3c-5a28-b86d-f2ac07bea19f"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16117
16180
  }
16118
16181
  configure(t) {
16119
16182
  mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && zr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16293,7 +16356,7 @@ class gd {
16293
16356
  })).data.customer;
16294
16357
  if (!n.id) {
16295
16358
  const l = (s = (await e.mutate({
16296
- mutation: Fl,
16359
+ mutation: xl,
16297
16360
  errorPolicy: "all",
16298
16361
  fetchPolicy: "no-cache",
16299
16362
  variables: {
@@ -16603,7 +16666,7 @@ class gd {
16603
16666
  if (t.length === 0)
16604
16667
  throw new ut("No options provided!");
16605
16668
  const a = B.getShadowGraphqlClient(), n = async (y) => {
16606
- var D, x, k;
16669
+ var D, F, k;
16607
16670
  if (y.length === 0)
16608
16671
  return [];
16609
16672
  const E = y.map((T) => T.option.transactionId), b = await a.query({
@@ -16615,7 +16678,7 @@ class gd {
16615
16678
  fetchPolicy: "no-cache"
16616
16679
  }), P = b.data.transactions;
16617
16680
  if (P.length !== y.length) {
16618
- const T = ((x = (D = b.errors) == null ? void 0 : D[0]) == null ? void 0 : x.message) || "Unknown error";
16681
+ const T = ((F = (D = b.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16619
16682
  throw new ut(`Not all transactions were found: ${T}`);
16620
16683
  }
16621
16684
  return !this.activeIntegration && ((k = P[0].integrationProduct) != null && k.integration) && (this.activeIntegration = Promise.resolve(P[0].integrationProduct.integration)), P.map((T, Z) => {
@@ -16628,7 +16691,7 @@ class gd {
16628
16691
  };
16629
16692
  });
16630
16693
  }, i = async (y) => {
16631
- var P, D, x;
16694
+ var P, D, F;
16632
16695
  if (y.length === 0)
16633
16696
  return [];
16634
16697
  const E = await a.mutate({
@@ -16649,7 +16712,7 @@ class gd {
16649
16712
  fetchPolicy: "no-cache"
16650
16713
  }), b = (P = E.data) == null ? void 0 : P.transactionCreateMany;
16651
16714
  if (!b || b.length === 0) {
16652
- const k = ((x = (D = E.errors) == null ? void 0 : D[0]) == null ? void 0 : x.message) || "Unknown error";
16715
+ const k = ((F = (D = E.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16653
16716
  throw new ut(`Failed to create transactions: ${k}`);
16654
16717
  }
16655
16718
  return b.map((k, T) => ({
@@ -16665,7 +16728,7 @@ class gd {
16665
16728
  ...d.map(i)
16666
16729
  ])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await rr(u, e), m = new Map(h.map((y) => [y.id, y])), g = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
16667
16730
  var et;
16668
- const { transaction: E, workflowId: b, readOnly: P, index: D } = y, x = m.get(b), k = t[D];
16731
+ const { transaction: E, workflowId: b, readOnly: P, index: D } = y, F = m.get(b), k = t[D];
16669
16732
  !g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
16670
16733
  const T = g.get(E.id) || void 0, Z = new Tl({
16671
16734
  onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
@@ -16683,7 +16746,7 @@ class gd {
16683
16746
  }),
16684
16747
  graphQlClient: () => Z,
16685
16748
  readOnly: P,
16686
- workflow: x,
16749
+ workflow: F,
16687
16750
  isReloadedTransaction: k.type === "transaction"
16688
16751
  };
16689
16752
  if (!P && k.workflowState) {
@@ -17404,7 +17467,7 @@ const Hl = v`
17404
17467
  id
17405
17468
  }
17406
17469
  }
17407
- `, xa = v`
17470
+ `, Fa = v`
17408
17471
  query GetCustomerTransactions(
17409
17472
  $id: String!
17410
17473
  $limit: Int!
@@ -17573,7 +17636,7 @@ const Hl = v`
17573
17636
  }), Dd = async (r, t, e) => {
17574
17637
  var n;
17575
17638
  const a = await B.getShadowGraphqlClient().query({
17576
- query: xa,
17639
+ query: Fa,
17577
17640
  errorPolicy: "all",
17578
17641
  fetchPolicy: "no-cache",
17579
17642
  variables: {
@@ -17594,10 +17657,10 @@ const Hl = v`
17594
17657
  }
17595
17658
  });
17596
17659
  return ((n = a == null ? void 0 : a.data.customerTransactionsFeed) == null ? void 0 : n.items) || [];
17597
- }, xd = async (r, t, e) => {
17660
+ }, Fd = async (r, t, e) => {
17598
17661
  var n;
17599
17662
  const a = await B.getShadowGraphqlClient().query({
17600
- query: xa,
17663
+ query: Fa,
17601
17664
  errorPolicy: "all",
17602
17665
  fetchPolicy: "no-cache",
17603
17666
  variables: {
@@ -17618,10 +17681,10 @@ const Hl = v`
17618
17681
  }
17619
17682
  });
17620
17683
  return ((n = a == null ? void 0 : a.data.customerTransactionsFeed) == null ? void 0 : n.items) || [];
17621
- }, Fd = async (r, t, e) => {
17684
+ }, xd = async (r, t, e) => {
17622
17685
  var n;
17623
17686
  const a = await B.getShadowGraphqlClient().query({
17624
- query: xa,
17687
+ query: Fa,
17625
17688
  errorPolicy: "all",
17626
17689
  fetchPolicy: "no-cache",
17627
17690
  variables: {
@@ -17758,7 +17821,7 @@ const sr = v`
17758
17821
  }
17759
17822
  missingComponentTypes
17760
17823
  }
17761
- `, Fa = v`
17824
+ `, xa = v`
17762
17825
  ${sr}
17763
17826
  fragment AddressValidationJobFields on AddressValidationJob {
17764
17827
  id
@@ -17771,14 +17834,14 @@ const sr = v`
17771
17834
  }
17772
17835
  }
17773
17836
  `, rc = v`
17774
- ${Fa}
17837
+ ${xa}
17775
17838
  query GetAddressValidationJobs($ids: [String!]!) {
17776
17839
  addressValidationJobs(ids: $ids) {
17777
17840
  ...AddressValidationJobFields
17778
17841
  }
17779
17842
  }
17780
17843
  `, ic = v`
17781
- ${Fa}
17844
+ ${xa}
17782
17845
  query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
17783
17846
  recipients(ids: $ids) {
17784
17847
  id
@@ -17795,7 +17858,7 @@ const sr = v`
17795
17858
  }
17796
17859
  }
17797
17860
  `, oc = v`
17798
- ${Fa}
17861
+ ${xa}
17799
17862
  mutation BatchValidateRecipientAddress($ids: [String!]!) {
17800
17863
  recipientValidateBatch(ids: $ids) {
17801
17864
  ...AddressValidationJobFields
@@ -17883,7 +17946,7 @@ export {
17883
17946
  Rl as CurrencyContext,
17884
17947
  Ql as CurrencyService,
17885
17948
  Et as DeleteElementCommand,
17886
- xo as DigitalContentStepHandle,
17949
+ Fo as DigitalContentStepHandle,
17887
17950
  cl as FileUploadGlobalPropertyHandle,
17888
17951
  ue as FlowExecutionNodeResult,
17889
17952
  Dl as FlowExecutionResult,
@@ -17910,10 +17973,10 @@ export {
17910
17973
  ve as MisconfigurationError,
17911
17974
  yd as MockWorkflowManager,
17912
17975
  Eo as ModelStepHandle,
17913
- Fo as ModuleStepHandle,
17976
+ xo as ModuleStepHandle,
17914
17977
  td as MoveCommand,
17915
17978
  nr as ObjectInput,
17916
- xl as ObjectInputType,
17979
+ Fl as ObjectInputType,
17917
17980
  er as OptionGlobalPropertyHandle,
17918
17981
  Se as OptionNotFoundError,
17919
17982
  Dt as ParseError,
@@ -17925,7 +17988,7 @@ export {
17925
17988
  Jt as PromiseCache,
17926
17989
  kn as PromiseQueue,
17927
17990
  Bo as QuestionStepHandle,
17928
- Fn as QueueablePromise,
17991
+ xn as QueueablePromise,
17929
17992
  ad as ResizeCommand,
17930
17993
  jt as ResourceNotFoundError,
17931
17994
  ed as RotateCommand,
@@ -17986,14 +18049,14 @@ export {
17986
18049
  Vl as getIntegration,
17987
18050
  Hc as getNEPoint,
17988
18051
  qc as getNWPoint,
17989
- xd as getOrderedTransactions,
18052
+ Fd as getOrderedTransactions,
17990
18053
  fd as getOverrideThemeConfiguration,
17991
18054
  Wc as getPointOfRotation,
17992
18055
  Ad as getProductCollections,
17993
18056
  jc as getSEPoint,
17994
18057
  va as getSvgElement,
17995
18058
  kd as getTemplateBundles,
17996
- Fd as getTemplateTransactions,
18059
+ xd as getTemplateTransactions,
17997
18060
  pd as getTransaction,
17998
18061
  wd as getTransactionThemeConfiguration,
17999
18062
  Pd as getTransactionsForBundle,
@@ -18038,7 +18101,7 @@ export {
18038
18101
  Ln as svgStringDimensions,
18039
18102
  ma as svgToDataUrl,
18040
18103
  q as textStepService,
18041
- xs as toast,
18104
+ Fs as toast,
18042
18105
  Nd as validateWorkflowExperienceRecipient,
18043
18106
  Qd as validateWorkflowExperienceRecipients,
18044
18107
  bt as xmlSerializer