@spiffcommerce/core 31.4.0-beta.313e588f-e8b3-5b1e-9fb4-fb2af3ac9d0e → 31.4.0-beta.c4e503af-360f-5779-8464-b409180b3fde
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 +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -62
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -7,7 +7,7 @@ import { orientation as gr } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as on } from "css";
|
8
8
|
import pr from "fuse.js";
|
9
9
|
import { Pith as Aa } from "pith";
|
10
|
-
import
|
10
|
+
import Et from "lodash.clonedeep";
|
11
11
|
import { toString as ln } from "qrcode";
|
12
12
|
import fr from "svg-path-bbox";
|
13
13
|
import { parse as ta } from "opentype.js";
|
@@ -44,7 +44,7 @@ class Y extends Xt {
|
|
44
44
|
super(`Panel not Found: ${t.panelId}`), this.panelId = t?.panelId || "N/A";
|
45
45
|
}
|
46
46
|
}
|
47
|
-
class
|
47
|
+
class bt extends Xt {
|
48
48
|
constructor(t) {
|
49
49
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
50
50
|
}
|
@@ -225,7 +225,7 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
225
225
|
const n = a.load();
|
226
226
|
return Ue.set(t, n), n;
|
227
227
|
}
|
228
|
-
},
|
228
|
+
}, It = () => {
|
229
229
|
if (Tt([typeof XMLSerializer]))
|
230
230
|
return new XMLSerializer();
|
231
231
|
const r = Zt();
|
@@ -3328,7 +3328,7 @@ const le = (r) => {
|
|
3328
3328
|
}
|
3329
3329
|
});
|
3330
3330
|
});
|
3331
|
-
}, vn = (r) =>
|
3331
|
+
}, vn = (r) => It().serializeToString(r), fa = (r, t, e, a, n) => {
|
3332
3332
|
const i = yn(r);
|
3333
3333
|
if (!i)
|
3334
3334
|
throw new Error("Failed to read SVG.");
|
@@ -3360,7 +3360,7 @@ const le = (r) => {
|
|
3360
3360
|
s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
|
3361
3361
|
}
|
3362
3362
|
});
|
3363
|
-
const i =
|
3363
|
+
const i = It().serializeToString(e);
|
3364
3364
|
return {
|
3365
3365
|
colors: a,
|
3366
3366
|
svg: i
|
@@ -3661,7 +3661,7 @@ class mi {
|
|
3661
3661
|
const a = await t.blob.text(), s = new window.DOMParser().parseFromString(a, "image/svg+xml").documentElement;
|
3662
3662
|
if (!s) throw new Dt("Failed to read SVG.");
|
3663
3663
|
ri(s);
|
3664
|
-
const l =
|
3664
|
+
const l = It().serializeToString(s);
|
3665
3665
|
return {
|
3666
3666
|
name: t.name,
|
3667
3667
|
blob: new Blob([l], { type: "image/svg+xml" })
|
@@ -5214,7 +5214,7 @@ const H = new yi(), bn = w`
|
|
5214
5214
|
],
|
5215
5215
|
silentSteps: []
|
5216
5216
|
}), t;
|
5217
|
-
}, ji = (r, t) => t.find((e) => e.stepNames.includes(r)),
|
5217
|
+
}, ji = (r, t) => t.find((e) => e.stepNames.includes(r)), vt = (r, t) => (r.conditions || []).every((e) => {
|
5218
5218
|
const a = t[e.targetStepName];
|
5219
5219
|
if (a && a.selectedVariants) {
|
5220
5220
|
const n = a.selectedVariants;
|
@@ -5227,12 +5227,12 @@ const H = new yi(), bn = w`
|
|
5227
5227
|
const e = {
|
5228
5228
|
name: r.name,
|
5229
5229
|
title: r.title,
|
5230
|
-
renderableSteps: r.renderableSteps.filter((a) =>
|
5231
|
-
silentSteps: r.silentSteps.filter((a) =>
|
5230
|
+
renderableSteps: r.renderableSteps.filter((a) => vt(a, t)),
|
5231
|
+
silentSteps: r.silentSteps.filter((a) => vt(a, t))
|
5232
5232
|
};
|
5233
5233
|
return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
|
5234
|
-
},
|
5235
|
-
const a =
|
5234
|
+
}, yt = (r, t) => r.map((e) => Hi(e, t)).filter((e) => e !== null), Yi = async (r, t, e = !1) => {
|
5235
|
+
const a = yt(r, t), n = [];
|
5236
5236
|
for (const s of a)
|
5237
5237
|
for (const o of s.renderableSteps) {
|
5238
5238
|
const l = (o.option?.variants || []).length;
|
@@ -5454,7 +5454,7 @@ const M = () => {
|
|
5454
5454
|
}), jc = (r, t, e, a) => ({
|
5455
5455
|
x: r.x + (t?.x + t?.width) * e,
|
5456
5456
|
y: r.y + (t?.y + t?.height) * a
|
5457
|
-
}),
|
5457
|
+
}), Pt = (r) => {
|
5458
5458
|
switch (r) {
|
5459
5459
|
case j.North:
|
5460
5460
|
return j.East;
|
@@ -5473,7 +5473,7 @@ const M = () => {
|
|
5473
5473
|
case j.Southwest:
|
5474
5474
|
return j.Northwest;
|
5475
5475
|
}
|
5476
|
-
}, Hc = (r, t) => t > 45 && t <= 135 ?
|
5476
|
+
}, Hc = (r, t) => t > 45 && t <= 135 ? Pt(r) : t > 135 && t <= 225 ? Pt(Pt(r)) : t > 225 && t <= 315 ? Pt(Pt(Pt(r))) : r, Yc = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
5477
5477
|
const a = ft(r.rotation), n = {
|
5478
5478
|
x: t.x + r.x * e.x,
|
5479
5479
|
y: t.x + r.y * e.y
|
@@ -5758,7 +5758,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5758
5758
|
const B = P.toSVG(2), Q = t.parseFromString(B, "image/svg+xml").firstElementChild;
|
5759
5759
|
h.appendChild(Q);
|
5760
5760
|
}
|
5761
|
-
return e.querySelectorAll("text").forEach((d) => d.remove()),
|
5761
|
+
return e.querySelectorAll("text").forEach((d) => d.remove()), It().serializeToString(a);
|
5762
5762
|
}, Be = (r, t, e, a) => Math.max(ns(r.join(`
|
5763
5763
|
`), e, a), t), Ua = (r, t, e, a, n, i) => {
|
5764
5764
|
const s = (i || Rn) * n.getApproximateHeight(), o = t.split(`
|
@@ -6331,7 +6331,7 @@ const ne = (r) => {
|
|
6331
6331
|
const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
|
6332
6332
|
if (!s)
|
6333
6333
|
throw new Error("Failed to read SVG");
|
6334
|
-
const l =
|
6334
|
+
const l = It().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
|
6335
6335
|
anonymousCrossOrigin: !0,
|
6336
6336
|
ignoreDimensions: !1,
|
6337
6337
|
createCanvas: pt,
|
@@ -6782,7 +6782,7 @@ class z extends N {
|
|
6782
6782
|
return a !== void 0 ? a + 1 : 0;
|
6783
6783
|
}
|
6784
6784
|
}
|
6785
|
-
class
|
6785
|
+
class Bt extends N {
|
6786
6786
|
constructor(t) {
|
6787
6787
|
super(), this.id = t;
|
6788
6788
|
}
|
@@ -7385,7 +7385,7 @@ class ys {
|
|
7385
7385
|
40
|
7386
7386
|
);
|
7387
7387
|
});
|
7388
|
-
t.forEach((h) => a.getCommandDispatcher()(new
|
7388
|
+
t.forEach((h) => a.getCommandDispatcher()(new Bt(h.id)));
|
7389
7389
|
const o = n.data.baseUrl.slice(0, 4) === "http" ? "" : "https://", l = new URL(o + n.data.baseUrl);
|
7390
7390
|
l.searchParams.append("video", btoa(JSON.stringify([s]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
7391
7391
|
const c = l.toString();
|
@@ -7443,7 +7443,7 @@ class Pe {
|
|
7443
7443
|
return oa(e);
|
7444
7444
|
const a = t.asset;
|
7445
7445
|
if (!a)
|
7446
|
-
throw new
|
7446
|
+
throw new bt(t);
|
7447
7447
|
const n = a.fileLink;
|
7448
7448
|
if (n)
|
7449
7449
|
return nt(n, !0);
|
@@ -7710,7 +7710,7 @@ class Pe {
|
|
7710
7710
|
i && i(!0);
|
7711
7711
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
7712
7712
|
t.data.regions.map(async (h, m) => {
|
7713
|
-
const g = await Oe(l[m]), p = o.getImageData(), f = a.map((P) => new
|
7713
|
+
const g = await Oe(l[m]), p = o.getImageData(), f = a.map((P) => new Bt(P.id)), S = p ? va(
|
7714
7714
|
p,
|
7715
7715
|
g,
|
7716
7716
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
@@ -7801,7 +7801,7 @@ class Pe {
|
|
7801
7801
|
), this.validateColorCount(e, a);
|
7802
7802
|
}
|
7803
7803
|
}
|
7804
|
-
const
|
7804
|
+
const St = new Pe();
|
7805
7805
|
class Ss {
|
7806
7806
|
async getIllustrationBody(t) {
|
7807
7807
|
return new Promise((e) => {
|
@@ -7958,11 +7958,11 @@ class Ss {
|
|
7958
7958
|
if (!t.data || !t.data.regions)
|
7959
7959
|
throw new Ee(t, "Missing regions.");
|
7960
7960
|
n(!0);
|
7961
|
-
const s = a.map((f) => new
|
7961
|
+
const s = a.map((f) => new Bt(f.id));
|
7962
7962
|
t.mandatory && i.setMandatoryFulfilled(t.stepName, !1);
|
7963
7963
|
const o = e.asset;
|
7964
7964
|
if (!o)
|
7965
|
-
throw new
|
7965
|
+
throw new bt(e);
|
7966
7966
|
const l = o.fileLink;
|
7967
7967
|
if (!l)
|
7968
7968
|
throw new Yt(o);
|
@@ -8093,7 +8093,7 @@ class vs {
|
|
8093
8093
|
n(!0);
|
8094
8094
|
const s = e.material;
|
8095
8095
|
if (!s)
|
8096
|
-
throw n(!1), new
|
8096
|
+
throw n(!1), new bt(e);
|
8097
8097
|
return {
|
8098
8098
|
command: void 0,
|
8099
8099
|
followup: async () => {
|
@@ -8144,7 +8144,7 @@ class Es {
|
|
8144
8144
|
const u = e.getModelContainer();
|
8145
8145
|
if (u && t.option) {
|
8146
8146
|
const h = d.asset?.fileLink;
|
8147
|
-
if (!h) throw new
|
8147
|
+
if (!h) throw new bt(d);
|
8148
8148
|
await u.applyModelVariant(
|
8149
8149
|
t.stepName || "",
|
8150
8150
|
{
|
@@ -8168,7 +8168,7 @@ class Es {
|
|
8168
8168
|
n(!0);
|
8169
8169
|
const i = e.asset?.fileLink;
|
8170
8170
|
if (!i)
|
8171
|
-
throw new
|
8171
|
+
throw new bt(e);
|
8172
8172
|
return {
|
8173
8173
|
command: void 0,
|
8174
8174
|
followup: async () => {
|
@@ -8229,7 +8229,7 @@ class bs {
|
|
8229
8229
|
if (!g)
|
8230
8230
|
return console.error(`Can not find layout for region: ${A.panelId}`), null;
|
8231
8231
|
const p = [];
|
8232
|
-
return u && p.push(new
|
8232
|
+
return u && p.push(new Bt(h)), p.push(
|
8233
8233
|
new z(
|
8234
8234
|
{
|
8235
8235
|
stepRegion: A,
|
@@ -8345,12 +8345,12 @@ class Bs {
|
|
8345
8345
|
async selectVariantCommand(t, e, a, n) {
|
8346
8346
|
const i = e.asset;
|
8347
8347
|
if (!i)
|
8348
|
-
throw new
|
8348
|
+
throw new bt(e);
|
8349
8349
|
const s = i?.fileLink;
|
8350
8350
|
if (!s)
|
8351
8351
|
return console.error("No URL for picture!"), null;
|
8352
8352
|
n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
|
8353
|
-
const l = a.getRegionElements(t.stepName).map((A) => new
|
8353
|
+
const l = a.getRegionElements(t.stepName).map((A) => new Bt(A.id)), c = (A) => {
|
8354
8354
|
const h = a.getLayouts().find((g) => g.panelId === A.panelId);
|
8355
8355
|
if (!h)
|
8356
8356
|
throw new Y(A);
|
@@ -9079,7 +9079,7 @@ class ks {
|
|
9079
9079
|
async fontDataFromVariant(t) {
|
9080
9080
|
const e = t.asset;
|
9081
9081
|
if (!e)
|
9082
|
-
throw new
|
9082
|
+
throw new bt(t);
|
9083
9083
|
const a = e.fileLink;
|
9084
9084
|
if (!a)
|
9085
9085
|
throw new Yt(e);
|
@@ -10396,7 +10396,7 @@ class yo {
|
|
10396
10396
|
this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
|
10397
10397
|
this.storage[o.stepName] = o.storage || {};
|
10398
10398
|
}), await this.fetchConversionConfiguration(), this.allScenes = await qi(t);
|
10399
|
-
const n =
|
10399
|
+
const n = yt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
|
10400
10400
|
this.commandContext.apply(new R(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
|
10401
10401
|
}
|
10402
10402
|
getWorkflowExperience() {
|
@@ -10569,7 +10569,7 @@ class yo {
|
|
10569
10569
|
this.mandatorySteps[t] !== e && (this.mandatorySteps = { ...this.mandatorySteps, [t]: e }, this.onMandatoryChange());
|
10570
10570
|
}
|
10571
10571
|
getMandatoryUnfulfilledSteps() {
|
10572
|
-
return
|
10572
|
+
return yt(this.allScenes, this.stepSelections).flatMap((i) => i.renderableSteps).filter((i) => i.mandatory).filter((i) => !this.mandatorySteps[i.stepName]).map((i) => i.stepName);
|
10573
10573
|
}
|
10574
10574
|
setStepError(t, e, a) {
|
10575
10575
|
let n = !1;
|
@@ -10604,7 +10604,7 @@ class yo {
|
|
10604
10604
|
},
|
10605
10605
|
{ refocusCamera: e }
|
10606
10606
|
);
|
10607
|
-
this.setModelContainer(a),
|
10607
|
+
this.setModelContainer(a), yt(this.allScenes, this.stepSelections).filter((s) => s).map((s) => s.renderableSteps).flat().filter((s) => s.type === v.Model || s.type === v.Material).forEach((s) => {
|
10608
10608
|
if (!s.option?.id) {
|
10609
10609
|
console.error(`Failed to read option id from step: ${s.stepName}`);
|
10610
10610
|
return;
|
@@ -10711,7 +10711,7 @@ class yo {
|
|
10711
10711
|
const t = this.getCommandContext().getState();
|
10712
10712
|
if (!t)
|
10713
10713
|
throw new V("Attempted to serialize state before it was initialized.");
|
10714
|
-
const e =
|
10714
|
+
const e = Et(t.transaction), a = this.dehydrateState(e);
|
10715
10715
|
return JSON.stringify(a);
|
10716
10716
|
}
|
10717
10717
|
/**
|
@@ -10747,12 +10747,12 @@ class yo {
|
|
10747
10747
|
this.stepElements = e(this.stepElements, t);
|
10748
10748
|
}
|
10749
10749
|
getInvalidCanvasRegions() {
|
10750
|
-
return this.workflow.steps.reduce((t, e) => (
|
10750
|
+
return this.workflow.steps.reduce((t, e) => (vt(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
|
10751
10751
|
(a) => t.push(a)
|
10752
10752
|
), t), []);
|
10753
10753
|
}
|
10754
10754
|
getInvalidModelVariants() {
|
10755
|
-
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !
|
10755
|
+
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !vt(e, this.stepSelections) && t.push(e.stepName), t), []);
|
10756
10756
|
}
|
10757
10757
|
async stepElementsForIntroducedSilentSteps(t, e) {
|
10758
10758
|
const a = this.product;
|
@@ -10842,7 +10842,7 @@ class yo {
|
|
10842
10842
|
async reset() {
|
10843
10843
|
this.commandContext.getAllLayouts().forEach(
|
10844
10844
|
(e) => e.layoutState.elements.forEach((a) => {
|
10845
|
-
this.getCommandDispatcher()(new
|
10845
|
+
this.getCommandDispatcher()(new Bt(a.id));
|
10846
10846
|
})
|
10847
10847
|
), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
|
10848
10848
|
}
|
@@ -10852,13 +10852,13 @@ class yo {
|
|
10852
10852
|
...this.stepSelections,
|
10853
10853
|
[t]: { selectedVariants: e }
|
10854
10854
|
}, this.selectionCost = Object.values(this.stepSelections).reduce((C, E) => C + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, B) => P + B, 0), 0), this.workflow.steps.forEach((C) => {
|
10855
|
-
|
10855
|
+
vt(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1, delete this.stepMetadata[C.stepName], delete this.stepSelections[C.stepName], delete this.storage[C.stepName]);
|
10856
10856
|
});
|
10857
|
-
const s = this.allScenes, o =
|
10857
|
+
const s = this.allScenes, o = yt(s, i), l = yt(s, this.stepSelections), c = o.map((C) => C.silentSteps).flat(), A = l.map((C) => C.silentSteps).flat().filter(
|
10858
10858
|
(C) => !c.some((E) => E.stepName === C.stepName)
|
10859
10859
|
);
|
10860
10860
|
c.forEach((C) => {
|
10861
|
-
|
10861
|
+
vt(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1);
|
10862
10862
|
});
|
10863
10863
|
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
|
10864
10864
|
this.stepElements = {
|
@@ -10868,7 +10868,7 @@ class yo {
|
|
10868
10868
|
}, this.removeElements(u);
|
10869
10869
|
const g = this.workflow.steps.find((C) => C.stepName === t);
|
10870
10870
|
g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
|
10871
|
-
const p = u.map((C) => new
|
10871
|
+
const p = u.map((C) => new Bt(C.id)), f = new Ga(this.constructSerializableWorkflow()), S = [...m, ...p, f];
|
10872
10872
|
S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
10873
10873
|
const b = this.getInvalidModelVariants(), I = this.modelContainer;
|
10874
10874
|
if (I) {
|
@@ -10886,7 +10886,7 @@ class yo {
|
|
10886
10886
|
await this.onSelectionChange(), n && await n();
|
10887
10887
|
}
|
10888
10888
|
async ensureStepsAreLoaded() {
|
10889
|
-
const e =
|
10889
|
+
const e = yt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
|
10890
10890
|
for (const l of n)
|
10891
10891
|
if (!this.stepInitialised[l.stepName])
|
10892
10892
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
@@ -10900,7 +10900,7 @@ class yo {
|
|
10900
10900
|
);
|
10901
10901
|
break;
|
10902
10902
|
case v.Frame:
|
10903
|
-
a.push(
|
10903
|
+
a.push(St.init(l, this, this.reloadedState));
|
10904
10904
|
break;
|
10905
10905
|
case v.Illustration:
|
10906
10906
|
a.push(
|
@@ -12345,7 +12345,7 @@ class Go {
|
|
12345
12345
|
getStepsConditionallyActive() {
|
12346
12346
|
return this.getScenes().flatMap(
|
12347
12347
|
(t) => this.getStepsByScene(t).filter(
|
12348
|
-
(e) =>
|
12348
|
+
(e) => vt(e.getRaw(), this.getWorkflowManager().getStepSelections())
|
12349
12349
|
)
|
12350
12350
|
);
|
12351
12351
|
}
|
@@ -12496,7 +12496,7 @@ class Go {
|
|
12496
12496
|
return await Ke.addDesign(n), n;
|
12497
12497
|
}
|
12498
12498
|
async copy() {
|
12499
|
-
const t =
|
12499
|
+
const t = Et(this.getCommandContext().getState());
|
12500
12500
|
if (!t) throw new V("Internal state is undefined! Cannot copy experience!");
|
12501
12501
|
const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = this.getWorkflowManager().getTransaction().integrationProduct?.id;
|
12502
12502
|
if (!n) throw new V("Integration product id is undefined!");
|
@@ -12796,7 +12796,7 @@ const Wo = (r) => {
|
|
12796
12796
|
C.classList.add(Q), g[Q] = { browserValue: B };
|
12797
12797
|
}
|
12798
12798
|
});
|
12799
|
-
const f =
|
12799
|
+
const f = It().serializeToString(m), S = n.colors;
|
12800
12800
|
if (S) {
|
12801
12801
|
for (const [C, E] of Object.entries(g))
|
12802
12802
|
for (const P of Object.keys(S))
|
@@ -12995,7 +12995,7 @@ const Wo = (r) => {
|
|
12995
12995
|
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", f = dt().parseFromString(m, "image/svg+xml").firstElementChild;
|
12996
12996
|
if (!f)
|
12997
12997
|
throw new Dt("Failed to read SVG.");
|
12998
|
-
return pa(f),
|
12998
|
+
return pa(f), It().serializeToString(f);
|
12999
12999
|
};
|
13000
13000
|
l.forEach((A) => {
|
13001
13001
|
const u = r.find((m) => m.panelId === A.panelId);
|
@@ -13260,7 +13260,7 @@ class sl {
|
|
13260
13260
|
* Actions to perform when a static render event is fired for this canvas.
|
13261
13261
|
*/
|
13262
13262
|
async render(t) {
|
13263
|
-
const e =
|
13263
|
+
const e = Et(t);
|
13264
13264
|
this.lastRequestedRenderArguments = e;
|
13265
13265
|
const a = this.getStaticContext();
|
13266
13266
|
if (!a) {
|
@@ -13920,7 +13920,7 @@ class hl {
|
|
13920
13920
|
}
|
13921
13921
|
async setGlobalPropertyState(t) {
|
13922
13922
|
this.globalPropertyState || await this.initPromise;
|
13923
|
-
const e =
|
13923
|
+
const e = Et(this.globalPropertyState);
|
13924
13924
|
this.globalPropertyState = { ...t, id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
13925
13925
|
}
|
13926
13926
|
getAspectMandatoryFulfilled(t) {
|
@@ -13947,7 +13947,7 @@ class hl {
|
|
13947
13947
|
if (!i)
|
13948
13948
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13949
13949
|
this.mandatoryFulfilledAspects.set(t, e !== "");
|
13950
|
-
const s =
|
13950
|
+
const s = Et(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((l) => l.name === t);
|
13951
13951
|
if (o.length > 0)
|
13952
13952
|
if (n) {
|
13953
13953
|
const l = o.find((c) => c.channel === n);
|
@@ -13990,7 +13990,7 @@ class hl {
|
|
13990
13990
|
const n = this.configuration.aspects.find((o) => o.name === t);
|
13991
13991
|
if (!n)
|
13992
13992
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13993
|
-
const i =
|
13993
|
+
const i = Et(this.globalPropertyState), s = this.globalPropertyState.aspects.filter((o) => o.name === t);
|
13994
13994
|
if (s.length > 0)
|
13995
13995
|
if (a) {
|
13996
13996
|
const o = s.find((l) => l.channel === a);
|
@@ -14392,7 +14392,7 @@ class ar {
|
|
14392
14392
|
if (h || g.partial && (!g.data.productCollections || g.data.productCollections.length === 0 || !g.data.productCollections[0].productCollectionProductsFeed?.items || g.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
14393
14393
|
return;
|
14394
14394
|
c.abort(), h = !0, m.unsubscribe();
|
14395
|
-
const p = g.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new Ae(
|
14395
|
+
const p = g.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new Ae(Et(f))) || [];
|
14396
14396
|
u({
|
14397
14397
|
items: p,
|
14398
14398
|
// Clone items because it could be cached data (immutable)
|
@@ -15966,7 +15966,7 @@ class md {
|
|
15966
15966
|
} catch (a) {
|
15967
15967
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15968
15968
|
}
|
15969
|
-
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.4.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15969
|
+
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.4.0-beta.313e588f-e8b3-5b1e-9fb4-fb2af3ac9d0e"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15970
15970
|
}
|
15971
15971
|
configure(t) {
|
15972
15972
|
gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.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);
|
@@ -17041,7 +17041,7 @@ class ql extends Z {
|
|
17041
17041
|
}
|
17042
17042
|
selectVariant(t) {
|
17043
17043
|
const e = this.manager.getRegionElements(this.step.stepName);
|
17044
|
-
return
|
17044
|
+
return St.selectVariant(
|
17045
17045
|
this.step,
|
17046
17046
|
t.getResource(),
|
17047
17047
|
e,
|
@@ -17061,7 +17061,7 @@ class ql extends Z {
|
|
17061
17061
|
* @param [recalculateOffsets=true] Optional: Recalculates the offsets of the image inside the frame. Default: `true`.
|
17062
17062
|
*/
|
17063
17063
|
async selectImage(t, e = !0, a = !0) {
|
17064
|
-
if (await
|
17064
|
+
if (await St.selectImage(this.step, t, this.manager, a), e) {
|
17065
17065
|
const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17066
17066
|
this.manager.updateStorage(this.step.stepName, {
|
17067
17067
|
framePatternData: {
|
@@ -17099,7 +17099,7 @@ class ql extends Z {
|
|
17099
17099
|
if (!e)
|
17100
17100
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
17101
17101
|
const a = await O.removeBackgroundFromAsset(e);
|
17102
|
-
t && await
|
17102
|
+
t && await St.selectImage(this.step, a, this.manager, !1);
|
17103
17103
|
const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17104
17104
|
return this.manager.updateStorage(this.step.stepName, {
|
17105
17105
|
framePatternData: {
|
@@ -17110,7 +17110,7 @@ class ql extends Z {
|
|
17110
17110
|
}), a;
|
17111
17111
|
}
|
17112
17112
|
changeColors(t) {
|
17113
|
-
|
17113
|
+
St.changeColors(this.step, this.manager, t);
|
17114
17114
|
}
|
17115
17115
|
getImageData() {
|
17116
17116
|
if (this.frameService)
|
@@ -17120,7 +17120,7 @@ class ql extends Z {
|
|
17120
17120
|
return this.step.data.colorOption;
|
17121
17121
|
}
|
17122
17122
|
getAvailableColors() {
|
17123
|
-
return this.step.data.colorPickerEnabled ?
|
17123
|
+
return this.step.data.colorPickerEnabled ? St.availableColors(this.step, this.manager) : Promise.resolve([]);
|
17124
17124
|
}
|
17125
17125
|
isColorPickerEnabled() {
|
17126
17126
|
return this.step.data.colorPickerEnabled ?? !1;
|
@@ -17133,7 +17133,7 @@ class ql extends Z {
|
|
17133
17133
|
return this.step.data.maxColors;
|
17134
17134
|
}
|
17135
17135
|
getUniqueColorCount() {
|
17136
|
-
return
|
17136
|
+
return St.getUniqueColorCount(this.step, this.manager);
|
17137
17137
|
}
|
17138
17138
|
getCurrentFrameStep(t, e, a, n) {
|
17139
17139
|
return n && n.length > 1 && t === void 0 ? "SelectFrame" : e || a || this.getImageData() ? "Position" : "SelectImage";
|
@@ -17635,7 +17635,7 @@ export {
|
|
17635
17635
|
oc as AddressValidationResultConfirmationLevel,
|
17636
17636
|
ud as ArrayInput,
|
17637
17637
|
L as AspectType,
|
17638
|
-
|
17638
|
+
bt as AssetNotFoundError,
|
17639
17639
|
ye as AssetType,
|
17640
17640
|
id as BringForwardCommand,
|
17641
17641
|
rd as BringToBackCommand,
|
@@ -17651,7 +17651,7 @@ export {
|
|
17651
17651
|
zn as CreateLayoutCommand,
|
17652
17652
|
Rl as CurrencyContext,
|
17653
17653
|
Ql as CurrencyService,
|
17654
|
-
|
17654
|
+
Bt as DeleteElementCommand,
|
17655
17655
|
Fo as DigitalContentStepHandle,
|
17656
17656
|
cl as FileUploadGlobalPropertyHandle,
|
17657
17657
|
ue as FlowExecutionNodeResult,
|
@@ -17737,7 +17737,7 @@ export {
|
|
17737
17737
|
$ as findElement,
|
17738
17738
|
$c as findPmsColors,
|
17739
17739
|
Vt as frameDataCache,
|
17740
|
-
|
17740
|
+
St as frameStepService,
|
17741
17741
|
M as generate,
|
17742
17742
|
al as generateCommands,
|
17743
17743
|
ot as generateSVGWithUnknownColors,
|
@@ -17810,6 +17810,6 @@ export {
|
|
17810
17810
|
Fs as toast,
|
17811
17811
|
Td as validateWorkflowExperienceRecipient,
|
17812
17812
|
Nd as validateWorkflowExperienceRecipients,
|
17813
|
-
|
17813
|
+
It as xmlSerializer
|
17814
17814
|
};
|
17815
17815
|
//# sourceMappingURL=index.mjs.map
|