@spiffcommerce/core 18.5.0-alpha.1 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -8
- package/dist/index.js +252 -267
- package/dist/index.umd.cjs +15 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHttpLink as gt, InMemoryCache as lt, ApolloClient as Bt, from as dt, gql as y } from "@apollo/client/core";
|
|
2
|
-
import { fetch as qA, getAttributesFromArrayBuffer as
|
|
3
|
-
import { AssetType as
|
|
2
|
+
import { fetch as qA, getAttributesFromArrayBuffer as fe, AssetType as re, StepType as D, getFrameData as ZA, frameDataCache as wt, GroupCommand as G, UpdateFramePattern as De, UpdateFrameThresholdSettingsCommand as Et, calculateOffsets as $A, LayoutElementType as v, generate as J, CreateElementCommand as L, generateSVGWithUnknownColors as Fe, svgObjectURL as pA, fetchAsString as q, DeleteElementCommand as Z, generateDefaultRectangleFrameSvg as ce, GetSVGDimensions as ht, patternImageDataCache as ge, fetchAsArrayBuffer as Ct, findElement as fA, modifySVGWithElementProperties as Qt, IllustrationColorCommand as OA, IllustrationCacheCommand as ut, getFontMetrics as mt, getPatternImageData as zA, FontAlignmentCommand as It, FontColorCommand as pt, FontImageFillCommand as kA, applyTextTransformations as KA, determineCorrectFontSizeAndLines as uA, FontSourceCommand as le, loadFont as _A, TextChangeCommand as ft, FontSizeCommand as Dt, createElementNS as Ft, createElement as lA, _loadFontExternalDataURL as Ae, UpdateWorkflowStateCommand as Be, CommandContext as Mt, createCanvas as DA, getSvgElement as Me, LayoutRenderingPurpose as ye, renderPapyrusComponentAsString as Ye, loadImage as Se, getDomParser as xe, toBase64 as de, getVariant as yt, generateFrameSVG as Yt, getDefaultVariant as NA, domParser as Pe, sanitizeSvgTree as Ne, traverse as St, xmlSerializer as He, CreateLayoutCommand as xt, AspectType as mA, rehydrateSerializedLayout as _ } from "@spiffcommerce/papyrus";
|
|
3
|
+
import { AssetType as Ri, BringForwardCommand as Ui, BringToBackCommand as Gi, BringToFrontCommand as vi, CanvasCommand as ki, CommandContext as Ji, CreateElementCommand as bi, CreateLayoutCommand as Li, DeleteElementCommand as Ti, FontAlignmentCommand as Oi, FontColorCommand as zi, FontSizeCommand as Ki, FontSourceCommand as ji, GroupCommand as Vi, LayoutElementFactory as Wi, LayoutElementType as Xi, MoveCommand as qi, ResizeCommand as Zi, RotateCommand as $i, SendBackwardsCommand as _i, StepAspectType as As, StepType as es, TextChangeCommand as ts, UnitOfMeasurement as as, dataUrlFromExternalUrl as ns, determineCorrectFontSizeAndLines as is, findElement as ss, frameDataCache as os, generate as rs, generateSVGWithUnknownColors as cs, getAttributesFromArrayBuffer as gs, getAxisAlignedBoundingBox as ls, getFrameData as Bs, getSvgElement as ds, loadFont as ws, patternImageDataCache as Es, registerFetchImplementation as hs, registerWindowImplementation as Cs, rehydrateSerializedLayout as Qs, setCanvasModule as us } from "@spiffcommerce/papyrus";
|
|
4
4
|
import { setContext as Pt } from "@apollo/client/link/context";
|
|
5
5
|
import { onError as Nt } from "@apollo/client/link/error";
|
|
6
6
|
import { Pith as Re } from "pith";
|
|
@@ -186,8 +186,8 @@ class Jt {
|
|
|
186
186
|
if (window && window.__SENTRY__) {
|
|
187
187
|
const C = window.__SENTRY__.hub;
|
|
188
188
|
if (C) {
|
|
189
|
-
const
|
|
190
|
-
Object.entries(
|
|
189
|
+
const f = C.traceHeaders();
|
|
190
|
+
Object.entries(f).forEach(([u, m]) => {
|
|
191
191
|
r[u] = m;
|
|
192
192
|
});
|
|
193
193
|
}
|
|
@@ -380,7 +380,7 @@ const N = new Jt(), bt = y`
|
|
|
380
380
|
class jt {
|
|
381
381
|
constructor() {
|
|
382
382
|
this.cache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map(), this.loadImageAsFileInfo = async (A) => {
|
|
383
|
-
const e = await A.arrayBuffer(), t = await
|
|
383
|
+
const e = await A.arrayBuffer(), t = await fe(e), a = (n, i) => {
|
|
384
384
|
const s = atob(n.split(",")[1]), o = [];
|
|
385
385
|
for (let r = 0; r < s.length; r++)
|
|
386
386
|
o.push(s.charCodeAt(r));
|
|
@@ -1090,14 +1090,14 @@ const Oe = y`
|
|
|
1090
1090
|
workflowState
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
|
-
`, nA = [
|
|
1093
|
+
`, nA = [D.SilentIllustration, D.ProductOverlay], oa = async (c) => {
|
|
1094
1094
|
const A = [];
|
|
1095
1095
|
c.introduction && A.push({
|
|
1096
1096
|
name: "Introduction",
|
|
1097
1097
|
title: c.name,
|
|
1098
1098
|
renderableSteps: [
|
|
1099
1099
|
{
|
|
1100
|
-
type:
|
|
1100
|
+
type: D.Introduction,
|
|
1101
1101
|
stepName: "Introduction",
|
|
1102
1102
|
stepTitle: c.name,
|
|
1103
1103
|
helpText: c.introduction,
|
|
@@ -1132,7 +1132,7 @@ const Oe = y`
|
|
|
1132
1132
|
title: e,
|
|
1133
1133
|
renderableSteps: [
|
|
1134
1134
|
{
|
|
1135
|
-
type:
|
|
1135
|
+
type: D.Finish,
|
|
1136
1136
|
stepName: "Finish",
|
|
1137
1137
|
stepTitle: e,
|
|
1138
1138
|
helpText: "",
|
|
@@ -1168,7 +1168,7 @@ const Oe = y`
|
|
|
1168
1168
|
for (const s of t)
|
|
1169
1169
|
for (const o of s.renderableSteps) {
|
|
1170
1170
|
const r = (((i = o.option) == null ? void 0 : i.variants) || []).length;
|
|
1171
|
-
o.silent || (o.type ===
|
|
1171
|
+
o.silent || (o.type === D.Model || o.type === D.Material || o.type === D.Picture || o.type === D.Shape ? (r > 1 || e) && a.push(o.stepName) : a.push(o.stepName));
|
|
1172
1172
|
}
|
|
1173
1173
|
const n = t.filter((s) => s.renderableSteps.filter(
|
|
1174
1174
|
(r) => a.includes(r.stepName)
|
|
@@ -1428,7 +1428,7 @@ class Ba {
|
|
|
1428
1428
|
n.forEach((o, r) => {
|
|
1429
1429
|
s(
|
|
1430
1430
|
new G([
|
|
1431
|
-
new
|
|
1431
|
+
new De(o, e, A[r]),
|
|
1432
1432
|
new Et(o, a.useThreshold, a.invertThreshold, a.threshold, a.thresholdSaturation)
|
|
1433
1433
|
])
|
|
1434
1434
|
);
|
|
@@ -1461,14 +1461,14 @@ class Qe {
|
|
|
1461
1461
|
if (!n)
|
|
1462
1462
|
throw new z(a);
|
|
1463
1463
|
let i = "";
|
|
1464
|
-
if (this.configuration.type ===
|
|
1464
|
+
if (this.configuration.type === D.ProductOverlay) {
|
|
1465
1465
|
let l = "";
|
|
1466
1466
|
if ((o = this.product) != null && o.overlayImageUrl && (l = this.product.overlayImageUrl), i = l, !l)
|
|
1467
1467
|
throw new MA(this.configuration, "Couldn't find an asset for product overlay step");
|
|
1468
1468
|
}
|
|
1469
1469
|
const s = this.evaluateAssetType();
|
|
1470
1470
|
if (s === v.Image) {
|
|
1471
|
-
const l = this.configuration.type ===
|
|
1471
|
+
const l = this.configuration.type === D.SilentIllustration ? (r = this.configuration.data.asset) == null ? void 0 : r.fileLink : (g = this.product) == null ? void 0 : g.overlayImageUrl;
|
|
1472
1472
|
if (!l)
|
|
1473
1473
|
throw new Error("Undefined raster silent step source");
|
|
1474
1474
|
const d = {
|
|
@@ -1483,7 +1483,7 @@ class Qe {
|
|
|
1483
1483
|
layer: a.layer,
|
|
1484
1484
|
layerIndex: a.layerIndex,
|
|
1485
1485
|
immutable: a.immutable,
|
|
1486
|
-
productOverlay: this.configuration.type ===
|
|
1486
|
+
productOverlay: this.configuration.type === D.ProductOverlay ? !0 : void 0,
|
|
1487
1487
|
rotation: a.rotation,
|
|
1488
1488
|
excludeFromExport: this.configuration.data.excludeFromPrint,
|
|
1489
1489
|
preserveAspectRatio: "none"
|
|
@@ -1496,7 +1496,7 @@ class Qe {
|
|
|
1496
1496
|
command: new L(d, n)
|
|
1497
1497
|
};
|
|
1498
1498
|
} else {
|
|
1499
|
-
const l = this.configuration.type ===
|
|
1499
|
+
const l = this.configuration.type === D.SilentIllustration ? (B = this.configuration.data.asset) == null ? void 0 : B.fileLink : i, w = await Fe(await (async () => new Promise((E, Q) => {
|
|
1500
1500
|
if (!l) {
|
|
1501
1501
|
Q("Undefined vector silent step source");
|
|
1502
1502
|
return;
|
|
@@ -1520,7 +1520,7 @@ class Qe {
|
|
|
1520
1520
|
layerIndex: a.layerIndex,
|
|
1521
1521
|
rotation: a.rotation,
|
|
1522
1522
|
immutable: a.immutable,
|
|
1523
|
-
productOverlay: this.configuration.type ===
|
|
1523
|
+
productOverlay: this.configuration.type === D.ProductOverlay ? !0 : void 0,
|
|
1524
1524
|
excludeFromExport: this.configuration.data.excludeFromPrint
|
|
1525
1525
|
};
|
|
1526
1526
|
return {
|
|
@@ -1536,11 +1536,11 @@ class Qe {
|
|
|
1536
1536
|
async trigger() {
|
|
1537
1537
|
if (!this.configuration.data.regions)
|
|
1538
1538
|
throw new MA(this.configuration, "Missing regions.");
|
|
1539
|
-
if (this.configuration.type ===
|
|
1539
|
+
if (this.configuration.type === D.SilentIllustration) {
|
|
1540
1540
|
const A = this.configuration.data.regions.map(this.processRegion);
|
|
1541
1541
|
return Promise.all(A);
|
|
1542
1542
|
} else
|
|
1543
|
-
return this.configuration.type ===
|
|
1543
|
+
return this.configuration.type === D.ProductOverlay ? Promise.all(
|
|
1544
1544
|
this.configuration.data.regions.map((A) => {
|
|
1545
1545
|
if (!this.layouts.find((t) => A.panelId === t.panelId))
|
|
1546
1546
|
throw new z(A);
|
|
@@ -1550,7 +1550,7 @@ class Qe {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
evaluateAssetType() {
|
|
1552
1552
|
var e, t, a;
|
|
1553
|
-
const A = this.configuration.type ===
|
|
1553
|
+
const A = this.configuration.type === D.ProductOverlay && ((e = this.product) != null && e.overlayImageUrl) ? this.product.overlayImageUrl.toLowerCase() : (a = (t = this.configuration.data.asset) == null ? void 0 : t.fileLink) == null ? void 0 : a.toLowerCase().split("?")[0];
|
|
1554
1554
|
return A != null && A.startsWith("data:image/png") || A != null && A.endsWith(".jpeg") || A != null && A.endsWith(".jpg") || A != null && A.endsWith(".png") ? v.Image : A != null && A.endsWith(".svg") || A != null && A.startsWith("image/svg+xml") ? v.Illustration : v.Illustration;
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
@@ -1613,9 +1613,9 @@ class wa {
|
|
|
1613
1613
|
if (!e && t !== "" && a === "") {
|
|
1614
1614
|
const g = async () => {
|
|
1615
1615
|
var u, m;
|
|
1616
|
-
const C = (await Le([t]))[0],
|
|
1617
|
-
return { asset: C, link:
|
|
1618
|
-
}, B = await new Promise((C,
|
|
1616
|
+
const C = (await Le([t]))[0], f = (m = (u = C == null ? void 0 : C.versions) == null ? void 0 : u.find((I) => I.name === "mpeg4")) == null ? void 0 : m.link;
|
|
1617
|
+
return { asset: C, link: f };
|
|
1618
|
+
}, B = await new Promise((C, f) => {
|
|
1619
1619
|
new je(
|
|
1620
1620
|
async () => !!(await g()).link,
|
|
1621
1621
|
async () => {
|
|
@@ -1628,7 +1628,7 @@ class wa {
|
|
|
1628
1628
|
});
|
|
1629
1629
|
},
|
|
1630
1630
|
() => {
|
|
1631
|
-
|
|
1631
|
+
f("Poller timed out with 40 attempts @ 3 second interval");
|
|
1632
1632
|
},
|
|
1633
1633
|
3e3,
|
|
1634
1634
|
40
|
|
@@ -1847,7 +1847,7 @@ class ha {
|
|
|
1847
1847
|
};
|
|
1848
1848
|
ge.set(A, i), e.setPatternData(i);
|
|
1849
1849
|
} else {
|
|
1850
|
-
const t = await Ct(A, !0), a = await
|
|
1850
|
+
const t = await Ct(A, !0), a = await fe(t), n = {
|
|
1851
1851
|
src: A,
|
|
1852
1852
|
width: a.width,
|
|
1853
1853
|
height: a.height,
|
|
@@ -1867,7 +1867,7 @@ class ha {
|
|
|
1867
1867
|
n && n(!0);
|
|
1868
1868
|
const r = await Promise.all(
|
|
1869
1869
|
A.data.regions.map(async (d, w) => {
|
|
1870
|
-
const h = await ZA(o[w]), E = s.getImageData(), Q = t.map((p) => new Z(p.id)), C = E ? $A(E, h) : void 0,
|
|
1870
|
+
const h = await ZA(o[w]), E = s.getImageData(), Q = t.map((p) => new Z(p.id)), C = E ? $A(E, h) : void 0, f = E ? {
|
|
1871
1871
|
id: J(),
|
|
1872
1872
|
src: E.src,
|
|
1873
1873
|
x: (C == null ? void 0 : C.x) || 0,
|
|
@@ -1883,7 +1883,7 @@ class ha {
|
|
|
1883
1883
|
return {
|
|
1884
1884
|
command: this.getCreateElementCommand(u, d, I, {
|
|
1885
1885
|
frameData: h,
|
|
1886
|
-
pattern:
|
|
1886
|
+
pattern: f,
|
|
1887
1887
|
disablePlaceholder: A.data.disablePlaceholder,
|
|
1888
1888
|
focalBlur: A.data.focalBlur,
|
|
1889
1889
|
focalBlurStrength: A.data.focalBlurStrength,
|
|
@@ -1980,7 +1980,7 @@ class Ca {
|
|
|
1980
1980
|
if (t.length === 0)
|
|
1981
1981
|
return [];
|
|
1982
1982
|
try {
|
|
1983
|
-
return
|
|
1983
|
+
return fA(
|
|
1984
1984
|
t[0].id,
|
|
1985
1985
|
e.getAllLayoutData()
|
|
1986
1986
|
).colors;
|
|
@@ -2057,7 +2057,7 @@ class Ca {
|
|
|
2057
2057
|
var d, w;
|
|
2058
2058
|
if (e.length === 0)
|
|
2059
2059
|
return;
|
|
2060
|
-
const i =
|
|
2060
|
+
const i = fA(
|
|
2061
2061
|
e[0].id,
|
|
2062
2062
|
a().map((h) => h.layoutState)
|
|
2063
2063
|
), s = { ...i.colors }, o = {};
|
|
@@ -2109,13 +2109,13 @@ class Ca {
|
|
|
2109
2109
|
if (!o)
|
|
2110
2110
|
throw new oA(s);
|
|
2111
2111
|
const r = await Fe(await this.getIllustrationBody(o)), g = await pA(r.svg), B = (C) => {
|
|
2112
|
-
const
|
|
2113
|
-
if (!
|
|
2112
|
+
const f = n.getLayouts().find((m) => m.panelId === C.panelId);
|
|
2113
|
+
if (!f)
|
|
2114
2114
|
throw new z(C);
|
|
2115
2115
|
const u = J();
|
|
2116
2116
|
return {
|
|
2117
2117
|
regionElement: { id: u, region: C },
|
|
2118
|
-
command: this.getCreateElementCommand(u, C,
|
|
2118
|
+
command: this.getCreateElementCommand(u, C, f, {
|
|
2119
2119
|
stepName: A.stepName,
|
|
2120
2120
|
src: o,
|
|
2121
2121
|
objectURL: g,
|
|
@@ -2126,9 +2126,9 @@ class Ca {
|
|
|
2126
2126
|
let h = Array.from(Object.values(r.colors)).map((C) => C.browserValue);
|
|
2127
2127
|
const E = A.data.colorOption;
|
|
2128
2128
|
return E && ((Q = E.variants) == null || Q.forEach((C) => {
|
|
2129
|
-
h = h.map((
|
|
2129
|
+
h = h.map((f) => {
|
|
2130
2130
|
var u;
|
|
2131
|
-
return
|
|
2131
|
+
return f.toLowerCase() === ((u = C.color) == null ? void 0 : u.toLowerCase()) ? C.name : f;
|
|
2132
2132
|
});
|
|
2133
2133
|
})), n.updateMetadata(A.stepName, { colors: h }), {
|
|
2134
2134
|
command: new G(w),
|
|
@@ -2141,9 +2141,9 @@ class Ca {
|
|
|
2141
2141
|
n.setMandatoryFulfilled(A.stepName, !0), a(!1);
|
|
2142
2142
|
}
|
|
2143
2143
|
);
|
|
2144
|
-
const C = await this.availableColors(A, n) || [],
|
|
2145
|
-
if (A.data.colorPickerEnabled && C.length === 1 &&
|
|
2146
|
-
const u = C[0], m =
|
|
2144
|
+
const C = await this.availableColors(A, n) || [], f = Object.keys(r.colors);
|
|
2145
|
+
if (A.data.colorPickerEnabled && C.length === 1 && f.length === 1) {
|
|
2146
|
+
const u = C[0], m = f[0];
|
|
2147
2147
|
await this.changeColors(
|
|
2148
2148
|
A,
|
|
2149
2149
|
l.map((I) => I.regionElement),
|
|
@@ -2522,7 +2522,7 @@ class pa {
|
|
|
2522
2522
|
}
|
|
2523
2523
|
}
|
|
2524
2524
|
const Xe = new pa();
|
|
2525
|
-
class
|
|
2525
|
+
class fa {
|
|
2526
2526
|
async init(A, e, t) {
|
|
2527
2527
|
const a = A.option;
|
|
2528
2528
|
if (!a)
|
|
@@ -2580,8 +2580,8 @@ class Da {
|
|
|
2580
2580
|
};
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
2583
|
-
const qe = new
|
|
2584
|
-
class
|
|
2583
|
+
const qe = new fa();
|
|
2584
|
+
class Da {
|
|
2585
2585
|
constructor() {
|
|
2586
2586
|
this.shapeFillId = "spiff-fill-shape";
|
|
2587
2587
|
}
|
|
@@ -2686,7 +2686,7 @@ class fa {
|
|
|
2686
2686
|
};
|
|
2687
2687
|
} else {
|
|
2688
2688
|
const r = (d) => {
|
|
2689
|
-
const w = n.find((
|
|
2689
|
+
const w = n.find((f) => f.panelId === d.panelId);
|
|
2690
2690
|
if (!w)
|
|
2691
2691
|
throw new z(d);
|
|
2692
2692
|
const h = s(), E = `
|
|
@@ -2753,7 +2753,7 @@ class fa {
|
|
|
2753
2753
|
}
|
|
2754
2754
|
}
|
|
2755
2755
|
}
|
|
2756
|
-
const sA = new
|
|
2756
|
+
const sA = new Da();
|
|
2757
2757
|
class Fa {
|
|
2758
2758
|
constructor() {
|
|
2759
2759
|
this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
|
|
@@ -2862,7 +2862,7 @@ class Ya {
|
|
|
2862
2862
|
return null;
|
|
2863
2863
|
}
|
|
2864
2864
|
findLayoutElements(A, e) {
|
|
2865
|
-
return A.getRegionElements(e.stepName).map((n) =>
|
|
2865
|
+
return A.getRegionElements(e.stepName).map((n) => fA(n.id, A.getAllLayoutData()));
|
|
2866
2866
|
}
|
|
2867
2867
|
/**
|
|
2868
2868
|
* Get the colors that can be used for a given text step.
|
|
@@ -3024,14 +3024,14 @@ class Ya {
|
|
|
3024
3024
|
if (o && l) {
|
|
3025
3025
|
const d = (r = o.variants) == null ? void 0 : r.find((w) => w.id === l);
|
|
3026
3026
|
if (d) {
|
|
3027
|
-
const w = await this.fontDataFromVariant(d), h = s.map((
|
|
3027
|
+
const w = await this.fontDataFromVariant(d), h = s.map((f) => ({ id: f.id, region: f.stepRegion })), E = (g = a.storage) == null ? void 0 : g.color, Q = (B = a.storage) == null ? void 0 : B.text;
|
|
3028
3028
|
await e.setSelectionsAndElements(
|
|
3029
3029
|
A.stepName,
|
|
3030
3030
|
[d],
|
|
3031
3031
|
h,
|
|
3032
3032
|
async () => {
|
|
3033
3033
|
e.updateMetadata(A.stepName, { color: E, text: Q }), e.updateStorage(A.stepName, { text: Q, inputText: Q });
|
|
3034
|
-
const
|
|
3034
|
+
const f = s.map((m) => new le(m.id, w)), u = new G(f);
|
|
3035
3035
|
e.getCommandDispatcher()(u), e.setMandatoryFulfilled(A.stepName, !0);
|
|
3036
3036
|
}
|
|
3037
3037
|
);
|
|
@@ -3163,11 +3163,11 @@ class Ya {
|
|
|
3163
3163
|
colorProfileAssetKey: (h = E.colorProfile) == null ? void 0 : h.key
|
|
3164
3164
|
});
|
|
3165
3165
|
}
|
|
3166
|
-
const C = await this.getDefaultColor(t),
|
|
3166
|
+
const C = await this.getDefaultColor(t), f = C || "#000000", u = {
|
|
3167
3167
|
stepRegion: B,
|
|
3168
3168
|
stepName: A,
|
|
3169
3169
|
align: this.textAlign(t),
|
|
3170
|
-
fill: n.color ? n.color :
|
|
3170
|
+
fill: n.color ? n.color : f,
|
|
3171
3171
|
fontSize: t.size || bA,
|
|
3172
3172
|
fontData: a,
|
|
3173
3173
|
id: w,
|
|
@@ -3237,9 +3237,9 @@ class Ya {
|
|
|
3237
3237
|
), g;
|
|
3238
3238
|
}
|
|
3239
3239
|
generateTextChangeCommandsForRegion(A, e, t, a) {
|
|
3240
|
-
const n = [], i = new
|
|
3240
|
+
const n = [], i = new ft(t, a);
|
|
3241
3241
|
if (n.push(i), !e.size) {
|
|
3242
|
-
const o = new
|
|
3242
|
+
const o = new Dt(t, A);
|
|
3243
3243
|
n.push(o);
|
|
3244
3244
|
}
|
|
3245
3245
|
return new G(n);
|
|
@@ -4760,8 +4760,8 @@ class Ua extends ae {
|
|
|
4760
4760
|
Q.setAttribute("opacity", "0"), E.appendChild(Q);
|
|
4761
4761
|
const C = R("g");
|
|
4762
4762
|
E.appendChild(C);
|
|
4763
|
-
const
|
|
4764
|
-
C.appendChild(
|
|
4763
|
+
const f = s();
|
|
4764
|
+
C.appendChild(f);
|
|
4765
4765
|
const u = ee(i);
|
|
4766
4766
|
return ie(C, u, l, d), At(o.outerHTML);
|
|
4767
4767
|
}
|
|
@@ -4803,8 +4803,8 @@ class va extends ae {
|
|
|
4803
4803
|
t ? (w = B * 0.25 * (1 + 0.1), h = l / 2 * (1 + 0.1), E = l * 0.22, Q = B * 0.32) : (w = B * 0.22 * (1 + 0.1), h = l * 0.8, E = l * 0.067, Q = B * 0.33);
|
|
4804
4804
|
const C = R("g");
|
|
4805
4805
|
g.appendChild(C), C.setAttribute("transform", `translate(${E} ${Q}) rotate(-10)`);
|
|
4806
|
-
const
|
|
4807
|
-
|
|
4806
|
+
const f = ne(w, h);
|
|
4807
|
+
f.setAttribute("opacity", "0"), C.appendChild(f);
|
|
4808
4808
|
const u = R("g");
|
|
4809
4809
|
C.appendChild(u);
|
|
4810
4810
|
const m = r();
|
|
@@ -4826,21 +4826,21 @@ class Ja extends ae {
|
|
|
4826
4826
|
return this.svgElement(A, e);
|
|
4827
4827
|
}
|
|
4828
4828
|
svgElement(A, e) {
|
|
4829
|
-
const t = Ae(ka), n = A !== "" ? ((
|
|
4830
|
-
const
|
|
4831
|
-
|
|
4829
|
+
const t = Ae(ka), n = A !== "" ? ((f) => f.charAt(0).toUpperCase() + f.substr(1).toLowerCase())(A) : "", i = t.getPath(n, 0, 72, 72), s = i.toSVG(2), o = i.getBoundingBox(), r = o.x2 - o.x1, g = i.toPathData(3), B = () => {
|
|
4830
|
+
const f = R("g");
|
|
4831
|
+
f.classList.add("module-text-group");
|
|
4832
4832
|
const u = R("defs");
|
|
4833
|
-
|
|
4833
|
+
f.appendChild(u), u.appendChild(_e(0, 2, 2, "shadow"));
|
|
4834
4834
|
const m = R("path");
|
|
4835
4835
|
m.setAttribute("d", g), m.setAttribute("stroke", "black"), m.setAttribute("stroke-width", "3"), u.appendChild(m);
|
|
4836
4836
|
const I = R("g");
|
|
4837
|
-
I.classList.add("module-layer0"),
|
|
4837
|
+
I.classList.add("module-layer0"), f.appendChild(I), I.setAttribute("filter", "url(#shadow)"), I.innerHTML = m.outerHTML;
|
|
4838
4838
|
const p = R("g");
|
|
4839
|
-
p.classList.add("module-layer1"),
|
|
4839
|
+
p.classList.add("module-layer1"), f.appendChild(p), p.setAttribute("stroke-width", "3"), p.setAttribute("stroke", "rgb(45,41,38)"), p.setAttribute("fill", "rgb(45,41,38)"), p.setAttribute("transform", "translate(0.5,0)"), p.innerHTML = s;
|
|
4840
4840
|
const F = R("g");
|
|
4841
|
-
F.classList.add("module-layer2"),
|
|
4841
|
+
F.classList.add("module-layer2"), f.appendChild(F), F.setAttribute("fill", "rgb(255,209,0)"), F.setAttribute("transform", "translate(1,-0.1)"), F.innerHTML = s;
|
|
4842
4842
|
const M = R("g");
|
|
4843
|
-
return M.classList.add("module-layer3"),
|
|
4843
|
+
return M.classList.add("module-layer3"), f.appendChild(M), M.setAttribute("fill", "white"), M.innerHTML = s, new se(f).transform(([Y, P]) => [Y, P + (r / 2 - Y) ** 2 / (r * 6)]), f;
|
|
4844
4844
|
}, l = R("g");
|
|
4845
4845
|
l.classList.add("module-root");
|
|
4846
4846
|
const d = R("defs");
|
|
@@ -4890,12 +4890,8 @@ class La {
|
|
|
4890
4890
|
return;
|
|
4891
4891
|
const E = this.getCommandContext().getAllLayouts(), Q = (C = this.getLayoutPreviewService()) == null ? void 0 : C.getAll();
|
|
4892
4892
|
if (Q)
|
|
4893
|
-
for (const [,
|
|
4894
|
-
|
|
4895
|
-
this.getWorkflow(),
|
|
4896
|
-
E,
|
|
4897
|
-
this.getProduct().overlayImageUrl
|
|
4898
|
-
);
|
|
4893
|
+
for (const [, f] of Q)
|
|
4894
|
+
f.render(this.getWorkflow(), E, this.getProduct().overlayImageUrl);
|
|
4899
4895
|
}, this.updateTransaction = n, this.commandContext = a, this.reloadedState = g, this.transaction = i, this.readOnly = B, this.singleVariantsRenderable = w, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = A, this.stepSpecificServices = {}, this.profanityFilter = e, this.pollers = [], this.allScenes = [], this.layouts = t, this.product = s, this.previewService = o, this.modelContainer = l, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = r, this.isReloadedTransaction = d, h && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(A), this.initializationPromise.then(() => {
|
|
4900
4896
|
this.initialized = !0;
|
|
4901
4897
|
}), this.initializationPromise.catch((E) => {
|
|
@@ -5087,7 +5083,7 @@ class La {
|
|
|
5087
5083
|
model: this.getProduct().modelUrl,
|
|
5088
5084
|
contextService: this.getLayoutPreviewService()
|
|
5089
5085
|
});
|
|
5090
|
-
this.setModelContainer(e), eA(this.allScenes, this.stepSelections).filter((n) => n).map((n) => n.renderableSteps).flat().filter((n) => n.type ===
|
|
5086
|
+
this.setModelContainer(e), eA(this.allScenes, this.stepSelections).filter((n) => n).map((n) => n.renderableSteps).flat().filter((n) => n.type === D.Model || n.type === D.Material).forEach((n) => {
|
|
5091
5087
|
var o, r, g;
|
|
5092
5088
|
if (!((o = n.option) != null && o.id)) {
|
|
5093
5089
|
console.error(`Failed to read option id from step: ${n.stepName}`);
|
|
@@ -5097,7 +5093,7 @@ class La {
|
|
|
5097
5093
|
if (i.length === 0)
|
|
5098
5094
|
return;
|
|
5099
5095
|
const s = i[0];
|
|
5100
|
-
if (n.type ===
|
|
5096
|
+
if (n.type === D.Model) {
|
|
5101
5097
|
if (!this.modelContainer)
|
|
5102
5098
|
throw new k(
|
|
5103
5099
|
"We should always have a model container when injecting a preview!"
|
|
@@ -5169,7 +5165,11 @@ class La {
|
|
|
5169
5165
|
const A = this.serialize();
|
|
5170
5166
|
this.workflowStatePromiseQueue.enqueue(
|
|
5171
5167
|
new me(async () => {
|
|
5172
|
-
await
|
|
5168
|
+
await new Promise((e) => {
|
|
5169
|
+
setTimeout(() => {
|
|
5170
|
+
e();
|
|
5171
|
+
}, 1);
|
|
5172
|
+
}), await this.updateTransaction({
|
|
5173
5173
|
variables: {
|
|
5174
5174
|
id: this.transaction.id,
|
|
5175
5175
|
workflowState: A.transaction
|
|
@@ -5227,17 +5227,17 @@ class La {
|
|
|
5227
5227
|
), A), []);
|
|
5228
5228
|
}
|
|
5229
5229
|
getInvalidModelVariants() {
|
|
5230
|
-
return this.workflow.steps.reduce((A, e) => (e.type ===
|
|
5230
|
+
return this.workflow.steps.reduce((A, e) => (e.type === D.Model && !tA(e, this.stepSelections) && A.push(e.stepName), A), []);
|
|
5231
5231
|
}
|
|
5232
5232
|
async stepElementsForIntroducedSilentSteps(A, e) {
|
|
5233
5233
|
const t = this.product;
|
|
5234
5234
|
if (!t)
|
|
5235
5235
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
|
5236
5236
|
const a = async (r, g, B) => {
|
|
5237
|
-
if (r.type ===
|
|
5237
|
+
if (r.type === D.SilentIllustration) {
|
|
5238
5238
|
const l = await new Qe(r, g).trigger();
|
|
5239
5239
|
return { step: r, results: l };
|
|
5240
|
-
} else if (r.type ===
|
|
5240
|
+
} else if (r.type === D.ProductOverlay) {
|
|
5241
5241
|
const l = await new Qe(
|
|
5242
5242
|
r,
|
|
5243
5243
|
g,
|
|
@@ -5303,15 +5303,15 @@ class La {
|
|
|
5303
5303
|
[A]: t
|
|
5304
5304
|
}, this.removeElements(l);
|
|
5305
5305
|
const h = this.workflow.steps.find((I) => I.stepName === A);
|
|
5306
|
-
if ((h == null ? void 0 : h.type) ===
|
|
5306
|
+
if ((h == null ? void 0 : h.type) === D.Frame) {
|
|
5307
5307
|
const I = this.getStepSpecificServices(A);
|
|
5308
5308
|
(m = I == null ? void 0 : I.frameService) == null || m.setTargetElements(t.map((p) => p.id));
|
|
5309
5309
|
}
|
|
5310
5310
|
const E = l.map((I) => new Z(I.id)), Q = new Be(this.constructSerializableWorkflow()), C = [...w, ...E, Q];
|
|
5311
5311
|
C.length > 0 && this.commandContext.apply(new G(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
5312
|
-
const
|
|
5312
|
+
const f = this.getInvalidModelVariants(), u = this.modelContainer;
|
|
5313
5313
|
if (u) {
|
|
5314
|
-
const I =
|
|
5314
|
+
const I = f.map(
|
|
5315
5315
|
(p) => u.applyModelVariant(
|
|
5316
5316
|
p,
|
|
5317
5317
|
{
|
|
@@ -5329,7 +5329,7 @@ class La {
|
|
|
5329
5329
|
for (const o of a)
|
|
5330
5330
|
if (!this.stepInitialised[o.stepName])
|
|
5331
5331
|
switch (this.stepInitialised[o.stepName] = !0, o.type) {
|
|
5332
|
-
case
|
|
5332
|
+
case D.DigitalContent:
|
|
5333
5333
|
t.push(
|
|
5334
5334
|
Ea.init(
|
|
5335
5335
|
o,
|
|
@@ -5338,8 +5338,8 @@ class La {
|
|
|
5338
5338
|
)
|
|
5339
5339
|
);
|
|
5340
5340
|
break;
|
|
5341
|
-
case
|
|
5342
|
-
case
|
|
5341
|
+
case D.Frame:
|
|
5342
|
+
case D.Photo:
|
|
5343
5343
|
{
|
|
5344
5344
|
const r = new Ba(o.data.forceImageCover);
|
|
5345
5345
|
r.connectWorkflowManager(this, o.stepName), this.stepSpecificServices[o.stepName] = {
|
|
@@ -5349,40 +5349,40 @@ class La {
|
|
|
5349
5349
|
);
|
|
5350
5350
|
}
|
|
5351
5351
|
break;
|
|
5352
|
-
case
|
|
5352
|
+
case D.Illustration:
|
|
5353
5353
|
t.push(
|
|
5354
5354
|
IA.init(o, this, this.reloadedState)
|
|
5355
5355
|
);
|
|
5356
5356
|
break;
|
|
5357
|
-
case
|
|
5357
|
+
case D.Material:
|
|
5358
5358
|
t.push(
|
|
5359
5359
|
Ve.init(o, this, this.reloadedState)
|
|
5360
5360
|
);
|
|
5361
5361
|
break;
|
|
5362
|
-
case
|
|
5362
|
+
case D.Model:
|
|
5363
5363
|
t.push(We.init(o, this, this.reloadedState));
|
|
5364
5364
|
break;
|
|
5365
|
-
case
|
|
5365
|
+
case D.Module:
|
|
5366
5366
|
this.stepSpecificServices[o.stepName] = {
|
|
5367
5367
|
module: await et(o.data.module)
|
|
5368
5368
|
}, t.push(
|
|
5369
5369
|
Ia.init(o, this, this.reloadedState)
|
|
5370
5370
|
);
|
|
5371
5371
|
break;
|
|
5372
|
-
case
|
|
5372
|
+
case D.Picture:
|
|
5373
5373
|
t.push(
|
|
5374
5374
|
Xe.init(o, this, this.reloadedState)
|
|
5375
5375
|
);
|
|
5376
5376
|
break;
|
|
5377
|
-
case
|
|
5377
|
+
case D.Question:
|
|
5378
5378
|
t.push(
|
|
5379
5379
|
qe.init(o, this, this.reloadedState)
|
|
5380
5380
|
);
|
|
5381
5381
|
break;
|
|
5382
|
-
case
|
|
5382
|
+
case D.Shape:
|
|
5383
5383
|
t.push(sA.init(o, this, this.reloadedState));
|
|
5384
5384
|
break;
|
|
5385
|
-
case
|
|
5385
|
+
case D.Text:
|
|
5386
5386
|
t.push(K.init(o, this, this.reloadedState));
|
|
5387
5387
|
break;
|
|
5388
5388
|
}
|
|
@@ -5650,7 +5650,7 @@ class Ta extends W {
|
|
|
5650
5650
|
const A = this.manager.getRegionElements(this.step.stepName) || [];
|
|
5651
5651
|
if (A.length !== 0)
|
|
5652
5652
|
try {
|
|
5653
|
-
return
|
|
5653
|
+
return fA(A[0].id, this.manager.getAllLayoutData()).colors;
|
|
5654
5654
|
} catch (e) {
|
|
5655
5655
|
console.error(e);
|
|
5656
5656
|
}
|
|
@@ -5989,24 +5989,24 @@ class Xa extends W {
|
|
|
5989
5989
|
class wA {
|
|
5990
5990
|
static get(A, e) {
|
|
5991
5991
|
switch (e.type) {
|
|
5992
|
-
case
|
|
5992
|
+
case D.Information:
|
|
5993
5993
|
return new Xa(A, e);
|
|
5994
|
-
case
|
|
5994
|
+
case D.Question:
|
|
5995
5995
|
return new ja(A, e);
|
|
5996
|
-
case
|
|
5996
|
+
case D.Text:
|
|
5997
5997
|
return new Wa(A, e);
|
|
5998
|
-
case
|
|
5998
|
+
case D.Illustration:
|
|
5999
5999
|
return new Ta(A, e);
|
|
6000
|
-
case
|
|
6000
|
+
case D.Picture:
|
|
6001
6001
|
return new Ka(A, e);
|
|
6002
|
-
case
|
|
6002
|
+
case D.Shape:
|
|
6003
6003
|
return new Va(A, e);
|
|
6004
|
-
case
|
|
6004
|
+
case D.Material:
|
|
6005
6005
|
return new Oa(A, e);
|
|
6006
|
-
case
|
|
6006
|
+
case D.Model:
|
|
6007
6007
|
return new za(A, e);
|
|
6008
|
-
case
|
|
6009
|
-
return new
|
|
6008
|
+
case D.Frame:
|
|
6009
|
+
return new hi(A, e);
|
|
6010
6010
|
default:
|
|
6011
6011
|
throw new k(`Step type ${e.type} not yet supported in Core SDK`);
|
|
6012
6012
|
}
|
|
@@ -6250,7 +6250,7 @@ const at = y`
|
|
|
6250
6250
|
}
|
|
6251
6251
|
}
|
|
6252
6252
|
return [S, Y];
|
|
6253
|
-
}, [C] = await Q(!0),
|
|
6253
|
+
}, [C] = await Q(!0), f = Object.fromEntries(
|
|
6254
6254
|
Object.keys(C).map((M) => [M, C[M].map((S) => S.id)])
|
|
6255
6255
|
), [u] = await Q(!1), m = Object.fromEntries(
|
|
6256
6256
|
Object.keys(u).map((M) => [
|
|
@@ -6277,7 +6277,7 @@ const at = y`
|
|
|
6277
6277
|
S.push({ key: Y, value: P });
|
|
6278
6278
|
M.metadata = S;
|
|
6279
6279
|
}
|
|
6280
|
-
if (
|
|
6280
|
+
if (f) {
|
|
6281
6281
|
const S = [];
|
|
6282
6282
|
for (const [Y, P] of Object.entries(m))
|
|
6283
6283
|
S.push({ key: Y, ids: P });
|
|
@@ -6523,16 +6523,16 @@ class EA {
|
|
|
6523
6523
|
return this.workflowManager;
|
|
6524
6524
|
}
|
|
6525
6525
|
async createPreviewImage(A, e) {
|
|
6526
|
-
var C,
|
|
6526
|
+
var C, f;
|
|
6527
6527
|
const t = this.workflowManager.getWorkflow(), a = (C = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : C.lookAtAnimation;
|
|
6528
6528
|
if (A) {
|
|
6529
6529
|
if (!a)
|
|
6530
6530
|
throw new Error("Failed to generate cart preview image!");
|
|
6531
|
-
return await ((
|
|
6531
|
+
return await ((f = this.workflowManager.getPreviewService()) == null ? void 0 : f.renderSceneScreenshot(e ?? 512, a)) || "";
|
|
6532
6532
|
}
|
|
6533
6533
|
let n = 2048;
|
|
6534
6534
|
e && e <= 2048 && (n = e);
|
|
6535
|
-
const i =
|
|
6535
|
+
const i = DA(n, n), s = this.commandContext.getAllLayouts(), o = t.defaultPreviewPanelIndex || 0, r = t.panels[o], g = s.find((u) => {
|
|
6536
6536
|
var m;
|
|
6537
6537
|
return ((m = u.layoutState) == null ? void 0 : m.layout.panelId) === (r == null ? void 0 : r.name);
|
|
6538
6538
|
}) || s[0], B = g.layoutState.layout.previewRegion ? {
|
|
@@ -6557,7 +6557,7 @@ class EA {
|
|
|
6557
6557
|
await (await Re.from(d, h, {
|
|
6558
6558
|
anonymousCrossOrigin: !0,
|
|
6559
6559
|
ignoreDimensions: !1,
|
|
6560
|
-
createCanvas:
|
|
6560
|
+
createCanvas: DA,
|
|
6561
6561
|
createImage: Se,
|
|
6562
6562
|
DOMParser: xe(),
|
|
6563
6563
|
fetch: qA
|
|
@@ -6701,7 +6701,7 @@ class EA {
|
|
|
6701
6701
|
const A = HA(this.getCommandContext().getState());
|
|
6702
6702
|
if (!A)
|
|
6703
6703
|
throw new k("Internal state is undefined! Cannot copy experience!");
|
|
6704
|
-
const e = JSON.stringify(A.transaction), t = this.getWorkflowManager().getWorkflow(), a = new
|
|
6704
|
+
const e = JSON.stringify(A.transaction), t = this.getWorkflowManager().getWorkflow(), a = new wi({}), n = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
|
|
6705
6705
|
if (!n)
|
|
6706
6706
|
throw new k("Integration product id is undefined!");
|
|
6707
6707
|
return await a.initFromIntegrationProduct(n), await a.getWorkflowExperience(t.id, e, void 0);
|
|
@@ -6728,7 +6728,7 @@ class EA {
|
|
|
6728
6728
|
* @returns Returns true when a valid handle is implemented for a given step type. Certain steps don't support handles, such as silent illustrations.
|
|
6729
6729
|
*/
|
|
6730
6730
|
stepHasHandle(A) {
|
|
6731
|
-
return A.type !==
|
|
6731
|
+
return A.type !== D.SilentIllustration && A.type !== D.ProductOverlay;
|
|
6732
6732
|
}
|
|
6733
6733
|
getExportedData() {
|
|
6734
6734
|
var a;
|
|
@@ -6833,7 +6833,7 @@ const sn = [
|
|
|
6833
6833
|
},
|
|
6834
6834
|
d
|
|
6835
6835
|
),
|
|
6836
|
-
new
|
|
6836
|
+
new De(l, i, w)
|
|
6837
6837
|
];
|
|
6838
6838
|
};
|
|
6839
6839
|
return (await Promise.all(t.data.regions.map((r) => o(r)))).flat();
|
|
@@ -6881,7 +6881,7 @@ const sn = [
|
|
|
6881
6881
|
break;
|
|
6882
6882
|
}
|
|
6883
6883
|
}
|
|
6884
|
-
const
|
|
6884
|
+
const f = (p) => {
|
|
6885
6885
|
const F = c.find((S) => S.panelId === p.panelId);
|
|
6886
6886
|
if (!F)
|
|
6887
6887
|
throw new z(p);
|
|
@@ -6905,7 +6905,7 @@ const sn = [
|
|
|
6905
6905
|
);
|
|
6906
6906
|
}, u = t.data.regions;
|
|
6907
6907
|
try {
|
|
6908
|
-
return u.map(
|
|
6908
|
+
return u.map(f);
|
|
6909
6909
|
} catch (p) {
|
|
6910
6910
|
return console.error(p), [];
|
|
6911
6911
|
}
|
|
@@ -7041,7 +7041,7 @@ const sn = [
|
|
|
7041
7041
|
}, dn = async (c, A, e) => {
|
|
7042
7042
|
const t = [], n = (() => {
|
|
7043
7043
|
var r, g;
|
|
7044
|
-
return A.type ===
|
|
7044
|
+
return A.type === D.ProductOverlay ? e || ((r = A.data.asset) == null ? void 0 : r.fileLink) || "" : ((g = A.data.asset) == null ? void 0 : g.fileLink) || "";
|
|
7045
7045
|
})(), s = (() => n.endsWith(".jpeg") || n.endsWith(".jpg") || n.endsWith(".png") ? v.Image : n.endsWith(".svg") ? v.Illustration : v.Illustration)(), o = A.data.regions;
|
|
7046
7046
|
if (s === "image")
|
|
7047
7047
|
try {
|
|
@@ -7059,7 +7059,7 @@ const sn = [
|
|
|
7059
7059
|
height: r.height,
|
|
7060
7060
|
layer: r.layer,
|
|
7061
7061
|
layerIndex: r.layerIndex,
|
|
7062
|
-
productOverlay: A.type ===
|
|
7062
|
+
productOverlay: A.type === D.ProductOverlay ? !0 : void 0,
|
|
7063
7063
|
scaleX: 1,
|
|
7064
7064
|
scaleY: 1,
|
|
7065
7065
|
rotation: r.rotation,
|
|
@@ -7098,7 +7098,7 @@ const sn = [
|
|
|
7098
7098
|
scaleX: 1,
|
|
7099
7099
|
scaleY: 1,
|
|
7100
7100
|
rotation: B.rotation,
|
|
7101
|
-
productOverlay: A.type ===
|
|
7101
|
+
productOverlay: A.type === D.ProductOverlay ? !0 : void 0,
|
|
7102
7102
|
excludeFromExport: A.data.excludeFromPrint
|
|
7103
7103
|
};
|
|
7104
7104
|
t.push(new L(d, l));
|
|
@@ -7107,11 +7107,11 @@ const sn = [
|
|
|
7107
7107
|
return t;
|
|
7108
7108
|
}, wn = async (c, A, e, t) => {
|
|
7109
7109
|
const a = [], n = e.data, i = 30, s = (E) => E.vertical ? "center" : E.textAlign || "center", o = () => {
|
|
7110
|
-
var
|
|
7110
|
+
var f;
|
|
7111
7111
|
const E = t.option;
|
|
7112
7112
|
if (!E)
|
|
7113
7113
|
return;
|
|
7114
|
-
const Q = ((
|
|
7114
|
+
const Q = ((f = E.variants) == null ? void 0 : f.find((u) => u.id === n.fontVariantId)) || NA(E);
|
|
7115
7115
|
if (!Q || !Q.asset)
|
|
7116
7116
|
return;
|
|
7117
7117
|
A[t.stepName] = { selectedVariants: [Q] };
|
|
@@ -7138,7 +7138,7 @@ const sn = [
|
|
|
7138
7138
|
return C == null ? void 0 : C.color;
|
|
7139
7139
|
}, w = n.color || await d(t.data), h = t.data.regions;
|
|
7140
7140
|
for (const E of h) {
|
|
7141
|
-
const Q = c.find((
|
|
7141
|
+
const Q = c.find((f) => f.panelId === E.panelId);
|
|
7142
7142
|
if (!Q)
|
|
7143
7143
|
continue;
|
|
7144
7144
|
const C = {
|
|
@@ -7163,7 +7163,7 @@ const sn = [
|
|
|
7163
7163
|
y: E.top
|
|
7164
7164
|
};
|
|
7165
7165
|
if (g) {
|
|
7166
|
-
const [
|
|
7166
|
+
const [f, u] = uA(
|
|
7167
7167
|
t.data.size || i,
|
|
7168
7168
|
g,
|
|
7169
7169
|
E,
|
|
@@ -7183,7 +7183,7 @@ const sn = [
|
|
|
7183
7183
|
new L(
|
|
7184
7184
|
{
|
|
7185
7185
|
...C,
|
|
7186
|
-
fontSize:
|
|
7186
|
+
fontSize: f,
|
|
7187
7187
|
text: C.curved ? C.text : (u || []).join(`
|
|
7188
7188
|
`)
|
|
7189
7189
|
},
|
|
@@ -7209,18 +7209,18 @@ const sn = [
|
|
|
7209
7209
|
const s = A.steps.find((o) => o.stepName === i.name);
|
|
7210
7210
|
if (s)
|
|
7211
7211
|
switch (s.type) {
|
|
7212
|
-
case
|
|
7212
|
+
case D.DigitalContent:
|
|
7213
7213
|
a.push(
|
|
7214
7214
|
...await on(e, i, s)
|
|
7215
7215
|
);
|
|
7216
7216
|
break;
|
|
7217
|
-
case
|
|
7218
|
-
case
|
|
7217
|
+
case D.Frame:
|
|
7218
|
+
case D.Photo:
|
|
7219
7219
|
a.push(
|
|
7220
7220
|
...await rn(e, n, i, s)
|
|
7221
7221
|
);
|
|
7222
7222
|
break;
|
|
7223
|
-
case
|
|
7223
|
+
case D.Illustration:
|
|
7224
7224
|
a.push(
|
|
7225
7225
|
...await cn(
|
|
7226
7226
|
e,
|
|
@@ -7230,20 +7230,20 @@ const sn = [
|
|
|
7230
7230
|
)
|
|
7231
7231
|
);
|
|
7232
7232
|
break;
|
|
7233
|
-
case
|
|
7233
|
+
case D.Module:
|
|
7234
7234
|
a.push(...await gn(e, i, s));
|
|
7235
7235
|
break;
|
|
7236
|
-
case
|
|
7236
|
+
case D.Picture:
|
|
7237
7237
|
a.push(
|
|
7238
7238
|
...await ln(e, n, i, s)
|
|
7239
7239
|
);
|
|
7240
7240
|
break;
|
|
7241
|
-
case
|
|
7241
|
+
case D.Shape:
|
|
7242
7242
|
a.push(
|
|
7243
7243
|
...await Bn(e, n, i, s)
|
|
7244
7244
|
);
|
|
7245
7245
|
break;
|
|
7246
|
-
case
|
|
7246
|
+
case D.Text:
|
|
7247
7247
|
a.push(
|
|
7248
7248
|
...await wn(e, n, i, s)
|
|
7249
7249
|
);
|
|
@@ -7251,7 +7251,7 @@ const sn = [
|
|
|
7251
7251
|
}
|
|
7252
7252
|
}
|
|
7253
7253
|
for (const i of A.steps)
|
|
7254
|
-
i.type !==
|
|
7254
|
+
i.type !== D.SilentIllustration && i.type !== D.ProductOverlay || En(i, n) && a.push(
|
|
7255
7255
|
...await dn(e, i, t)
|
|
7256
7256
|
);
|
|
7257
7257
|
return a;
|
|
@@ -7273,7 +7273,7 @@ class hA {
|
|
|
7273
7273
|
}
|
|
7274
7274
|
}
|
|
7275
7275
|
const Cn = () => new Promise((c, A) => {
|
|
7276
|
-
const t =
|
|
7276
|
+
const t = DA().getContext("webgl2");
|
|
7277
7277
|
c(!!t);
|
|
7278
7278
|
}), Qn = Cn();
|
|
7279
7279
|
class un {
|
|
@@ -7411,7 +7411,7 @@ class mn extends ze {
|
|
|
7411
7411
|
ignoreClear: !0,
|
|
7412
7412
|
ignoreMouse: !0,
|
|
7413
7413
|
enableRedraw: !1,
|
|
7414
|
-
createCanvas:
|
|
7414
|
+
createCanvas: DA,
|
|
7415
7415
|
createImage: Se,
|
|
7416
7416
|
DOMParser: xe(),
|
|
7417
7417
|
fetch: qA
|
|
@@ -7419,18 +7419,18 @@ class mn extends ze {
|
|
|
7419
7419
|
B.resize(s, o), await B.render(), this.onRender();
|
|
7420
7420
|
}
|
|
7421
7421
|
}
|
|
7422
|
-
const
|
|
7422
|
+
const Si = (c, A) => {
|
|
7423
7423
|
const e = [];
|
|
7424
7424
|
return c.forEach((t) => {
|
|
7425
7425
|
const a = A.steps.find((n) => n.stepName === t.stepName);
|
|
7426
|
-
(a == null ? void 0 : a.type) ===
|
|
7426
|
+
(a == null ? void 0 : a.type) === D.Text && t.stepAspectType === "Text" && e.push({
|
|
7427
7427
|
name: a.stepName,
|
|
7428
7428
|
data: {
|
|
7429
7429
|
text: t.value
|
|
7430
7430
|
}
|
|
7431
7431
|
});
|
|
7432
7432
|
}), e;
|
|
7433
|
-
},
|
|
7433
|
+
}, xi = async (c, A, e, t) => {
|
|
7434
7434
|
let a = {
|
|
7435
7435
|
serializableWorkflow: { steps: [] },
|
|
7436
7436
|
layouts: {}
|
|
@@ -7537,7 +7537,7 @@ const xi = (c, A) => {
|
|
|
7537
7537
|
}
|
|
7538
7538
|
}
|
|
7539
7539
|
}
|
|
7540
|
-
`,
|
|
7540
|
+
`, fn = y`
|
|
7541
7541
|
${st}
|
|
7542
7542
|
query GetBundle($id: String!) {
|
|
7543
7543
|
bundles(ids: [$id]) {
|
|
@@ -7559,7 +7559,7 @@ const xi = (c, A) => {
|
|
|
7559
7559
|
}
|
|
7560
7560
|
}
|
|
7561
7561
|
}
|
|
7562
|
-
`,
|
|
7562
|
+
`, Dn = y`
|
|
7563
7563
|
query GetBundleStakeholders($id: String!) {
|
|
7564
7564
|
bundles(ids: [$id]) {
|
|
7565
7565
|
id
|
|
@@ -8071,39 +8071,51 @@ class On {
|
|
|
8071
8071
|
A && (this.state = JSON.parse(A));
|
|
8072
8072
|
}
|
|
8073
8073
|
applyStateToWorkflowExperience(A) {
|
|
8074
|
-
var
|
|
8075
|
-
if (!this.state || !((
|
|
8074
|
+
var i;
|
|
8075
|
+
if (!this.state || !((i = A == null ? void 0 : A.getWorkflowManager()) != null && i.getModelContainer()))
|
|
8076
8076
|
return;
|
|
8077
|
-
const e =
|
|
8078
|
-
(s) => s.transactionId === A.getWorkflowManager().getTransaction().id
|
|
8079
|
-
)
|
|
8077
|
+
const e = this.state.transactions.find(
|
|
8078
|
+
(s) => s.transactionId === A.getWorkflowManager().getTransaction().id
|
|
8079
|
+
);
|
|
8080
8080
|
if (!e)
|
|
8081
8081
|
return;
|
|
8082
|
-
const t = this.
|
|
8083
|
-
|
|
8084
|
-
A.getWorkflowManager().getPreviewService()
|
|
8085
|
-
), a = A.getWorkflowManager().getModelContainer();
|
|
8086
|
-
a.position = t.position, a.rotation = t.rotation, a.scale = t.scale;
|
|
8087
|
-
}
|
|
8088
|
-
setWorkflowExperienceTransform(A, e) {
|
|
8089
|
-
var s;
|
|
8090
|
-
if (!((s = A == null ? void 0 : A.getWorkflowManager()) != null && s.getModelContainer()))
|
|
8082
|
+
const t = this.getTransformToApply(e);
|
|
8083
|
+
if (!t)
|
|
8091
8084
|
return;
|
|
8092
|
-
const
|
|
8093
|
-
|
|
8085
|
+
const a = this.flipTransform(
|
|
8086
|
+
t,
|
|
8094
8087
|
A.getWorkflowManager().getPreviewService()
|
|
8095
|
-
),
|
|
8096
|
-
|
|
8097
|
-
|
|
8088
|
+
), n = A.getWorkflowManager().getModelContainer();
|
|
8089
|
+
n.position = a.position, n.rotation = a.rotation, n.scale = a.scale;
|
|
8090
|
+
}
|
|
8091
|
+
getTransformToApply(A) {
|
|
8092
|
+
return A.activeTransform && A.transforms ? A.transforms[A.activeTransform] : A.transform;
|
|
8093
|
+
}
|
|
8094
|
+
updateWorkflowExperienceTransform(A, e, t) {
|
|
8095
|
+
const a = A.getWorkflowManager().getTransaction().id;
|
|
8098
8096
|
this.state ? this.state.transactions || (this.state.transactions = []) : this.state = {
|
|
8099
8097
|
transactions: []
|
|
8100
8098
|
};
|
|
8101
|
-
const
|
|
8102
|
-
|
|
8103
|
-
transactionId:
|
|
8104
|
-
|
|
8099
|
+
const n = this.state.transactions.find((i) => i.transactionId === a);
|
|
8100
|
+
n ? (n.transforms || (n.transforms = {}), n.transforms[e] = t) : this.state.transactions.push({
|
|
8101
|
+
transactionId: a,
|
|
8102
|
+
activeTransform: e,
|
|
8103
|
+
transforms: { [e]: t }
|
|
8105
8104
|
});
|
|
8106
8105
|
}
|
|
8106
|
+
activateWorkflowExperienceTransform(A, e) {
|
|
8107
|
+
var o, r;
|
|
8108
|
+
if (!((o = A == null ? void 0 : A.getWorkflowManager()) != null && o.getModelContainer()) || !this.state)
|
|
8109
|
+
return;
|
|
8110
|
+
const t = A.getWorkflowManager().getTransaction().id, a = this.state.transactions.find((g) => g.transactionId === t), n = (r = a == null ? void 0 : a.transforms) == null ? void 0 : r[e];
|
|
8111
|
+
if (!n)
|
|
8112
|
+
return;
|
|
8113
|
+
const i = this.flipTransform(
|
|
8114
|
+
n,
|
|
8115
|
+
A.getWorkflowManager().getPreviewService()
|
|
8116
|
+
), s = A.getWorkflowManager().getModelContainer();
|
|
8117
|
+
s.position = i.position, s.rotation = i.rotation, s.scale = i.scale, a.activeTransform = e;
|
|
8118
|
+
}
|
|
8107
8119
|
removeStateForTransaction(A) {
|
|
8108
8120
|
if (!this.state || !this.state.transactions)
|
|
8109
8121
|
return;
|
|
@@ -8608,7 +8620,7 @@ class pe {
|
|
|
8608
8620
|
}
|
|
8609
8621
|
async getAllStakeholders() {
|
|
8610
8622
|
const A = await N.getShadowGraphqlClient().query({
|
|
8611
|
-
query:
|
|
8623
|
+
query: Dn,
|
|
8612
8624
|
errorPolicy: "all",
|
|
8613
8625
|
variables: {
|
|
8614
8626
|
id: this.id
|
|
@@ -8661,8 +8673,11 @@ class pe {
|
|
|
8661
8673
|
await this.injectExperienceIntoPreviewService(e);
|
|
8662
8674
|
A && A.registerModelLoadEventListener && A.registerModelLoadEventListener(this.onModelLoadEvent.bind(this)), this.previewService && this.previewService !== A && this.previewService.unregisterModelLoadEventListener && this.previewService.unregisterModelLoadEventListener(this.onModelLoadEvent.bind(this)), this.previewService = A;
|
|
8663
8675
|
}
|
|
8664
|
-
|
|
8665
|
-
return this.bundleStateManager.
|
|
8676
|
+
updateWorkflowExperienceTransform(A, e, t) {
|
|
8677
|
+
return this.bundleStateManager.updateWorkflowExperienceTransform(A, e, t), this.updateBundle();
|
|
8678
|
+
}
|
|
8679
|
+
activateWorkflowExperienceTransform(A, e) {
|
|
8680
|
+
return this.bundleStateManager.activateWorkflowExperienceTransform(A, e), this.updateBundle();
|
|
8666
8681
|
}
|
|
8667
8682
|
onModelLoadEvent(A) {
|
|
8668
8683
|
A.eventType === "unload" || !A.modelContainer || (A.modelContainer.registerMaterialSelectedCallback(() => this.onModelSelectedEvent(A.modelContainer, !0)), A.modelContainer.registerMaterialDeselectedCallback(() => this.onModelSelectedEvent(A.modelContainer, !1)));
|
|
@@ -9446,24 +9461,6 @@ const _n = y`
|
|
|
9446
9461
|
}
|
|
9447
9462
|
}
|
|
9448
9463
|
`, ii = y`
|
|
9449
|
-
query GetIntegrationWithPartnerAndLogo {
|
|
9450
|
-
currentIntegration {
|
|
9451
|
-
id
|
|
9452
|
-
logo
|
|
9453
|
-
theme {
|
|
9454
|
-
id
|
|
9455
|
-
configuration
|
|
9456
|
-
primaryColor
|
|
9457
|
-
secondaryColor
|
|
9458
|
-
textColor
|
|
9459
|
-
}
|
|
9460
|
-
partner {
|
|
9461
|
-
id
|
|
9462
|
-
name
|
|
9463
|
-
}
|
|
9464
|
-
}
|
|
9465
|
-
}
|
|
9466
|
-
`, si = y`
|
|
9467
9464
|
${GA(!1)}
|
|
9468
9465
|
query GetWorkflowForTheme($id: String!) {
|
|
9469
9466
|
workflow(id: $id) {
|
|
@@ -9485,7 +9482,7 @@ const _n = y`
|
|
|
9485
9482
|
}
|
|
9486
9483
|
}
|
|
9487
9484
|
}
|
|
9488
|
-
`,
|
|
9485
|
+
`, si = y`
|
|
9489
9486
|
query GetCustomer($emailAddress: String!) {
|
|
9490
9487
|
customer(emailAddress: $emailAddress) {
|
|
9491
9488
|
id
|
|
@@ -9495,7 +9492,7 @@ const _n = y`
|
|
|
9495
9492
|
}
|
|
9496
9493
|
}
|
|
9497
9494
|
}
|
|
9498
|
-
`,
|
|
9495
|
+
`, oi = y`
|
|
9499
9496
|
mutation CustomerCreate($details: CustomerDetailsInput!) {
|
|
9500
9497
|
customerCreate(details: $details) {
|
|
9501
9498
|
id
|
|
@@ -9505,7 +9502,7 @@ const _n = y`
|
|
|
9505
9502
|
}
|
|
9506
9503
|
}
|
|
9507
9504
|
}
|
|
9508
|
-
`,
|
|
9505
|
+
`, ri = y`
|
|
9509
9506
|
mutation CustomerAuthenticate($loginToken: String!) {
|
|
9510
9507
|
customerAuthenticate(loginToken: $loginToken) {
|
|
9511
9508
|
id
|
|
@@ -9532,11 +9529,11 @@ const _n = y`
|
|
|
9532
9529
|
}
|
|
9533
9530
|
}
|
|
9534
9531
|
}
|
|
9535
|
-
`,
|
|
9532
|
+
`, ci = y`
|
|
9536
9533
|
mutation CustomerGenerateVerificationCode($emailAddress: String!) {
|
|
9537
9534
|
customerGenerateVerificationCode(emailAddress: $emailAddress)
|
|
9538
9535
|
}
|
|
9539
|
-
`,
|
|
9536
|
+
`, gi = y`
|
|
9540
9537
|
mutation CustomerVerifyCode($emailAddress: String!, $verificationCode: String!) {
|
|
9541
9538
|
customerVerifyCode(emailAddress: $emailAddress, verificationCode: $verificationCode) {
|
|
9542
9539
|
id
|
|
@@ -9580,7 +9577,7 @@ const _n = y`
|
|
|
9580
9577
|
(A = i.fontData) != null && A.assetUrl && await _A(i.fontData.assetUrl);
|
|
9581
9578
|
}
|
|
9582
9579
|
}
|
|
9583
|
-
},
|
|
9580
|
+
}, li = async (c, A) => {
|
|
9584
9581
|
var a;
|
|
9585
9582
|
const e = await N.getShadowGraphqlClient().query({
|
|
9586
9583
|
query: ai(((a = A == null ? void 0 : A.assets) == null ? void 0 : a.metadata) || !1),
|
|
@@ -9600,7 +9597,7 @@ const _n = y`
|
|
|
9600
9597
|
}), rA.set({ id: i.option.id }, Promise.resolve(i.option)));
|
|
9601
9598
|
});
|
|
9602
9599
|
}), t;
|
|
9603
|
-
},
|
|
9600
|
+
}, Bi = async (c, A) => {
|
|
9604
9601
|
const t = (await A).find((a) => a.id === c);
|
|
9605
9602
|
if (!t)
|
|
9606
9603
|
throw new Error(`Workflow not found: ${c}`);
|
|
@@ -9609,11 +9606,11 @@ const _n = y`
|
|
|
9609
9606
|
const e = c.map((s) => rA.get({ id: s, options: A })), t = c.filter((s, o) => e[o] === void 0);
|
|
9610
9607
|
if (t.length === 0)
|
|
9611
9608
|
return Promise.all(e);
|
|
9612
|
-
const a =
|
|
9613
|
-
(s) => rA.set({ id: s, options: A },
|
|
9609
|
+
const a = li(t, A), n = t.map(
|
|
9610
|
+
(s) => rA.set({ id: s, options: A }, Bi(s, a))
|
|
9614
9611
|
), i = e.filter((s) => s !== void 0);
|
|
9615
9612
|
return await Promise.all(i.concat(n));
|
|
9616
|
-
}, QA = async (c, A) => (await ct([c], A))[0],
|
|
9613
|
+
}, QA = async (c, A) => (await ct([c], A))[0], di = (c) => c.sort((A, e) => A.index - e.index).map((A) => ({
|
|
9617
9614
|
id: J(),
|
|
9618
9615
|
panelId: A.name,
|
|
9619
9616
|
name: A.name,
|
|
@@ -9628,9 +9625,9 @@ const _n = y`
|
|
|
9628
9625
|
editableArea: A.editableArea
|
|
9629
9626
|
})), TA = (c, A) => {
|
|
9630
9627
|
const e = c.workflowState, t = e ? JSON.parse(e) : void 0;
|
|
9631
|
-
return t ? Object.values(t.layouts).map((a) => a.layout) :
|
|
9628
|
+
return t ? Object.values(t.layouts).map((a) => a.layout) : di(A.panels);
|
|
9632
9629
|
};
|
|
9633
|
-
class
|
|
9630
|
+
class wi {
|
|
9634
9631
|
constructor(A) {
|
|
9635
9632
|
this.updateTransactionState = async (e) => {
|
|
9636
9633
|
try {
|
|
@@ -9660,12 +9657,6 @@ class Ei {
|
|
|
9660
9657
|
throw new Error("Application key required to use Flow Service.");
|
|
9661
9658
|
return new Xn();
|
|
9662
9659
|
}
|
|
9663
|
-
async getIntegration() {
|
|
9664
|
-
return (await N.getShadowGraphqlClient().query({
|
|
9665
|
-
query: ii,
|
|
9666
|
-
errorPolicy: "all"
|
|
9667
|
-
})).data.currentIntegration;
|
|
9668
|
-
}
|
|
9669
9660
|
// TODO: Authentication functions should probably be moved to a separate class.
|
|
9670
9661
|
/**
|
|
9671
9662
|
* Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
|
|
@@ -9731,14 +9722,14 @@ class Ei {
|
|
|
9731
9722
|
const E = s.get(A);
|
|
9732
9723
|
if (E && await this.authenticateCustomerId(E)) {
|
|
9733
9724
|
const C = ((d = (l = this.customer) == null ? void 0 : l.bundleStakeholders) == null ? void 0 : d.find(
|
|
9734
|
-
(
|
|
9725
|
+
(f) => {
|
|
9735
9726
|
var u, m;
|
|
9736
|
-
return (m = (u =
|
|
9727
|
+
return (m = (u = f.bundle) == null ? void 0 : u.transactions) == null ? void 0 : m.some((I) => I.id === A);
|
|
9737
9728
|
}
|
|
9738
9729
|
)) || ((h = (w = this.customer) == null ? void 0 : w.stakeholders) == null ? void 0 : h.find(
|
|
9739
|
-
(
|
|
9730
|
+
(f) => {
|
|
9740
9731
|
var u;
|
|
9741
|
-
return ((u =
|
|
9732
|
+
return ((u = f.transaction) == null ? void 0 : u.id) === A;
|
|
9742
9733
|
}
|
|
9743
9734
|
));
|
|
9744
9735
|
if (C)
|
|
@@ -9749,7 +9740,7 @@ class Ei {
|
|
|
9749
9740
|
}
|
|
9750
9741
|
}
|
|
9751
9742
|
const r = (await e.query({
|
|
9752
|
-
query:
|
|
9743
|
+
query: ii,
|
|
9753
9744
|
errorPolicy: "all",
|
|
9754
9745
|
variables: {
|
|
9755
9746
|
id: a.workflowId
|
|
@@ -9785,7 +9776,7 @@ class Ei {
|
|
|
9785
9776
|
var i;
|
|
9786
9777
|
this.customer = void 0;
|
|
9787
9778
|
const e = N.getShadowGraphqlClient(), a = (await e.query({
|
|
9788
|
-
query:
|
|
9779
|
+
query: si,
|
|
9789
9780
|
errorPolicy: "all",
|
|
9790
9781
|
fetchPolicy: "no-cache",
|
|
9791
9782
|
variables: {
|
|
@@ -9794,7 +9785,7 @@ class Ei {
|
|
|
9794
9785
|
})).data.customer;
|
|
9795
9786
|
if (!a.id) {
|
|
9796
9787
|
const o = (i = (await e.mutate({
|
|
9797
|
-
mutation:
|
|
9788
|
+
mutation: oi,
|
|
9798
9789
|
errorPolicy: "all",
|
|
9799
9790
|
fetchPolicy: "no-cache",
|
|
9800
9791
|
variables: {
|
|
@@ -9826,7 +9817,7 @@ class Ei {
|
|
|
9826
9817
|
if (!a)
|
|
9827
9818
|
return !1;
|
|
9828
9819
|
const i = (s = (await e.mutate({
|
|
9829
|
-
mutation:
|
|
9820
|
+
mutation: ri,
|
|
9830
9821
|
errorPolicy: "all",
|
|
9831
9822
|
fetchPolicy: "no-cache",
|
|
9832
9823
|
variables: {
|
|
@@ -9841,7 +9832,7 @@ class Ei {
|
|
|
9841
9832
|
*/
|
|
9842
9833
|
async generateVerificationCode(A) {
|
|
9843
9834
|
await N.getShadowGraphqlClient().mutate({
|
|
9844
|
-
mutation:
|
|
9835
|
+
mutation: ci,
|
|
9845
9836
|
variables: {
|
|
9846
9837
|
emailAddress: A
|
|
9847
9838
|
}
|
|
@@ -9856,7 +9847,7 @@ class Ei {
|
|
|
9856
9847
|
async verifyCode(A, e) {
|
|
9857
9848
|
var n, i;
|
|
9858
9849
|
const a = (n = (await N.getShadowGraphqlClient().mutate({
|
|
9859
|
-
mutation:
|
|
9850
|
+
mutation: gi,
|
|
9860
9851
|
errorPolicy: "all",
|
|
9861
9852
|
fetchPolicy: "no-cache",
|
|
9862
9853
|
variables: {
|
|
@@ -9906,7 +9897,7 @@ class Ei {
|
|
|
9906
9897
|
async getExistingBundle(A, e, t) {
|
|
9907
9898
|
var g, B, l, d;
|
|
9908
9899
|
const a = x.getMap("bundleOwnerIds"), n = a == null ? void 0 : a.get(A), i = await N.getShadowGraphqlClient().query({
|
|
9909
|
-
query:
|
|
9900
|
+
query: fn,
|
|
9910
9901
|
variables: {
|
|
9911
9902
|
id: A
|
|
9912
9903
|
},
|
|
@@ -9961,10 +9952,10 @@ class Ei {
|
|
|
9961
9952
|
var Q, C;
|
|
9962
9953
|
const E = N.getShadowGraphqlClient();
|
|
9963
9954
|
if (a.type === "transaction") {
|
|
9964
|
-
const { transactionId:
|
|
9955
|
+
const { transactionId: f, readOnly: u } = a, m = await E.query({
|
|
9965
9956
|
query: BA,
|
|
9966
9957
|
variables: {
|
|
9967
|
-
ids: [
|
|
9958
|
+
ids: [f]
|
|
9968
9959
|
},
|
|
9969
9960
|
errorPolicy: "all",
|
|
9970
9961
|
fetchPolicy: "no-cache"
|
|
@@ -9980,7 +9971,7 @@ class Ei {
|
|
|
9980
9971
|
return { transaction: I, workflow: p, readOnly: u };
|
|
9981
9972
|
}
|
|
9982
9973
|
if (a.type === "integration" || a.type === "external") {
|
|
9983
|
-
const
|
|
9974
|
+
const f = async () => {
|
|
9984
9975
|
const p = a.type === "integration" ? { integrationProductId: a.integrationProductId } : {
|
|
9985
9976
|
externalIntegrationId: a.externalIntegrationId,
|
|
9986
9977
|
externalProductId: a.externalProductId
|
|
@@ -10002,7 +9993,7 @@ class Ei {
|
|
|
10002
9993
|
if (!M.product)
|
|
10003
9994
|
throw new U("Failed to create transaction, product not available.");
|
|
10004
9995
|
return M;
|
|
10005
|
-
}, u = QA(a.workflowId, a == null ? void 0 : a.graphql), [m, I] = await Promise.all([
|
|
9996
|
+
}, u = QA(a.workflowId, a == null ? void 0 : a.graphql), [m, I] = await Promise.all([f(), u]);
|
|
10006
9997
|
return { transaction: m, workflow: I };
|
|
10007
9998
|
}
|
|
10008
9999
|
throw new U("No workflow ID provided.");
|
|
@@ -10150,10 +10141,10 @@ class Ei {
|
|
|
10150
10141
|
), H.delayWorkflowStateSync = !0, this.initialized = !0, this.experienceOptions = H, { experienceOptions: H, index: M, options: Y };
|
|
10151
10142
|
});
|
|
10152
10143
|
x.setMap("transactionOwnerIds", h);
|
|
10153
|
-
const
|
|
10144
|
+
const f = (await Promise.all(E)).sort((m, I) => m.index - I.index).map(async (m) => {
|
|
10154
10145
|
const { experienceOptions: I, options: p } = m, F = new EA(this, I);
|
|
10155
10146
|
return await F.getWorkflowManager().getInitializationPromise(), p.type !== "transaction" && this.customer && await F.attachCustomerDetails({ email: this.customer.emailAddress }), F;
|
|
10156
|
-
}), u = await Promise.all(
|
|
10147
|
+
}), u = await Promise.all(f);
|
|
10157
10148
|
return u.forEach((m) => m.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), u;
|
|
10158
10149
|
}
|
|
10159
10150
|
/**
|
|
@@ -10187,10 +10178,7 @@ class Ei {
|
|
|
10187
10178
|
product: a.product,
|
|
10188
10179
|
transaction: a,
|
|
10189
10180
|
layouts: [],
|
|
10190
|
-
stateMutationFunc: async (s) => this.updateTransactionState({
|
|
10191
|
-
...s,
|
|
10192
|
-
context: { transactionOwnerId: a.transactionOwnerId }
|
|
10193
|
-
})
|
|
10181
|
+
stateMutationFunc: async (s) => this.updateTransactionState({ ...s, context: { transactionOwnerId: a.transactionOwnerId } })
|
|
10194
10182
|
}, this.initialized = !0;
|
|
10195
10183
|
}
|
|
10196
10184
|
/**
|
|
@@ -10263,10 +10251,7 @@ class Ei {
|
|
|
10263
10251
|
product: l.product,
|
|
10264
10252
|
transaction: l,
|
|
10265
10253
|
layouts: [],
|
|
10266
|
-
stateMutationFunc: async (d) => this.updateTransactionState({
|
|
10267
|
-
...d,
|
|
10268
|
-
context: { transactionOwnerId: l.transactionOwnerId }
|
|
10269
|
-
}),
|
|
10254
|
+
stateMutationFunc: async (d) => this.updateTransactionState({ ...d, context: { transactionOwnerId: l.transactionOwnerId } }),
|
|
10270
10255
|
readOnly: e
|
|
10271
10256
|
}, this.initialized = !0;
|
|
10272
10257
|
} catch {
|
|
@@ -10352,7 +10337,7 @@ class Ei {
|
|
|
10352
10337
|
e.set(A.partner.id, A.id), x.setMap("partnerCustomerIds", e);
|
|
10353
10338
|
}
|
|
10354
10339
|
}
|
|
10355
|
-
class
|
|
10340
|
+
class Pi {
|
|
10356
10341
|
getInitializationPromise() {
|
|
10357
10342
|
return Promise.resolve();
|
|
10358
10343
|
}
|
|
@@ -10477,8 +10462,8 @@ class Ni {
|
|
|
10477
10462
|
setWorkflowStateSyncEnabled(A) {
|
|
10478
10463
|
}
|
|
10479
10464
|
}
|
|
10480
|
-
var
|
|
10481
|
-
class
|
|
10465
|
+
var Ei = /* @__PURE__ */ ((c) => (c.SelectFrame = "SelectFrame", c.SelectImage = "SelectImage", c.Position = "Position", c))(Ei || {});
|
|
10466
|
+
class hi extends W {
|
|
10482
10467
|
constructor(A, e) {
|
|
10483
10468
|
var t;
|
|
10484
10469
|
super(A, e), this.frameService = (t = this.manager.getStepSpecificServices(this.getId())) == null ? void 0 : t.frameService;
|
|
@@ -10520,42 +10505,42 @@ class Ci extends W {
|
|
|
10520
10505
|
}
|
|
10521
10506
|
export {
|
|
10522
10507
|
$ as AssetNotFoundError,
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10508
|
+
Ri as AssetType,
|
|
10509
|
+
Ui as BringForwardCommand,
|
|
10510
|
+
Gi as BringToBackCommand,
|
|
10511
|
+
vi as BringToFrontCommand,
|
|
10512
|
+
ki as CanvasCommand,
|
|
10528
10513
|
Kn as CollectionProduct,
|
|
10529
|
-
|
|
10514
|
+
Ji as CommandContext,
|
|
10530
10515
|
ta as ConversionDataType,
|
|
10531
10516
|
ea as ConversionLocation,
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10517
|
+
bi as CreateElementCommand,
|
|
10518
|
+
Li as CreateLayoutCommand,
|
|
10519
|
+
Ti as DeleteElementCommand,
|
|
10535
10520
|
CA as FlowExecutionNodeResult,
|
|
10536
10521
|
qn as FlowExecutionResult,
|
|
10537
10522
|
Xn as FlowService,
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10523
|
+
Oi as FontAlignmentCommand,
|
|
10524
|
+
zi as FontColorCommand,
|
|
10525
|
+
Ki as FontSizeCommand,
|
|
10526
|
+
ji as FontSourceCommand,
|
|
10542
10527
|
Ba as FrameService,
|
|
10543
|
-
|
|
10544
|
-
|
|
10528
|
+
Ei as FrameStep,
|
|
10529
|
+
hi as FrameStepHandle,
|
|
10545
10530
|
oe as GlobalPropertyHandle,
|
|
10546
|
-
|
|
10531
|
+
Vi as GroupCommand,
|
|
10547
10532
|
Ta as IllustrationStepHandle,
|
|
10548
10533
|
PA as InformationMessageType,
|
|
10549
10534
|
Xa as InformationStepHandle,
|
|
10550
10535
|
_t as IntegrationType,
|
|
10551
|
-
|
|
10552
|
-
|
|
10536
|
+
Wi as LayoutElementFactory,
|
|
10537
|
+
Xi as LayoutElementType,
|
|
10553
10538
|
z as LayoutNotFoundError,
|
|
10554
10539
|
Oa as MaterialStepHandle,
|
|
10555
10540
|
MA as MisconfigurationError,
|
|
10556
|
-
|
|
10541
|
+
Pi as MockWorkflowManager,
|
|
10557
10542
|
za as ModelStepHandle,
|
|
10558
|
-
|
|
10543
|
+
qi as MoveCommand,
|
|
10559
10544
|
rt as ObjectInput,
|
|
10560
10545
|
$n as ObjectInputType,
|
|
10561
10546
|
FA as OptionNotFoundError,
|
|
@@ -10568,63 +10553,63 @@ export {
|
|
|
10568
10553
|
Ke as PromiseQueue,
|
|
10569
10554
|
ja as QuestionStepHandle,
|
|
10570
10555
|
ze as QueueablePromise,
|
|
10571
|
-
|
|
10556
|
+
Zi as ResizeCommand,
|
|
10572
10557
|
oA as ResourceNotFoundError,
|
|
10573
|
-
|
|
10574
|
-
|
|
10558
|
+
$i as RotateCommand,
|
|
10559
|
+
_i as SendBackwardsCommand,
|
|
10575
10560
|
Va as ShapeStepHandle,
|
|
10576
|
-
|
|
10561
|
+
wi as SpiffCommerceClient,
|
|
10577
10562
|
YA as StakeholderType,
|
|
10578
|
-
|
|
10563
|
+
As as StepAspectType,
|
|
10579
10564
|
W as StepHandle,
|
|
10580
|
-
|
|
10581
|
-
|
|
10565
|
+
es as StepType,
|
|
10566
|
+
ts as TextChangeCommand,
|
|
10582
10567
|
Wa as TextStepHandle,
|
|
10583
10568
|
Vn as Transform,
|
|
10584
10569
|
jn as TransformCollection,
|
|
10585
10570
|
k as UnhandledBehaviorError,
|
|
10586
|
-
|
|
10571
|
+
as as UnitOfMeasurement,
|
|
10587
10572
|
X as Variant,
|
|
10588
10573
|
EA as WorkflowExperienceImpl,
|
|
10589
10574
|
O as assetService,
|
|
10590
10575
|
en as createDesign,
|
|
10591
|
-
|
|
10576
|
+
ns as dataUrlFromExternalUrl,
|
|
10592
10577
|
LA as designService,
|
|
10593
|
-
|
|
10578
|
+
is as determineCorrectFontSizeAndLines,
|
|
10594
10579
|
Ea as digitalContentStepService,
|
|
10595
|
-
|
|
10596
|
-
|
|
10580
|
+
ss as findElement,
|
|
10581
|
+
os as frameDataCache,
|
|
10597
10582
|
VA as frameStepService,
|
|
10598
|
-
|
|
10583
|
+
rs as generate,
|
|
10599
10584
|
hn as generateCommands,
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10585
|
+
cs as generateSVGWithUnknownColors,
|
|
10586
|
+
xi as generateStateFromDesignInputSteps,
|
|
10587
|
+
gs as getAttributesFromArrayBuffer,
|
|
10588
|
+
ls as getAxisAlignedBoundingBox,
|
|
10604
10589
|
la as getBoundedOffsets,
|
|
10605
|
-
|
|
10606
|
-
|
|
10590
|
+
Bs as getFrameData,
|
|
10591
|
+
ds as getSvgElement,
|
|
10607
10592
|
QA as getWorkflow,
|
|
10608
10593
|
ct as getWorkflows,
|
|
10609
10594
|
N as graphQlManager,
|
|
10610
10595
|
IA as illustrationStepService,
|
|
10611
|
-
|
|
10596
|
+
ws as loadFont,
|
|
10612
10597
|
Ve as materialStepService,
|
|
10613
10598
|
We as modelStepService,
|
|
10614
10599
|
Ia as moduleStepService,
|
|
10615
10600
|
j as optionService,
|
|
10616
|
-
|
|
10601
|
+
Es as patternImageDataCache,
|
|
10617
10602
|
x as persistenceService,
|
|
10618
10603
|
Xe as pictureStepService,
|
|
10619
10604
|
qe as questionStepService,
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10605
|
+
hs as registerFetchImplementation,
|
|
10606
|
+
Cs as registerWindowImplementation,
|
|
10607
|
+
Qs as rehydrateSerializedLayout,
|
|
10608
|
+
us as setCanvasModule,
|
|
10624
10609
|
sA as shapeStepService,
|
|
10625
10610
|
da as shortenUrl,
|
|
10626
10611
|
yA as spiffCoreConfiguration,
|
|
10627
|
-
|
|
10612
|
+
Si as stepAspectValuesToDesignInputSteps,
|
|
10628
10613
|
K as textStepService,
|
|
10629
10614
|
Ma as toast
|
|
10630
10615
|
};
|