@spiffcommerce/core 16.8.1-rc.2 → 16.8.1-rc.3
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 +121 -121
- package/dist/index.umd.cjs +17 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createHttpLink as Qt, InMemoryCache as ut, ApolloClient as mt, from as pt, gql as y } from "@apollo/client/core";
|
|
2
|
-
import { fetch as Ae, getAttributesFromArrayBuffer as Me, AssetType as Be, StepType as I, StepAspectType as O, getFrameData as ee, frameDataCache as It, UpdateFramePattern as ye, calculateOffsets as te, LayoutElementType as H, generate as k, CreateElementCommand as J, generateSVGWithUnknownColors as Ye, svgObjectURL as
|
|
2
|
+
import { fetch as Ae, getAttributesFromArrayBuffer as Me, AssetType as Be, StepType as I, StepAspectType as O, getFrameData as ee, frameDataCache as It, UpdateFramePattern as ye, calculateOffsets as te, LayoutElementType as H, generate as k, CreateElementCommand as J, generateSVGWithUnknownColors as Ye, svgObjectURL as FA, fetchAsString as Z, DeleteElementCommand as $, GroupCommand as G, generateDefaultRectangleFrameSvg as de, GetSVGDimensions as Dt, patternImageDataCache as we, fetchAsArrayBuffer as ft, findElement as MA, modifySVGWithElementProperties as Ft, IllustrationColorCommand as VA, IllustrationCacheCommand as Mt, getFontMetrics as yt, getPatternImageData as WA, FontColorCommand as Yt, FontImageFillCommand as JA, applyTextTransformations as XA, determineCorrectFontSizeAndLines as IA, FontSourceCommand as Ee, loadFont as ae, TextChangeCommand as St, FontSizeCommand as xt, createElementNS as Nt, createElement as wA, _loadFontExternalDataURL as ne, UpdateWorkflowStateCommand as he, CommandContext as Rt, createCanvas as yA, getSvgElement as Se, LayoutRenderingPurpose as xe, renderPapyrusComponentAsString as Ne, loadImage as Re, getDomParser as Pe, toBase64 as Ce, getVariant as Pt, generateFrameSVG as Ht, getDefaultVariant as UA, domParser as He, sanitizeSvgTree as Ue, traverse as Ut, xmlSerializer as Ge, CreateLayoutCommand as Gt, sortElementsByLayersWithIndex as vt, AspectType as DA, rehydrateSerializedLayout as AA } from "@spiffcommerce/papyrus";
|
|
3
3
|
import { AssetType as Ls, BringForwardCommand as Os, BringToBackCommand as zs, BringToFrontCommand as Ks, CanvasCommand as js, CommandContext as Vs, CreateElementCommand as Ws, CreateLayoutCommand as Xs, DeleteElementCommand as qs, FontAlignmentCommand as Zs, FontColorCommand as $s, FontSizeCommand as _s, FontSourceCommand as Ai, GroupCommand as ei, LayoutElementFactory as ti, LayoutElementType as ai, MoveCommand as ni, ResizeCommand as si, RotateCommand as ii, SendBackwardsCommand as oi, StepAspectType as ri, StepType as ci, TextChangeCommand as gi, UnitOfMeasurement as li, dataUrlFromExternalUrl as Bi, determineCorrectFontSizeAndLines as di, findElement as wi, frameDataCache as Ei, generate as hi, generateSVGWithUnknownColors as Ci, getAttributesFromArrayBuffer as Qi, getAxisAlignedBoundingBox as ui, getFrameData as mi, getSvgElement as pi, loadFont as Ii, patternImageDataCache as Di, registerFetchImplementation as fi, registerWindowImplementation as Fi, rehydrateSerializedLayout as Mi, setCanvasModule as yi } from "@spiffcommerce/papyrus";
|
|
4
4
|
import { setContext as kt } from "@apollo/client/link/context";
|
|
5
5
|
import { onError as bt } from "@apollo/client/link/error";
|
|
6
|
-
import * as
|
|
6
|
+
import * as TA from "@sentry/browser";
|
|
7
7
|
import { Pith as ve } from "pith";
|
|
8
8
|
import ke from "lodash.debounce";
|
|
9
9
|
import be from "lodash.isequal";
|
|
@@ -21,7 +21,7 @@ class dA extends Te {
|
|
|
21
21
|
super(`ConfigurationError - ${A}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class YA extends dA {
|
|
25
25
|
constructor(A) {
|
|
26
26
|
super(`Option not Configured: ${A.stepTitle}`), this.optionId = (A == null ? void 0 : A.optionId) || "N/A";
|
|
27
27
|
}
|
|
@@ -41,32 +41,32 @@ class lA extends dA {
|
|
|
41
41
|
super(`Resource not found for asset: ${A.name}`), this.asset = A;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
class
|
|
44
|
+
class SA extends dA {
|
|
45
45
|
constructor(A, e) {
|
|
46
46
|
super(`Workflow Misconfiguration: ${A.stepName} - ${e}`), this.step = A;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
class
|
|
49
|
+
class GA extends Te {
|
|
50
50
|
constructor(A) {
|
|
51
51
|
super(`ImplementationError - ${A}`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
class v extends
|
|
54
|
+
class v extends GA {
|
|
55
55
|
constructor(A) {
|
|
56
56
|
super(`Unhandled Behavior Encountered: ${A}`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
class rA extends
|
|
59
|
+
class rA extends GA {
|
|
60
60
|
constructor(A) {
|
|
61
61
|
super(`Parsing Error: ${A}`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
class P extends
|
|
64
|
+
class P extends GA {
|
|
65
65
|
constructor(A) {
|
|
66
66
|
super(`Client Error: ${A}`);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
class
|
|
69
|
+
class vA extends GA {
|
|
70
70
|
constructor(A) {
|
|
71
71
|
super(`Resource Generation Failed: ${A}`);
|
|
72
72
|
}
|
|
@@ -147,7 +147,7 @@ class Lt {
|
|
|
147
147
|
this.serverUrlCallbacks.push(A);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
const
|
|
150
|
+
const xA = new Lt();
|
|
151
151
|
let Le;
|
|
152
152
|
const eA = (g) => {
|
|
153
153
|
Le = g;
|
|
@@ -164,7 +164,7 @@ let Ke;
|
|
|
164
164
|
const Ot = (g) => {
|
|
165
165
|
Ke = g;
|
|
166
166
|
}, zt = () => new Promise((g) => {
|
|
167
|
-
const A =
|
|
167
|
+
const A = xA.getHubUrl(), e = (t) => {
|
|
168
168
|
t.origin === A && (window.removeEventListener("message", e), g(t.data));
|
|
169
169
|
};
|
|
170
170
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", A));
|
|
@@ -179,7 +179,7 @@ const Ot = (g) => {
|
|
|
179
179
|
};
|
|
180
180
|
class jt {
|
|
181
181
|
constructor() {
|
|
182
|
-
this.shadowGraphqlClient = this.constructShadowGraphqlClient(),
|
|
182
|
+
this.shadowGraphqlClient = this.constructShadowGraphqlClient(), xA.addServerUrlCallback(() => {
|
|
183
183
|
this.shadowGraphqlClient = this.constructShadowGraphqlClient();
|
|
184
184
|
});
|
|
185
185
|
}
|
|
@@ -188,13 +188,13 @@ class jt {
|
|
|
188
188
|
}
|
|
189
189
|
constructShadowGraphqlClient() {
|
|
190
190
|
const A = Qt({
|
|
191
|
-
uri: `${
|
|
191
|
+
uri: `${xA.getServerUrl()}/graphql`,
|
|
192
192
|
fetch: Ae
|
|
193
193
|
}), e = kt(async (s, i) => {
|
|
194
194
|
const { headers: o } = i, r = o || {}, c = await Kt(), B = i.bearer ?? c.bearer, l = i.partnerId ?? c.partnerId, d = i.activeIntegration ?? c.activeIntegration, E = i.transactionOwnerId ?? c.transactionOwnerId, C = i.customerToken ?? c.customerToken, w = i.applicationKey ?? c.applicationKey, Q = i.bundleOwnerId ?? c.bundleOwnerId;
|
|
195
|
-
if (
|
|
196
|
-
const h =
|
|
197
|
-
|
|
195
|
+
if (TA && TA.getCurrentHub()) {
|
|
196
|
+
const h = TA.getCurrentHub().traceHeaders();
|
|
197
|
+
Object.entries(h).forEach(([u, f]) => {
|
|
198
198
|
r[u] = f;
|
|
199
199
|
});
|
|
200
200
|
}
|
|
@@ -265,7 +265,7 @@ const N = new jt(), Vt = y`
|
|
|
265
265
|
value
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
`,
|
|
268
|
+
`, kA = (g) => y`
|
|
269
269
|
${g && Vt || ""}
|
|
270
270
|
fragment AssetFields on Asset {
|
|
271
271
|
name
|
|
@@ -281,7 +281,7 @@ const N = new jt(), Vt = y`
|
|
|
281
281
|
${g && "...AssetMetadataFields" || ""}
|
|
282
282
|
}
|
|
283
283
|
`, Wt = y`
|
|
284
|
-
${
|
|
284
|
+
${kA(!1)}
|
|
285
285
|
query GetAssets($keys: [String]!) {
|
|
286
286
|
assets(keys: $keys) {
|
|
287
287
|
...AssetFields
|
|
@@ -606,7 +606,7 @@ const BA = new Aa(), Ve = y`
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
`, ea = y`
|
|
609
|
-
${
|
|
609
|
+
${kA(!1)}
|
|
610
610
|
${ie}
|
|
611
611
|
${Ve}
|
|
612
612
|
query GetOptions($ids: [String]!) {
|
|
@@ -692,7 +692,7 @@ class sa {
|
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
const z = new sa();
|
|
695
|
-
var ia = /* @__PURE__ */ ((g) => (g[g.Orbit = 0] = "Orbit", g[g.Pan = 1] = "Pan", g))(ia || {}), oa = /* @__PURE__ */ ((g) => (g.PerVariation = "PerVariation", g.BaseProduct = "BaseProduct", g))(oa || {}), ra = /* @__PURE__ */ ((g) => (g.Manual = "Manual", g.OnStart = "OnStart", g.OnQuit = "OnQuit", g.OnEnd = "OnEnd", g))(ra || {}), ca = /* @__PURE__ */ ((g) => (g.Email = "Email", g.FirstName = "FirstName", g.LastName = "LastName", g.Phone = "Phone", g))(ca || {}),
|
|
695
|
+
var ia = /* @__PURE__ */ ((g) => (g[g.Orbit = 0] = "Orbit", g[g.Pan = 1] = "Pan", g))(ia || {}), oa = /* @__PURE__ */ ((g) => (g.PerVariation = "PerVariation", g.BaseProduct = "BaseProduct", g))(oa || {}), ra = /* @__PURE__ */ ((g) => (g.Manual = "Manual", g.OnStart = "OnStart", g.OnQuit = "OnQuit", g.OnEnd = "OnEnd", g))(ra || {}), ca = /* @__PURE__ */ ((g) => (g.Email = "Email", g.FirstName = "FirstName", g.LastName = "LastName", g.Phone = "Phone", g))(ca || {}), NA = /* @__PURE__ */ ((g) => (g.Owner = "Owner", g.Approver = "Approver", g.Editor = "Editor", g.Viewer = "Viewer", g))(NA || {});
|
|
696
696
|
const me = y`
|
|
697
697
|
mutation CreateTransaction(
|
|
698
698
|
$integrationProductId: String
|
|
@@ -947,7 +947,7 @@ const me = y`
|
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
`,
|
|
950
|
+
`, EA = y`
|
|
951
951
|
query ReadTransactions($ids: [String]!) {
|
|
952
952
|
transactions(ids: $ids) {
|
|
953
953
|
bulk
|
|
@@ -1423,12 +1423,12 @@ function ua(g, A, e, t) {
|
|
|
1423
1423
|
const i = g, o = Math.max(A.width / e.width, A.height / e.height);
|
|
1424
1424
|
i.zoom = Math.max(o, g.zoom);
|
|
1425
1425
|
const r = e.width * i.zoom, c = e.height * i.zoom;
|
|
1426
|
-
return i.x =
|
|
1426
|
+
return i.x = hA(g.x, A.width - r, 0), i.y = hA(g.y, A.height - c, 0), i;
|
|
1427
1427
|
}
|
|
1428
1428
|
const s = g;
|
|
1429
|
-
return s.x =
|
|
1429
|
+
return s.x = hA(s.x, -a, A.width), s.y = hA(s.y, -n, A.height), s;
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function hA(g, A, e) {
|
|
1432
1432
|
return Math.min(Math.max(g, A), e);
|
|
1433
1433
|
}
|
|
1434
1434
|
class ma {
|
|
@@ -1616,7 +1616,7 @@ class pe {
|
|
|
1616
1616
|
if (this.configuration.type === I.ProductOverlay) {
|
|
1617
1617
|
let l = "";
|
|
1618
1618
|
if ((o = this.product) != null && o.overlayImageUrl && (l = this.product.overlayImageUrl), s = l, !l)
|
|
1619
|
-
throw new
|
|
1619
|
+
throw new SA(this.configuration, "Couldn't find an asset for product overlay step");
|
|
1620
1620
|
}
|
|
1621
1621
|
const i = this.evaluateAssetType();
|
|
1622
1622
|
if (i === H.Image) {
|
|
@@ -1659,7 +1659,7 @@ class pe {
|
|
|
1659
1659
|
}))()), C = {
|
|
1660
1660
|
stepName: this.configuration.stepName,
|
|
1661
1661
|
id: k(),
|
|
1662
|
-
cachedObjectURL: await
|
|
1662
|
+
cachedObjectURL: await FA(E.svg),
|
|
1663
1663
|
src: l,
|
|
1664
1664
|
svg: E.svg,
|
|
1665
1665
|
colors: E.colors,
|
|
@@ -1687,7 +1687,7 @@ class pe {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
async trigger() {
|
|
1689
1689
|
if (!this.configuration.data.regions)
|
|
1690
|
-
throw new
|
|
1690
|
+
throw new SA(this.configuration, "Missing regions.");
|
|
1691
1691
|
if (this.configuration.type === I.SilentIllustration) {
|
|
1692
1692
|
const A = this.configuration.data.regions.map(this.processRegion);
|
|
1693
1693
|
return Promise.all(A);
|
|
@@ -1707,7 +1707,7 @@ class pe {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
1709
1709
|
const pa = async (g) => {
|
|
1710
|
-
const A = `${
|
|
1710
|
+
const A = `${xA.getServicesApiUrl()}/shortener`;
|
|
1711
1711
|
try {
|
|
1712
1712
|
return (await (await fetch(A, {
|
|
1713
1713
|
method: "POST",
|
|
@@ -1717,7 +1717,7 @@ const pa = async (g) => {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
})).json()).shortUrl;
|
|
1719
1719
|
} catch (e) {
|
|
1720
|
-
throw console.error(e), new
|
|
1720
|
+
throw console.error(e), new vA("Failed to shorten URL, see console.");
|
|
1721
1721
|
}
|
|
1722
1722
|
};
|
|
1723
1723
|
class $e {
|
|
@@ -1791,10 +1791,10 @@ class Ia {
|
|
|
1791
1791
|
d.searchParams.append("video", btoa(JSON.stringify([B]))), d.pathname = d.pathname + (d.pathname.slice(-1) === "/" ? "" : "/");
|
|
1792
1792
|
const E = d.toString();
|
|
1793
1793
|
if (E.length >= 2e3)
|
|
1794
|
-
throw new
|
|
1794
|
+
throw new vA("Cannot create QR code, URL too long.");
|
|
1795
1795
|
const C = await pa(E);
|
|
1796
1796
|
if (i(C), !s.data || !s.data.regions)
|
|
1797
|
-
throw new
|
|
1797
|
+
throw new SA(s, "Missing regions.");
|
|
1798
1798
|
const w = await this.regionElements(s), Q = await this.command(C, w, n, s.stepName);
|
|
1799
1799
|
Q && (Q.command && n.getCommandDispatcher()(Q.command), Q.followup && await Q.followup()), await n.setSelectionsAndElements(s.stepName, [], w, async () => {
|
|
1800
1800
|
n.updateStorage(s.stepName, {
|
|
@@ -1945,7 +1945,7 @@ class fa {
|
|
|
1945
1945
|
});
|
|
1946
1946
|
},
|
|
1947
1947
|
() => {
|
|
1948
|
-
throw new
|
|
1948
|
+
throw new vA("Failed to resolve transcoded PDF");
|
|
1949
1949
|
}
|
|
1950
1950
|
)
|
|
1951
1951
|
) : this.loadPatternFromAsset(e, A, t);
|
|
@@ -2132,7 +2132,7 @@ class Fa {
|
|
|
2132
2132
|
if (t.length === 0)
|
|
2133
2133
|
return [];
|
|
2134
2134
|
try {
|
|
2135
|
-
return
|
|
2135
|
+
return MA(
|
|
2136
2136
|
t[0].id,
|
|
2137
2137
|
e.getAllLayoutData()
|
|
2138
2138
|
).colors;
|
|
@@ -2197,7 +2197,7 @@ class Fa {
|
|
|
2197
2197
|
const s = {};
|
|
2198
2198
|
for (const [B, l] of n.entries())
|
|
2199
2199
|
s[B] = { browserValue: l, spotColor: (c = s[B]) == null ? void 0 : c.spotColor };
|
|
2200
|
-
const i = Ft(A, e, t, s), o = await
|
|
2200
|
+
const i = Ft(A, e, t, s), o = await FA(i), r = [];
|
|
2201
2201
|
for (const B of a) {
|
|
2202
2202
|
for (const [l, d] of n.entries())
|
|
2203
2203
|
r.push(new VA(B, l, d));
|
|
@@ -2209,7 +2209,7 @@ class Fa {
|
|
|
2209
2209
|
var d, E;
|
|
2210
2210
|
if (e.length === 0)
|
|
2211
2211
|
return;
|
|
2212
|
-
const s =
|
|
2212
|
+
const s = MA(
|
|
2213
2213
|
e[0].id,
|
|
2214
2214
|
a().map((C) => C.layoutState)
|
|
2215
2215
|
), i = { ...s.colors }, o = {};
|
|
@@ -2250,7 +2250,7 @@ class Fa {
|
|
|
2250
2250
|
async selectVariantCommand(A, e, t, a, n) {
|
|
2251
2251
|
var Q;
|
|
2252
2252
|
if (!A.data || !A.data.regions)
|
|
2253
|
-
throw new
|
|
2253
|
+
throw new SA(A, "Missing regions.");
|
|
2254
2254
|
a(!0);
|
|
2255
2255
|
const s = t.map((h) => new $(h.id));
|
|
2256
2256
|
n.setMandatoryFulfilled(A.stepName, !1);
|
|
@@ -2260,7 +2260,7 @@ class Fa {
|
|
|
2260
2260
|
const o = i.fileLink;
|
|
2261
2261
|
if (!o)
|
|
2262
2262
|
throw new lA(i);
|
|
2263
|
-
const r = await Ye(await this.getIllustrationBody(o)), c = await
|
|
2263
|
+
const r = await Ye(await this.getIllustrationBody(o)), c = await FA(r.svg), B = (h) => {
|
|
2264
2264
|
const u = n.getLayouts().find((p) => p.panelId === h.panelId);
|
|
2265
2265
|
if (!u)
|
|
2266
2266
|
throw new L(h);
|
|
@@ -2297,12 +2297,12 @@ class Fa {
|
|
|
2297
2297
|
};
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
|
-
const
|
|
2300
|
+
const fA = new Fa();
|
|
2301
2301
|
class Ma {
|
|
2302
2302
|
async init(A, e, t) {
|
|
2303
2303
|
const a = A.option;
|
|
2304
2304
|
if (!a)
|
|
2305
|
-
throw new
|
|
2305
|
+
throw new YA(A);
|
|
2306
2306
|
if (t)
|
|
2307
2307
|
await this.reload(A, e, t);
|
|
2308
2308
|
else {
|
|
@@ -2320,7 +2320,7 @@ class Ma {
|
|
|
2320
2320
|
t.serializableWorkflow.steps
|
|
2321
2321
|
), i = Object.values(t.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === A.stepName), o = A.option;
|
|
2322
2322
|
if (!o)
|
|
2323
|
-
throw new
|
|
2323
|
+
throw new YA(A);
|
|
2324
2324
|
if (a != null && a.selectedVariants) {
|
|
2325
2325
|
const c = a.selectedVariants[0].id;
|
|
2326
2326
|
if (c) {
|
|
@@ -2376,7 +2376,7 @@ class ya {
|
|
|
2376
2376
|
async init(A, e, t) {
|
|
2377
2377
|
const a = A.option;
|
|
2378
2378
|
if (!a)
|
|
2379
|
-
throw new
|
|
2379
|
+
throw new YA(A);
|
|
2380
2380
|
if (t)
|
|
2381
2381
|
await this.reload(A, e, t);
|
|
2382
2382
|
else {
|
|
@@ -2748,7 +2748,7 @@ class Ra {
|
|
|
2748
2748
|
async init(A, e, t) {
|
|
2749
2749
|
const a = A.option;
|
|
2750
2750
|
if (!a)
|
|
2751
|
-
throw new
|
|
2751
|
+
throw new YA(A);
|
|
2752
2752
|
if (t)
|
|
2753
2753
|
await this.reload(A, e, t);
|
|
2754
2754
|
else {
|
|
@@ -2918,16 +2918,16 @@ class Pa {
|
|
|
2918
2918
|
}
|
|
2919
2919
|
}
|
|
2920
2920
|
const Ha = new Pa(), zA = 30;
|
|
2921
|
-
class
|
|
2921
|
+
class RA extends Error {
|
|
2922
2922
|
constructor(A) {
|
|
2923
|
-
super(A), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
|
2923
|
+
super(A), Object.setPrototypeOf(this, new.target.prototype), this.name = RA.name;
|
|
2924
2924
|
}
|
|
2925
2925
|
}
|
|
2926
2926
|
const Ua = ["‘", "’", "“", "”", `
|
|
2927
2927
|
`];
|
|
2928
|
-
class
|
|
2928
|
+
class PA extends Error {
|
|
2929
2929
|
constructor(A) {
|
|
2930
|
-
super(A), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
|
2930
|
+
super(A), Object.setPrototypeOf(this, new.target.prototype), this.name = PA.name;
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
2933
|
class Ga {
|
|
@@ -3003,7 +3003,7 @@ class Ga {
|
|
|
3003
3003
|
return null;
|
|
3004
3004
|
}
|
|
3005
3005
|
findLayoutElements(A, e) {
|
|
3006
|
-
return A.getRegionElements(e.stepName).map((n) =>
|
|
3006
|
+
return A.getRegionElements(e.stepName).map((n) => MA(n.id, A.getAllLayoutData()));
|
|
3007
3007
|
}
|
|
3008
3008
|
/**
|
|
3009
3009
|
* Get the colors that can be used for a given text step.
|
|
@@ -3080,7 +3080,7 @@ class Ga {
|
|
|
3080
3080
|
fillImage: e
|
|
3081
3081
|
});
|
|
3082
3082
|
for (const r of t) {
|
|
3083
|
-
const c = new
|
|
3083
|
+
const c = new JA(r.id, e);
|
|
3084
3084
|
n(c);
|
|
3085
3085
|
}
|
|
3086
3086
|
}
|
|
@@ -3105,7 +3105,7 @@ class Ga {
|
|
|
3105
3105
|
for (const d of e) {
|
|
3106
3106
|
if (!d.fontData)
|
|
3107
3107
|
throw new v("Failed to resolve font data for text.");
|
|
3108
|
-
const [E, C] =
|
|
3108
|
+
const [E, C] = IA(
|
|
3109
3109
|
d.fontSize,
|
|
3110
3110
|
d.fontData,
|
|
3111
3111
|
{ left: d.x, top: d.y, width: d.width, height: d.height, rotation: d.rotation, panelId: "" },
|
|
@@ -3214,7 +3214,7 @@ class Ga {
|
|
|
3214
3214
|
if (a.length > 0) {
|
|
3215
3215
|
const l = a.map((C) => new Ee(C.id, c));
|
|
3216
3216
|
if (o) {
|
|
3217
|
-
const C = a.map((w) => new
|
|
3217
|
+
const C = a.map((w) => new JA(w.id, o));
|
|
3218
3218
|
l.push(...C);
|
|
3219
3219
|
}
|
|
3220
3220
|
const d = await this.changeInputTextWithRegion(
|
|
@@ -3255,7 +3255,7 @@ class Ga {
|
|
|
3255
3255
|
), E = l.flatMap((w) => w.commands);
|
|
3256
3256
|
if (o) {
|
|
3257
3257
|
const w = l.map(
|
|
3258
|
-
(Q) => new
|
|
3258
|
+
(Q) => new JA(Q.regionElement.id, o)
|
|
3259
3259
|
);
|
|
3260
3260
|
E.push(...w);
|
|
3261
3261
|
}
|
|
@@ -3283,7 +3283,7 @@ class Ga {
|
|
|
3283
3283
|
const E = s.getLayouts().find((Q) => Q.panelId === l.panelId), C = k();
|
|
3284
3284
|
try {
|
|
3285
3285
|
if (!E)
|
|
3286
|
-
throw new
|
|
3286
|
+
throw new PA("Failed to find layout for region: " + l.panelId);
|
|
3287
3287
|
const Q = t.colorOption;
|
|
3288
3288
|
let h;
|
|
3289
3289
|
if (Q && Q.variants) {
|
|
@@ -3322,7 +3322,7 @@ class Ga {
|
|
|
3322
3322
|
}, D = [], m = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
3323
3323
|
if (!p.fontData)
|
|
3324
3324
|
throw new v("Failed to resolve font data for text.");
|
|
3325
|
-
const [Y, F] =
|
|
3325
|
+
const [Y, F] = IA(
|
|
3326
3326
|
p.fontSize,
|
|
3327
3327
|
p.fontData,
|
|
3328
3328
|
{
|
|
@@ -3350,10 +3350,10 @@ class Ga {
|
|
|
3350
3350
|
fontData: a
|
|
3351
3351
|
};
|
|
3352
3352
|
} catch (Q) {
|
|
3353
|
-
throw console.log(Q), new
|
|
3353
|
+
throw console.log(Q), new RA("Error adding font to region");
|
|
3354
3354
|
}
|
|
3355
3355
|
}, B = await Promise.all(t.regions.map(c)).catch((l) => {
|
|
3356
|
-
throw l instanceof
|
|
3356
|
+
throw l instanceof RA ? (Ha.setLatestToast("Failed to load font.", HA.Error), l) : l instanceof PA ? l : new Error(l);
|
|
3357
3357
|
});
|
|
3358
3358
|
return await s.setSelectionsAndElements(
|
|
3359
3359
|
A,
|
|
@@ -3384,7 +3384,7 @@ class Ga {
|
|
|
3384
3384
|
const B = (a || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), l = this.getProcessedInput(B, A.data, i), d = s.getRegionElements(A.stepName), E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
3385
3385
|
for (const p of d)
|
|
3386
3386
|
if (p.region) {
|
|
3387
|
-
const [D, m] =
|
|
3387
|
+
const [D, m] = IA(
|
|
3388
3388
|
e,
|
|
3389
3389
|
t,
|
|
3390
3390
|
p.region,
|
|
@@ -5005,7 +5005,7 @@ async function ot(g) {
|
|
|
5005
5005
|
return new Va();
|
|
5006
5006
|
throw new v(`Failed to resolve Module, Module ${g} not found`);
|
|
5007
5007
|
}
|
|
5008
|
-
var
|
|
5008
|
+
var HA = /* @__PURE__ */ ((g) => (g.Error = "Error", g.Warning = "Warning", g.Info = "Info", g))(HA || {});
|
|
5009
5009
|
const Wa = 1e3;
|
|
5010
5010
|
class De extends qe {
|
|
5011
5011
|
constructor(A) {
|
|
@@ -5543,7 +5543,7 @@ class Xa {
|
|
|
5543
5543
|
break;
|
|
5544
5544
|
case I.Illustration:
|
|
5545
5545
|
t.push(
|
|
5546
|
-
|
|
5546
|
+
fA.init(c, this, this.reloadedState)
|
|
5547
5547
|
);
|
|
5548
5548
|
break;
|
|
5549
5549
|
case I.Material:
|
|
@@ -5911,7 +5911,7 @@ class $a extends j {
|
|
|
5911
5911
|
*/
|
|
5912
5912
|
async selectVariant(A) {
|
|
5913
5913
|
if (this.getCurrentVariant() !== A)
|
|
5914
|
-
return
|
|
5914
|
+
return fA.selectVariant(
|
|
5915
5915
|
this.step,
|
|
5916
5916
|
A.getResource(),
|
|
5917
5917
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -5927,7 +5927,7 @@ class $a extends j {
|
|
|
5927
5927
|
const A = this.manager.getRegionElements(this.step.stepName) || [];
|
|
5928
5928
|
if (A.length !== 0)
|
|
5929
5929
|
try {
|
|
5930
|
-
return
|
|
5930
|
+
return MA(A[0].id, this.manager.getAllLayoutData()).colors;
|
|
5931
5931
|
} catch (e) {
|
|
5932
5932
|
console.error(e);
|
|
5933
5933
|
}
|
|
@@ -5937,7 +5937,7 @@ class $a extends j {
|
|
|
5937
5937
|
*/
|
|
5938
5938
|
setColor(A, e) {
|
|
5939
5939
|
const t = /* @__PURE__ */ new Map();
|
|
5940
|
-
return t.set(A, e),
|
|
5940
|
+
return t.set(A, e), fA.changeColors(
|
|
5941
5941
|
this.step,
|
|
5942
5942
|
this.manager.getRegionElements(this.step.stepName),
|
|
5943
5943
|
this.manager,
|
|
@@ -5949,7 +5949,7 @@ class $a extends j {
|
|
|
5949
5949
|
return this.step.data.colorOption;
|
|
5950
5950
|
}
|
|
5951
5951
|
getAvailableColors() {
|
|
5952
|
-
return this.step.data.colorPickerEnabled ?
|
|
5952
|
+
return this.step.data.colorPickerEnabled ? fA.availableColors(this.step, this.manager) : Promise.resolve([]);
|
|
5953
5953
|
}
|
|
5954
5954
|
hasVaryingSelection() {
|
|
5955
5955
|
return this.step.data.varySelection;
|
|
@@ -6103,7 +6103,7 @@ class nn extends j {
|
|
|
6103
6103
|
...this.manager.getInformationResults(),
|
|
6104
6104
|
{
|
|
6105
6105
|
message: "An issue has occured with test",
|
|
6106
|
-
messageType:
|
|
6106
|
+
messageType: HA.Error,
|
|
6107
6107
|
stepID: this.step.stepName
|
|
6108
6108
|
}
|
|
6109
6109
|
]);
|
|
@@ -6190,7 +6190,7 @@ class nn extends j {
|
|
|
6190
6190
|
...B,
|
|
6191
6191
|
{
|
|
6192
6192
|
message: `${l} - ${this.step.stepTitle}`,
|
|
6193
|
-
messageType:
|
|
6193
|
+
messageType: HA.Error,
|
|
6194
6194
|
stepID: this.step.stepName
|
|
6195
6195
|
}
|
|
6196
6196
|
]);
|
|
@@ -6544,12 +6544,12 @@ const gt = y`
|
|
|
6544
6544
|
for (let W = 0; W < b.selections.length; ++W) {
|
|
6545
6545
|
const q = b.selections[W];
|
|
6546
6546
|
if (V && (!Y || V.option && (V.option.variants || []).length > 1 && !V.data.hideSelectionInCart && !V.data.hideSelectionsInCart)) {
|
|
6547
|
-
const
|
|
6548
|
-
F[
|
|
6547
|
+
const bA = V.stepTitle;
|
|
6548
|
+
F[bA] ? F[bA].push({
|
|
6549
6549
|
id: q.id || "",
|
|
6550
6550
|
name: q.name,
|
|
6551
6551
|
priceModifier: q.priceModifier
|
|
6552
|
-
}) : F[
|
|
6552
|
+
}) : F[bA] = [
|
|
6553
6553
|
{
|
|
6554
6554
|
id: q.id || "",
|
|
6555
6555
|
name: q.name,
|
|
@@ -6756,7 +6756,7 @@ class En {
|
|
|
6756
6756
|
}
|
|
6757
6757
|
}
|
|
6758
6758
|
const KA = new En();
|
|
6759
|
-
class
|
|
6759
|
+
class CA {
|
|
6760
6760
|
constructor(A, e) {
|
|
6761
6761
|
var a;
|
|
6762
6762
|
if (this.renderableScenes = [], this.renderableSceneCallbacks = [], this.debouncedSavedDesignUpdate = ke(async () => {
|
|
@@ -6850,7 +6850,7 @@ class QA {
|
|
|
6850
6850
|
}
|
|
6851
6851
|
let n = 2048;
|
|
6852
6852
|
e && e <= 2048 && (n = e);
|
|
6853
|
-
const s =
|
|
6853
|
+
const s = yA(n, n), i = this.commandContext.getAllLayouts(), o = t.defaultPreviewPanelIndex || 0, r = t.panels[o], c = i.find((f) => {
|
|
6854
6854
|
var p;
|
|
6855
6855
|
return ((p = f.layoutState) == null ? void 0 : p.layout.panelId) === (r == null ? void 0 : r.name);
|
|
6856
6856
|
}) || i[0], B = c.layoutState.layout.previewRegion ? {
|
|
@@ -6865,7 +6865,7 @@ class QA {
|
|
|
6865
6865
|
height: c.layoutState.layout.height
|
|
6866
6866
|
}, l = this.commandContext.getLayoutById(c.layoutState.layout.id), d = s.getContext("2d");
|
|
6867
6867
|
if (!d)
|
|
6868
|
-
throw new
|
|
6868
|
+
throw new vA("Failed to obtain 2D context for preview image creation");
|
|
6869
6869
|
const E = Se(l.layoutState.layout, l.layoutState.elements, {
|
|
6870
6870
|
renderingConfiguration: {
|
|
6871
6871
|
purpose: xe.Print,
|
|
@@ -6875,7 +6875,7 @@ class QA {
|
|
|
6875
6875
|
await (await ve.from(d, C, {
|
|
6876
6876
|
anonymousCrossOrigin: !0,
|
|
6877
6877
|
ignoreDimensions: !1,
|
|
6878
|
-
createCanvas:
|
|
6878
|
+
createCanvas: yA,
|
|
6879
6879
|
createImage: Re,
|
|
6880
6880
|
DOMParser: Pe(),
|
|
6881
6881
|
fetch: Ae
|
|
@@ -7145,7 +7145,7 @@ const hn = [
|
|
|
7145
7145
|
const a = e.data, n = t.option;
|
|
7146
7146
|
if (!n)
|
|
7147
7147
|
return console.error(`No option for step ${t.stepName}.`), [];
|
|
7148
|
-
const s = ((p = n.variants) == null ? void 0 : p.find((m) => m.id === a.illustrationVariantId)) ||
|
|
7148
|
+
const s = ((p = n.variants) == null ? void 0 : p.find((m) => m.id === a.illustrationVariantId)) || UA(n);
|
|
7149
7149
|
if (!s)
|
|
7150
7150
|
return console.error(`No variant with ID: ${a.illustrationVariantId}`), [];
|
|
7151
7151
|
if (!s.asset)
|
|
@@ -7244,7 +7244,7 @@ const hn = [
|
|
|
7244
7244
|
const a = e.data, n = t.option;
|
|
7245
7245
|
if (!n)
|
|
7246
7246
|
return console.error(`No option for step ${t.stepName}.`), [];
|
|
7247
|
-
const s = ((c = n.variants) == null ? void 0 : c.find((l) => l.id === a.pictureVariantId)) ||
|
|
7247
|
+
const s = ((c = n.variants) == null ? void 0 : c.find((l) => l.id === a.pictureVariantId)) || UA(n);
|
|
7248
7248
|
if (!s)
|
|
7249
7249
|
return console.error(`No variant with ID: ${a.pictureVariantId}`), [];
|
|
7250
7250
|
if (!s.asset)
|
|
@@ -7286,7 +7286,7 @@ const hn = [
|
|
|
7286
7286
|
const a = e.data, n = t.option;
|
|
7287
7287
|
if (!n)
|
|
7288
7288
|
return console.error(`No option for step ${t.stepName}.`), [];
|
|
7289
|
-
const s = ((r = n.variants) == null ? void 0 : r.find((c) => c.id === a.colorVariantId)) ||
|
|
7289
|
+
const s = ((r = n.variants) == null ? void 0 : r.find((c) => c.id === a.colorVariantId)) || UA(n);
|
|
7290
7290
|
if (!s)
|
|
7291
7291
|
return console.error(`No variant with ID: ${a.colorVariantId}`), [];
|
|
7292
7292
|
A[t.stepName] = { selectedVariants: [s] };
|
|
@@ -7411,7 +7411,7 @@ const hn = [
|
|
|
7411
7411
|
const w = t.option;
|
|
7412
7412
|
if (!w)
|
|
7413
7413
|
return;
|
|
7414
|
-
const Q = ((u = w.variants) == null ? void 0 : u.find((f) => f.id === n.fontVariantId)) ||
|
|
7414
|
+
const Q = ((u = w.variants) == null ? void 0 : u.find((f) => f.id === n.fontVariantId)) || UA(w);
|
|
7415
7415
|
if (!Q || !Q.asset)
|
|
7416
7416
|
return;
|
|
7417
7417
|
A[t.stepName] = { selectedVariants: [Q] };
|
|
@@ -7463,7 +7463,7 @@ const hn = [
|
|
|
7463
7463
|
y: w.top
|
|
7464
7464
|
};
|
|
7465
7465
|
if (c) {
|
|
7466
|
-
const [u, f] =
|
|
7466
|
+
const [u, f] = IA(
|
|
7467
7467
|
t.data.size || s,
|
|
7468
7468
|
c,
|
|
7469
7469
|
w,
|
|
@@ -7556,7 +7556,7 @@ const hn = [
|
|
|
7556
7556
|
);
|
|
7557
7557
|
return a;
|
|
7558
7558
|
};
|
|
7559
|
-
class
|
|
7559
|
+
class QA {
|
|
7560
7560
|
constructor(A) {
|
|
7561
7561
|
this.handleCompleteRender = null;
|
|
7562
7562
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -7572,8 +7572,8 @@ class uA {
|
|
|
7572
7572
|
return this.layouts;
|
|
7573
7573
|
}
|
|
7574
7574
|
}
|
|
7575
|
-
let
|
|
7576
|
-
const yn = () => (
|
|
7575
|
+
let uA;
|
|
7576
|
+
const yn = () => (uA !== void 0 || (uA = !!yA().getContext("webgl2")), uA);
|
|
7577
7577
|
class Yn {
|
|
7578
7578
|
constructor(A, e, t) {
|
|
7579
7579
|
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.lastModificationID = void 0, this.renderQueue = new Ze(2), this.id = A, this.name = e, this.service = t;
|
|
@@ -7728,7 +7728,7 @@ class Sn extends qe {
|
|
|
7728
7728
|
ignoreClear: !0,
|
|
7729
7729
|
ignoreMouse: !0,
|
|
7730
7730
|
enableRedraw: !1,
|
|
7731
|
-
createCanvas:
|
|
7731
|
+
createCanvas: yA,
|
|
7732
7732
|
createImage: Re,
|
|
7733
7733
|
DOMParser: Pe(),
|
|
7734
7734
|
fetch: Ae
|
|
@@ -8067,13 +8067,13 @@ class jn {
|
|
|
8067
8067
|
}
|
|
8068
8068
|
async createHandle(A) {
|
|
8069
8069
|
switch (A.type) {
|
|
8070
|
-
case
|
|
8070
|
+
case DA.FileUpload:
|
|
8071
8071
|
return new Vn(this.bundle, A);
|
|
8072
|
-
case
|
|
8072
|
+
case DA.Option: {
|
|
8073
8073
|
const e = A.entityId ? await z.getOption(A.entityId) : void 0;
|
|
8074
8074
|
return (e == null ? void 0 : e.type) === "Color" ? new Xn(this.bundle, A, e) : new Et(this.bundle, A, e);
|
|
8075
8075
|
}
|
|
8076
|
-
case
|
|
8076
|
+
case DA.Text:
|
|
8077
8077
|
return new Wn(this.bundle, A);
|
|
8078
8078
|
}
|
|
8079
8079
|
}
|
|
@@ -8663,7 +8663,7 @@ class Fe {
|
|
|
8663
8663
|
return this.globalPropertyStateManager;
|
|
8664
8664
|
}
|
|
8665
8665
|
async getGlobalPropertyTotalSubunits() {
|
|
8666
|
-
return (await this.globalPropertyHandleService.getHandles()).filter((t) => t.getType() ===
|
|
8666
|
+
return (await this.globalPropertyHandleService.getHandles()).filter((t) => t.getType() === DA.Option).map((t) => {
|
|
8667
8667
|
var a;
|
|
8668
8668
|
return ((a = t.getCurrentVariant()) == null ? void 0 : a.getPrice()) || 0;
|
|
8669
8669
|
}).reduce((t, a) => t + a, 0);
|
|
@@ -8836,7 +8836,7 @@ class Fe {
|
|
|
8836
8836
|
variables: {
|
|
8837
8837
|
id: this.id,
|
|
8838
8838
|
details: A,
|
|
8839
|
-
type: e ||
|
|
8839
|
+
type: e || NA.Owner
|
|
8840
8840
|
}
|
|
8841
8841
|
});
|
|
8842
8842
|
if (!((n = t.data) != null && n.bundleAddStakeholder))
|
|
@@ -9078,14 +9078,14 @@ class os {
|
|
|
9078
9078
|
* @returns The nodes contained within the execution.
|
|
9079
9079
|
*/
|
|
9080
9080
|
getNodes() {
|
|
9081
|
-
return this.execution.nodes.map((A) => new
|
|
9081
|
+
return this.execution.nodes.map((A) => new mA(A));
|
|
9082
9082
|
}
|
|
9083
9083
|
/**
|
|
9084
9084
|
* @param type The type of node to return.
|
|
9085
9085
|
* @returns A list of nodes matching the requested type.
|
|
9086
9086
|
*/
|
|
9087
9087
|
getNodesByType(A) {
|
|
9088
|
-
return this.execution.nodes.filter((e) => e.type === A).map((e) => new
|
|
9088
|
+
return this.execution.nodes.filter((e) => e.type === A).map((e) => new mA(e));
|
|
9089
9089
|
}
|
|
9090
9090
|
/**
|
|
9091
9091
|
* @returns A list of input nodes that exist in this execution.
|
|
@@ -9094,7 +9094,7 @@ class os {
|
|
|
9094
9094
|
return this.execution.nodes.filter(
|
|
9095
9095
|
(A) => A.type === "StartTerminal"
|
|
9096
9096
|
/* StartTerminal */
|
|
9097
|
-
).map((A) => new
|
|
9097
|
+
).map((A) => new mA(A));
|
|
9098
9098
|
}
|
|
9099
9099
|
/**
|
|
9100
9100
|
* @returns A list of out put nodes that exist in this execution.
|
|
@@ -9103,7 +9103,7 @@ class os {
|
|
|
9103
9103
|
return this.execution.nodes.filter(
|
|
9104
9104
|
(A) => A.type === "EndTerminal"
|
|
9105
9105
|
/* EndTerminal */
|
|
9106
|
-
).map((A) => new
|
|
9106
|
+
).map((A) => new mA(A));
|
|
9107
9107
|
}
|
|
9108
9108
|
/**
|
|
9109
9109
|
* @returns A date object representing the point in time this execution completed.
|
|
@@ -9120,7 +9120,7 @@ class os {
|
|
|
9120
9120
|
return new Date(this.execution.failedAt);
|
|
9121
9121
|
}
|
|
9122
9122
|
}
|
|
9123
|
-
class
|
|
9123
|
+
class mA {
|
|
9124
9124
|
constructor(A) {
|
|
9125
9125
|
this.node = A;
|
|
9126
9126
|
}
|
|
@@ -9281,7 +9281,7 @@ const gs = y`
|
|
|
9281
9281
|
name
|
|
9282
9282
|
}
|
|
9283
9283
|
`, ws = (g) => y`
|
|
9284
|
-
${
|
|
9284
|
+
${kA(g)}
|
|
9285
9285
|
${ie}
|
|
9286
9286
|
${Ve}
|
|
9287
9287
|
${gs}
|
|
@@ -9696,7 +9696,7 @@ const gs = y`
|
|
|
9696
9696
|
}
|
|
9697
9697
|
}
|
|
9698
9698
|
`, hs = y`
|
|
9699
|
-
${
|
|
9699
|
+
${kA(!1)}
|
|
9700
9700
|
query GetWorkflowForTheme($id: String!) {
|
|
9701
9701
|
workflow(id: $id) {
|
|
9702
9702
|
id
|
|
@@ -9804,7 +9804,7 @@ const gs = y`
|
|
|
9804
9804
|
);
|
|
9805
9805
|
for (let n = 0; n < t.length; ++n) {
|
|
9806
9806
|
const s = t[n];
|
|
9807
|
-
s.src && s.svg && (s.cachedObjectURL = await
|
|
9807
|
+
s.src && s.svg && (s.cachedObjectURL = await FA(s.svg));
|
|
9808
9808
|
}
|
|
9809
9809
|
const a = g.layouts[e].elements.filter((n) => n.type === H.Textbox);
|
|
9810
9810
|
for (let n = 0; n < a.length; ++n) {
|
|
@@ -9845,7 +9845,7 @@ const gs = y`
|
|
|
9845
9845
|
(i) => BA.set({ id: i, options: A }, Ds(i, a))
|
|
9846
9846
|
), s = e.filter((i) => i !== void 0);
|
|
9847
9847
|
return await Promise.all(s.concat(n));
|
|
9848
|
-
},
|
|
9848
|
+
}, pA = async (g, A) => (await Ct([g], A))[0], fs = (g) => g.sort((A, e) => A.index - e.index).map((A) => ({
|
|
9849
9849
|
id: k(),
|
|
9850
9850
|
panelId: A.name,
|
|
9851
9851
|
name: A.name,
|
|
@@ -9903,7 +9903,7 @@ class Fs {
|
|
|
9903
9903
|
const e = x.getMap("bundleOwnerIds");
|
|
9904
9904
|
if (e != null && e.has(A)) {
|
|
9905
9905
|
const s = e.get(A);
|
|
9906
|
-
return LA(s), Promise.resolve({ success: !0, stakeholderType:
|
|
9906
|
+
return LA(s), Promise.resolve({ success: !0, stakeholderType: NA.Owner });
|
|
9907
9907
|
}
|
|
9908
9908
|
const t = x.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
9909
9909
|
if (t.has(A)) {
|
|
@@ -9954,7 +9954,7 @@ class Fs {
|
|
|
9954
9954
|
const s = x.getMap("transactionOwnerIds");
|
|
9955
9955
|
if (s != null && s.has(A)) {
|
|
9956
9956
|
const w = s.get(A);
|
|
9957
|
-
return eA(w), Promise.resolve({ success: !0, stakeholderType:
|
|
9957
|
+
return eA(w), Promise.resolve({ success: !0, stakeholderType: NA.Owner });
|
|
9958
9958
|
}
|
|
9959
9959
|
const i = x.getMap("transactionCustomerIds");
|
|
9960
9960
|
if (i != null && i.has(A)) {
|
|
@@ -10190,7 +10190,7 @@ class Fs {
|
|
|
10190
10190
|
const w = N.getShadowGraphqlClient();
|
|
10191
10191
|
if (a.type === "transaction") {
|
|
10192
10192
|
const { transactionId: u, readOnly: f } = a, p = await w.query({
|
|
10193
|
-
query:
|
|
10193
|
+
query: EA,
|
|
10194
10194
|
variables: {
|
|
10195
10195
|
ids: [u]
|
|
10196
10196
|
},
|
|
@@ -10202,7 +10202,7 @@ class Fs {
|
|
|
10202
10202
|
const D = (h = p.data) == null ? void 0 : h.transactions[0];
|
|
10203
10203
|
if (!D.workflowId)
|
|
10204
10204
|
throw new P("Existing transaction has no workflow ID.");
|
|
10205
|
-
const m = await
|
|
10205
|
+
const m = await pA(D.workflowId);
|
|
10206
10206
|
if (!D.product)
|
|
10207
10207
|
throw new P("Failed to load transaction, product not available.");
|
|
10208
10208
|
return { transaction: D, workflow: m, readOnly: f };
|
|
@@ -10231,7 +10231,7 @@ class Fs {
|
|
|
10231
10231
|
if (!Y.product)
|
|
10232
10232
|
throw new P("Failed to create transaction, product not available.");
|
|
10233
10233
|
return Y;
|
|
10234
|
-
}, f =
|
|
10234
|
+
}, f = pA(a.workflowId, a == null ? void 0 : a.graphql), [p, D] = await Promise.all([u(), f]);
|
|
10235
10235
|
return { transaction: p, workflow: D };
|
|
10236
10236
|
}
|
|
10237
10237
|
throw new P("No workflow ID provided.");
|
|
@@ -10262,7 +10262,7 @@ class Fs {
|
|
|
10262
10262
|
r.transaction,
|
|
10263
10263
|
r.workflow
|
|
10264
10264
|
);
|
|
10265
|
-
if (r.renderableContextService = new
|
|
10265
|
+
if (r.renderableContextService = new QA(
|
|
10266
10266
|
r.layouts
|
|
10267
10267
|
), a.previewService ? (r.previewService = a.previewService, (d = r.product) != null && d.modelUrl && (r.modelContainer = r.previewService.loadModel({
|
|
10268
10268
|
model: r.product.modelUrl,
|
|
@@ -10278,7 +10278,7 @@ class Fs {
|
|
|
10278
10278
|
Q && eA(Q), r.isReloadedTransaction = !0;
|
|
10279
10279
|
}
|
|
10280
10280
|
this.initialized = !0, this.experienceOptions = r;
|
|
10281
|
-
const c = new
|
|
10281
|
+
const c = new CA(this, r);
|
|
10282
10282
|
return await c.getWorkflowManager().getInitializationPromise(), a.type !== "transaction" && this.customer && await c.attachCustomerDetails({ email: this.customer.emailAddress }), c;
|
|
10283
10283
|
}
|
|
10284
10284
|
/**
|
|
@@ -10298,7 +10298,7 @@ class Fs {
|
|
|
10298
10298
|
if (n.length === 0)
|
|
10299
10299
|
return [];
|
|
10300
10300
|
const h = n.map((m) => m.option.transactionId), u = await t.query({
|
|
10301
|
-
query:
|
|
10301
|
+
query: EA,
|
|
10302
10302
|
variables: {
|
|
10303
10303
|
ids: h
|
|
10304
10304
|
},
|
|
@@ -10374,13 +10374,13 @@ class Fs {
|
|
|
10374
10374
|
F.transaction,
|
|
10375
10375
|
F.workflow
|
|
10376
10376
|
);
|
|
10377
|
-
return F.renderableContextService = new
|
|
10377
|
+
return F.renderableContextService = new QA(
|
|
10378
10378
|
F.layouts
|
|
10379
10379
|
), this.initialized = !0, this.experienceOptions = F, { experienceOptions: F, index: D, options: M };
|
|
10380
10380
|
});
|
|
10381
10381
|
x.setMap("transactionOwnerIds", d);
|
|
10382
10382
|
const Q = (await Promise.all(E)).sort((h, u) => h.index - u.index).map(async (h) => {
|
|
10383
|
-
const { experienceOptions: u, options: f } = h, p = new
|
|
10383
|
+
const { experienceOptions: u, options: f } = h, p = new CA(this, u);
|
|
10384
10384
|
return await p.getWorkflowManager().getInitializationPromise(), f.type !== "transaction" && this.customer && await p.attachCustomerDetails({ email: this.customer.emailAddress }), p;
|
|
10385
10385
|
});
|
|
10386
10386
|
return await Promise.all(Q);
|
|
@@ -10433,7 +10433,7 @@ class Fs {
|
|
|
10433
10433
|
const t = N.getShadowGraphqlClient(), a = async () => {
|
|
10434
10434
|
var d, E;
|
|
10435
10435
|
const l = (d = (await t.query({
|
|
10436
|
-
query:
|
|
10436
|
+
query: EA,
|
|
10437
10437
|
variables: { ids: [A] },
|
|
10438
10438
|
fetchPolicy: "no-cache",
|
|
10439
10439
|
errorPolicy: "all"
|
|
@@ -10458,7 +10458,7 @@ class Fs {
|
|
|
10458
10458
|
if (s) {
|
|
10459
10459
|
eA(s);
|
|
10460
10460
|
const l = (i = (await t.query({
|
|
10461
|
-
query:
|
|
10461
|
+
query: EA,
|
|
10462
10462
|
variables: {
|
|
10463
10463
|
ids: [A]
|
|
10464
10464
|
},
|
|
@@ -10506,16 +10506,16 @@ class Fs {
|
|
|
10506
10506
|
if (!this.initialized || !this.experienceOptions)
|
|
10507
10507
|
throw new P("Cannot launch experience: Not initialized.");
|
|
10508
10508
|
if (this.experienceOptions.transaction.workflowId) {
|
|
10509
|
-
const o = await
|
|
10509
|
+
const o = await pA(this.experienceOptions.transaction.workflowId);
|
|
10510
10510
|
if (this.experienceOptions.workflow = o, this.experienceOptions.transaction.workflowState) {
|
|
10511
10511
|
const c = JSON.parse(this.experienceOptions.transaction.workflowState);
|
|
10512
10512
|
this.experienceOptions.layouts = Object.values(c.layouts).map((B) => B.layout), await AA(c), await tA(c), this.experienceOptions.reloadedState = c;
|
|
10513
10513
|
}
|
|
10514
|
-
this.experienceOptions.previewService = t && t(o), this.experienceOptions.renderableContextService = new
|
|
10514
|
+
this.experienceOptions.previewService = t && t(o), this.experienceOptions.renderableContextService = new QA(this.experienceOptions.layouts), (a = this.experienceOptions.product) != null && a.modelUrl && (this.experienceOptions.modelContainer = (n = this.experienceOptions.previewService) == null ? void 0 : n.loadModel({
|
|
10515
10515
|
model: this.experienceOptions.product.modelUrl,
|
|
10516
10516
|
contextService: this.experienceOptions.renderableContextService
|
|
10517
10517
|
}));
|
|
10518
|
-
const r = new
|
|
10518
|
+
const r = new CA(this, this.experienceOptions);
|
|
10519
10519
|
return await r.getWorkflowManager().getInitializationPromise(), r;
|
|
10520
10520
|
}
|
|
10521
10521
|
if (A) {
|
|
@@ -10525,7 +10525,7 @@ class Fs {
|
|
|
10525
10525
|
workflowId: A,
|
|
10526
10526
|
id: this.experienceOptions.transaction.id
|
|
10527
10527
|
}
|
|
10528
|
-
}), r =
|
|
10528
|
+
}), r = pA(A);
|
|
10529
10529
|
if (await Promise.all([o, r]), this.experienceOptions.workflow = await r, e) {
|
|
10530
10530
|
const B = JSON.parse(e);
|
|
10531
10531
|
this.experienceOptions.layouts = Object.values(B.layouts).map((l) => l.layout), await AA(B), await tA(B), this.experienceOptions.reloadedState = B;
|
|
@@ -10534,11 +10534,11 @@ class Fs {
|
|
|
10534
10534
|
this.experienceOptions.transaction,
|
|
10535
10535
|
this.experienceOptions.workflow
|
|
10536
10536
|
);
|
|
10537
|
-
this.experienceOptions.previewService = t && t(await r), this.experienceOptions.renderableContextService = new
|
|
10537
|
+
this.experienceOptions.previewService = t && t(await r), this.experienceOptions.renderableContextService = new QA(this.experienceOptions.layouts), (s = this.experienceOptions.product) != null && s.modelUrl && (this.experienceOptions.modelContainer = (i = this.experienceOptions.previewService) == null ? void 0 : i.loadModel({
|
|
10538
10538
|
model: this.experienceOptions.product.modelUrl,
|
|
10539
10539
|
contextService: this.experienceOptions.renderableContextService
|
|
10540
10540
|
}));
|
|
10541
|
-
const c = new
|
|
10541
|
+
const c = new CA(this, this.experienceOptions);
|
|
10542
10542
|
return await c.getWorkflowManager().getInitializationPromise(), c;
|
|
10543
10543
|
}
|
|
10544
10544
|
throw new P("No workflow ID provided.");
|
|
@@ -10783,7 +10783,7 @@ export {
|
|
|
10783
10783
|
Ws as CreateElementCommand,
|
|
10784
10784
|
Xs as CreateLayoutCommand,
|
|
10785
10785
|
qs as DeleteElementCommand,
|
|
10786
|
-
|
|
10786
|
+
mA as FlowExecutionNodeResult,
|
|
10787
10787
|
os as FlowExecutionResult,
|
|
10788
10788
|
is as FlowService,
|
|
10789
10789
|
Zs as FontAlignmentCommand,
|
|
@@ -10796,19 +10796,19 @@ export {
|
|
|
10796
10796
|
le as GlobalPropertyHandle,
|
|
10797
10797
|
ei as GroupCommand,
|
|
10798
10798
|
$a as IllustrationStepHandle,
|
|
10799
|
-
|
|
10799
|
+
HA as InformationMessageType,
|
|
10800
10800
|
sn as InformationStepHandle,
|
|
10801
10801
|
ti as LayoutElementFactory,
|
|
10802
10802
|
ai as LayoutElementType,
|
|
10803
10803
|
L as LayoutNotFoundError,
|
|
10804
10804
|
_a as MaterialStepHandle,
|
|
10805
|
-
|
|
10805
|
+
SA as MisconfigurationError,
|
|
10806
10806
|
bs as MockWorkflowManager,
|
|
10807
10807
|
An as ModelStepHandle,
|
|
10808
10808
|
ni as MoveCommand,
|
|
10809
10809
|
ht as ObjectInput,
|
|
10810
10810
|
cs as ObjectInputType,
|
|
10811
|
-
|
|
10811
|
+
YA as OptionNotFoundError,
|
|
10812
10812
|
rA as ParseError,
|
|
10813
10813
|
en as PictureStepHandle,
|
|
10814
10814
|
ia as ProductCameraRig,
|
|
@@ -10824,7 +10824,7 @@ export {
|
|
|
10824
10824
|
oi as SendBackwardsCommand,
|
|
10825
10825
|
an as ShapeStepHandle,
|
|
10826
10826
|
Fs as SpiffCommerceClient,
|
|
10827
|
-
|
|
10827
|
+
NA as StakeholderType,
|
|
10828
10828
|
ri as StepAspectType,
|
|
10829
10829
|
j as StepHandle,
|
|
10830
10830
|
ci as StepType,
|
|
@@ -10835,7 +10835,7 @@ export {
|
|
|
10835
10835
|
v as UnhandledBehaviorError,
|
|
10836
10836
|
li as UnitOfMeasurement,
|
|
10837
10837
|
X as Variant,
|
|
10838
|
-
|
|
10838
|
+
CA as WorkflowExperienceImpl,
|
|
10839
10839
|
T as assetService,
|
|
10840
10840
|
dn as createDesign,
|
|
10841
10841
|
Bi as dataUrlFromExternalUrl,
|
|
@@ -10855,10 +10855,10 @@ export {
|
|
|
10855
10855
|
ua as getBoundedOffsets,
|
|
10856
10856
|
mi as getFrameData,
|
|
10857
10857
|
pi as getSvgElement,
|
|
10858
|
-
|
|
10858
|
+
pA as getWorkflow,
|
|
10859
10859
|
Ct as getWorkflows,
|
|
10860
10860
|
N as graphQlManager,
|
|
10861
|
-
|
|
10861
|
+
fA as illustrationStepService,
|
|
10862
10862
|
Ii as loadFont,
|
|
10863
10863
|
_e as materialStepService,
|
|
10864
10864
|
At as modelStepService,
|
|
@@ -10874,7 +10874,7 @@ export {
|
|
|
10874
10874
|
yi as setCanvasModule,
|
|
10875
10875
|
cA as shapeStepService,
|
|
10876
10876
|
pa as shortenUrl,
|
|
10877
|
-
|
|
10877
|
+
xA as spiffCoreConfiguration,
|
|
10878
10878
|
xn as stepAspectValuesToDesignInputSteps,
|
|
10879
10879
|
K as textStepService,
|
|
10880
10880
|
Ha as toast
|