@spiffcommerce/core 32.4.0-beta.a1f69100-8b64-5ab1-b13d-d042fc2f8765 → 32.4.0-beta.cd474f46-545e-5665-a996-1f7685b6328c
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 +2 -0
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +279 -268
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -7,7 +7,7 @@ import { orientation as Cr } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as dn } from "css";
|
8
8
|
import wr from "fuse.js";
|
9
9
|
import { Pith as ma } from "pith";
|
10
|
-
import
|
10
|
+
import ht from "lodash.clonedeep";
|
11
11
|
import { toString as An } from "qrcode";
|
12
12
|
import yr from "svg-path-bbox";
|
13
13
|
import { parse as aa } from "opentype.js";
|
@@ -18,44 +18,44 @@ import Ma from "lodash.chunk";
|
|
18
18
|
import { CognitoIdentityProviderClient as Er, InitiateAuthCommand as Ta, RespondToAuthChallengeCommand as br } from "@aws-sdk/client-cognito-identity-provider";
|
19
19
|
import Br from "dinero.js";
|
20
20
|
import * as Na from "currency-codes";
|
21
|
-
import
|
21
|
+
import Wt from "lodash.isequal";
|
22
22
|
import { split as na } from "unicode-default-word-boundary";
|
23
23
|
import un from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
26
26
|
import Ir from "lodash.omit";
|
27
|
-
var ve = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(ve || {}), U = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(U || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), Pr = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Pr || {}),
|
27
|
+
var ve = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(ve || {}), U = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(U || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), Pr = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Pr || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}), x = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(x || {}), Dr = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Dr || {}), hn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(hn || {}), Fr = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Fr || {}), xr = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(xr || {}), ga = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(ga || {}), kr = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(kr || {}), Ee = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Ee || {}), Mt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Mt || {}), H = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(H || {}), Mr = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(Mr || {});
|
28
28
|
class mn extends Error {
|
29
29
|
constructor(t) {
|
30
30
|
super(t), this.name = this.constructor.name;
|
31
31
|
}
|
32
32
|
}
|
33
|
-
class
|
33
|
+
class Zt extends mn {
|
34
34
|
constructor(t) {
|
35
35
|
super(`ConfigurationError - ${t}`);
|
36
36
|
}
|
37
37
|
}
|
38
|
-
class be extends
|
38
|
+
class be extends Zt {
|
39
39
|
constructor(t) {
|
40
40
|
super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
|
41
41
|
}
|
42
42
|
}
|
43
|
-
class Y extends
|
43
|
+
class Y extends Zt {
|
44
44
|
constructor(t) {
|
45
45
|
super(`Panel not Found: ${t.panelId}`), this.panelId = t?.panelId || "N/A";
|
46
46
|
}
|
47
47
|
}
|
48
|
-
class bt extends
|
48
|
+
class bt extends Zt {
|
49
49
|
constructor(t) {
|
50
50
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
51
51
|
}
|
52
52
|
}
|
53
|
-
class
|
53
|
+
class Jt extends Zt {
|
54
54
|
constructor(t) {
|
55
55
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
56
56
|
}
|
57
57
|
}
|
58
|
-
class Be extends
|
58
|
+
class Be extends Zt {
|
59
59
|
constructor(t, e) {
|
60
60
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
61
61
|
}
|
@@ -75,7 +75,7 @@ class Dt extends Me {
|
|
75
75
|
super(`Parsing Error: ${t}`);
|
76
76
|
}
|
77
77
|
}
|
78
|
-
class
|
78
|
+
class mt extends Me {
|
79
79
|
constructor(t) {
|
80
80
|
super(`Client Error: ${t}`);
|
81
81
|
}
|
@@ -161,7 +161,7 @@ class Qr {
|
|
161
161
|
this.serverUrlCallbacks.push(t);
|
162
162
|
}
|
163
163
|
}
|
164
|
-
const
|
164
|
+
const pt = new Qr();
|
165
165
|
let ra, ia;
|
166
166
|
function zc(n) {
|
167
167
|
ra = n;
|
@@ -169,7 +169,7 @@ function zc(n) {
|
|
169
169
|
function Gc(n) {
|
170
170
|
ia = n;
|
171
171
|
}
|
172
|
-
function
|
172
|
+
function te() {
|
173
173
|
return ra ? new ra().window : (console.log(
|
174
174
|
"DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
|
175
175
|
), window);
|
@@ -197,17 +197,17 @@ const gn = /* @__PURE__ */ new Map(), Ra = /* @__PURE__ */ new Map(), Oa = /* @_
|
|
197
197
|
if (t) return t;
|
198
198
|
const a = (async () => await (await rt(n)).text())();
|
199
199
|
return Oa.set(n, a), a;
|
200
|
-
}, Tt = (n) => n.every((t) => t !== "undefined"),
|
200
|
+
}, Tt = (n) => n.every((t) => t !== "undefined"), se = (n) => Tt([typeof document]) ? document.createElement(n) : te().document.createElement(n), Or = (n, t) => {
|
201
201
|
if (Tt([typeof document]))
|
202
202
|
return document.createElementNS(n, t);
|
203
|
-
const a =
|
203
|
+
const a = te().document.createElement(t);
|
204
204
|
return a.setAttribute("xmlns", n), a;
|
205
205
|
}, dt = () => {
|
206
206
|
if (Tt([typeof DOMParser]))
|
207
207
|
return new DOMParser();
|
208
|
-
const n =
|
208
|
+
const n = te();
|
209
209
|
return new n.DOMParser();
|
210
|
-
}, $r = () => Tt([typeof DOMParser]) ? DOMParser :
|
210
|
+
}, $r = () => Tt([typeof DOMParser]) ? DOMParser : te().DOMParser, Ne = (n, t) => new Promise((e, a) => {
|
211
211
|
t ? pn(n).then(e).catch(a) : rt(n).then((r) => {
|
212
212
|
r.arrayBuffer().then(e).catch(a);
|
213
213
|
}).catch((r) => {
|
@@ -229,7 +229,7 @@ const gn = /* @__PURE__ */ new Map(), Ra = /* @__PURE__ */ new Map(), Oa = /* @_
|
|
229
229
|
}, It = () => {
|
230
230
|
if (Tt([typeof XMLSerializer]))
|
231
231
|
return new XMLSerializer();
|
232
|
-
const n =
|
232
|
+
const n = te();
|
233
233
|
return new n.XMLSerializer();
|
234
234
|
}, $a = (n) => btoa(n), Qe = (n) => {
|
235
235
|
function t() {
|
@@ -296,7 +296,7 @@ let wn;
|
|
296
296
|
const Hr = (n) => {
|
297
297
|
wn = n;
|
298
298
|
}, jr = () => new Promise((n) => {
|
299
|
-
const t =
|
299
|
+
const t = pt.getHubUrl(), e = (a) => {
|
300
300
|
a.origin === t && (window.removeEventListener("message", e), n(a.data));
|
301
301
|
};
|
302
302
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
@@ -309,13 +309,13 @@ const Hr = (n) => {
|
|
309
309
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await jr(), ...n } : n;
|
310
310
|
};
|
311
311
|
async function Jr(n, t) {
|
312
|
-
const e =
|
312
|
+
const e = pt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
|
313
313
|
let r = await rt(n, { ...t, redirect: "manual" });
|
314
314
|
return r.type === "opaqueredirect" && (typeof n != "string" && "url" in n ? r = await rt({ ...n, url: `${a}/graphql` }, t) : r = await rt(`${a}/graphql`, t)), r;
|
315
315
|
}
|
316
316
|
class Kr {
|
317
317
|
constructor() {
|
318
|
-
this.shadowGraphqlClient = this.constructShadowGraphqlClient(),
|
318
|
+
this.shadowGraphqlClient = this.constructShadowGraphqlClient(), pt.addServerUrlCallback(() => {
|
319
319
|
this.shadowGraphqlClient = this.constructShadowGraphqlClient();
|
320
320
|
});
|
321
321
|
}
|
@@ -327,7 +327,7 @@ class Kr {
|
|
327
327
|
}
|
328
328
|
constructShadowGraphqlClient() {
|
329
329
|
const t = dr({
|
330
|
-
uri: `${
|
330
|
+
uri: `${pt.getServerUrl()}/graphql`,
|
331
331
|
fetch: Jr
|
332
332
|
}), e = mr(async (i, o) => {
|
333
333
|
const { headers: s } = o, l = s || {}, c = await Yr();
|
@@ -366,7 +366,7 @@ class Kr {
|
|
366
366
|
}
|
367
367
|
const y = new Kr();
|
368
368
|
let oa, sa;
|
369
|
-
const
|
369
|
+
const ft = (n, t, e) => {
|
370
370
|
if (oa !== void 0)
|
371
371
|
return oa(n, t, e);
|
372
372
|
try {
|
@@ -375,7 +375,7 @@ const pt = (n, t, e) => {
|
|
375
375
|
} catch {
|
376
376
|
throw new Error("Canvas module not set");
|
377
377
|
}
|
378
|
-
},
|
378
|
+
}, ee = (n, t) => {
|
379
379
|
if (sa !== void 0)
|
380
380
|
return sa(n, t);
|
381
381
|
try {
|
@@ -411,26 +411,26 @@ let ze;
|
|
411
411
|
function Ca() {
|
412
412
|
return ze === void 0 && (ze = $r()), ze;
|
413
413
|
}
|
414
|
-
let
|
414
|
+
let le = null;
|
415
415
|
const _r = (n) => new Promise((t) => {
|
416
416
|
if (Qe(n) !== "image/jpeg")
|
417
417
|
return t(1);
|
418
418
|
Cr(n).then((a) => t(a || 1)).catch(() => t(1));
|
419
419
|
}), Xr = async () => {
|
420
|
-
if (
|
421
|
-
return !
|
422
|
-
const t = await
|
423
|
-
return
|
420
|
+
if (le !== null)
|
421
|
+
return !le;
|
422
|
+
const t = await ee("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=");
|
423
|
+
return le = t.width === 2 && t.height === 3, !le;
|
424
424
|
}, Zr = (n) => {
|
425
425
|
const e = n.naturalWidth / n.naturalHeight;
|
426
426
|
return n.naturalHeight <= 8192 && n.naturalWidth <= 8192 ? [n.naturalWidth, n.naturalHeight] : n.naturalHeight > n.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
|
427
427
|
}, ti = async (n) => {
|
428
|
-
const t = await Vr(n), e = await
|
428
|
+
const t = await Vr(n), e = await ee(t), [a, r] = Zr(e);
|
429
429
|
if (!await Xr()) {
|
430
|
-
const A =
|
430
|
+
const A = ft(a, r);
|
431
431
|
return A.getContext("2d")?.drawImage(e, 0, 0, a, r), A;
|
432
432
|
}
|
433
|
-
const o = await _r(n), [s, l] = o > 4 ? [r, a] : [a, r], c =
|
433
|
+
const o = await _r(n), [s, l] = o > 4 ? [r, a] : [a, r], c = ft(s, l), d = c.getContext("2d");
|
434
434
|
switch (o) {
|
435
435
|
case 2:
|
436
436
|
d.translate(s, 0), d.scale(-1, 1);
|
@@ -466,7 +466,7 @@ const _r = (n) => new Promise((t) => {
|
|
466
466
|
height: t.height,
|
467
467
|
width: t.width
|
468
468
|
};
|
469
|
-
},
|
469
|
+
}, Kt = [
|
470
470
|
"Yellow C",
|
471
471
|
"Yellow 012 C",
|
472
472
|
"Orange 021 C",
|
@@ -3156,12 +3156,12 @@ const _r = (n) => new Promise((t) => {
|
|
3156
3156
|
parseInt(n.substring(4, 6), 16)
|
3157
3157
|
]);
|
3158
3158
|
function qc(n) {
|
3159
|
-
const t =
|
3159
|
+
const t = Kt.indexOf(n);
|
3160
3160
|
return t >= 0 ? xt[t] : "";
|
3161
3161
|
}
|
3162
3162
|
function ei(n) {
|
3163
3163
|
const t = xt.indexOf(n);
|
3164
|
-
return t >= 0 ?
|
3164
|
+
return t >= 0 ? Kt[t] : "";
|
3165
3165
|
}
|
3166
3166
|
function Hc(n, t = 64) {
|
3167
3167
|
const e = [], a = [], r = ei(n);
|
@@ -3178,10 +3178,10 @@ function Hc(n, t = 64) {
|
|
3178
3178
|
a.push(u);
|
3179
3179
|
}
|
3180
3180
|
for (let A = 0; A < a.length; A++)
|
3181
|
-
a[A] <= t && !e.some((u) => u.pms ===
|
3181
|
+
a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex: xt[A], distance: a[A] });
|
3182
3182
|
return e.sort((A, u) => A.distance - u.distance);
|
3183
3183
|
}
|
3184
|
-
const ai =
|
3184
|
+
const ai = Kt.map((n, t) => ({ pms: n, hex: xt[t] })), ni = new wr(ai, { keys: ["pms"] });
|
3185
3185
|
function jc(n, t) {
|
3186
3186
|
return ni.search(n, t ? { limit: t } : void 0);
|
3187
3187
|
}
|
@@ -3201,7 +3201,7 @@ function Ua(n) {
|
|
3201
3201
|
const t = n.substring(1).toUpperCase();
|
3202
3202
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
3203
3203
|
}
|
3204
|
-
const
|
3204
|
+
const ce = (n) => {
|
3205
3205
|
const t = vn(n.spotColor);
|
3206
3206
|
return t ? `${n.browserValue} ${t}` : n.browserValue;
|
3207
3207
|
}, vn = (n) => {
|
@@ -3299,13 +3299,13 @@ const le = (n) => {
|
|
3299
3299
|
if (s)
|
3300
3300
|
a.setAttribute(
|
3301
3301
|
"fill",
|
3302
|
-
e ?
|
3302
|
+
e ? ce(s) : s.browserValue
|
3303
3303
|
);
|
3304
3304
|
else {
|
3305
3305
|
const l = t[o];
|
3306
3306
|
l && a.setAttribute(
|
3307
3307
|
"fill",
|
3308
|
-
e ?
|
3308
|
+
e ? ce(l) : l.browserValue
|
3309
3309
|
);
|
3310
3310
|
}
|
3311
3311
|
}
|
@@ -3317,13 +3317,13 @@ const le = (n) => {
|
|
3317
3317
|
if (s)
|
3318
3318
|
a.setAttribute(
|
3319
3319
|
"stroke",
|
3320
|
-
e ?
|
3320
|
+
e ? ce(s) : s.browserValue
|
3321
3321
|
);
|
3322
3322
|
else {
|
3323
3323
|
const l = t[o];
|
3324
3324
|
l && a.setAttribute(
|
3325
3325
|
"fill",
|
3326
|
-
e ?
|
3326
|
+
e ? ce(l) : l.browserValue
|
3327
3327
|
);
|
3328
3328
|
}
|
3329
3329
|
}
|
@@ -3373,7 +3373,7 @@ const le = (n) => {
|
|
3373
3373
|
value
|
3374
3374
|
}
|
3375
3375
|
}
|
3376
|
-
`,
|
3376
|
+
`, ae = (n) => w`
|
3377
3377
|
${n && Ai || ""}
|
3378
3378
|
fragment AssetFields on Asset {
|
3379
3379
|
name
|
@@ -3417,7 +3417,7 @@ const le = (n) => {
|
|
3417
3417
|
${n && "...AssetMetadataFields" || ""}
|
3418
3418
|
}
|
3419
3419
|
`, ui = w`
|
3420
|
-
${
|
3420
|
+
${ae(!1)}
|
3421
3421
|
query GetAssets($keys: [String]!) {
|
3422
3422
|
assets(keys: $keys) {
|
3423
3423
|
...AssetFields
|
@@ -3492,7 +3492,7 @@ const le = (n) => {
|
|
3492
3492
|
}
|
3493
3493
|
}
|
3494
3494
|
`, gi = w`
|
3495
|
-
${
|
3495
|
+
${ae(!1)}
|
3496
3496
|
mutation RemoveBackgroundFromAsset($key: String!) {
|
3497
3497
|
assetRemoveBackground(key: $key) {
|
3498
3498
|
...AssetFields
|
@@ -3812,7 +3812,7 @@ class wi {
|
|
3812
3812
|
this.disabled = t;
|
3813
3813
|
}
|
3814
3814
|
}
|
3815
|
-
const
|
3815
|
+
const _t = new wi(), In = w`
|
3816
3816
|
fragment OptionFields on Option {
|
3817
3817
|
id
|
3818
3818
|
name
|
@@ -3850,7 +3850,7 @@ const Kt = new wi(), In = w`
|
|
3850
3850
|
}
|
3851
3851
|
}
|
3852
3852
|
`, yi = w`
|
3853
|
-
${
|
3853
|
+
${ae(!1)}
|
3854
3854
|
${va}
|
3855
3855
|
${In}
|
3856
3856
|
query GetOptions($ids: [String]!) {
|
@@ -3872,11 +3872,11 @@ const Kt = new wi(), In = w`
|
|
3872
3872
|
});
|
3873
3873
|
}), t.data.options;
|
3874
3874
|
}, vi = async (n, t) => (await t).find((a) => a.id === n), Ei = async (n) => {
|
3875
|
-
const t = n.map((o) =>
|
3875
|
+
const t = n.map((o) => _t.get({ id: o })), e = n.filter((o, s) => t[s] === void 0);
|
3876
3876
|
if (e.length === 0)
|
3877
3877
|
return Promise.all(t);
|
3878
3878
|
const a = Si(e), r = e.map(
|
3879
|
-
(o) =>
|
3879
|
+
(o) => _t.set({ id: o }, vi(o, a))
|
3880
3880
|
), i = t.filter((o) => o !== void 0);
|
3881
3881
|
return await Promise.all(i.concat(r));
|
3882
3882
|
};
|
@@ -4588,7 +4588,7 @@ const j = new bi(), Pn = w`
|
|
4588
4588
|
name
|
4589
4589
|
}
|
4590
4590
|
`, Li = (n) => w`
|
4591
|
-
${
|
4591
|
+
${ae(n)}
|
4592
4592
|
${va}
|
4593
4593
|
${In}
|
4594
4594
|
${Ri}
|
@@ -5008,7 +5008,7 @@ const j = new bi(), Pn = w`
|
|
5008
5008
|
}
|
5009
5009
|
}
|
5010
5010
|
`, zi = w`
|
5011
|
-
${
|
5011
|
+
${ae(!1)}
|
5012
5012
|
query GetWorkflowForTheme($id: String!) {
|
5013
5013
|
workflow(id: $id) {
|
5014
5014
|
id
|
@@ -5216,7 +5216,7 @@ const j = new bi(), Pn = w`
|
|
5216
5216
|
],
|
5217
5217
|
silentSteps: []
|
5218
5218
|
}), t;
|
5219
|
-
}, Ki = (n, t) => t.find((e) => e.stepNames.includes(n)),
|
5219
|
+
}, Ki = (n, t) => t.find((e) => e.stepNames.includes(n)), Et = (n, t) => (n.conditions || []).every((e) => {
|
5220
5220
|
const a = t[e.targetStepName];
|
5221
5221
|
if (a && a.selectedVariants) {
|
5222
5222
|
const r = a.selectedVariants;
|
@@ -5229,12 +5229,12 @@ const j = new bi(), Pn = w`
|
|
5229
5229
|
const e = {
|
5230
5230
|
name: n.name,
|
5231
5231
|
title: n.title,
|
5232
|
-
renderableSteps: n.renderableSteps.filter((a) =>
|
5233
|
-
silentSteps: n.silentSteps.filter((a) =>
|
5232
|
+
renderableSteps: n.renderableSteps.filter((a) => Et(a, t)),
|
5233
|
+
silentSteps: n.silentSteps.filter((a) => Et(a, t))
|
5234
5234
|
};
|
5235
5235
|
return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
|
5236
|
-
},
|
5237
|
-
const a =
|
5236
|
+
}, St = (n, t) => n.map((e) => _i(e, t)).filter((e) => e !== null), Xi = async (n, t, e = !1) => {
|
5237
|
+
const a = St(n, t), r = [];
|
5238
5238
|
for (const o of a)
|
5239
5239
|
for (const s of o.renderableSteps) {
|
5240
5240
|
const l = (s.option?.variants || []).length;
|
@@ -5342,7 +5342,7 @@ const M = () => {
|
|
5342
5342
|
viewBox: A,
|
5343
5343
|
width: u
|
5344
5344
|
}) => {
|
5345
|
-
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: i }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose ===
|
5345
|
+
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: i }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose === Yt.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: p.width, height: p.height, rx: h }) }) }), B = a.colorProfiles?.map((E, P) => (
|
5346
5346
|
/* @ts-ignore */
|
5347
5347
|
/* @__PURE__ */ D("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, P)
|
5348
5348
|
)), I = r.map((E) => ({
|
@@ -5385,7 +5385,7 @@ const M = () => {
|
|
5385
5385
|
"g",
|
5386
5386
|
{
|
5387
5387
|
id: "element-group",
|
5388
|
-
clipPath: a.purpose ===
|
5388
|
+
clipPath: a.purpose === Yt.FreeDesign ? "url(#viewboxClip)" : void 0,
|
5389
5389
|
children: C.map((E) => Vn(E)).filter((E) => !!E)
|
5390
5390
|
}
|
5391
5391
|
),
|
@@ -5428,7 +5428,7 @@ const M = () => {
|
|
5428
5428
|
}
|
5429
5429
|
);
|
5430
5430
|
}, Yc = (n, t, e, a, r) => {
|
5431
|
-
const i =
|
5431
|
+
const i = Ct(r), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(i), A = Math.cos(i), u = o, h = o, m = -s, p = s, g = u * A - m * d, f = h * A - p * d, S = u * d + m * A, B = h * d + p * A, I = Math.max(Math.abs(g), Math.abs(f)), C = Math.max(Math.abs(S), Math.abs(B));
|
5432
5432
|
return {
|
5433
5433
|
minX: l - I,
|
5434
5434
|
maxX: l + I,
|
@@ -5438,8 +5438,8 @@ const M = () => {
|
|
5438
5438
|
}, Jc = (n, t, e) => {
|
5439
5439
|
const a = Math.sqrt(Math.pow(t.x - n.x, 2) + Math.pow(t.y - n.y, 2)), r = Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)), i = Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2));
|
5440
5440
|
return Math.acos((r * r + a * a - i * i) / (2 * r * a)) * (180 / Math.PI);
|
5441
|
-
},
|
5442
|
-
const a = Math.sin(
|
5441
|
+
}, Ct = (n) => n * (Math.PI / 180), Kc = (n, t, e) => Math.abs(n - t) < e, _c = (n, t, e) => {
|
5442
|
+
const a = Math.sin(Ct(e)), r = Math.cos(Ct(e));
|
5443
5443
|
return {
|
5444
5444
|
x: (n.x - t.x) * r - (n.y - t.y) * a + t.x,
|
5445
5445
|
y: (n.x - t.x) * a + (n.y - t.y) * r + t.y
|
@@ -5476,7 +5476,7 @@ const M = () => {
|
|
5476
5476
|
return H.Northwest;
|
5477
5477
|
}
|
5478
5478
|
}, ad = (n, t) => t > 45 && t <= 135 ? Pt(n) : t > 135 && t <= 225 ? Pt(Pt(n)) : t > 225 && t <= 315 ? Pt(Pt(Pt(n))) : n, nd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
5479
|
-
const a =
|
5479
|
+
const a = Ct(n.rotation), r = {
|
5480
5480
|
x: t.x + n.x * e.x,
|
5481
5481
|
y: t.x + n.y * e.y
|
5482
5482
|
}, i = {
|
@@ -5493,20 +5493,20 @@ const M = () => {
|
|
5493
5493
|
y: s.y - n.height * e.y / 2
|
5494
5494
|
};
|
5495
5495
|
return {
|
5496
|
-
a:
|
5497
|
-
b:
|
5498
|
-
c:
|
5499
|
-
d:
|
5496
|
+
a: de(r, l, a),
|
5497
|
+
b: de(i, l, a),
|
5498
|
+
c: de(o, l, a),
|
5499
|
+
d: de(s, l, a),
|
5500
5500
|
center: l
|
5501
5501
|
};
|
5502
|
-
},
|
5502
|
+
}, de = (n, t, e) => {
|
5503
5503
|
const a = Math.sin(e), r = Math.cos(e);
|
5504
5504
|
return {
|
5505
5505
|
x: (n.x - t.x) * r - (n.y - t.y) * a + t.x,
|
5506
5506
|
y: (n.x - t.x) * a + (n.y - t.y) * r + t.y
|
5507
5507
|
};
|
5508
5508
|
}, rd = 0.352778, id = 0.035277, Nn = (n) => {
|
5509
|
-
const t = n.rotation || 0, e =
|
5509
|
+
const t = n.rotation || 0, e = Ct(t), a = Math.cos(e), r = -Math.sin(e);
|
5510
5510
|
return /* @__PURE__ */ D("g", { mask: n.stepName || n.productOverlay ? void 0 : n.mask, children: /* @__PURE__ */ D(
|
5511
5511
|
"g",
|
5512
5512
|
{
|
@@ -5528,7 +5528,7 @@ const M = () => {
|
|
5528
5528
|
}
|
5529
5529
|
) });
|
5530
5530
|
}, Qn = (n) => {
|
5531
|
-
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a =
|
5531
|
+
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = Ct(e), r = Math.cos(a), i = -Math.sin(a), o = ba(n.children);
|
5532
5532
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5533
5533
|
/* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: t, preserveAspectRatio: "none", children: n.clipPath ? /* @__PURE__ */ D("path", { d: n.clipPath }) : /* @__PURE__ */ D("rect", { x: 0, y: 0, width: n.width, height: n.height }) }) }),
|
5534
5534
|
/* @__PURE__ */ ct(
|
@@ -5589,7 +5589,7 @@ const M = () => {
|
|
5589
5589
|
/* @__PURE__ */ D("feFuncG", { type: "discrete", tableValues: r() }),
|
5590
5590
|
/* @__PURE__ */ D("feFuncB", { type: "discrete", tableValues: r() })
|
5591
5591
|
] })
|
5592
|
-
] }) }) }), o = n.rotation || 0, s =
|
5592
|
+
] }) }) }), o = n.rotation || 0, s = Ct(o), l = Math.cos(s), c = -Math.sin(s), d = () => {
|
5593
5593
|
const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, m = n.pattern?.height || 0, p = n.pattern?.scaleX || 1, g = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
|
5594
5594
|
return [n.pattern?.svg ? {
|
5595
5595
|
id: `${t}-contents`,
|
@@ -5704,7 +5704,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5704
5704
|
return We.get(n);
|
5705
5705
|
const e = (async () => {
|
5706
5706
|
try {
|
5707
|
-
return
|
5707
|
+
return wt(n).getFont();
|
5708
5708
|
} catch {
|
5709
5709
|
if (ao(n)) {
|
5710
5710
|
const a = Cn(n), r = aa(a);
|
@@ -5719,7 +5719,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5719
5719
|
}, no = (n) => {
|
5720
5720
|
const t = Cn(n), e = aa(t);
|
5721
5721
|
return la(n, e), e;
|
5722
|
-
},
|
5722
|
+
}, wt = (n) => {
|
5723
5723
|
const t = Rn.get(n);
|
5724
5724
|
if (t)
|
5725
5725
|
return t;
|
@@ -5766,7 +5766,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5766
5766
|
const o = (i || Un) * r.getApproximateHeight(), s = t.split(`
|
5767
5767
|
`);
|
5768
5768
|
try {
|
5769
|
-
const l = s.flatMap((d) =>
|
5769
|
+
const l = s.flatMap((d) => fe(d, n.width, a, r)), c = l.flatMap((d) => d.lines);
|
5770
5770
|
return {
|
5771
5771
|
lines: c,
|
5772
5772
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * o),
|
@@ -5782,29 +5782,29 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5782
5782
|
requiredWidth: Pe(c, n.width, a, r)
|
5783
5783
|
};
|
5784
5784
|
}
|
5785
|
-
},
|
5786
|
-
const r =
|
5785
|
+
}, fe = (n, t, e, a) => {
|
5786
|
+
const r = gt(n, e, a);
|
5787
5787
|
if (r <= t)
|
5788
5788
|
return { lines: [n], width: r };
|
5789
5789
|
if (!(n.indexOf(" ") > -1)) {
|
5790
5790
|
if (n.length <= 1)
|
5791
5791
|
throw new Error(`Character ${n} is wider than region`);
|
5792
|
-
const d = Math.floor(n.length / 2), A =
|
5792
|
+
const d = Math.floor(n.length / 2), A = fe(n.slice(0, d), t, e, a), u = fe(n.slice(d), t, e, a);
|
5793
5793
|
return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
|
5794
5794
|
}
|
5795
5795
|
const o = n.split(" "), s = [];
|
5796
5796
|
let l = -1 / 0, c = 0;
|
5797
5797
|
for (; c < o.length; ) {
|
5798
5798
|
const d = o[c];
|
5799
|
-
if (
|
5800
|
-
const A =
|
5799
|
+
if (gt(d, e, a) > t) {
|
5800
|
+
const A = fe(d, t, e, a);
|
5801
5801
|
s.push(...A.lines), l = Math.max(l, A.width), c++;
|
5802
5802
|
} else {
|
5803
5803
|
const A = [d];
|
5804
|
-
l = Math.max(l,
|
5804
|
+
l = Math.max(l, gt(d, e, a));
|
5805
5805
|
let u = c + 1, h = !0;
|
5806
5806
|
for (; u < o.length && h; ) {
|
5807
|
-
const m = o[u], p =
|
5807
|
+
const m = o[u], p = gt(`${A.join(" ")} ${m}`, e, a);
|
5808
5808
|
p <= t ? (A.push(m), l = Math.max(l, p), u++) : h = !1;
|
5809
5809
|
}
|
5810
5810
|
s.push(A.join(" ")), c = u;
|
@@ -5817,7 +5817,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5817
5817
|
const o = (i ?? Un) * t.getApproximateHeight(), s = 1 / e.unitsPerEm, l = On(n, s, t), c = n.length * o * s, d = a / l, A = r / c;
|
5818
5818
|
return Math.min(A, d);
|
5819
5819
|
}, io = (n, t, e, a) => {
|
5820
|
-
const r =
|
5820
|
+
const r = wt(t.fontData.assetUrl), i = r.getFont(), o = t.fontSize / i.unitsPerEm;
|
5821
5821
|
if (!e)
|
5822
5822
|
return za(t, n, t.fontSize, o, r, a);
|
5823
5823
|
let s;
|
@@ -5838,11 +5838,11 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5838
5838
|
fontSize: ro(s, r, i, t.width, t.height, a)
|
5839
5839
|
} : za(t, n, t.fontSize, o, r, a);
|
5840
5840
|
}, oo = (n, t, e, a, r) => {
|
5841
|
-
const o =
|
5841
|
+
const o = wt(t.assetUrl).getFont();
|
5842
5842
|
let s = { ...n };
|
5843
|
-
const l = { ...n }, c = On(a, e / o.unitsPerEm,
|
5843
|
+
const l = { ...n }, c = On(a, e / o.unitsPerEm, wt(t.assetUrl));
|
5844
5844
|
return c && c < s.width && (l.width = c, r === "left" ? (l.left += Math.sin(s.rotation * Math.PI / 360) * (s.width - c), l.top += Math.sin(s.rotation * Math.PI / 180) * (c - s.width) / 2) : r === "right" ? l.left += s.width - c : l.left += (s.width - c) / 2, a && lo(a, a).every(([d, A]) => d === A) && (s = l)), s;
|
5845
|
-
}, qe = 1,
|
5845
|
+
}, qe = 1, gt = (n, t, e) => {
|
5846
5846
|
let a = 0;
|
5847
5847
|
const r = e.getGlyphs(n);
|
5848
5848
|
return r.forEach((i, o) => {
|
@@ -5863,7 +5863,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5863
5863
|
}, On = (n, t, e) => {
|
5864
5864
|
let a = 0;
|
5865
5865
|
return n.forEach((r) => {
|
5866
|
-
a = Math.max(a,
|
5866
|
+
a = Math.max(a, gt(r, t, e));
|
5867
5867
|
}), a;
|
5868
5868
|
}, Ga = {
|
5869
5869
|
stripControlCharacters: !0,
|
@@ -5874,7 +5874,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5874
5874
|
let a = n || "";
|
5875
5875
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
5876
5876
|
`)), a;
|
5877
|
-
}, lo = (n, t) => n.map((e, a) => [e, t[a]]), co = (n = "center", t = !1) => t ? "center" : n, $n = (n) => n === "left" ? "start" : n === "right" ? "end" : "middle",
|
5877
|
+
}, lo = (n, t) => n.map((e, a) => [e, t[a]]), co = (n = "center", t = !1) => t ? "center" : n, $n = (n) => n === "left" ? "start" : n === "right" ? "end" : "middle", ne = (n, t, e) => n.fontData ? {
|
5878
5878
|
...n,
|
5879
5879
|
...(() => {
|
5880
5880
|
if (n.algorithm === Mt.Traditional) {
|
@@ -5988,7 +5988,7 @@ const Ao = (n) => {
|
|
5988
5988
|
const t = () => {
|
5989
5989
|
if (n.lineHeight !== void 0)
|
5990
5990
|
return n.lineHeight * n.fontSize;
|
5991
|
-
const r =
|
5991
|
+
const r = wt(n.fontData.assetUrl), i = r.getFont(), o = n.fontSize / i.unitsPerEm;
|
5992
5992
|
return r.getApproximateHeight() * o;
|
5993
5993
|
}, e = () => n.align === "left" ? -n.textboxWidth / 2 : n.align === "right" ? n.textboxWidth / 2 : 0, a = () => {
|
5994
5994
|
const r = t(), i = n.textboxHeight / 2;
|
@@ -6031,7 +6031,7 @@ const Ao = (n) => {
|
|
6031
6031
|
mask: n.stepName ? void 0 : n.mask
|
6032
6032
|
}
|
6033
6033
|
);
|
6034
|
-
const t = n.rotation || 0, e =
|
6034
|
+
const t = n.rotation || 0, e = Ct(t), a = Math.cos(e), r = -Math.sin(e), i = `
|
6035
6035
|
matrix(1, 0, 0, 1, ${n.x}, ${n.y})
|
6036
6036
|
matrix(1, 0, 0, 1, ${n.width / 2}, ${n.height / 2})
|
6037
6037
|
matrix(${a}, ${-r}, ${r}, ${a}, 0, 0)
|
@@ -6187,7 +6187,7 @@ function ba(n) {
|
|
6187
6187
|
return i < o ? -1 : i > o ? 1 : 0;
|
6188
6188
|
});
|
6189
6189
|
}
|
6190
|
-
const
|
6190
|
+
const re = (n) => {
|
6191
6191
|
const t = n.variants;
|
6192
6192
|
if (t) {
|
6193
6193
|
if (t.length === 1)
|
@@ -6210,7 +6210,7 @@ const ne = (n) => {
|
|
6210
6210
|
}, po = (n, t) => {
|
6211
6211
|
if (!t)
|
6212
6212
|
return;
|
6213
|
-
const e = t.variants?.find((a) => a.id === n.frameVariantId) ||
|
6213
|
+
const e = t.variants?.find((a) => a.id === n.frameVariantId) || re(t);
|
6214
6214
|
if (!e)
|
6215
6215
|
throw new Error(`No variant with ID: ${n.frameVariantId}`);
|
6216
6216
|
if (!e.asset)
|
@@ -6315,7 +6315,7 @@ const ne = (n) => {
|
|
6315
6315
|
nt(n).then((e) => {
|
6316
6316
|
t(e);
|
6317
6317
|
}).catch((e) => console.error(e));
|
6318
|
-
}), je = /* @__PURE__ */ new Map(),
|
6318
|
+
}), je = /* @__PURE__ */ new Map(), Xt = async (n) => {
|
6319
6319
|
if (je.has(n))
|
6320
6320
|
return je.get(n);
|
6321
6321
|
const t = async (r) => new Promise((i, o) => {
|
@@ -6333,11 +6333,11 @@ const ne = (n) => {
|
|
6333
6333
|
const o = dt().parseFromString(n, "image/svg+xml").firstElementChild;
|
6334
6334
|
if (!o)
|
6335
6335
|
throw new Error("Failed to read SVG");
|
6336
|
-
const l = It().serializeToString(o), c =
|
6336
|
+
const l = It().serializeToString(o), c = ft(), d = c.getContext("2d"), A = await ma.from(d, l, {
|
6337
6337
|
anonymousCrossOrigin: !0,
|
6338
6338
|
ignoreDimensions: !1,
|
6339
|
-
createCanvas:
|
6340
|
-
createImage:
|
6339
|
+
createCanvas: ft,
|
6340
|
+
createImage: ee,
|
6341
6341
|
DOMParser: Ca(),
|
6342
6342
|
fetch: rt
|
6343
6343
|
}), u = o.getAttribute("width"), h = o.getAttribute("height"), m = 2048;
|
@@ -6375,7 +6375,7 @@ const ne = (n) => {
|
|
6375
6375
|
}
|
6376
6376
|
if (e && t === x.Textbox && a?.text && a?.fontScale) {
|
6377
6377
|
await Nt(e);
|
6378
|
-
const l =
|
6378
|
+
const l = wt(e), c = gt(a.text, a?.fontScale, l);
|
6379
6379
|
s.width = Math.min(c, r.width * 0.85), s.left = r.x + r.width / 2 - s.width / 2;
|
6380
6380
|
}
|
6381
6381
|
return s;
|
@@ -6434,7 +6434,7 @@ class sd {
|
|
6434
6434
|
}), A = e.region || await Ut(t, x.Textbox, r, {
|
6435
6435
|
text: d,
|
6436
6436
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
6437
|
-
}), u =
|
6437
|
+
}), u = ne(
|
6438
6438
|
{
|
6439
6439
|
id: M(),
|
6440
6440
|
type: x.Textbox,
|
@@ -6515,7 +6515,7 @@ class sd {
|
|
6515
6515
|
};
|
6516
6516
|
}
|
6517
6517
|
static async getIllustration(t, e) {
|
6518
|
-
const a = e.region || await Ut(t, x.Illustration, e.src), r = await st(await Wn(e.src)), i = await
|
6518
|
+
const a = e.region || await Ut(t, x.Illustration, e.src), r = await st(await Wn(e.src)), i = await Xt(r.svg), o = M();
|
6519
6519
|
return {
|
6520
6520
|
cachedObjectURL: i,
|
6521
6521
|
stepRegion: e.region,
|
@@ -6588,7 +6588,7 @@ const $ = (n, t) => _(n, t).elements.find((r) => r.id === n), _ = (n, t) => {
|
|
6588
6588
|
const s = r[o];
|
6589
6589
|
if (s.src && s.svg)
|
6590
6590
|
try {
|
6591
|
-
s.cachedObjectURL = await
|
6591
|
+
s.cachedObjectURL = await Xt(s.svg);
|
6592
6592
|
} catch (l) {
|
6593
6593
|
console.log(l);
|
6594
6594
|
}
|
@@ -6687,7 +6687,7 @@ class dd extends N {
|
|
6687
6687
|
o.scaleX = o.scaleX * this.width / e.width, o.scaleY = o.scaleY * this.height / e.height;
|
6688
6688
|
} else if (e.type === "textbox") {
|
6689
6689
|
const o = a, s = (!o.algorithm || o.algorithm === Mt.Autosize ? o.text : o.input) ?? "";
|
6690
|
-
a =
|
6690
|
+
a = ne(o, s, e);
|
6691
6691
|
}
|
6692
6692
|
const r = _(e.id, Object.values(t.layouts)), i = X(a, r);
|
6693
6693
|
return {
|
@@ -6864,7 +6864,7 @@ class Co extends N {
|
|
6864
6864
|
const a = {
|
6865
6865
|
...e,
|
6866
6866
|
fontSize: this.size
|
6867
|
-
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(
|
6867
|
+
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(ne(a, i), r);
|
6868
6868
|
return {
|
6869
6869
|
...t,
|
6870
6870
|
layouts: {
|
@@ -6886,7 +6886,7 @@ class ja extends N {
|
|
6886
6886
|
const a = {
|
6887
6887
|
...e,
|
6888
6888
|
fontData: this.fontData
|
6889
|
-
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(
|
6889
|
+
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(ne(a, i), r);
|
6890
6890
|
return {
|
6891
6891
|
...t,
|
6892
6892
|
layouts: {
|
@@ -7010,7 +7010,7 @@ class vo extends N {
|
|
7010
7010
|
const e = $(this.id, Object.values(t.layouts));
|
7011
7011
|
if (!e.id)
|
7012
7012
|
throw new L();
|
7013
|
-
const a = _(e.id, Object.values(t.layouts)), r = X(
|
7013
|
+
const a = _(e.id, Object.values(t.layouts)), r = X(ne(e, this.text, e), a);
|
7014
7014
|
return {
|
7015
7015
|
...t,
|
7016
7016
|
layouts: {
|
@@ -7265,7 +7265,7 @@ class Ya {
|
|
7265
7265
|
}))()), A = {
|
7266
7266
|
stepName: this.configuration.stepName,
|
7267
7267
|
id: M(),
|
7268
|
-
cachedObjectURL: await
|
7268
|
+
cachedObjectURL: await Xt(d.svg),
|
7269
7269
|
src: l,
|
7270
7270
|
svg: d.svg,
|
7271
7271
|
colors: d.colors,
|
@@ -7311,7 +7311,7 @@ class Ya {
|
|
7311
7311
|
}
|
7312
7312
|
}
|
7313
7313
|
const bo = async (n) => {
|
7314
|
-
const t = `${
|
7314
|
+
const t = `${pt.getServicesApiUrl()}/shortener`;
|
7315
7315
|
try {
|
7316
7316
|
return (await (await rt(t, {
|
7317
7317
|
method: "POST",
|
@@ -7374,7 +7374,7 @@ class Bo {
|
|
7374
7374
|
async () => {
|
7375
7375
|
const p = await i();
|
7376
7376
|
if (!p.link || !p.link)
|
7377
|
-
throw new
|
7377
|
+
throw new Jt(p.asset);
|
7378
7378
|
h({
|
7379
7379
|
rel: "mpeg4",
|
7380
7380
|
href: p.link
|
@@ -7449,7 +7449,7 @@ class Fe {
|
|
7449
7449
|
const r = a.fileLink;
|
7450
7450
|
if (r)
|
7451
7451
|
return nt(r, !0);
|
7452
|
-
throw new
|
7452
|
+
throw new Jt(a);
|
7453
7453
|
};
|
7454
7454
|
}
|
7455
7455
|
async init(t, e, a) {
|
@@ -7773,7 +7773,7 @@ class Fe {
|
|
7773
7773
|
const a = t.fileLink;
|
7774
7774
|
if (a)
|
7775
7775
|
return a;
|
7776
|
-
throw new
|
7776
|
+
throw new Jt(t);
|
7777
7777
|
}
|
7778
7778
|
async loadPatternFromAsset(t, e, a, r) {
|
7779
7779
|
const i = Fe.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
@@ -7803,7 +7803,7 @@ class Fe {
|
|
7803
7803
|
), this.validateColorCount(e, a);
|
7804
7804
|
}
|
7805
7805
|
}
|
7806
|
-
const
|
7806
|
+
const vt = new Fe();
|
7807
7807
|
class Io {
|
7808
7808
|
async getIllustrationBody(t) {
|
7809
7809
|
return new Promise((e) => {
|
@@ -7908,7 +7908,7 @@ class Io {
|
|
7908
7908
|
spotColor: A.spotColor,
|
7909
7909
|
pmsValue: A.pmsValue
|
7910
7910
|
};
|
7911
|
-
const s = ya(t, e, a, o), l = await
|
7911
|
+
const s = ya(t, e, a, o), l = await Xt(s), c = [];
|
7912
7912
|
for (const d of r) {
|
7913
7913
|
for (const [A, u] of i.entries())
|
7914
7914
|
c.push(new Aa(d, A, u));
|
@@ -7967,8 +7967,8 @@ class Io {
|
|
7967
7967
|
throw new bt(e);
|
7968
7968
|
const l = s.fileLink;
|
7969
7969
|
if (!l)
|
7970
|
-
throw new
|
7971
|
-
const c = await st(await this.getIllustrationBody(l)), d = await
|
7970
|
+
throw new Jt(s);
|
7971
|
+
const c = await st(await this.getIllustrationBody(l)), d = await Xt(c.svg), A = (f) => {
|
7972
7972
|
const S = i.getLayouts().find((I) => I.panelId === f.panelId);
|
7973
7973
|
if (!S)
|
7974
7974
|
throw new Y(f);
|
@@ -8036,7 +8036,7 @@ class Io {
|
|
8036
8036
|
};
|
8037
8037
|
}
|
8038
8038
|
}
|
8039
|
-
const
|
8039
|
+
const Ce = new Io();
|
8040
8040
|
class Po {
|
8041
8041
|
async init(t, e, a) {
|
8042
8042
|
const r = t.option;
|
@@ -8645,7 +8645,7 @@ const No = new To(), Ke = (n, t, e, a, r) => {
|
|
8645
8645
|
if (t.some((d) => d == null))
|
8646
8646
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
8647
8647
|
let i = t.map((d) => d.split(`
|
8648
|
-
`)).flat(), o = i.length, s = i.map((d) =>
|
8648
|
+
`)).flat(), o = i.length, s = i.map((d) => gt(d, a, r));
|
8649
8649
|
const l = r.getApproximateHeight() * a;
|
8650
8650
|
let c = !0;
|
8651
8651
|
for (; c; ) {
|
@@ -8658,7 +8658,7 @@ const No = new To(), Ke = (n, t, e, a, r) => {
|
|
8658
8658
|
let m = !1, p = h.length;
|
8659
8659
|
for (; !m && p > -1; ) {
|
8660
8660
|
p = h.lastIndexOf(" ", p - 1);
|
8661
|
-
const g = [h.slice(0, p), h.slice(p + 1)], f = g.map((B) =>
|
8661
|
+
const g = [h.slice(0, p), h.slice(p + 1)], f = g.map((B) => gt(B, a, r));
|
8662
8662
|
f[0] <= n.width && (i = [...i.slice(0, u), ...g, ...i.slice(u + 1)], s = [
|
8663
8663
|
...s.slice(0, u),
|
8664
8664
|
...f,
|
@@ -8668,9 +8668,9 @@ const No = new To(), Ke = (n, t, e, a, r) => {
|
|
8668
8668
|
m || (c = !1);
|
8669
8669
|
}
|
8670
8670
|
return [null, null];
|
8671
|
-
},
|
8671
|
+
}, we = (n, t, e, a, r) => {
|
8672
8672
|
let i, o;
|
8673
|
-
const s =
|
8673
|
+
const s = wt(t.assetUrl), l = s.getFont();
|
8674
8674
|
if (r.size) {
|
8675
8675
|
const u = n / l.unitsPerEm;
|
8676
8676
|
return [i, o] = Ke(e, a, n, u, s), [r.size, i, o];
|
@@ -8705,7 +8705,7 @@ class Ro {
|
|
8705
8705
|
/(\r\n|\r|(\u2665|\u00a9|\u00ae|[\u2000-\u2017]|[\u201E-\u3300]]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))/gm,
|
8706
8706
|
""
|
8707
8707
|
);
|
8708
|
-
const r = [], i = e ?
|
8708
|
+
const r = [], i = e ? wt(e.assetUrl) : void 0;
|
8709
8709
|
if (i) {
|
8710
8710
|
const o = a.split("").filter((l) => !Qo.includes(l)).join(""), s = o.split("").map((l) => i.getFont().charToGlyph(l));
|
8711
8711
|
for (let l = 0; l < s.length; l++)
|
@@ -8924,7 +8924,7 @@ class Ro {
|
|
8924
8924
|
const c = [], d = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
|
8925
8925
|
for (const u of e) {
|
8926
8926
|
if (!u.fontData) throw new V("Failed to resolve font data for text.");
|
8927
|
-
const [h, m] =
|
8927
|
+
const [h, m] = we(
|
8928
8928
|
u.fontSize,
|
8929
8929
|
u.fontData,
|
8930
8930
|
{ left: u.x, top: u.y, width: u.width, height: u.height, rotation: u.rotation },
|
@@ -9084,7 +9084,7 @@ class Ro {
|
|
9084
9084
|
throw new bt(t);
|
9085
9085
|
const a = e.fileLink;
|
9086
9086
|
if (!a)
|
9087
|
-
throw new
|
9087
|
+
throw new Jt(e);
|
9088
9088
|
const r = await Nt(a);
|
9089
9089
|
return {
|
9090
9090
|
assetUrl: a,
|
@@ -9211,7 +9211,7 @@ class Ro {
|
|
9211
9211
|
fillSpotColorDefinition: f
|
9212
9212
|
}, C = [], E = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
|
9213
9213
|
if (!I.fontData) throw new V("Failed to resolve font data for text.");
|
9214
|
-
const [b, F] =
|
9214
|
+
const [b, F] = we(
|
9215
9215
|
I.fontSize,
|
9216
9216
|
I.fontData,
|
9217
9217
|
{
|
@@ -9272,7 +9272,7 @@ class Ro {
|
|
9272
9272
|
const A = (r || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = Ft(A, o), h = this.getProcessedInput(u, t.data, s), m = o.getRegionElements(t.stepName), p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
9273
9273
|
for (const C of m)
|
9274
9274
|
if (C.region) {
|
9275
|
-
const [E, P] =
|
9275
|
+
const [E, P] = we(
|
9276
9276
|
e,
|
9277
9277
|
a,
|
9278
9278
|
C.region,
|
@@ -9326,13 +9326,13 @@ const $o = "data:application/octet-stream;base64,AAEAAAAPAIAAAwBwRkZUTYdHeHoAAEl
|
|
9326
9326
|
const e = at("rect");
|
9327
9327
|
return e.setAttribute("height", `${n}`), e.setAttribute("width", `${t}`), e;
|
9328
9328
|
}, Lo = (n, t, e, a) => {
|
9329
|
-
const r =
|
9329
|
+
const r = se("filter");
|
9330
9330
|
r.setAttribute("id", a), r.setAttribute("height", "200%"), r.setAttribute("width", "200%"), r.setAttribute("x", "-50%"), r.setAttribute("y", "-50%");
|
9331
|
-
const i =
|
9331
|
+
const i = se("feOffset");
|
9332
9332
|
r.appendChild(i), i.setAttribute("result", "offOut"), i.setAttribute("in", "SourceAlpha"), i.setAttribute("dx", `${n}`), i.setAttribute("dy", `${t}`);
|
9333
|
-
const o =
|
9333
|
+
const o = se("feGaussianBlur");
|
9334
9334
|
r.appendChild(o), o.setAttribute("result", "blurOut"), o.setAttribute("in", "offOut"), o.setAttribute("stdDeviation", `${e}`);
|
9335
|
-
const s =
|
9335
|
+
const s = se("feBlend");
|
9336
9336
|
return r.appendChild(s), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "blurOut"), s.setAttribute("mode", "normal"), r;
|
9337
9337
|
}, Vo = (n) => {
|
9338
9338
|
let t = n;
|
@@ -9511,7 +9511,7 @@ async function Zn(n) {
|
|
9511
9511
|
return new qo();
|
9512
9512
|
throw new V(`Failed to resolve Module, Module ${n} not found`);
|
9513
9513
|
}
|
9514
|
-
const
|
9514
|
+
const ie = w`
|
9515
9515
|
fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
|
9516
9516
|
name
|
9517
9517
|
value
|
@@ -9534,7 +9534,7 @@ const re = w`
|
|
9534
9534
|
}
|
9535
9535
|
}
|
9536
9536
|
`, Ho = w`
|
9537
|
-
${
|
9537
|
+
${ie}
|
9538
9538
|
mutation CreateGlobalPropertyState($bundleId: String!) {
|
9539
9539
|
globalPropertyStateCreate(bundleId: $bundleId) {
|
9540
9540
|
id
|
@@ -9544,7 +9544,7 @@ const re = w`
|
|
9544
9544
|
}
|
9545
9545
|
}
|
9546
9546
|
`, jo = w`
|
9547
|
-
${
|
9547
|
+
${ie}
|
9548
9548
|
mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
|
9549
9549
|
globalPropertyStateUpdate(id: $id, aspects: $aspects) {
|
9550
9550
|
id
|
@@ -9554,7 +9554,7 @@ const re = w`
|
|
9554
9554
|
}
|
9555
9555
|
}
|
9556
9556
|
`, Yo = w`
|
9557
|
-
${
|
9557
|
+
${ie}
|
9558
9558
|
query GetGlobalPropertyState($bundleId: String!) {
|
9559
9559
|
globalPropertyState(bundleId: $bundleId) {
|
9560
9560
|
id
|
@@ -9625,7 +9625,7 @@ const re = w`
|
|
9625
9625
|
...ProductFields
|
9626
9626
|
}
|
9627
9627
|
}
|
9628
|
-
`,
|
9628
|
+
`, oe = (n, t = !1) => w`
|
9629
9629
|
${n ? Pa(t) : ""}
|
9630
9630
|
fragment ProductCollectionFields on ProductCollection {
|
9631
9631
|
id
|
@@ -9696,8 +9696,8 @@ const re = w`
|
|
9696
9696
|
}
|
9697
9697
|
}
|
9698
9698
|
`, Ko = (n) => w`
|
9699
|
-
${
|
9700
|
-
${
|
9699
|
+
${ie}
|
9700
|
+
${oe(n)}
|
9701
9701
|
query GetBundle($id: String!) {
|
9702
9702
|
globalPropertyState(bundleId: $id) {
|
9703
9703
|
id
|
@@ -9879,7 +9879,7 @@ const re = w`
|
|
9879
9879
|
}
|
9880
9880
|
}
|
9881
9881
|
`, es = (n) => w`
|
9882
|
-
${
|
9882
|
+
${oe(n)}
|
9883
9883
|
mutation CreateBundle(
|
9884
9884
|
$collectionId: String
|
9885
9885
|
$initialMetadata: [MetadataInput!]
|
@@ -9908,8 +9908,8 @@ const re = w`
|
|
9908
9908
|
}
|
9909
9909
|
}
|
9910
9910
|
`, as = (n) => w`
|
9911
|
-
${
|
9912
|
-
${
|
9911
|
+
${ie}
|
9912
|
+
${oe(n)}
|
9913
9913
|
mutation DuplicateBundle(
|
9914
9914
|
$id: String!
|
9915
9915
|
$template: Boolean
|
@@ -10064,7 +10064,7 @@ const re = w`
|
|
10064
10064
|
}
|
10065
10065
|
}
|
10066
10066
|
`, us = (n) => w`
|
10067
|
-
${
|
10067
|
+
${oe(n)}
|
10068
10068
|
mutation BundleAssignProductCollection($id: String!, $productCollectionId: String!) {
|
10069
10069
|
bundleAssignProductCollection(id: $id, collectionId: $productCollectionId) {
|
10070
10070
|
id
|
@@ -10270,7 +10270,7 @@ class Bs {
|
|
10270
10270
|
const t = this.transaction.recipient, e = { recipient: t };
|
10271
10271
|
return this.recipientConversionConfiguration?.requestedDataItems?.forEach((a) => {
|
10272
10272
|
const r = a.uniqueIdentifier ?? a.title ?? "";
|
10273
|
-
a.type ===
|
10273
|
+
a.type === ye.FirstName ? e[r] = t?.firstName : a.type === ye.LastName ? e[r] = t?.lastName : a.type === ye.Custom && (a.customFieldIndex === 1 ? e[r] = t?.customField1 : a.customFieldIndex === 2 ? e[r] = t?.customField2 : a.customFieldIndex === 3 ? e[r] = t?.customField3 : a.customFieldIndex === 4 ? e[r] = t?.customField4 : a.customFieldIndex === 5 && (e[r] = t?.customField5));
|
10274
10274
|
}), e;
|
10275
10275
|
}
|
10276
10276
|
async updateRecipient(t, e, a, r, i, o, s, l, c, d, A, u, h, m, p, g, f) {
|
@@ -10402,7 +10402,7 @@ class Bs {
|
|
10402
10402
|
this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((s) => {
|
10403
10403
|
this.storage[s.stepName] = s.storage || {};
|
10404
10404
|
}), await this.fetchConversionConfiguration(), this.allScenes = await Ji(t);
|
10405
|
-
const r =
|
10405
|
+
const r = St(this.allScenes, this.stepSelections).map((s) => s.silentSteps).flat(), { stepElements: i, commands: o } = await this.stepElementsForIntroducedSilentSteps(r, !!this.reloadedState);
|
10406
10406
|
this.commandContext.apply(new R(o), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), this.isReloadedTransaction || this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
|
10407
10407
|
}
|
10408
10408
|
getWorkflowExperience() {
|
@@ -10575,7 +10575,7 @@ class Bs {
|
|
10575
10575
|
this.mandatorySteps[t] !== e && (this.mandatorySteps = { ...this.mandatorySteps, [t]: e }, this.onMandatoryChange());
|
10576
10576
|
}
|
10577
10577
|
getMandatoryUnfulfilledSteps() {
|
10578
|
-
return
|
10578
|
+
return St(this.allScenes, this.stepSelections).flatMap((i) => i.renderableSteps).filter((i) => i.mandatory).filter((i) => !this.mandatorySteps[i.stepName]).map((i) => i.stepName);
|
10579
10579
|
}
|
10580
10580
|
setStepError(t, e, a) {
|
10581
10581
|
let r = !1;
|
@@ -10610,7 +10610,7 @@ class Bs {
|
|
10610
10610
|
},
|
10611
10611
|
{ refocusCamera: e }
|
10612
10612
|
);
|
10613
|
-
this.setModelContainer(a),
|
10613
|
+
this.setModelContainer(a), St(this.allScenes, this.stepSelections).filter((o) => o).map((o) => o.renderableSteps).flat().filter((o) => o.type === v.Model || o.type === v.Material).forEach((o) => {
|
10614
10614
|
if (!o.option?.id) {
|
10615
10615
|
console.error(`Failed to read option id from step: ${o.stepName}`);
|
10616
10616
|
return;
|
@@ -10666,7 +10666,7 @@ class Bs {
|
|
10666
10666
|
...this.storage,
|
10667
10667
|
[t]: { ...this.storage[t], ...e }
|
10668
10668
|
};
|
10669
|
-
if (!
|
10669
|
+
if (!Wt(a, this.storage)) {
|
10670
10670
|
this.storage = a;
|
10671
10671
|
const r = new Ha(this.constructSerializableWorkflow());
|
10672
10672
|
this.commandContext.apply(r, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
@@ -10717,7 +10717,7 @@ class Bs {
|
|
10717
10717
|
const t = this.getCommandContext().getState();
|
10718
10718
|
if (!t)
|
10719
10719
|
throw new V("Attempted to serialize state before it was initialized.");
|
10720
|
-
const e =
|
10720
|
+
const e = ht(t.transaction), a = this.dehydrateState(e);
|
10721
10721
|
return JSON.stringify(a);
|
10722
10722
|
}
|
10723
10723
|
/**
|
@@ -10753,12 +10753,12 @@ class Bs {
|
|
10753
10753
|
this.stepElements = e(this.stepElements, t);
|
10754
10754
|
}
|
10755
10755
|
getInvalidCanvasRegions() {
|
10756
|
-
return this.workflow.steps.reduce((t, e) => (
|
10756
|
+
return this.workflow.steps.reduce((t, e) => (Et(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
|
10757
10757
|
(a) => t.push(a)
|
10758
10758
|
), t), []);
|
10759
10759
|
}
|
10760
10760
|
getInvalidModelVariants() {
|
10761
|
-
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !
|
10761
|
+
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !Et(e, this.stepSelections) && t.push(e.stepName), t), []);
|
10762
10762
|
}
|
10763
10763
|
async stepElementsForIntroducedSilentSteps(t, e) {
|
10764
10764
|
const a = this.product;
|
@@ -10858,13 +10858,13 @@ class Bs {
|
|
10858
10858
|
...this.stepSelections,
|
10859
10859
|
[t]: { selectedVariants: e }
|
10860
10860
|
}, this.selectionCost = Object.values(this.stepSelections).reduce((C, E) => C + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, b) => P + b, 0), 0), this.workflow.steps.forEach((C) => {
|
10861
|
-
|
10861
|
+
Et(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1, delete this.stepMetadata[C.stepName], delete this.stepSelections[C.stepName], delete this.storage[C.stepName]);
|
10862
10862
|
});
|
10863
|
-
const o = this.allScenes, s =
|
10863
|
+
const o = this.allScenes, s = St(o, i), l = St(o, this.stepSelections), c = s.map((C) => C.silentSteps).flat(), A = l.map((C) => C.silentSteps).flat().filter(
|
10864
10864
|
(C) => !c.some((E) => E.stepName === C.stepName)
|
10865
10865
|
);
|
10866
10866
|
c.forEach((C) => {
|
10867
|
-
|
10867
|
+
Et(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1);
|
10868
10868
|
});
|
10869
10869
|
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
|
10870
10870
|
this.stepElements = {
|
@@ -10892,7 +10892,7 @@ class Bs {
|
|
10892
10892
|
await this.onSelectionChange(), r && await r();
|
10893
10893
|
}
|
10894
10894
|
async ensureStepsAreLoaded() {
|
10895
|
-
const e =
|
10895
|
+
const e = St(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], r = e.flat();
|
10896
10896
|
for (const l of r)
|
10897
10897
|
if (!this.stepInitialised[l.stepName])
|
10898
10898
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
@@ -10906,11 +10906,11 @@ class Bs {
|
|
10906
10906
|
);
|
10907
10907
|
break;
|
10908
10908
|
case v.Frame:
|
10909
|
-
a.push(
|
10909
|
+
a.push(vt.init(l, this, this.reloadedState));
|
10910
10910
|
break;
|
10911
10911
|
case v.Illustration:
|
10912
10912
|
a.push(
|
10913
|
-
|
10913
|
+
Ce.init(l, this, this.reloadedState)
|
10914
10914
|
);
|
10915
10915
|
break;
|
10916
10916
|
case v.Material:
|
@@ -11084,7 +11084,7 @@ class it {
|
|
11084
11084
|
return this.variantData.enabled;
|
11085
11085
|
}
|
11086
11086
|
}
|
11087
|
-
const
|
11087
|
+
const jt = class jt {
|
11088
11088
|
constructor(t, e, a) {
|
11089
11089
|
this.manager = t, this.step = e, this.tags = a;
|
11090
11090
|
}
|
@@ -11094,13 +11094,13 @@ const Ht = class Ht {
|
|
11094
11094
|
* @param value The new value
|
11095
11095
|
*/
|
11096
11096
|
setUpdateState(t) {
|
11097
|
-
|
11097
|
+
jt.updateState.set(`${this.step.stepName}-${this.manager.getTransaction().id}`, t);
|
11098
11098
|
}
|
11099
11099
|
/**
|
11100
11100
|
* @returns Gets the current update state of this step. All step handles for this step will see this value.
|
11101
11101
|
*/
|
11102
11102
|
getUpdateState() {
|
11103
|
-
return !!
|
11103
|
+
return !!jt.updateState.get(`${this.step.stepName}-${this.manager.getTransaction().id}`);
|
11104
11104
|
}
|
11105
11105
|
/**
|
11106
11106
|
* Gets the currently selected variant, or undefined if no variant is selected.
|
@@ -11210,8 +11210,8 @@ const Ht = class Ht {
|
|
11210
11210
|
e ? i && e.executeCameraAnimation(i) : console.warn("No preview service available, cannot execute camera animations."), a ? r && a.executeAnimation(r, t) : console.warn("No model container available, cannot execute model animations.");
|
11211
11211
|
}
|
11212
11212
|
};
|
11213
|
-
|
11214
|
-
let Z =
|
11213
|
+
jt.updateState = /* @__PURE__ */ new Map();
|
11214
|
+
let Z = jt;
|
11215
11215
|
class Is extends Z {
|
11216
11216
|
constructor(t, e, a) {
|
11217
11217
|
super(t, e, a);
|
@@ -11223,7 +11223,7 @@ class Is extends Z {
|
|
11223
11223
|
*/
|
11224
11224
|
async selectVariant(t) {
|
11225
11225
|
if (!this.getUpdateState() && this.getCurrentVariant() !== t)
|
11226
|
-
return
|
11226
|
+
return Ce.selectVariant(
|
11227
11227
|
this.step,
|
11228
11228
|
t.getResource(),
|
11229
11229
|
this.manager.getRegionElements(this.step.stepName) || [],
|
@@ -11265,7 +11265,7 @@ class Is extends Z {
|
|
11265
11265
|
const c = l.id.replace(/\W/g, "");
|
11266
11266
|
a ? r.set(c, { browserValue: e, pmsValue: a }) : r.set(c, e);
|
11267
11267
|
}
|
11268
|
-
}) : a ? r.set(t, { browserValue: e, pmsValue: a }) : r.set(t, e),
|
11268
|
+
}) : a ? r.set(t, { browserValue: e, pmsValue: a }) : r.set(t, e), Ce.changeColors(
|
11269
11269
|
this.step,
|
11270
11270
|
this.manager.getRegionElements(this.step.stepName),
|
11271
11271
|
this.manager,
|
@@ -11277,7 +11277,7 @@ class Is extends Z {
|
|
11277
11277
|
return this.step.data.colorOption;
|
11278
11278
|
}
|
11279
11279
|
getAvailableColors() {
|
11280
|
-
return this.step.data.colorPickerEnabled ?
|
11280
|
+
return this.step.data.colorPickerEnabled ? Ce.availableColors(this.step, this.manager) : Promise.resolve([]);
|
11281
11281
|
}
|
11282
11282
|
isColorPickerEnabled() {
|
11283
11283
|
return this.step.data.colorPickerEnabled ?? !1;
|
@@ -11684,7 +11684,7 @@ class Qs extends Z {
|
|
11684
11684
|
});
|
11685
11685
|
}
|
11686
11686
|
}
|
11687
|
-
class
|
11687
|
+
class Ae {
|
11688
11688
|
static get(t, e) {
|
11689
11689
|
switch (e.type) {
|
11690
11690
|
case v.DigitalContent:
|
@@ -11786,7 +11786,7 @@ const tr = w`
|
|
11786
11786
|
}
|
11787
11787
|
}
|
11788
11788
|
`;
|
11789
|
-
function
|
11789
|
+
function qt(n) {
|
11790
11790
|
const t = JSON.parse(atob(n.split(".")[1])).exp;
|
11791
11791
|
return Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) >= t;
|
11792
11792
|
}
|
@@ -11796,7 +11796,7 @@ const $s = async (n, t) => {
|
|
11796
11796
|
if (!t) throw new Error();
|
11797
11797
|
} catch {
|
11798
11798
|
const o = Object.entries(localStorage).find(([l, c]) => l.startsWith("CognitoIdentityServiceProvider") && l.endsWith("idToken"))?.[0] || "", s = localStorage.getItem(o);
|
11799
|
-
s && !
|
11799
|
+
s && !qt(s) && (e.Authorization = `Bearer ${s}`);
|
11800
11800
|
}
|
11801
11801
|
return (await y.getShadowGraphqlClient().mutate({
|
11802
11802
|
mutation: Rs,
|
@@ -11822,7 +11822,7 @@ const $s = async (n, t) => {
|
|
11822
11822
|
if (!t) throw new Error();
|
11823
11823
|
} catch {
|
11824
11824
|
const o = Object.entries(localStorage).find(([l, c]) => l.startsWith("CognitoIdentityServiceProvider") && l.endsWith("idToken"))?.[0] || "", s = localStorage.getItem(o);
|
11825
|
-
s && !
|
11825
|
+
s && !qt(s) && (e.Authorization = `Bearer ${s}`);
|
11826
11826
|
}
|
11827
11827
|
return (await y.getShadowGraphqlClient().mutate({
|
11828
11828
|
mutation: Os,
|
@@ -11949,12 +11949,12 @@ const $s = async (n, t) => {
|
|
11949
11949
|
for (let W = 0; W < tt.selections.length; ++W) {
|
11950
11950
|
const q = tt.selections[W];
|
11951
11951
|
if (et && (!b || et.option && (et.option.variants || []).length > 1 && !et.data.hideSelectionInCart && !et.data.hideSelectionsInCart)) {
|
11952
|
-
const
|
11953
|
-
F[
|
11952
|
+
const yt = et.stepTitle;
|
11953
|
+
F[yt] ? F[yt].push({
|
11954
11954
|
id: q.id || "",
|
11955
11955
|
name: q.name,
|
11956
11956
|
priceModifier: q.priceModifier
|
11957
|
-
}) : F[
|
11957
|
+
}) : F[yt] = [
|
11958
11958
|
{
|
11959
11959
|
id: q.id || "",
|
11960
11960
|
name: q.name,
|
@@ -12315,7 +12315,7 @@ class Ys {
|
|
12315
12315
|
}
|
12316
12316
|
let i = 2048;
|
12317
12317
|
e && e <= 2048 && (i = e);
|
12318
|
-
const o =
|
12318
|
+
const o = ft(i, i), s = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = s.find((B) => B.layoutState?.layout.panelId === c?.name) || s[0], A = d.layoutState.layout.previewRegion ? {
|
12319
12319
|
x: d.layoutState.layout.previewRegion.left,
|
12320
12320
|
y: d.layoutState.layout.previewRegion.top,
|
12321
12321
|
width: d.layoutState.layout.previewRegion.width,
|
@@ -12330,7 +12330,7 @@ class Ys {
|
|
12330
12330
|
throw new Te("Failed to obtain 2D context for preview image creation");
|
12331
12331
|
const m = this.workflowManager.getTemplatingContext(), p = Ea(u.layoutState.layout, u.layoutState.elements, {
|
12332
12332
|
renderingConfiguration: {
|
12333
|
-
purpose:
|
12333
|
+
purpose: Yt.Print,
|
12334
12334
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
12335
12335
|
templatingContext: m
|
12336
12336
|
}
|
@@ -12338,8 +12338,8 @@ class Ys {
|
|
12338
12338
|
await (await ma.from(h, g, {
|
12339
12339
|
anonymousCrossOrigin: !0,
|
12340
12340
|
ignoreDimensions: !1,
|
12341
|
-
createCanvas:
|
12342
|
-
createImage:
|
12341
|
+
createCanvas: ft,
|
12342
|
+
createImage: ee,
|
12343
12343
|
DOMParser: Ca(),
|
12344
12344
|
fetch
|
12345
12345
|
})).render();
|
@@ -12352,7 +12352,7 @@ class Ys {
|
|
12352
12352
|
const a = this.cachedStepHandles.get(e.stepName);
|
12353
12353
|
if (a)
|
12354
12354
|
return a;
|
12355
|
-
const r =
|
12355
|
+
const r = Ae.get(this.getWorkflowManager(), e);
|
12356
12356
|
return this.cachedStepHandles.set(e.stepName, r), r;
|
12357
12357
|
}
|
12358
12358
|
getSteps() {
|
@@ -12361,7 +12361,7 @@ class Ys {
|
|
12361
12361
|
getStepsConditionallyActive() {
|
12362
12362
|
return this.getScenes().flatMap(
|
12363
12363
|
(t) => this.getStepsByScene(t).filter(
|
12364
|
-
(e) =>
|
12364
|
+
(e) => Et(e.getRaw(), this.getWorkflowManager().getStepSelections())
|
12365
12365
|
)
|
12366
12366
|
);
|
12367
12367
|
}
|
@@ -12453,10 +12453,10 @@ class Ys {
|
|
12453
12453
|
getStepByName(t) {
|
12454
12454
|
const e = this.getWorkflowManager().getWorkflow().steps.find((a) => a.stepTitle === t);
|
12455
12455
|
if (!(!e || !this.stepHasHandle(e)))
|
12456
|
-
return
|
12456
|
+
return Ae.get(this.getWorkflowManager(), e);
|
12457
12457
|
}
|
12458
12458
|
getStepsByType(t) {
|
12459
|
-
return this.getWorkflowManager().getWorkflow().steps.filter((e) => e.type === t).map((e) =>
|
12459
|
+
return this.getWorkflowManager().getWorkflow().steps.filter((e) => e.type === t).map((e) => Ae.get(this.getWorkflowManager(), e));
|
12460
12460
|
}
|
12461
12461
|
getStepsByScene(t) {
|
12462
12462
|
if (!this.getWorkflowManager().getWorkflow().stepGroups.find((a) => a.name === t.name))
|
@@ -12465,7 +12465,7 @@ class Ys {
|
|
12465
12465
|
);
|
12466
12466
|
return t.stepIds.map(
|
12467
12467
|
(a) => this.getWorkflowManager().getWorkflow().steps.find((r) => r.stepName === a)
|
12468
|
-
).filter((a) => this.stepHasHandle(a)).map((a) =>
|
12468
|
+
).filter((a) => this.stepHasHandle(a)).map((a) => Ae.get(this.getWorkflowManager(), a));
|
12469
12469
|
}
|
12470
12470
|
async attachCustomerDetails(t) {
|
12471
12471
|
return this.assignCustomerDetails({ emailAddress: t.email });
|
@@ -12512,7 +12512,7 @@ class Ys {
|
|
12512
12512
|
return await Xe.addDesign(r), r;
|
12513
12513
|
}
|
12514
12514
|
async copy() {
|
12515
|
-
const t =
|
12515
|
+
const t = ht(this.getCommandContext().getState());
|
12516
12516
|
if (!t) throw new V("Internal state is undefined! Cannot copy experience!");
|
12517
12517
|
const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), r = this.getWorkflowManager().getTransaction().integrationProduct?.id;
|
12518
12518
|
if (!r) throw new V("Integration product id is undefined!");
|
@@ -12785,7 +12785,7 @@ const Js = (n) => {
|
|
12785
12785
|
const r = e.data, i = a.option;
|
12786
12786
|
if (!i)
|
12787
12787
|
return console.error(`No option for step ${a.stepName}.`), [];
|
12788
|
-
const o = i.variants?.find((C) => C.id === r.illustrationVariantId) ||
|
12788
|
+
const o = i.variants?.find((C) => C.id === r.illustrationVariantId) || re(i);
|
12789
12789
|
if (!o)
|
12790
12790
|
return console.error(`No variant with ID: ${r.illustrationVariantId}`), [];
|
12791
12791
|
if (!o.asset)
|
@@ -12883,7 +12883,7 @@ const Js = (n) => {
|
|
12883
12883
|
const r = e.data, i = a.option;
|
12884
12884
|
if (!i)
|
12885
12885
|
return console.error(`No option for step ${a.stepName}.`), [];
|
12886
|
-
const o = i.variants?.find((d) => d.id === r.pictureVariantId) ||
|
12886
|
+
const o = i.variants?.find((d) => d.id === r.pictureVariantId) || re(i);
|
12887
12887
|
if (!o)
|
12888
12888
|
return console.error(`No variant with ID: ${r.pictureVariantId}`), [];
|
12889
12889
|
if (!o.asset)
|
@@ -12924,7 +12924,7 @@ const Js = (n) => {
|
|
12924
12924
|
const r = e.data, i = a.option;
|
12925
12925
|
if (!i)
|
12926
12926
|
return console.error(`No option for step ${a.stepName}.`), [];
|
12927
|
-
const o = i.variants?.find((c) => c.id === r.colorVariantId) ||
|
12927
|
+
const o = i.variants?.find((c) => c.id === r.colorVariantId) || re(i);
|
12928
12928
|
if (!o)
|
12929
12929
|
return console.error(`No variant with ID: ${r.colorVariantId}`), [];
|
12930
12930
|
t[a.stepName] = { selectedVariants: [o] };
|
@@ -13045,7 +13045,7 @@ const Js = (n) => {
|
|
13045
13045
|
const g = a.option;
|
13046
13046
|
if (!g)
|
13047
13047
|
return;
|
13048
|
-
const f = g.variants?.find((B) => B.id === i.fontVariantId) ||
|
13048
|
+
const f = g.variants?.find((B) => B.id === i.fontVariantId) || re(g);
|
13049
13049
|
if (!f || !f.asset)
|
13050
13050
|
return;
|
13051
13051
|
t[a.stepName] = { selectedVariants: [f] };
|
@@ -13094,7 +13094,7 @@ const Js = (n) => {
|
|
13094
13094
|
y: g.top
|
13095
13095
|
};
|
13096
13096
|
if (d) {
|
13097
|
-
const [B, I] =
|
13097
|
+
const [B, I] = we(
|
13098
13098
|
a.data.size || o,
|
13099
13099
|
d,
|
13100
13100
|
g,
|
@@ -13222,7 +13222,7 @@ class ll {
|
|
13222
13222
|
}
|
13223
13223
|
const cl = () => new Promise((n, t) => {
|
13224
13224
|
try {
|
13225
|
-
const a =
|
13225
|
+
const a = ft().getContext("webgl2");
|
13226
13226
|
n(!!a);
|
13227
13227
|
} catch {
|
13228
13228
|
n(!1);
|
@@ -13276,7 +13276,7 @@ class Al {
|
|
13276
13276
|
* Actions to perform when a static render event is fired for this canvas.
|
13277
13277
|
*/
|
13278
13278
|
async render(t) {
|
13279
|
-
const e =
|
13279
|
+
const e = ht(t);
|
13280
13280
|
this.lastRequestedRenderArguments = e;
|
13281
13281
|
const a = this.getStaticContext();
|
13282
13282
|
if (!a) {
|
@@ -13349,7 +13349,7 @@ class ul extends Mn {
|
|
13349
13349
|
l = i.width, c = i.height;
|
13350
13350
|
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = Ea(t.layoutState.layout, e, {
|
13351
13351
|
renderingConfiguration: {
|
13352
|
-
purpose:
|
13352
|
+
purpose: Yt.ThreeD,
|
13353
13353
|
templatingContext: d
|
13354
13354
|
}
|
13355
13355
|
}), u = fn(A), h = await ma.from(this.ctx, u, {
|
@@ -13359,8 +13359,8 @@ class ul extends Mn {
|
|
13359
13359
|
ignoreClear: !0,
|
13360
13360
|
ignoreMouse: !0,
|
13361
13361
|
enableRedraw: !1,
|
13362
|
-
createCanvas:
|
13363
|
-
createImage:
|
13362
|
+
createCanvas: ft,
|
13363
|
+
createImage: ee,
|
13364
13364
|
DOMParser: Ca(),
|
13365
13365
|
fetch
|
13366
13366
|
});
|
@@ -13421,11 +13421,9 @@ class hl {
|
|
13421
13421
|
return e ? t.filter((a) => this.aspectConditionsSatisfied(a.getRawProperty(), e)) : t;
|
13422
13422
|
}
|
13423
13423
|
aspectConditionsSatisfied(t, e) {
|
13424
|
-
return
|
13425
|
-
const r = e.aspects.find((
|
13426
|
-
|
13427
|
-
const i = a.requiredVariantSelections.some((o) => o === r.value);
|
13428
|
-
return console.log(`LOG: does aspect ${t.name} (${t.title}) have a matching selection for ${a.targetAspectName} / ${r.value}? ${i}`), i;
|
13424
|
+
return !t.conditions || t.conditions.length === 0 ? !0 : t.conditions.some((a) => {
|
13425
|
+
const r = e.aspects.find((i) => i.name === a.targetAspectName);
|
13426
|
+
return r ? a.requiredVariantSelections.some((i) => i === r.value) : !1;
|
13429
13427
|
});
|
13430
13428
|
}
|
13431
13429
|
async createHandle(t) {
|
@@ -13495,6 +13493,9 @@ class Da {
|
|
13495
13493
|
isMandatoryFulfilled() {
|
13496
13494
|
return !this.property.mandatory || !!this.bundle.getGlobalPropertyStateManager().getAspectMandatoryFulfilled(this.property.name);
|
13497
13495
|
}
|
13496
|
+
async clear() {
|
13497
|
+
await this.bundle.getGlobalPropertyStateManager().clearAspect(this.property.name);
|
13498
|
+
}
|
13498
13499
|
/**
|
13499
13500
|
* Returns all steps that share this property.
|
13500
13501
|
* @param targetExperiences Optionally filter the steps to only those in the given experiences.
|
@@ -13924,7 +13925,7 @@ function rr(n) {
|
|
13924
13925
|
e.value !== "" && t.set(e.name, !0);
|
13925
13926
|
}), t;
|
13926
13927
|
}
|
13927
|
-
function
|
13928
|
+
function ue(n) {
|
13928
13929
|
return ua(n, ["__typename"]);
|
13929
13930
|
}
|
13930
13931
|
class yl {
|
@@ -13932,11 +13933,17 @@ class yl {
|
|
13932
13933
|
this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = i;
|
13933
13934
|
const o = i?.existingGlobalPropertyState;
|
13934
13935
|
this.initPromise = o ? Promise.resolve(o).then(() => {
|
13935
|
-
console.log("Setting global property state to existing state."), this.globalPropertyState =
|
13936
|
+
console.log("Setting global property state to existing state."), this.globalPropertyState = ue(o), this.recalculateMandatoryStates();
|
13936
13937
|
}) : this.createGlobalPropertyState().then((s) => {
|
13937
|
-
console.log("Setting global property state to new state."), this.globalPropertyState =
|
13938
|
+
console.log("Setting global property state to new state."), this.globalPropertyState = ue(s), this.recalculateMandatoryStates();
|
13938
13939
|
}), this.onGlobalPropertyStateChange = r;
|
13939
13940
|
}
|
13941
|
+
async clearAspect(t) {
|
13942
|
+
if (!this.globalPropertyState)
|
13943
|
+
throw new Error("Global property state not initialized");
|
13944
|
+
const e = this.globalPropertyState.aspects, a = ht(this.globalPropertyState);
|
13945
|
+
this.globalPropertyState.aspects = e.filter((r) => r.name !== t), !Wt(a, this.globalPropertyState) && (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(a, this.globalPropertyState));
|
13946
|
+
}
|
13940
13947
|
recalculateMandatoryStates() {
|
13941
13948
|
this.mandatoryFulfilledAspects = rr(this.globalPropertyState);
|
13942
13949
|
}
|
@@ -13957,8 +13964,8 @@ class yl {
|
|
13957
13964
|
}
|
13958
13965
|
async setGlobalPropertyState(t) {
|
13959
13966
|
this.globalPropertyState || await this.initPromise;
|
13960
|
-
const e =
|
13961
|
-
this.globalPropertyState = { ...
|
13967
|
+
const e = ht(this.globalPropertyState);
|
13968
|
+
this.globalPropertyState = { ...ue(t), id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
13962
13969
|
}
|
13963
13970
|
getAspectMandatoryFulfilled(t) {
|
13964
13971
|
return this.mandatoryFulfilledAspects.get(t);
|
@@ -13984,7 +13991,7 @@ class yl {
|
|
13984
13991
|
if (!i)
|
13985
13992
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13986
13993
|
this.mandatoryFulfilledAspects.set(t, e !== "");
|
13987
|
-
const o =
|
13994
|
+
const o = ht(this.globalPropertyState), s = this.globalPropertyState.aspects.filter((l) => l.name === t);
|
13988
13995
|
if (s.length > 0)
|
13989
13996
|
if (r) {
|
13990
13997
|
const l = s.find((c) => c.channel === r);
|
@@ -14017,7 +14024,7 @@ class yl {
|
|
14017
14024
|
storage: a !== null ? a : void 0,
|
14018
14025
|
channel: r
|
14019
14026
|
});
|
14020
|
-
|
14027
|
+
Wt(o, this.globalPropertyState) || (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(o, this.globalPropertyState));
|
14021
14028
|
}
|
14022
14029
|
async setAspectStorage(t, e, a) {
|
14023
14030
|
if (!this.globalPropertyState)
|
@@ -14027,7 +14034,7 @@ class yl {
|
|
14027
14034
|
const r = this.configuration.aspects.find((s) => s.name === t);
|
14028
14035
|
if (!r)
|
14029
14036
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
14030
|
-
const i =
|
14037
|
+
const i = ht(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((s) => s.name === t);
|
14031
14038
|
if (o.length > 0)
|
14032
14039
|
if (a) {
|
14033
14040
|
const s = o.find((l) => l.channel === a);
|
@@ -14044,11 +14051,12 @@ class yl {
|
|
14044
14051
|
storage: e !== null ? e : void 0,
|
14045
14052
|
channel: a
|
14046
14053
|
});
|
14047
|
-
|
14054
|
+
Wt(i, this.globalPropertyState) || (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(i, this.globalPropertyState));
|
14048
14055
|
}
|
14049
14056
|
async updateGlobalPropertyState() {
|
14050
14057
|
if (!this.globalPropertyState)
|
14051
14058
|
throw new Error("Global property state not initialized");
|
14059
|
+
console.log(`LOG: updating ${this.globalPropertyState.aspects.length} aspects`), console.trace();
|
14052
14060
|
const t = await y.getShadowGraphqlClient().mutate({
|
14053
14061
|
mutation: jo,
|
14054
14062
|
variables: {
|
@@ -14087,7 +14095,7 @@ class yl {
|
|
14087
14095
|
}
|
14088
14096
|
});
|
14089
14097
|
if (t.data?.globalPropertyStateUpdate)
|
14090
|
-
this.globalPropertyState =
|
14098
|
+
this.globalPropertyState = ue(t.data.globalPropertyStateUpdate);
|
14091
14099
|
else
|
14092
14100
|
throw new Error("Unable to update global property state");
|
14093
14101
|
}
|
@@ -14323,14 +14331,14 @@ class ir {
|
|
14323
14331
|
getProducts() {
|
14324
14332
|
if (!this.collection.productCollectionProducts)
|
14325
14333
|
throw new Error("Failed to find products on collection. Ensure you fetch them first!");
|
14326
|
-
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new
|
14334
|
+
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new he(t));
|
14327
14335
|
}
|
14328
14336
|
/**
|
14329
14337
|
* A list of products in this collections with useful helpers for interacting with them.
|
14330
14338
|
*/
|
14331
14339
|
async fetchProducts(t) {
|
14332
14340
|
if (this.fullFetched)
|
14333
|
-
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
14341
|
+
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new he(a));
|
14334
14342
|
const e = await y.getShadowGraphqlClient().query({
|
14335
14343
|
query: Xo,
|
14336
14344
|
variables: {
|
@@ -14339,7 +14347,7 @@ class ir {
|
|
14339
14347
|
},
|
14340
14348
|
errorPolicy: "all"
|
14341
14349
|
});
|
14342
|
-
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
14350
|
+
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new he(a));
|
14343
14351
|
}
|
14344
14352
|
/**
|
14345
14353
|
* Returns a list of collections products matching the associated metafield/tag filters.
|
@@ -14429,7 +14437,7 @@ class ir {
|
|
14429
14437
|
if (h || p.partial && (!p.data.productCollections || p.data.productCollections.length === 0 || !p.data.productCollections[0].productCollectionProductsFeed?.items || p.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
14430
14438
|
return;
|
14431
14439
|
c.abort(), h = !0, m.unsubscribe();
|
14432
|
-
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new
|
14440
|
+
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new he(ht(f))) || [];
|
14433
14441
|
u({
|
14434
14442
|
items: g,
|
14435
14443
|
// Clone items because it could be cached data (immutable)
|
@@ -14453,7 +14461,7 @@ class ir {
|
|
14453
14461
|
return this.collection;
|
14454
14462
|
}
|
14455
14463
|
}
|
14456
|
-
class
|
14464
|
+
class he {
|
14457
14465
|
constructor(t) {
|
14458
14466
|
this.product = t.product, this.productResource = t;
|
14459
14467
|
}
|
@@ -14501,23 +14509,23 @@ class ue {
|
|
14501
14509
|
getDefaultWorkflow() {
|
14502
14510
|
const t = this.product.workflows;
|
14503
14511
|
if (t === void 0)
|
14504
|
-
throw new
|
14512
|
+
throw new mt(
|
14505
14513
|
"Called getDefaultWorkflow() before fetching collection products. Use collection.fetchProducts() first to ensure the data is available."
|
14506
14514
|
);
|
14507
14515
|
if (t.length === 0)
|
14508
|
-
throw new
|
14516
|
+
throw new mt(
|
14509
14517
|
"Called getDefaultWorkflow() but no workflows on requested product. Ensure at least 1 workflow is assigned to this product."
|
14510
14518
|
);
|
14511
14519
|
const e = this.productResource.workflowId;
|
14512
14520
|
if (e) {
|
14513
14521
|
const a = t.find((r) => r.workflowName === e);
|
14514
|
-
if (a) return new
|
14522
|
+
if (a) return new Ht(a);
|
14515
14523
|
}
|
14516
14524
|
if (t.length === 1)
|
14517
14525
|
return console.warn(
|
14518
14526
|
"Called getDefaultWorkflow() but no default was configured. There is only one workflow available so we will fall back to using this!"
|
14519
|
-
), new
|
14520
|
-
throw new
|
14527
|
+
), new Ht(t[0]);
|
14528
|
+
throw new mt(
|
14521
14529
|
"Called getDefaultWorkflow() but no default workflow is configured for the requested product. Multiple workflows exist so we can't assume!"
|
14522
14530
|
);
|
14523
14531
|
}
|
@@ -14526,10 +14534,10 @@ class ue {
|
|
14526
14534
|
*/
|
14527
14535
|
getAllWorkflows() {
|
14528
14536
|
if ((this.product.workflows || []).length === 0)
|
14529
|
-
throw new
|
14537
|
+
throw new mt(
|
14530
14538
|
"No workflows on configured product. Ensure at least 1 workflow is assigned to this product."
|
14531
14539
|
);
|
14532
|
-
return this.product.workflows.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new
|
14540
|
+
return this.product.workflows.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new Ht(e));
|
14533
14541
|
}
|
14534
14542
|
/**
|
14535
14543
|
* A list of all integrations this product is connected to.
|
@@ -14573,7 +14581,7 @@ class ue {
|
|
14573
14581
|
return bl.requestKeysForEntity(this.product.id, t);
|
14574
14582
|
}
|
14575
14583
|
}
|
14576
|
-
class
|
14584
|
+
class Ht {
|
14577
14585
|
constructor(t) {
|
14578
14586
|
this.workflow = t;
|
14579
14587
|
}
|
@@ -14648,7 +14656,7 @@ class Pl {
|
|
14648
14656
|
}
|
14649
14657
|
}
|
14650
14658
|
const Dl = w`
|
14651
|
-
${
|
14659
|
+
${oe(!1)}
|
14652
14660
|
query GetProductCollections($ids: [String!]!) {
|
14653
14661
|
productCollections(ids: $ids) {
|
14654
14662
|
...ProductCollectionFields
|
@@ -15383,7 +15391,10 @@ class Ze {
|
|
15383
15391
|
return l.initDefaultVariant();
|
15384
15392
|
}
|
15385
15393
|
});
|
15386
|
-
await Promise.all(o)
|
15394
|
+
await Promise.all(o);
|
15395
|
+
for (const s of a)
|
15396
|
+
i.find((l) => l.getName() == s.getName()) || await s.clear();
|
15397
|
+
await Promise.all(i.map((s) => s.applyGlobalState()));
|
15387
15398
|
}
|
15388
15399
|
checkConditionalHandlesChanged(t, e) {
|
15389
15400
|
(() => {
|
@@ -15537,14 +15548,14 @@ class Ql {
|
|
15537
15548
|
* @returns The nodes contained within the execution.
|
15538
15549
|
*/
|
15539
15550
|
getNodes() {
|
15540
|
-
return this.execution.nodes.map((t) => new
|
15551
|
+
return this.execution.nodes.map((t) => new me(t));
|
15541
15552
|
}
|
15542
15553
|
/**
|
15543
15554
|
* @param type The type of node to return.
|
15544
15555
|
* @returns A list of nodes matching the requested type.
|
15545
15556
|
*/
|
15546
15557
|
getNodesByType(t) {
|
15547
|
-
return this.execution.nodes.filter((e) => e.type === t).map((e) => new
|
15558
|
+
return this.execution.nodes.filter((e) => e.type === t).map((e) => new me(e));
|
15548
15559
|
}
|
15549
15560
|
/**
|
15550
15561
|
* @returns A list of input nodes that exist in this execution.
|
@@ -15553,7 +15564,7 @@ class Ql {
|
|
15553
15564
|
return this.execution.nodes.filter(
|
15554
15565
|
(t) => t.type === "StartTerminal"
|
15555
15566
|
/* StartTerminal */
|
15556
|
-
).map((t) => new
|
15567
|
+
).map((t) => new me(t));
|
15557
15568
|
}
|
15558
15569
|
/**
|
15559
15570
|
* @returns A list of out put nodes that exist in this execution.
|
@@ -15562,7 +15573,7 @@ class Ql {
|
|
15562
15573
|
return this.execution.nodes.filter(
|
15563
15574
|
(t) => t.type === "EndTerminal"
|
15564
15575
|
/* EndTerminal */
|
15565
|
-
).map((t) => new
|
15576
|
+
).map((t) => new me(t));
|
15566
15577
|
}
|
15567
15578
|
/**
|
15568
15579
|
* @returns A date object representing the point in time this execution completed.
|
@@ -15579,7 +15590,7 @@ class Ql {
|
|
15579
15590
|
return new Date(this.execution.failedAt);
|
15580
15591
|
}
|
15581
15592
|
}
|
15582
|
-
class
|
15593
|
+
class me {
|
15583
15594
|
constructor(t) {
|
15584
15595
|
this.node = t;
|
15585
15596
|
}
|
@@ -15656,7 +15667,7 @@ class tn {
|
|
15656
15667
|
throw new Error(
|
15657
15668
|
"No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product."
|
15658
15669
|
);
|
15659
|
-
return new
|
15670
|
+
return new Ht(t[0]);
|
15660
15671
|
}
|
15661
15672
|
getAllWorkflows() {
|
15662
15673
|
if (!this.integrationProduct.product)
|
@@ -15666,10 +15677,10 @@ class tn {
|
|
15666
15677
|
throw new Error(
|
15667
15678
|
"No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product."
|
15668
15679
|
);
|
15669
|
-
return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new
|
15680
|
+
return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new Ht(e));
|
15670
15681
|
}
|
15671
15682
|
}
|
15672
|
-
const
|
15683
|
+
const ge = w`
|
15673
15684
|
query GetCustomer($emailAddress: String!) {
|
15674
15685
|
customer(emailAddress: $emailAddress) {
|
15675
15686
|
id
|
@@ -15956,7 +15967,7 @@ const Wl = async (n, t) => {
|
|
15956
15967
|
r.steps.forEach((i) => {
|
15957
15968
|
delete i.data.__typename, i.option?.id && (i.option.defaultVariant?.asset && O.cacheAsset(i.option.defaultVariant.asset), i.option.colorProfile && O.cacheAsset(i.option.colorProfile), i.option.variants?.forEach((o) => {
|
15958
15969
|
o.asset && O.cacheAsset(o.asset), o.thumbnail && O.cacheAsset(o.thumbnail), o.material && O.cacheMaterial(o.material);
|
15959
|
-
}),
|
15970
|
+
}), _t.set({ id: i.option.id }, Promise.resolve(i.option)));
|
15960
15971
|
}), r.finalizeStepConfig || (r.finalizeStepConfig = {}), r.finalizeStepConfig.termsMarkdown = r.finalizeStepConfig.termsMarkdown || r.partner.termsMarkdown;
|
15961
15972
|
}), a;
|
15962
15973
|
}, ql = async (n, t) => {
|
@@ -15965,11 +15976,11 @@ const Wl = async (n, t) => {
|
|
15965
15976
|
throw new Error(`Workflow not found: ${n}`);
|
15966
15977
|
return a;
|
15967
15978
|
}, sr = async (n, t) => {
|
15968
|
-
const e = n.map((s) =>
|
15979
|
+
const e = n.map((s) => _t.get({ id: s, options: t })), a = n.filter((s, l) => e[l] === void 0);
|
15969
15980
|
if (a.length === 0)
|
15970
15981
|
return Promise.all(e);
|
15971
15982
|
const r = Wl(a, t), i = a.map(
|
15972
|
-
(s) =>
|
15983
|
+
(s) => _t.set({ id: s, options: t }, ql(s, r))
|
15973
15984
|
), o = e.filter((s) => s !== void 0);
|
15974
15985
|
return await Promise.all(o.concat(i));
|
15975
15986
|
}, vd = async (n, t) => (await sr([n], t))[0], Hl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
@@ -15999,12 +16010,12 @@ class Ed {
|
|
15999
16010
|
mutation: Pi
|
16000
16011
|
});
|
16001
16012
|
} catch (a) {
|
16002
|
-
throw console.error(a), new
|
16013
|
+
throw console.error(a), new mt("Critical - Unable to synchronize workflow state with server.");
|
16003
16014
|
}
|
16004
|
-
}, this.options = t, this.options.applicationKey && Wr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.4.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
16015
|
+
}, this.options = t, this.options.applicationKey && Wr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.4.0-beta.363e50d8-0581-5d51-b4bf-cf795131d06b"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
16005
16016
|
}
|
16006
16017
|
configure(t) {
|
16007
|
-
|
16018
|
+
pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && Hr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
16008
16019
|
}
|
16009
16020
|
/**
|
16010
16021
|
* @returns The asset manager allows for common operations related to assets
|
@@ -16133,7 +16144,7 @@ class Ed {
|
|
16133
16144
|
}
|
16134
16145
|
async customerHasBundleTemplates(t) {
|
16135
16146
|
const r = (await y.getShadowGraphqlClient().query({
|
16136
|
-
query:
|
16147
|
+
query: ge,
|
16137
16148
|
errorPolicy: "all",
|
16138
16149
|
fetchPolicy: "no-cache",
|
16139
16150
|
variables: {
|
@@ -16152,7 +16163,7 @@ class Ed {
|
|
16152
16163
|
async getOrCreateCustomer(t) {
|
16153
16164
|
this.customer = void 0;
|
16154
16165
|
const e = y.getShadowGraphqlClient(), r = (await e.query({
|
16155
|
-
query:
|
16166
|
+
query: ge,
|
16156
16167
|
errorPolicy: "all",
|
16157
16168
|
fetchPolicy: "no-cache",
|
16158
16169
|
variables: {
|
@@ -16205,7 +16216,7 @@ class Ed {
|
|
16205
16216
|
return this.logOut(), console.error("Failed to refresh tokens."), !1;
|
16206
16217
|
}
|
16207
16218
|
const s = (await y.getShadowGraphqlClient().query({
|
16208
|
-
query:
|
16219
|
+
query: ge,
|
16209
16220
|
errorPolicy: "all",
|
16210
16221
|
fetchPolicy: "no-cache",
|
16211
16222
|
variables: {
|
@@ -16234,7 +16245,7 @@ class Ed {
|
|
16234
16245
|
if (r?.AuthenticationResult) {
|
16235
16246
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(r.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
16236
16247
|
const o = (await y.getShadowGraphqlClient().query({
|
16237
|
-
query:
|
16248
|
+
query: ge,
|
16238
16249
|
errorPolicy: "all",
|
16239
16250
|
fetchPolicy: "no-cache",
|
16240
16251
|
variables: {
|
@@ -16258,7 +16269,7 @@ class Ed {
|
|
16258
16269
|
const t = localStorage.getItem("last-refreshed-cognito-tokens"), e = localStorage.getItem("cognito-tokens");
|
16259
16270
|
if (!t || !e)
|
16260
16271
|
throw new Error("No token data in storage.");
|
16261
|
-
const a = JSON.parse(e), r = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !a?.AccessToken ||
|
16272
|
+
const a = JSON.parse(e), r = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !a?.AccessToken || qt(a.AccessToken);
|
16262
16273
|
if (!a.ExpiresIn || a.ExpiresIn < r - parseInt(t) || i) {
|
16263
16274
|
const o = await Lt.refreshTokens();
|
16264
16275
|
if (o?.AuthenticationResult)
|
@@ -16321,7 +16332,7 @@ class Ed {
|
|
16321
16332
|
s.Authorization = `Bearer ${h}`;
|
16322
16333
|
} catch {
|
16323
16334
|
const p = Object.entries(localStorage).find(([f, S]) => f.startsWith("CognitoIdentityServiceProvider") && f.endsWith("idToken"))?.[0] || "", g = localStorage.getItem(p);
|
16324
|
-
g && !
|
16335
|
+
g && !qt(g) && (s.Authorization = `Bearer ${g}`);
|
16325
16336
|
}
|
16326
16337
|
const l = {
|
16327
16338
|
bundleOwnerId: o,
|
@@ -16362,7 +16373,7 @@ class Ed {
|
|
16362
16373
|
o.Authorization = `Bearer ${u}`;
|
16363
16374
|
} catch {
|
16364
16375
|
const m = Object.entries(localStorage).find(([g, f]) => g.startsWith("CognitoIdentityServiceProvider") && g.endsWith("idToken"))?.[0] || "", p = localStorage.getItem(m);
|
16365
|
-
p && !
|
16376
|
+
p && !qt(p) && (o.Authorization = `Bearer ${p}`);
|
16366
16377
|
}
|
16367
16378
|
const s = {
|
16368
16379
|
bundleOwnerId: i,
|
@@ -16459,7 +16470,7 @@ class Ed {
|
|
16459
16470
|
*/
|
16460
16471
|
async getWorkflowExperiences(t, e) {
|
16461
16472
|
if (t.length === 0)
|
16462
|
-
throw new
|
16473
|
+
throw new mt("No options provided!");
|
16463
16474
|
const a = y.getShadowGraphqlClient(), r = async (C) => {
|
16464
16475
|
if (C.length === 0)
|
16465
16476
|
return [];
|
@@ -16473,7 +16484,7 @@ class Ed {
|
|
16473
16484
|
}), b = P.data.transactions;
|
16474
16485
|
if (b.length !== C.length) {
|
16475
16486
|
const F = P.errors?.[0]?.message || "Unknown error";
|
16476
|
-
throw new
|
16487
|
+
throw new mt(`Not all transactions were found: ${F}`);
|
16477
16488
|
}
|
16478
16489
|
return !this.activeIntegration && b[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(b[0].integrationProduct.integration)), b.map((F, Q) => ({
|
16479
16490
|
transaction: F,
|
@@ -16505,7 +16516,7 @@ class Ed {
|
|
16505
16516
|
}), P = E.data?.transactionCreateMany;
|
16506
16517
|
if (!P || P.length === 0) {
|
16507
16518
|
const b = E.errors?.[0]?.message || "Unknown error";
|
16508
|
-
throw new
|
16519
|
+
throw new mt(`Failed to create transactions: ${b}`);
|
16509
16520
|
}
|
16510
16521
|
return P.map((b, F) => ({
|
16511
16522
|
transaction: b,
|
@@ -16542,10 +16553,10 @@ class Ed {
|
|
16542
16553
|
};
|
16543
16554
|
if (T.type === "transaction" && E.workflowState) {
|
16544
16555
|
const q = JSON.parse(E.workflowState);
|
16545
|
-
W.layouts = Object.values(q.layouts || {}).map((
|
16556
|
+
W.layouts = Object.values(q.layouts || {}).map((yt) => yt.layout), await qa(q), W.reloadedState = q;
|
16546
16557
|
} else if (!b && T.workflowState) {
|
16547
16558
|
const q = JSON.parse(T.workflowState);
|
16548
|
-
W.layouts = Object.values(q.layouts || {}).map((
|
16559
|
+
W.layouts = Object.values(q.layouts || {}).map((yt) => yt.layout), await qa(q), W.reloadedState = q;
|
16549
16560
|
} else
|
16550
16561
|
W.layouts = jl(
|
16551
16562
|
W.transaction,
|
@@ -16691,12 +16702,12 @@ function Jl(n, t, e, a) {
|
|
16691
16702
|
const s = n, l = Math.max(t.width / e.width, t.height / e.height);
|
16692
16703
|
s.zoom = Math.max(l, n.zoom);
|
16693
16704
|
const c = e.width * s.zoom, d = e.height * s.zoom;
|
16694
|
-
return s.x =
|
16705
|
+
return s.x = pe(n.x, t.width - c, 0), s.y = pe(n.y, t.height - d, 0), s;
|
16695
16706
|
}
|
16696
16707
|
const o = n;
|
16697
|
-
return o.x =
|
16708
|
+
return o.x = pe(o.x, -r, t.width), o.y = pe(o.y, -i, t.height), o;
|
16698
16709
|
}
|
16699
|
-
function
|
16710
|
+
function pe(n, t, e) {
|
16700
16711
|
return Math.min(Math.max(n, t), e);
|
16701
16712
|
}
|
16702
16713
|
class Kl {
|
@@ -16722,7 +16733,7 @@ class Kl {
|
|
16722
16733
|
let i = !1;
|
16723
16734
|
for (let o = 0; o < r.currentFrameSources.length; o++) {
|
16724
16735
|
const s = r.currentFrameSources[o], l = await Ue(s), c = this.frameData ? this.frameData[o] : void 0;
|
16725
|
-
|
16736
|
+
Wt(l, c) || (this.frameData || (this.frameData = new Array(r.currentFrameSources.length)), this.frameData[o] = l, i = !0);
|
16726
16737
|
}
|
16727
16738
|
i && (this.onFrameDataChangeListeners.forEach(
|
16728
16739
|
(o) => o(this.frameData)
|
@@ -17094,7 +17105,7 @@ class Xl extends Z {
|
|
17094
17105
|
}
|
17095
17106
|
selectVariant(t) {
|
17096
17107
|
const e = this.manager.getRegionElements(this.step.stepName);
|
17097
|
-
return
|
17108
|
+
return vt.selectVariant(
|
17098
17109
|
this.step,
|
17099
17110
|
t.getResource(),
|
17100
17111
|
e,
|
@@ -17114,7 +17125,7 @@ class Xl extends Z {
|
|
17114
17125
|
* @param [recalculateOffsets=true] Optional: Recalculates the offsets of the image inside the frame. Default: `true`.
|
17115
17126
|
*/
|
17116
17127
|
async selectImage(t, e = !0, a = !0) {
|
17117
|
-
if (await
|
17128
|
+
if (await vt.selectImage(this.step, t, this.manager, a), e) {
|
17118
17129
|
const r = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17119
17130
|
this.manager.updateStorage(this.step.stepName, {
|
17120
17131
|
framePatternData: {
|
@@ -17152,7 +17163,7 @@ class Xl extends Z {
|
|
17152
17163
|
if (!e)
|
17153
17164
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
17154
17165
|
const a = await O.removeBackgroundFromAsset(e);
|
17155
|
-
t && await
|
17166
|
+
t && await vt.selectImage(this.step, a, this.manager, !1);
|
17156
17167
|
const r = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17157
17168
|
return this.manager.updateStorage(this.step.stepName, {
|
17158
17169
|
framePatternData: {
|
@@ -17163,7 +17174,7 @@ class Xl extends Z {
|
|
17163
17174
|
}), a;
|
17164
17175
|
}
|
17165
17176
|
changeColors(t) {
|
17166
|
-
|
17177
|
+
vt.changeColors(this.step, this.manager, t);
|
17167
17178
|
}
|
17168
17179
|
getImageData() {
|
17169
17180
|
if (this.frameService)
|
@@ -17173,7 +17184,7 @@ class Xl extends Z {
|
|
17173
17184
|
return this.step.data.colorOption;
|
17174
17185
|
}
|
17175
17186
|
getAvailableColors() {
|
17176
|
-
return this.step.data.colorPickerEnabled ?
|
17187
|
+
return this.step.data.colorPickerEnabled ? vt.availableColors(this.step, this.manager) : Promise.resolve([]);
|
17177
17188
|
}
|
17178
17189
|
isColorPickerEnabled() {
|
17179
17190
|
return this.step.data.colorPickerEnabled ?? !1;
|
@@ -17186,7 +17197,7 @@ class Xl extends Z {
|
|
17186
17197
|
return this.step.data.maxColors;
|
17187
17198
|
}
|
17188
17199
|
getUniqueColorCount() {
|
17189
|
-
return
|
17200
|
+
return vt.getUniqueColorCount(this.step, this.manager);
|
17190
17201
|
}
|
17191
17202
|
getCurrentFrameStep(t, e, a, r) {
|
17192
17203
|
return r && r.length > 1 && t === void 0 ? "SelectFrame" : e || a || this.getImageData() ? "Position" : "SelectImage";
|
@@ -17498,7 +17509,7 @@ const Zl = w`
|
|
17498
17509
|
console.error("vite-plugin-css-injected-by-js", t);
|
17499
17510
|
}
|
17500
17511
|
})();
|
17501
|
-
var sc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(sc || {}),
|
17512
|
+
var sc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(sc || {}), ye = /* @__PURE__ */ ((n) => (n.Email = "Email", n.FirstName = "FirstName", n.LastName = "LastName", n.Phone = "Phone", n.Apartment = "Apartment", n.City = "City", n.Country = "Country", n.OrganizationName = "OrganizationName", n.PostCode = "PostCode", n.State = "State", n.StreetAddress = "StreetAddress", n.Custom = "Custom", n))(ye || {}), K;
|
17502
17513
|
K = { __e: function(n, t, e, a) {
|
17503
17514
|
for (var r, i, o; t = t.__; )
|
17504
17515
|
if ((r = t.__c) && !r.__)
|
@@ -17515,7 +17526,7 @@ function lc() {
|
|
17515
17526
|
for (var n; n = lr.shift(); )
|
17516
17527
|
if (n.__P && n.__H)
|
17517
17528
|
try {
|
17518
|
-
n.__H.__h.forEach(
|
17529
|
+
n.__H.__h.forEach(Se), n.__H.__h.forEach(ha), n.__H.__h = [];
|
17519
17530
|
} catch (t) {
|
17520
17531
|
n.__H.__h = [], K.__e(t, n.__v);
|
17521
17532
|
}
|
@@ -17527,7 +17538,7 @@ K.__b = function(n) {
|
|
17527
17538
|
var t = (ot = n.__c).__H;
|
17528
17539
|
t && (ta === ot ? (t.__h = [], ot.__h = [], t.__.forEach(function(e) {
|
17529
17540
|
e.__N && (e.__ = e.__N), e.__V = ea, e.__N = e.i = void 0;
|
17530
|
-
})) : (t.__h.forEach(
|
17541
|
+
})) : (t.__h.forEach(Se), t.__h.forEach(ha), t.__h = [])), ta = ot;
|
17531
17542
|
}, K.diffed = function(n) {
|
17532
17543
|
on && on(n);
|
17533
17544
|
var t = n.__c;
|
@@ -17537,7 +17548,7 @@ K.__b = function(n) {
|
|
17537
17548
|
}, K.__c = function(n, t) {
|
17538
17549
|
t.some(function(e) {
|
17539
17550
|
try {
|
17540
|
-
e.__h.forEach(
|
17551
|
+
e.__h.forEach(Se), e.__h = e.__h.filter(function(a) {
|
17541
17552
|
return !a.__ || ha(a);
|
17542
17553
|
});
|
17543
17554
|
} catch (a) {
|
@@ -17551,7 +17562,7 @@ K.__b = function(n) {
|
|
17551
17562
|
var t, e = n.__c;
|
17552
17563
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
17553
17564
|
try {
|
17554
|
-
|
17565
|
+
Se(a);
|
17555
17566
|
} catch (r) {
|
17556
17567
|
t = r;
|
17557
17568
|
}
|
@@ -17564,7 +17575,7 @@ function cc(n) {
|
|
17564
17575
|
}, a = setTimeout(e, 100);
|
17565
17576
|
cn && (t = requestAnimationFrame(e));
|
17566
17577
|
}
|
17567
|
-
function
|
17578
|
+
function Se(n) {
|
17568
17579
|
var t = ot, e = n.__c;
|
17569
17580
|
typeof e == "function" && (n.__c = void 0, e()), ot = t;
|
17570
17581
|
}
|
@@ -17714,10 +17725,10 @@ export {
|
|
17714
17725
|
ud as BringToFrontCommand,
|
17715
17726
|
Dr as BundleDesignCreationCartAddMode,
|
17716
17727
|
N as CanvasCommand,
|
17717
|
-
|
17728
|
+
he as CollectionProduct,
|
17718
17729
|
Za as ColorOptionGlobalPropertyHandle,
|
17719
17730
|
go as CommandContext,
|
17720
|
-
|
17731
|
+
ye as ConversionDataType,
|
17721
17732
|
sc as ConversionLocation,
|
17722
17733
|
z as CreateElementCommand,
|
17723
17734
|
qn as CreateLayoutCommand,
|
@@ -17726,7 +17737,7 @@ export {
|
|
17726
17737
|
Bt as DeleteElementCommand,
|
17727
17738
|
Ns as DigitalContentStepHandle,
|
17728
17739
|
ml as FileUploadGlobalPropertyHandle,
|
17729
|
-
|
17740
|
+
me as FlowExecutionNodeResult,
|
17730
17741
|
Ql as FlowExecutionResult,
|
17731
17742
|
Nl as FlowService,
|
17732
17743
|
wo as FontAlignmentCommand,
|
@@ -17746,7 +17757,7 @@ export {
|
|
17746
17757
|
sd as LayoutElementFactory,
|
17747
17758
|
x as LayoutElementType,
|
17748
17759
|
Y as LayoutNotFoundError,
|
17749
|
-
|
17760
|
+
Yt as LayoutRenderingPurpose,
|
17750
17761
|
Ps as MaterialStepHandle,
|
17751
17762
|
Be as MisconfigurationError,
|
17752
17763
|
Fd as MockWorkflowManager,
|
@@ -17762,13 +17773,13 @@ export {
|
|
17762
17773
|
kr as ProductCameraRig,
|
17763
17774
|
ir as ProductCollection,
|
17764
17775
|
Bl as ProductCollectionProductSortKey,
|
17765
|
-
|
17766
|
-
|
17776
|
+
Ht as ProductWorkflow,
|
17777
|
+
_t as PromiseCache,
|
17767
17778
|
Tn as PromiseQueue,
|
17768
17779
|
xs as QuestionStepHandle,
|
17769
17780
|
Mn as QueueablePromise,
|
17770
17781
|
dd as ResizeCommand,
|
17771
|
-
|
17782
|
+
Jt as ResourceNotFoundError,
|
17772
17783
|
cd as RotateCommand,
|
17773
17784
|
H as ScaleAxis,
|
17774
17785
|
gd as SendBackwardsCommand,
|
@@ -17800,7 +17811,7 @@ export {
|
|
17800
17811
|
Wc as dataUrlFromExternalUrl,
|
17801
17812
|
Dd as deleteBundle,
|
17802
17813
|
Xe as designService,
|
17803
|
-
|
17814
|
+
we as determineCorrectFontSizeAndLines,
|
17804
17815
|
jn as digitalContentStepService,
|
17805
17816
|
dt as domParser,
|
17806
17817
|
Md as duplicateBundle,
|
@@ -17810,7 +17821,7 @@ export {
|
|
17810
17821
|
$ as findElement,
|
17811
17822
|
jc as findPmsColors,
|
17812
17823
|
Vt as frameDataCache,
|
17813
|
-
|
17824
|
+
vt as frameStepService,
|
17814
17825
|
M as generate,
|
17815
17826
|
sl as generateCommands,
|
17816
17827
|
st as generateSVGWithUnknownColors,
|
@@ -17845,7 +17856,7 @@ export {
|
|
17845
17856
|
vd as getWorkflow,
|
17846
17857
|
sr as getWorkflows,
|
17847
17858
|
y as graphQlManager,
|
17848
|
-
|
17859
|
+
Ce as illustrationStepService,
|
17849
17860
|
Kc as isCloseToValue,
|
17850
17861
|
Nt as loadFont,
|
17851
17862
|
Hc as matchHexToPms,
|
@@ -17869,13 +17880,13 @@ export {
|
|
17869
17880
|
zc as registerWindowImplementation,
|
17870
17881
|
qa as rehydrateSerializedLayout,
|
17871
17882
|
ei as rgbToPms,
|
17872
|
-
|
17883
|
+
de as rotateAroundPoint,
|
17873
17884
|
wa as sanitizeSvgTree,
|
17874
17885
|
Hr as setBearerAuthenticationToken,
|
17875
17886
|
yn as setCanvasModule,
|
17876
17887
|
zt as shapeStepService,
|
17877
17888
|
bo as shortenUrl,
|
17878
|
-
|
17889
|
+
pt as spiffCoreConfiguration,
|
17879
17890
|
fd as stepAspectValuesToDesignInputSteps,
|
17880
17891
|
La as svgColorValueToDefinition,
|
17881
17892
|
Gn as svgStringDimensions,
|