@spiffcommerce/core 28.0.1-beta.10d96995-f841-5fe3-9e44-7c0791da863a → 28.0.1-beta.2bb92e7d-b050-5d55-9e14-866d5d3029a3
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 +24 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +132 -131
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5327,10 +5327,10 @@ const Q = () => {
|
|
|
5327
5327
|
viewBox: A,
|
|
5328
5328
|
width: u
|
|
5329
5329
|
}) => {
|
|
5330
|
-
var
|
|
5331
|
-
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 = (
|
|
5330
|
+
var I;
|
|
5331
|
+
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 = (I = a.colorProfiles) == null ? void 0 : I.map((b, E) => (
|
|
5332
5332
|
/* @ts-ignore */
|
|
5333
|
-
/* @__PURE__ */ x("color-profile", { name: b.name, xlinkHref: b.key, children: " " },
|
|
5333
|
+
/* @__PURE__ */ x("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, E)
|
|
5334
5334
|
)), S = n.map((b) => ({
|
|
5335
5335
|
...b,
|
|
5336
5336
|
_renderingConfiguration: a,
|
|
@@ -5577,8 +5577,8 @@ const Q = () => {
|
|
|
5577
5577
|
/* @__PURE__ */ x("feFuncB", { type: "discrete", tableValues: n() })
|
|
5578
5578
|
] })
|
|
5579
5579
|
] }) }) }), s = r.rotation || 0, o = pt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
|
|
5580
|
-
var w, S, y,
|
|
5581
|
-
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 = ((
|
|
5580
|
+
var w, S, y, I, b, E, D, F, k, T;
|
|
5581
|
+
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 = ((I = r.pattern) == null ? void 0 : I.height) || 0, g = ((b = r.pattern) == null ? void 0 : b.scaleX) || 1, p = ((E = r.pattern) == null ? void 0 : E.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
|
|
5582
5582
|
return [(F = r.pattern) != null && F.svg ? {
|
|
5583
5583
|
id: `${t}-contents`,
|
|
5584
5584
|
type: M.Illustration,
|
|
@@ -5739,8 +5739,8 @@ const Ji = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5739
5739
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5740
5740
|
), S = w.getBoundingBox().x2 - w.getBoundingBox().x1;
|
|
5741
5741
|
let y = 0;
|
|
5742
|
-
const
|
|
5743
|
-
|
|
5742
|
+
const I = A.getAttribute("text-anchor");
|
|
5743
|
+
I === "middle" ? y = S / 2 : I === "end" && (y = S);
|
|
5744
5744
|
const b = g.getPath(
|
|
5745
5745
|
A.innerHTML,
|
|
5746
5746
|
parseFloat(A.getAttribute("x") ?? "0") - y,
|
|
@@ -5748,7 +5748,7 @@ const Ji = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5748
5748
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5749
5749
|
);
|
|
5750
5750
|
b.fill = p, b.stroke = f, b.strokeWidth = parseFloat(C ?? "0");
|
|
5751
|
-
const
|
|
5751
|
+
const E = b.toSVG(2), F = t.parseFromString(E, "image/svg+xml").firstElementChild;
|
|
5752
5752
|
h.appendChild(F);
|
|
5753
5753
|
}
|
|
5754
5754
|
return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
|
|
@@ -6541,7 +6541,7 @@ const L = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
|
6541
6541
|
if (!e)
|
|
6542
6542
|
throw new V();
|
|
6543
6543
|
return e;
|
|
6544
|
-
},
|
|
6544
|
+
}, X = (r, t) => {
|
|
6545
6545
|
const e = [...t.elements.filter((n) => n.id !== r.id), r], a = va(e);
|
|
6546
6546
|
return {
|
|
6547
6547
|
layout: t.layout,
|
|
@@ -6634,7 +6634,7 @@ class Kc extends O {
|
|
|
6634
6634
|
...e,
|
|
6635
6635
|
x: this.x,
|
|
6636
6636
|
y: this.y
|
|
6637
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6637
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6638
6638
|
return {
|
|
6639
6639
|
...t,
|
|
6640
6640
|
layouts: {
|
|
@@ -6656,7 +6656,7 @@ class _c extends O {
|
|
|
6656
6656
|
const a = {
|
|
6657
6657
|
...e,
|
|
6658
6658
|
rotation: this.angle
|
|
6659
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6659
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6660
6660
|
return {
|
|
6661
6661
|
...t,
|
|
6662
6662
|
layouts: {
|
|
@@ -6687,7 +6687,7 @@ class Xc extends O {
|
|
|
6687
6687
|
const s = a, o = (!s.algorithm || s.algorithm === kt.Autosize ? s.text : s.input) ?? "";
|
|
6688
6688
|
a = ee(s, o, e);
|
|
6689
6689
|
}
|
|
6690
|
-
const n = _(e.id, Object.values(t.layouts)), i =
|
|
6690
|
+
const n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6691
6691
|
return {
|
|
6692
6692
|
...t,
|
|
6693
6693
|
layouts: {
|
|
@@ -6819,7 +6819,7 @@ class ds extends O {
|
|
|
6819
6819
|
fill: this.color,
|
|
6820
6820
|
fillSpotColorDefinition: this.textFillSpotColor,
|
|
6821
6821
|
textFillImage: void 0
|
|
6822
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6822
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6823
6823
|
return {
|
|
6824
6824
|
...t,
|
|
6825
6825
|
layouts: {
|
|
@@ -6841,7 +6841,7 @@ class We extends O {
|
|
|
6841
6841
|
const a = {
|
|
6842
6842
|
...e,
|
|
6843
6843
|
textFillImage: this.imageFill
|
|
6844
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6844
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6845
6845
|
return {
|
|
6846
6846
|
...t,
|
|
6847
6847
|
layouts: {
|
|
@@ -6863,7 +6863,7 @@ class As extends O {
|
|
|
6863
6863
|
const a = {
|
|
6864
6864
|
...e,
|
|
6865
6865
|
fontSize: this.size
|
|
6866
|
-
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s =
|
|
6866
|
+
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = X(ee(a, i), n);
|
|
6867
6867
|
return {
|
|
6868
6868
|
...t,
|
|
6869
6869
|
layouts: {
|
|
@@ -6885,7 +6885,7 @@ class Wa extends O {
|
|
|
6885
6885
|
const a = {
|
|
6886
6886
|
...e,
|
|
6887
6887
|
fontData: this.fontData
|
|
6888
|
-
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s =
|
|
6888
|
+
}, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = X(ee(a, i), n);
|
|
6889
6889
|
return {
|
|
6890
6890
|
...t,
|
|
6891
6891
|
layouts: {
|
|
@@ -6907,7 +6907,7 @@ class us extends O {
|
|
|
6907
6907
|
const a = {
|
|
6908
6908
|
...e,
|
|
6909
6909
|
align: this.align
|
|
6910
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6910
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6911
6911
|
return {
|
|
6912
6912
|
...t,
|
|
6913
6913
|
layouts: {
|
|
@@ -6968,7 +6968,7 @@ class ms extends O {
|
|
|
6968
6968
|
invertThreshold: this.invertThreshold,
|
|
6969
6969
|
threshold: this.threshold,
|
|
6970
6970
|
thresholdSaturation: this.thresholdSaturation
|
|
6971
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6971
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6972
6972
|
return {
|
|
6973
6973
|
...t,
|
|
6974
6974
|
layouts: {
|
|
@@ -6990,7 +6990,7 @@ class Zc extends O {
|
|
|
6990
6990
|
const a = {
|
|
6991
6991
|
...e,
|
|
6992
6992
|
src: this.src
|
|
6993
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
6993
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
6994
6994
|
return {
|
|
6995
6995
|
...t,
|
|
6996
6996
|
layouts: {
|
|
@@ -7009,7 +7009,7 @@ class gs extends O {
|
|
|
7009
7009
|
const e = L(this.id, Object.values(t.layouts));
|
|
7010
7010
|
if (!e.id)
|
|
7011
7011
|
throw new V();
|
|
7012
|
-
const a = _(e.id, Object.values(t.layouts)), n =
|
|
7012
|
+
const a = _(e.id, Object.values(t.layouts)), n = X(ee(e, this.text, e), a);
|
|
7013
7013
|
return {
|
|
7014
7014
|
...t,
|
|
7015
7015
|
layouts: {
|
|
@@ -7032,7 +7032,7 @@ class je extends O {
|
|
|
7032
7032
|
...e,
|
|
7033
7033
|
strokeColor: this.strokeColor,
|
|
7034
7034
|
strokeThickness: this.strokeThickness
|
|
7035
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
7035
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
7036
7036
|
return {
|
|
7037
7037
|
...t,
|
|
7038
7038
|
layouts: {
|
|
@@ -7064,7 +7064,7 @@ class oa extends O {
|
|
|
7064
7064
|
const i = {
|
|
7065
7065
|
...e,
|
|
7066
7066
|
colors: a
|
|
7067
|
-
}, s = _(e.id, Object.values(t.layouts)), o =
|
|
7067
|
+
}, s = _(e.id, Object.values(t.layouts)), o = X(i, s);
|
|
7068
7068
|
return {
|
|
7069
7069
|
...t,
|
|
7070
7070
|
layouts: {
|
|
@@ -7087,7 +7087,7 @@ class ps extends O {
|
|
|
7087
7087
|
...e,
|
|
7088
7088
|
svg: this.svgBody,
|
|
7089
7089
|
cachedObjectURL: this.objectURL
|
|
7090
|
-
}, n = _(e.id, Object.values(t.layouts)), i =
|
|
7090
|
+
}, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
|
|
7091
7091
|
return {
|
|
7092
7092
|
...t,
|
|
7093
7093
|
layouts: {
|
|
@@ -7733,7 +7733,7 @@ class Be {
|
|
|
7733
7733
|
i && i(!0);
|
|
7734
7734
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7735
7735
|
t.data.regions.map(async (m, g) => {
|
|
7736
|
-
const p = await Qe(l[g]), f = o.getImageData(), C = a.map((
|
|
7736
|
+
const p = await Qe(l[g]), f = o.getImageData(), C = a.map((E) => new Et(E.id)), w = f ? Ea(
|
|
7737
7737
|
f,
|
|
7738
7738
|
p,
|
|
7739
7739
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
@@ -7748,7 +7748,7 @@ class Be {
|
|
|
7748
7748
|
scaleX: (w == null ? void 0 : w.zoom) || 1,
|
|
7749
7749
|
scaleY: (w == null ? void 0 : w.zoom) || 1,
|
|
7750
7750
|
rotation: 0
|
|
7751
|
-
} : void 0, y = Q(), b = n.getLayouts().find((
|
|
7751
|
+
} : void 0, y = Q(), b = n.getLayouts().find((E) => E.panelId === m.panelId);
|
|
7752
7752
|
if (!b)
|
|
7753
7753
|
throw new Y(m);
|
|
7754
7754
|
return {
|
|
@@ -8042,8 +8042,8 @@ class ws {
|
|
|
8042
8042
|
const y = {};
|
|
8043
8043
|
(((S = o.assetConfiguration) == null ? void 0 : S.channelNumbers) || []).forEach((b) => {
|
|
8044
8044
|
var D;
|
|
8045
|
-
const
|
|
8046
|
-
|
|
8045
|
+
const E = C.find((F) => F.channelNumber === b.number);
|
|
8046
|
+
E && (y[`${b.id.replace(/\W/g, "")}`] = { browserValue: ((D = E == null ? void 0 : E.variant) == null ? void 0 : D.color) || "" });
|
|
8047
8047
|
}), await this.changeColors(
|
|
8048
8048
|
t,
|
|
8049
8049
|
u.map((b) => b.regionElement),
|
|
@@ -8053,20 +8053,20 @@ class ws {
|
|
|
8053
8053
|
);
|
|
8054
8054
|
}
|
|
8055
8055
|
if (t.data.colorPickerEnabled) {
|
|
8056
|
-
const y = await this.availableColors(t, i) || [],
|
|
8056
|
+
const y = await this.availableColors(t, i) || [], I = Object.keys(c.colors), b = y.length === 1 && I.length === 1;
|
|
8057
8057
|
if (b) {
|
|
8058
|
-
const
|
|
8058
|
+
const E = y[0], D = I[0];
|
|
8059
8059
|
await this.changeColors(
|
|
8060
8060
|
t,
|
|
8061
8061
|
u.map((F) => F.regionElement),
|
|
8062
8062
|
i,
|
|
8063
8063
|
() => i.getCommandContext().getAllLayouts(),
|
|
8064
|
-
/* @__PURE__ */ new Map([[D,
|
|
8064
|
+
/* @__PURE__ */ new Map([[D, E.variant.color]])
|
|
8065
8065
|
);
|
|
8066
8066
|
}
|
|
8067
8067
|
!b && C.length === 0 && await this.changeColors(
|
|
8068
8068
|
t,
|
|
8069
|
-
u.map((
|
|
8069
|
+
u.map((E) => E.regionElement),
|
|
8070
8070
|
i,
|
|
8071
8071
|
() => i.getCommandContext().getAllLayouts(),
|
|
8072
8072
|
/* @__PURE__ */ new Map()
|
|
@@ -8814,7 +8814,7 @@ class Fs {
|
|
|
8814
8814
|
if (p && t.globalPropertyAspectConfigurations) {
|
|
8815
8815
|
const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
|
|
8816
8816
|
var y;
|
|
8817
|
-
return S.type === z.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((
|
|
8817
|
+
return S.type === z.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((I) => I.aspectName).includes(S.name));
|
|
8818
8818
|
});
|
|
8819
8819
|
if (w) {
|
|
8820
8820
|
const y = p.getGlobalPropertyStateManager().getAspect(w.name);
|
|
@@ -9056,13 +9056,13 @@ class Fs {
|
|
|
9056
9056
|
let w = (A = n.storage) == null ? void 0 : A.text;
|
|
9057
9057
|
const S = e.getWorkflowExperience().getBundle();
|
|
9058
9058
|
if (S && t.globalPropertyAspectConfigurations) {
|
|
9059
|
-
const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects,
|
|
9060
|
-
var
|
|
9061
|
-
return b.type === z.Text && ((
|
|
9059
|
+
const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, I = y == null ? void 0 : y.find((b) => {
|
|
9060
|
+
var E;
|
|
9061
|
+
return b.type === z.Text && ((E = t.globalPropertyAspectConfigurations) == null ? void 0 : E.map((D) => D.aspectName).includes(b.name));
|
|
9062
9062
|
});
|
|
9063
|
-
if (
|
|
9064
|
-
const
|
|
9065
|
-
|
|
9063
|
+
if (I) {
|
|
9064
|
+
const E = S.getGlobalPropertyStateManager().getAspect(I.name);
|
|
9065
|
+
E && (w = E);
|
|
9066
9066
|
}
|
|
9067
9067
|
}
|
|
9068
9068
|
if (await e.setSelectionsAndElements(
|
|
@@ -9071,13 +9071,13 @@ class Fs {
|
|
|
9071
9071
|
f,
|
|
9072
9072
|
async () => {
|
|
9073
9073
|
e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
|
|
9074
|
-
const y = o.map((b) => new Wa(b.id, p)),
|
|
9075
|
-
e.getCommandDispatcher()(
|
|
9074
|
+
const y = o.map((b) => new Wa(b.id, p)), I = new $(y);
|
|
9075
|
+
e.getCommandDispatcher()(I);
|
|
9076
9076
|
}
|
|
9077
9077
|
), o.length === 0 && l) {
|
|
9078
9078
|
const y = q.getDefaultVariant(l);
|
|
9079
9079
|
if (y) {
|
|
9080
|
-
const
|
|
9080
|
+
const I = await this.selectVariantCommand(
|
|
9081
9081
|
t,
|
|
9082
9082
|
y,
|
|
9083
9083
|
{ text: w },
|
|
@@ -9088,7 +9088,7 @@ class Fs {
|
|
|
9088
9088
|
() => {
|
|
9089
9089
|
}
|
|
9090
9090
|
);
|
|
9091
|
-
e.getCommandDispatcher()(
|
|
9091
|
+
e.getCommandDispatcher()(I.command);
|
|
9092
9092
|
}
|
|
9093
9093
|
} else {
|
|
9094
9094
|
const { command: y } = j.updateInputText(
|
|
@@ -9298,10 +9298,10 @@ class Fs {
|
|
|
9298
9298
|
curved: a.curved,
|
|
9299
9299
|
paths: a.paths,
|
|
9300
9300
|
fillSpotColorDefinition: f
|
|
9301
|
-
}, y = [],
|
|
9301
|
+
}, y = [], I = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
|
|
9302
9302
|
if (!S.fontData)
|
|
9303
9303
|
throw new G("Failed to resolve font data for text.");
|
|
9304
|
-
const [
|
|
9304
|
+
const [E, D] = pe(
|
|
9305
9305
|
S.fontSize,
|
|
9306
9306
|
S.fontData,
|
|
9307
9307
|
{
|
|
@@ -9315,11 +9315,11 @@ class Fs {
|
|
|
9315
9315
|
[l],
|
|
9316
9316
|
{ size: a.size, minSize: a.minSize, maxSize: a.maxSize }
|
|
9317
9317
|
);
|
|
9318
|
-
|
|
9318
|
+
I.set(S.id, E), b.set(S.id, D);
|
|
9319
9319
|
const F = a.curved || a.vertical ? l : (D || []).join(`
|
|
9320
9320
|
`);
|
|
9321
9321
|
y.push(
|
|
9322
|
-
this.generateTextChangeCommandsForRegion(
|
|
9322
|
+
this.generateTextChangeCommandsForRegion(E, a, S.id, F)
|
|
9323
9323
|
);
|
|
9324
9324
|
const k = new W(S, h);
|
|
9325
9325
|
return {
|
|
@@ -9362,23 +9362,23 @@ class Fs {
|
|
|
9362
9362
|
const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
9363
9363
|
for (const S of h)
|
|
9364
9364
|
if (S.region) {
|
|
9365
|
-
const [y,
|
|
9365
|
+
const [y, I] = pe(
|
|
9366
9366
|
e,
|
|
9367
9367
|
a,
|
|
9368
9368
|
S.region,
|
|
9369
9369
|
[u],
|
|
9370
9370
|
{ size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
|
|
9371
9371
|
);
|
|
9372
|
-
m.set(S.id, y), g.set(S.id,
|
|
9372
|
+
m.set(S.id, y), g.set(S.id, I);
|
|
9373
9373
|
}
|
|
9374
9374
|
const f = (() => {
|
|
9375
9375
|
if (t.data && t.data.maxLength && u.length > t.data.maxLength)
|
|
9376
9376
|
return d && d(!0), { info: "0" };
|
|
9377
9377
|
const S = s.getProfanities(), y = Ze(u.toLowerCase());
|
|
9378
|
-
for (const
|
|
9378
|
+
for (const I of y)
|
|
9379
9379
|
for (const b in S) {
|
|
9380
|
-
const
|
|
9381
|
-
if (
|
|
9380
|
+
const E = S[b].toLowerCase().replace(/\s/g, "");
|
|
9381
|
+
if (I === E)
|
|
9382
9382
|
return l(!0), { error: "Blocked profanity." };
|
|
9383
9383
|
}
|
|
9384
9384
|
return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
|
|
@@ -9572,12 +9572,12 @@ class $s extends xs {
|
|
|
9572
9572
|
w.appendChild(S), S.appendChild(Ts(0, 2, 2, "shadow"));
|
|
9573
9573
|
const y = et("path");
|
|
9574
9574
|
y.setAttribute("d", d), y.setAttribute("stroke", "black"), y.setAttribute("stroke-width", "3"), S.appendChild(y);
|
|
9575
|
-
const
|
|
9576
|
-
|
|
9575
|
+
const I = et("g");
|
|
9576
|
+
I.classList.add("module-layer0"), w.appendChild(I), I.setAttribute("filter", "url(#shadow)"), I.innerHTML = y.outerHTML;
|
|
9577
9577
|
const b = et("g");
|
|
9578
9578
|
b.classList.add("module-layer1"), w.appendChild(b), b.setAttribute("stroke-width", "3"), b.setAttribute("stroke", "rgb(45,41,38)"), b.setAttribute("fill", "rgb(45,41,38)"), b.setAttribute("transform", "translate(0.5,0)"), b.innerHTML = o;
|
|
9579
|
-
const
|
|
9580
|
-
|
|
9579
|
+
const E = et("g");
|
|
9580
|
+
E.classList.add("module-layer2"), w.appendChild(E), E.setAttribute("fill", "rgb(255,209,0)"), E.setAttribute("transform", "translate(1,-0.1)"), E.innerHTML = o;
|
|
9581
9581
|
const D = et("g");
|
|
9582
9582
|
return D.classList.add("module-layer3"), w.appendChild(D), D.setAttribute("fill", "white"), D.innerHTML = o, new Os(w).transform(([k, T]) => [k, T + (c / 2 - k) ** 2 / (c * 6)]), w;
|
|
9583
9583
|
}, u = et("g");
|
|
@@ -10290,10 +10290,10 @@ class Co {
|
|
|
10290
10290
|
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, C = !1) {
|
|
10291
10291
|
var w;
|
|
10292
10292
|
this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
|
10293
|
-
var
|
|
10293
|
+
var I;
|
|
10294
10294
|
if (!this.previewService)
|
|
10295
10295
|
return;
|
|
10296
|
-
const S = this.getCommandContext().getAllLayouts(), y = (
|
|
10296
|
+
const S = this.getCommandContext().getAllLayouts(), y = (I = this.getLayoutPreviewService()) == null ? void 0 : I.getAll();
|
|
10297
10297
|
if (y)
|
|
10298
10298
|
for (const [, b] of y)
|
|
10299
10299
|
b.render(S);
|
|
@@ -10403,7 +10403,7 @@ class Co {
|
|
|
10403
10403
|
this.storage[o.stepName] = o.storage || {};
|
|
10404
10404
|
}), this.allScenes = await zi(t);
|
|
10405
10405
|
const n = Pt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
|
|
10406
|
-
this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i },
|
|
10406
|
+
this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
|
|
10407
10407
|
}
|
|
10408
10408
|
getWorkflowExperience() {
|
|
10409
10409
|
return this.experience;
|
|
@@ -10851,26 +10851,27 @@ class Co {
|
|
|
10851
10851
|
});
|
|
10852
10852
|
}
|
|
10853
10853
|
async reset() {
|
|
10854
|
-
this.commandContext.getAllLayouts().forEach(
|
|
10854
|
+
console.log("LOG: reset?"), this.commandContext.getAllLayouts().forEach(
|
|
10855
10855
|
(e) => e.layoutState.elements.forEach((a) => {
|
|
10856
10856
|
this.getCommandDispatcher()(new Et(a.id));
|
|
10857
10857
|
})
|
|
10858
10858
|
), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
|
|
10859
10859
|
}
|
|
10860
10860
|
async setSelectionsAndElements(t, e, a, n) {
|
|
10861
|
-
var y;
|
|
10861
|
+
var y, I, b;
|
|
10862
|
+
console.log(`LOG: set selection of step ${t} to variant ${(y = e == null ? void 0 : e[0]) == null ? void 0 : y.name} (${(I = e == null ? void 0 : e[0]) == null ? void 0 : I.id})`), console.trace();
|
|
10862
10863
|
const i = this.stepSelections;
|
|
10863
10864
|
this.stepSelections = {
|
|
10864
10865
|
...this.stepSelections,
|
|
10865
10866
|
[t]: { selectedVariants: e }
|
|
10866
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((E,
|
|
10867
|
-
wt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
|
|
10867
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((E, D) => E + D.selectedVariants.map((F) => F.priceModifier || 0).reduce((F, k) => F + k, 0), 0), this.workflow.steps.forEach((E) => {
|
|
10868
|
+
wt(E, this.stepSelections) || (console.log(`LOG: uniniting step ${E.stepTitle} (${E.stepName})`), this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
|
|
10868
10869
|
});
|
|
10869
10870
|
const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((E) => E.silentSteps).flat(), A = l.map((E) => E.silentSteps).flat().filter(
|
|
10870
|
-
(E) => !c.some((
|
|
10871
|
+
(E) => !c.some((D) => D.stepName === E.stepName)
|
|
10871
10872
|
);
|
|
10872
10873
|
c.forEach((E) => {
|
|
10873
|
-
wt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
|
|
10874
|
+
wt(E, this.stepSelections) || (console.log(`LOG: uniniting silent step ${E.stepTitle} (${E.stepName})`), this.stepInitialised[E.stepName] = !1);
|
|
10874
10875
|
});
|
|
10875
10876
|
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
|
|
10876
10877
|
this.stepElements = {
|
|
@@ -10880,16 +10881,16 @@ class Co {
|
|
|
10880
10881
|
}, this.removeElements(u);
|
|
10881
10882
|
const g = this.workflow.steps.find((E) => E.stepName === t);
|
|
10882
10883
|
if ((g == null ? void 0 : g.type) === P.Frame) {
|
|
10883
|
-
const E = (
|
|
10884
|
-
E == null || E.setTargetElements(a.map((
|
|
10884
|
+
const E = (b = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : b.frameService;
|
|
10885
|
+
E == null || E.setTargetElements(a.map((D) => D.id));
|
|
10885
10886
|
}
|
|
10886
10887
|
const p = u.map((E) => new Et(E.id)), f = new Ga(this.constructSerializableWorkflow()), C = [...m, ...p, f];
|
|
10887
10888
|
C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
10888
10889
|
const w = this.getInvalidModelVariants(), S = this.modelContainer;
|
|
10889
10890
|
if (S) {
|
|
10890
10891
|
const E = w.map(
|
|
10891
|
-
(
|
|
10892
|
-
|
|
10892
|
+
(D) => S.applyModelVariant(
|
|
10893
|
+
D,
|
|
10893
10894
|
{
|
|
10894
10895
|
contextService: this.getLayoutPreviewService()
|
|
10895
10896
|
},
|
|
@@ -10901,10 +10902,11 @@ class Co {
|
|
|
10901
10902
|
await this.onSelectionChange(), n && await n();
|
|
10902
10903
|
}
|
|
10903
10904
|
async ensureStepsAreLoaded() {
|
|
10905
|
+
console.log("LOG: ensure steps loaded");
|
|
10904
10906
|
const e = Pt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
|
|
10905
10907
|
for (const l of n)
|
|
10906
10908
|
if (!this.stepInitialised[l.stepName])
|
|
10907
|
-
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
|
10909
|
+
switch (console.log(`LOG: step ${l.stepTitle} (${l.stepName}) was not inited`), this.stepInitialised[l.stepName] = !0, l.type) {
|
|
10908
10910
|
case P.DigitalContent:
|
|
10909
10911
|
a.push(
|
|
10910
10912
|
zn.init(
|
|
@@ -11468,7 +11470,7 @@ class Bo extends it {
|
|
|
11468
11470
|
*/
|
|
11469
11471
|
async setFillColor(t) {
|
|
11470
11472
|
const e = this.manager.getRegionElements(this.step.stepName);
|
|
11471
|
-
await j.changeFillColor(this.step, t, e, this.manager);
|
|
11473
|
+
console.log(`LOG: changing fill color of step ${this.step.stepTitle} (${this.step.stepName}) with ${e.length} elements to ${t}`), await j.changeFillColor(this.step, t, e, this.manager);
|
|
11472
11474
|
}
|
|
11473
11475
|
/**
|
|
11474
11476
|
* Gets the color currently applied to the element.
|
|
@@ -11964,7 +11966,7 @@ const ko = async (r, t) => {
|
|
|
11964
11966
|
};
|
|
11965
11967
|
return i && (h.metadata = i), a && (h.selectedVariants = a), n && (h.sku = n), h;
|
|
11966
11968
|
}, Xn = async (r, t, e, a, n, i, s, o, l, c) => {
|
|
11967
|
-
var
|
|
11969
|
+
var E;
|
|
11968
11970
|
await (async () => {
|
|
11969
11971
|
var R;
|
|
11970
11972
|
if (c !== void 0)
|
|
@@ -11983,29 +11985,29 @@ const ko = async (r, t) => {
|
|
|
11983
11985
|
T.errors && console.log("Server Error:", tt.message);
|
|
11984
11986
|
}), null) : nt ?? null;
|
|
11985
11987
|
})() || (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"));
|
|
11986
|
-
const u = r.getPreviewService(), h = (
|
|
11988
|
+
const u = r.getPreviewService(), h = (E = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : E.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && ca(l, t, !0), p = l && ca(l, t, !1), f = async (D) => {
|
|
11987
11989
|
const F = {};
|
|
11988
11990
|
let k = 0;
|
|
11989
11991
|
if (Object.keys(i).length > 0)
|
|
11990
11992
|
for (const T of Object.keys(i)) {
|
|
11991
11993
|
const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
|
|
11992
11994
|
for (let tt = 0; tt < nt.selections.length; ++tt) {
|
|
11993
|
-
const
|
|
11995
|
+
const Z = nt.selections[tt];
|
|
11994
11996
|
if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
|
|
11995
11997
|
const Nt = R.stepTitle;
|
|
11996
11998
|
F[Nt] ? F[Nt].push({
|
|
11997
|
-
id:
|
|
11998
|
-
name:
|
|
11999
|
-
priceModifier:
|
|
11999
|
+
id: Z.id || "",
|
|
12000
|
+
name: Z.name,
|
|
12001
|
+
priceModifier: Z.priceModifier
|
|
12000
12002
|
}) : F[Nt] = [
|
|
12001
12003
|
{
|
|
12002
|
-
id:
|
|
12003
|
-
name:
|
|
12004
|
-
priceModifier:
|
|
12004
|
+
id: Z.id || "",
|
|
12005
|
+
name: Z.name,
|
|
12006
|
+
priceModifier: Z.priceModifier
|
|
12005
12007
|
}
|
|
12006
12008
|
];
|
|
12007
12009
|
}
|
|
12008
|
-
k +=
|
|
12010
|
+
k += Z.priceModifier;
|
|
12009
12011
|
}
|
|
12010
12012
|
}
|
|
12011
12013
|
return [F, k];
|
|
@@ -12017,10 +12019,10 @@ const ko = async (r, t) => {
|
|
|
12017
12019
|
S[D].map((F) => F.id)
|
|
12018
12020
|
])
|
|
12019
12021
|
);
|
|
12020
|
-
let
|
|
12021
|
-
if (
|
|
12022
|
-
const D = await (await rt(
|
|
12023
|
-
|
|
12022
|
+
let I = await o(m, n.id);
|
|
12023
|
+
if (I) {
|
|
12024
|
+
const D = await (await rt(I)).blob();
|
|
12025
|
+
I = (await U.uploadAsset(
|
|
12024
12026
|
{ name: `${n.id}-preview-image.png`, blob: D },
|
|
12025
12027
|
Ce.Image,
|
|
12026
12028
|
!0,
|
|
@@ -12038,7 +12040,7 @@ const ko = async (r, t) => {
|
|
|
12038
12040
|
workflowId: t.id,
|
|
12039
12041
|
transactionId: n.id,
|
|
12040
12042
|
useThreeDimPreview: !!m,
|
|
12041
|
-
previewImage:
|
|
12043
|
+
previewImage: I
|
|
12042
12044
|
};
|
|
12043
12045
|
if (p) {
|
|
12044
12046
|
const F = [];
|
|
@@ -12774,7 +12776,7 @@ const zo = [
|
|
|
12774
12776
|
return console.error(o), [];
|
|
12775
12777
|
}
|
|
12776
12778
|
}, jo = async (r, t, e, a) => {
|
|
12777
|
-
var y,
|
|
12779
|
+
var y, I;
|
|
12778
12780
|
const n = e.data, i = a.option;
|
|
12779
12781
|
if (!i)
|
|
12780
12782
|
return console.error(`No option for step ${a.stepName}.`), [];
|
|
@@ -12784,7 +12786,7 @@ const zo = [
|
|
|
12784
12786
|
if (!s.asset)
|
|
12785
12787
|
return console.error(`No asset for variant with ID: ${n.illustrationVariantId}`), [];
|
|
12786
12788
|
t[a.stepName] = { selectedVariants: [s] };
|
|
12787
|
-
const o = (
|
|
12789
|
+
const o = (I = s.asset) == null ? void 0 : I.fileLink;
|
|
12788
12790
|
if (!o)
|
|
12789
12791
|
return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
|
|
12790
12792
|
const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "", m = dt().parseFromString(A, "image/svg+xml").firstElementChild;
|
|
@@ -12794,9 +12796,9 @@ const zo = [
|
|
|
12794
12796
|
const g = {};
|
|
12795
12797
|
xt(m, (b) => {
|
|
12796
12798
|
zo.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
|
|
12797
|
-
const
|
|
12798
|
-
if (
|
|
12799
|
-
const F =
|
|
12799
|
+
const E = b.attributes.getNamedItem("fill");
|
|
12800
|
+
if (E && E.value !== "none") {
|
|
12801
|
+
const F = E.value, T = `spiff-fill-${F.replace(/\W/g, "")}`;
|
|
12800
12802
|
b.classList.add(T), g[T] = { browserValue: F };
|
|
12801
12803
|
}
|
|
12802
12804
|
const D = b.attributes.getNamedItem("stroke");
|
|
@@ -12807,16 +12809,16 @@ const zo = [
|
|
|
12807
12809
|
});
|
|
12808
12810
|
const f = bt().serializeToString(m), C = n.colors;
|
|
12809
12811
|
if (C) {
|
|
12810
|
-
for (const [b,
|
|
12812
|
+
for (const [b, E] of Object.entries(g))
|
|
12811
12813
|
for (const D of Object.keys(C))
|
|
12812
|
-
if (
|
|
12814
|
+
if (E.browserValue === D) {
|
|
12813
12815
|
g[b] = { browserValue: C[D] };
|
|
12814
12816
|
break;
|
|
12815
12817
|
}
|
|
12816
12818
|
}
|
|
12817
12819
|
const w = (b) => {
|
|
12818
|
-
const
|
|
12819
|
-
if (!
|
|
12820
|
+
const E = r.find((F) => F.panelId === b.panelId);
|
|
12821
|
+
if (!E)
|
|
12820
12822
|
throw new Y(b);
|
|
12821
12823
|
const D = Q();
|
|
12822
12824
|
return new W(
|
|
@@ -12834,7 +12836,7 @@ const zo = [
|
|
|
12834
12836
|
layerIndex: b.layerIndex,
|
|
12835
12837
|
immutable: b.immutable
|
|
12836
12838
|
},
|
|
12837
|
-
|
|
12839
|
+
E
|
|
12838
12840
|
);
|
|
12839
12841
|
}, S = a.data.regions;
|
|
12840
12842
|
try {
|
|
@@ -13840,7 +13842,6 @@ class Zn extends Ia {
|
|
|
13840
13842
|
}
|
|
13841
13843
|
async applyGlobalState(t) {
|
|
13842
13844
|
var n, i;
|
|
13843
|
-
console.log(`LOG: applying global state for option ${this.property.name}`);
|
|
13844
13845
|
const e = this.getStateValue();
|
|
13845
13846
|
if (!e)
|
|
13846
13847
|
return Promise.resolve();
|
|
@@ -13877,13 +13878,13 @@ class Ja extends Zn {
|
|
|
13877
13878
|
return Promise.resolve();
|
|
13878
13879
|
await this.applyColorVariant(new st(a), t);
|
|
13879
13880
|
const n = (o = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)) == null ? void 0 : o.customColor;
|
|
13880
|
-
console.log(`LOG:
|
|
13881
|
+
console.log(`LOG: end of apply global state for color ${this.property.name}`), n && this.setCustomColor(n);
|
|
13881
13882
|
}
|
|
13882
13883
|
async applyColorVariant(t, e, a) {
|
|
13883
13884
|
const n = this.getSharedSteps(e);
|
|
13884
|
-
console.log(`LOG: applying color variant for ${n.length} shared steps`);
|
|
13885
|
+
console.log(`LOG: applying color variant ${t.getName()} for ${n.length} shared steps`);
|
|
13885
13886
|
const i = n.map((s) => {
|
|
13886
|
-
switch (s.getType()) {
|
|
13887
|
+
switch (console.log(`LOG: applying to step type ${s.getType()}`), s.getType()) {
|
|
13887
13888
|
case P.Shape:
|
|
13888
13889
|
return s.selectVariant(t);
|
|
13889
13890
|
case P.Text:
|
|
@@ -15994,7 +15995,7 @@ class Ad {
|
|
|
15994
15995
|
} catch (a) {
|
|
15995
15996
|
throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
|
|
15996
15997
|
}
|
|
15997
|
-
}, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1-beta.
|
|
15998
|
+
}, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1-beta.bfc4858f-0e0f-569a-aec4-7fcae31d702c"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
15998
15999
|
}
|
|
15999
16000
|
configure(t) {
|
|
16000
16001
|
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 && Lr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16103,7 +16104,7 @@ class Ad {
|
|
|
16103
16104
|
const C = ((h = (u = this.customer) == null ? void 0 : u.bundleStakeholders) == null ? void 0 : h.find(
|
|
16104
16105
|
(w) => {
|
|
16105
16106
|
var S, y;
|
|
16106
|
-
return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((
|
|
16107
|
+
return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((I) => I.id === t);
|
|
16107
16108
|
}
|
|
16108
16109
|
)) || ((g = (m = this.customer) == null ? void 0 : m.stakeholders) == null ? void 0 : g.find(
|
|
16109
16110
|
(w) => {
|
|
@@ -16330,11 +16331,11 @@ class Ad {
|
|
|
16330
16331
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16331
16332
|
*/
|
|
16332
16333
|
async getExistingBundle(t, e, a, n) {
|
|
16333
|
-
var h, m, g, p, f, C, w, S, y,
|
|
16334
|
+
var h, m, g, p, f, C, w, S, y, I, b;
|
|
16334
16335
|
const i = N.getMap("bundleOwnerIds"), s = i == null ? void 0 : i.get(t), o = {};
|
|
16335
16336
|
try {
|
|
16336
|
-
const
|
|
16337
|
-
o.Authorization = `Bearer ${
|
|
16337
|
+
const E = await this.loggedInBearerToken();
|
|
16338
|
+
o.Authorization = `Bearer ${E}`;
|
|
16338
16339
|
} catch {
|
|
16339
16340
|
const F = ((h = Object.entries(localStorage).find(([T, nt]) => T.startsWith("CognitoIdentityServiceProvider") && T.endsWith("idToken"))) == null ? void 0 : h[0]) || "", k = localStorage.getItem(F);
|
|
16340
16341
|
k && !Wt(k) && (o.Authorization = `Bearer ${k}`);
|
|
@@ -16359,7 +16360,7 @@ class Ad {
|
|
|
16359
16360
|
A.set(d.id, d.partner.id), N.setMap("bundlePartnerIds", A);
|
|
16360
16361
|
const u = new Je(this, d, e, a, s, {
|
|
16361
16362
|
additionalHeaders: (y = n == null ? void 0 : n.graphql) == null ? void 0 : y.additionalHeaders,
|
|
16362
|
-
eagerFetchProducts: (b = (
|
|
16363
|
+
eagerFetchProducts: (b = (I = n == null ? void 0 : n.graphql) == null ? void 0 : I.productCollection) == null ? void 0 : b.eagerFetchProducts,
|
|
16363
16364
|
existingGlobalPropertyState: c.data.globalPropertyState,
|
|
16364
16365
|
readonly: n == null ? void 0 : n.readonly
|
|
16365
16366
|
});
|
|
@@ -16378,7 +16379,7 @@ class Ad {
|
|
|
16378
16379
|
const C = await this.loggedInBearerToken();
|
|
16379
16380
|
s.Authorization = `Bearer ${C}`;
|
|
16380
16381
|
} catch {
|
|
16381
|
-
const S = ((h = Object.entries(localStorage).find(([
|
|
16382
|
+
const S = ((h = Object.entries(localStorage).find(([I, b]) => I.startsWith("CognitoIdentityServiceProvider") && I.endsWith("idToken"))) == null ? void 0 : h[0]) || "", y = localStorage.getItem(S);
|
|
16382
16383
|
y && !Wt(y) && (s.Authorization = `Bearer ${y}`);
|
|
16383
16384
|
}
|
|
16384
16385
|
const o = {
|
|
@@ -16485,19 +16486,19 @@ class Ad {
|
|
|
16485
16486
|
var D, F, k;
|
|
16486
16487
|
if (y.length === 0)
|
|
16487
16488
|
return [];
|
|
16488
|
-
const
|
|
16489
|
+
const I = y.map((T) => T.option.transactionId), b = await a.query({
|
|
16489
16490
|
query: yi,
|
|
16490
16491
|
variables: {
|
|
16491
|
-
ids:
|
|
16492
|
+
ids: I
|
|
16492
16493
|
},
|
|
16493
16494
|
errorPolicy: "all",
|
|
16494
16495
|
fetchPolicy: "no-cache"
|
|
16495
|
-
}),
|
|
16496
|
-
if (
|
|
16496
|
+
}), E = b.data.transactions;
|
|
16497
|
+
if (E.length !== y.length) {
|
|
16497
16498
|
const T = ((F = (D = b.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
|
|
16498
16499
|
throw new ut(`Not all transactions were found: ${T}`);
|
|
16499
16500
|
}
|
|
16500
|
-
return !this.activeIntegration && ((k =
|
|
16501
|
+
return !this.activeIntegration && ((k = E[0].integrationProduct) != null && k.integration) && (this.activeIntegration = Promise.resolve(E[0].integrationProduct.integration)), E.map((T, nt) => {
|
|
16501
16502
|
var R;
|
|
16502
16503
|
return {
|
|
16503
16504
|
transaction: T,
|
|
@@ -16507,10 +16508,10 @@ class Ad {
|
|
|
16507
16508
|
};
|
|
16508
16509
|
});
|
|
16509
16510
|
}, i = async (y) => {
|
|
16510
|
-
var
|
|
16511
|
+
var E, D, F;
|
|
16511
16512
|
if (y.length === 0)
|
|
16512
16513
|
return [];
|
|
16513
|
-
const
|
|
16514
|
+
const I = await a.mutate({
|
|
16514
16515
|
mutation: wi,
|
|
16515
16516
|
variables: {
|
|
16516
16517
|
inputs: y.map((k) => ({
|
|
@@ -16526,9 +16527,9 @@ class Ad {
|
|
|
16526
16527
|
},
|
|
16527
16528
|
errorPolicy: "all",
|
|
16528
16529
|
fetchPolicy: "no-cache"
|
|
16529
|
-
}), b = (
|
|
16530
|
+
}), b = (E = I.data) == null ? void 0 : E.transactionCreateMany;
|
|
16530
16531
|
if (!b || b.length === 0) {
|
|
16531
|
-
const k = ((F = (D =
|
|
16532
|
+
const k = ((F = (D = I.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
|
|
16532
16533
|
throw new ut(`Failed to create transactions: ${k}`);
|
|
16533
16534
|
}
|
|
16534
16535
|
return b.map((k, T) => ({
|
|
@@ -16537,37 +16538,37 @@ class Ad {
|
|
|
16537
16538
|
readOnly: !1,
|
|
16538
16539
|
index: y[T].index
|
|
16539
16540
|
}));
|
|
16540
|
-
}, s = t.map((y,
|
|
16541
|
+
}, s = t.map((y, I) => ({ option: y, index: I })), o = s.filter((y) => y.option.type === "transaction"), l = s.filter(
|
|
16541
16542
|
(y) => y.option.type === "integration" || y.option.type === "external"
|
|
16542
16543
|
), c = xa(o, 10), d = xa(l, 10), A = (await Promise.all([
|
|
16543
16544
|
...c.map(n),
|
|
16544
16545
|
...d.map(i)
|
|
16545
16546
|
])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await ar(u, e), m = new Map(h.map((y) => [y.id, y])), g = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
|
|
16546
16547
|
var tt;
|
|
16547
|
-
const { transaction:
|
|
16548
|
-
!g.get(
|
|
16549
|
-
const T = g.get(
|
|
16548
|
+
const { transaction: I, workflowId: b, readOnly: E, index: D } = y, F = m.get(b), k = t[D];
|
|
16549
|
+
!g.get(I.id) && I.transactionOwnerId && g.set(I.id, I.transactionOwnerId);
|
|
16550
|
+
const T = g.get(I.id) || void 0, nt = new Fl({
|
|
16550
16551
|
onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
|
|
16551
16552
|
onQuery: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } })
|
|
16552
16553
|
}), R = {
|
|
16553
|
-
product:
|
|
16554
|
-
transaction:
|
|
16554
|
+
product: I.product,
|
|
16555
|
+
transaction: I,
|
|
16555
16556
|
layouts: [],
|
|
16556
16557
|
singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
|
|
16557
|
-
stateMutationFunc:
|
|
16558
|
+
stateMutationFunc: E ? async () => {
|
|
16558
16559
|
throw new G("State mutation is forbidden in read only mode!");
|
|
16559
|
-
} : async (
|
|
16560
|
-
...
|
|
16560
|
+
} : async (Z) => (console.log("LOG: updating transaction"), this.updateTransactionState({
|
|
16561
|
+
...Z,
|
|
16561
16562
|
context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
|
|
16562
16563
|
})),
|
|
16563
16564
|
graphQlClient: () => nt,
|
|
16564
|
-
readOnly:
|
|
16565
|
+
readOnly: E,
|
|
16565
16566
|
workflow: F,
|
|
16566
16567
|
isReloadedTransaction: k.type === "transaction"
|
|
16567
16568
|
};
|
|
16568
|
-
if (!
|
|
16569
|
-
const
|
|
16570
|
-
R.layouts = Object.values(
|
|
16569
|
+
if (!E && k.workflowState) {
|
|
16570
|
+
const Z = JSON.parse(k.workflowState);
|
|
16571
|
+
R.layouts = Object.values(Z.layouts || {}).map((Nt) => Nt.layout), await cs(Z), R.reloadedState = Z;
|
|
16571
16572
|
} else
|
|
16572
16573
|
R.layouts = Rl(
|
|
16573
16574
|
R.transaction,
|
|
@@ -16578,9 +16579,9 @@ class Ad {
|
|
|
16578
16579
|
), R.delayWorkflowStateSync = !0, { experienceOptions: R, index: D, options: k };
|
|
16579
16580
|
}), f = await Promise.all(p);
|
|
16580
16581
|
N.setMap("transactionOwnerIds", g);
|
|
16581
|
-
const w = f.sort((y,
|
|
16582
|
-
const { experienceOptions:
|
|
16583
|
-
return await
|
|
16582
|
+
const w = f.sort((y, I) => y.index - I.index).map(async (y) => {
|
|
16583
|
+
const { experienceOptions: I, options: b } = y, E = new Vo(this, I);
|
|
16584
|
+
return await E.getWorkflowManager().getInitializationPromise(), b.type !== "transaction" && this.customer && await E.attachCustomerDetails({ email: this.customer.emailAddress }), E;
|
|
16584
16585
|
}), S = await Promise.all(w);
|
|
16585
16586
|
return S.forEach((y) => y.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), S;
|
|
16586
16587
|
}
|