@spiffcommerce/core 27.2.1-beta.f00f15a6-0222-5820-93a8-912f98bdbdfe → 27.2.1-beta.f9f891fb-9e3d-52fc-8c9a-0382e6e1afa4
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 +8 -7
- package/dist/index.js +44 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +689 -680
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9,10 +9,10 @@ import hr from "fuse.js";
|
|
|
9
9
|
import { Pith as Aa } from "pith";
|
|
10
10
|
import St from "lodash.clonedeep";
|
|
11
11
|
import { toString as sn } from "qrcode";
|
|
12
|
-
import
|
|
12
|
+
import gr from "svg-path-bbox";
|
|
13
13
|
import { parse as Xe } from "opentype.js";
|
|
14
|
-
import { jsx as F, jsxs as ct, Fragment as
|
|
15
|
-
import
|
|
14
|
+
import { jsx as F, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
|
|
15
|
+
import mr from "handlebars";
|
|
16
16
|
import { dataUriToBuffer as pr } from "data-uri-to-buffer";
|
|
17
17
|
import Fa from "lodash.chunk";
|
|
18
18
|
import { CognitoIdentityProviderClient as fr, InitiateAuthCommand as ka, RespondToAuthChallengeCommand as Cr } from "@aws-sdk/client-cognito-identity-provider";
|
|
@@ -21,7 +21,7 @@ import { split as Ze } from "unicode-default-word-boundary";
|
|
|
21
21
|
import ln from "lodash.debounce";
|
|
22
22
|
import "fs";
|
|
23
23
|
import "path";
|
|
24
|
-
var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}),
|
|
24
|
+
var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), qt = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(qt || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), H = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(H || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
|
|
25
25
|
class cn extends Error {
|
|
26
26
|
constructor(t) {
|
|
27
27
|
super(t), this.name = this.constructor.name;
|
|
@@ -47,7 +47,7 @@ class vt extends _t {
|
|
|
47
47
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
class
|
|
50
|
+
class Ht extends _t {
|
|
51
51
|
constructor(t) {
|
|
52
52
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
|
53
53
|
}
|
|
@@ -62,7 +62,7 @@ class De extends cn {
|
|
|
62
62
|
super(`ImplementationError - ${t}`);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
class
|
|
65
|
+
class z extends De {
|
|
66
66
|
constructor(t) {
|
|
67
67
|
super(`Unhandled Behavior Encountered: ${t}`);
|
|
68
68
|
}
|
|
@@ -158,7 +158,7 @@ class Pr {
|
|
|
158
158
|
this.serverUrlCallbacks.push(t);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const gt = new Pr();
|
|
162
162
|
let ta, ea;
|
|
163
163
|
function Ec(r) {
|
|
164
164
|
ta = r;
|
|
@@ -289,34 +289,34 @@ const dn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
|
289
289
|
!i || !i.result ? e() : t(i.result.toString());
|
|
290
290
|
}, a.readAsDataURL(r);
|
|
291
291
|
});
|
|
292
|
-
let Qr,
|
|
292
|
+
let Qr, ga;
|
|
293
293
|
const Rr = (r) => {
|
|
294
|
-
|
|
295
|
-
}, Or = () =>
|
|
296
|
-
let
|
|
294
|
+
ga = r;
|
|
295
|
+
}, Or = () => ga;
|
|
296
|
+
let gn;
|
|
297
297
|
const $r = (r) => {
|
|
298
|
-
|
|
299
|
-
},
|
|
300
|
-
const t =
|
|
298
|
+
gn = r;
|
|
299
|
+
}, Lr = () => new Promise((r) => {
|
|
300
|
+
const t = gt.getHubUrl(), e = (a) => {
|
|
301
301
|
a.origin === t && (window.removeEventListener("message", e), r(a.data));
|
|
302
302
|
};
|
|
303
303
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
|
304
|
-
}),
|
|
304
|
+
}), Ur = async () => {
|
|
305
305
|
const r = {
|
|
306
|
-
applicationKey:
|
|
306
|
+
applicationKey: ga,
|
|
307
307
|
customerToken: Qr,
|
|
308
|
-
bearer:
|
|
308
|
+
bearer: gn
|
|
309
309
|
};
|
|
310
|
-
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await
|
|
310
|
+
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Lr(), ...r } : r;
|
|
311
311
|
};
|
|
312
312
|
async function Vr(r, t) {
|
|
313
|
-
const e =
|
|
313
|
+
const e = gt.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";
|
|
314
314
|
let n = await rt(r, { ...t, redirect: "manual" });
|
|
315
315
|
return n.type === "opaqueredirect" && (typeof r != "string" && "url" in r ? n = await rt({ ...r, url: `${a}/graphql` }, t) : n = await rt(`${a}/graphql`, t)), n;
|
|
316
316
|
}
|
|
317
|
-
class
|
|
317
|
+
class Gr {
|
|
318
318
|
constructor() {
|
|
319
|
-
this.shadowGraphqlClient = this.constructShadowGraphqlClient(),
|
|
319
|
+
this.shadowGraphqlClient = this.constructShadowGraphqlClient(), gt.addServerUrlCallback(() => {
|
|
320
320
|
this.shadowGraphqlClient = this.constructShadowGraphqlClient();
|
|
321
321
|
});
|
|
322
322
|
}
|
|
@@ -328,17 +328,17 @@ class zr {
|
|
|
328
328
|
}
|
|
329
329
|
constructShadowGraphqlClient() {
|
|
330
330
|
const t = rr({
|
|
331
|
-
uri: `${
|
|
331
|
+
uri: `${gt.getServerUrl()}/graphql`,
|
|
332
332
|
fetch: Vr
|
|
333
333
|
}), e = lr(async (i, s) => {
|
|
334
|
-
const { headers: o } = s, l = o || {}, c = await
|
|
334
|
+
const { headers: o } = s, l = o || {}, c = await Ur();
|
|
335
335
|
let d = s.bearer ?? c.bearer;
|
|
336
336
|
if (this.spiffClient)
|
|
337
337
|
try {
|
|
338
338
|
d = await this.spiffClient.loggedInBearerToken();
|
|
339
339
|
} catch {
|
|
340
340
|
}
|
|
341
|
-
const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId,
|
|
341
|
+
const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, g = s.customerToken ?? c.customerToken, m = s.applicationKey ?? c.applicationKey, p = s.bundleOwnerId;
|
|
342
342
|
try {
|
|
343
343
|
if (window && window.__SENTRY__) {
|
|
344
344
|
const f = window.__SENTRY__.hub;
|
|
@@ -351,7 +351,7 @@ class zr {
|
|
|
351
351
|
}
|
|
352
352
|
} catch {
|
|
353
353
|
}
|
|
354
|
-
return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h),
|
|
354
|
+
return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), g && (l.customerToken = g), m && (l["X-Application-Key"] = m), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
|
|
355
355
|
headers: l
|
|
356
356
|
};
|
|
357
357
|
}), a = cr(({ operation: i, graphQLErrors: s, networkError: o }) => {
|
|
@@ -366,14 +366,14 @@ class zr {
|
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
const b = new
|
|
369
|
+
const b = new Gr();
|
|
370
370
|
let aa, na;
|
|
371
|
-
const
|
|
371
|
+
const mt = (r, t, e) => {
|
|
372
372
|
if (aa !== void 0)
|
|
373
373
|
return aa(r, t, e);
|
|
374
374
|
try {
|
|
375
375
|
const a = pn(!0);
|
|
376
|
-
return
|
|
376
|
+
return mn(a), a.createCanvas(r, t, e);
|
|
377
377
|
} catch {
|
|
378
378
|
throw new Error("Canvas module not set");
|
|
379
379
|
}
|
|
@@ -382,12 +382,12 @@ const gt = (r, t, e) => {
|
|
|
382
382
|
return na(r, t);
|
|
383
383
|
try {
|
|
384
384
|
const e = pn(!0);
|
|
385
|
-
return
|
|
385
|
+
return mn(e), e.loadImage(r, t);
|
|
386
386
|
} catch {
|
|
387
387
|
throw new Error("Canvas module not set");
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
|
-
function
|
|
390
|
+
function mn(r) {
|
|
391
391
|
aa = r == null ? void 0 : r.createCanvas, na = r == null ? void 0 : r.loadImage;
|
|
392
392
|
}
|
|
393
393
|
function pn(r) {
|
|
@@ -411,11 +411,11 @@ function pn(r) {
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
let $e;
|
|
414
|
-
function
|
|
414
|
+
function ma() {
|
|
415
415
|
return $e === void 0 && ($e = Fr()), $e;
|
|
416
416
|
}
|
|
417
417
|
let se = null;
|
|
418
|
-
const
|
|
418
|
+
const zr = (r) => new Promise((t) => {
|
|
419
419
|
if (ke(r) !== "image/jpeg")
|
|
420
420
|
return t(1);
|
|
421
421
|
ur(r).then((a) => t(a || 1)).catch(() => t(1));
|
|
@@ -427,14 +427,14 @@ const Gr = (r) => new Promise((t) => {
|
|
|
427
427
|
}, jr = (r) => {
|
|
428
428
|
const e = r.naturalWidth / r.naturalHeight;
|
|
429
429
|
return r.naturalHeight <= 8192 && r.naturalWidth <= 8192 ? [r.naturalWidth, r.naturalHeight] : r.naturalHeight > r.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
|
|
430
|
-
},
|
|
430
|
+
}, qr = async (r) => {
|
|
431
431
|
var A;
|
|
432
432
|
const t = await Tr(r), e = await Zt(t), [a, n] = jr(e);
|
|
433
433
|
if (!await Wr()) {
|
|
434
|
-
const u =
|
|
434
|
+
const u = mt(a, n);
|
|
435
435
|
return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
|
|
436
436
|
}
|
|
437
|
-
const s = await
|
|
437
|
+
const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = mt(o, l), d = c.getContext("2d");
|
|
438
438
|
switch (s) {
|
|
439
439
|
case 2:
|
|
440
440
|
d.translate(o, 0), d.scale(-1, 1);
|
|
@@ -460,7 +460,7 @@ const Gr = (r) => new Promise((t) => {
|
|
|
460
460
|
}
|
|
461
461
|
return d.drawImage(e, 0, 0, o, l), c;
|
|
462
462
|
}, Me = async (r) => {
|
|
463
|
-
const t = await
|
|
463
|
+
const t = await qr(r);
|
|
464
464
|
return ke(r) === "image/jpeg" ? {
|
|
465
465
|
dataUrl: t.toDataURL("image/jpeg", 1),
|
|
466
466
|
height: t.height,
|
|
@@ -3154,7 +3154,7 @@ const Gr = (r) => new Promise((t) => {
|
|
|
3154
3154
|
"3E2B2E",
|
|
3155
3155
|
"101820",
|
|
3156
3156
|
"3D3935"
|
|
3157
|
-
],
|
|
3157
|
+
], Le = Ft.map((r) => [
|
|
3158
3158
|
parseInt(r.substring(0, 2), 16),
|
|
3159
3159
|
parseInt(r.substring(2, 4), 16),
|
|
3160
3160
|
parseInt(r.substring(4, 6), 16)
|
|
@@ -3163,12 +3163,12 @@ function Ic(r) {
|
|
|
3163
3163
|
const t = Yt.indexOf(r);
|
|
3164
3164
|
return t >= 0 ? Ft[t] : "";
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3166
|
+
function Hr(r) {
|
|
3167
3167
|
const t = Ft.indexOf(r);
|
|
3168
3168
|
return t >= 0 ? Yt[t] : "";
|
|
3169
3169
|
}
|
|
3170
3170
|
function Pc(r, t = 64) {
|
|
3171
|
-
const e = [], a = [], n =
|
|
3171
|
+
const e = [], a = [], n = Hr(r);
|
|
3172
3172
|
n && e.push({
|
|
3173
3173
|
pms: n,
|
|
3174
3174
|
hex: r,
|
|
@@ -3177,7 +3177,7 @@ function Pc(r, t = 64) {
|
|
|
3177
3177
|
const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
|
|
3178
3178
|
let l, c, d;
|
|
3179
3179
|
for (let A = 0; A < Ft.length; A++) {
|
|
3180
|
-
l =
|
|
3180
|
+
l = Le[A][0], c = Le[A][1], d = Le[A][2];
|
|
3181
3181
|
const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
|
|
3182
3182
|
a.push(u);
|
|
3183
3183
|
}
|
|
@@ -3275,8 +3275,8 @@ const oe = (r) => {
|
|
|
3275
3275
|
n.split(";").forEach((d) => {
|
|
3276
3276
|
const A = d.trim();
|
|
3277
3277
|
if (A) {
|
|
3278
|
-
const [u, h] = A.split(":"),
|
|
3279
|
-
Xr.indexOf(
|
|
3278
|
+
const [u, h] = A.split(":"), g = u.toLowerCase();
|
|
3279
|
+
Xr.indexOf(g) > -1 ? a.setAttribute(g, h.trim()) : l.push(A);
|
|
3280
3280
|
}
|
|
3281
3281
|
}), l.length > 0 ? a.setAttribute("style", l.join(";")) : a.removeAttribute("style");
|
|
3282
3282
|
}
|
|
@@ -3556,7 +3556,7 @@ class di {
|
|
|
3556
3556
|
if (this.cache.has(t)) {
|
|
3557
3557
|
const n = this.cache.get(t);
|
|
3558
3558
|
if (!n)
|
|
3559
|
-
throw new
|
|
3559
|
+
throw new z("Failed to get asset from cache!");
|
|
3560
3560
|
return n;
|
|
3561
3561
|
}
|
|
3562
3562
|
const a = (async () => (await ve([t]))[0])();
|
|
@@ -3583,7 +3583,7 @@ class di {
|
|
|
3583
3583
|
*/
|
|
3584
3584
|
cacheAsset(t) {
|
|
3585
3585
|
if (!t.key)
|
|
3586
|
-
throw new
|
|
3586
|
+
throw new z("Asset has no key!");
|
|
3587
3587
|
this.cache.has(t.key) || this.cache.set(t.key, Promise.resolve(t));
|
|
3588
3588
|
}
|
|
3589
3589
|
/**
|
|
@@ -3591,7 +3591,7 @@ class di {
|
|
|
3591
3591
|
*/
|
|
3592
3592
|
cacheMaterial(t) {
|
|
3593
3593
|
if (!t.id)
|
|
3594
|
-
throw new
|
|
3594
|
+
throw new z("Material has no id!");
|
|
3595
3595
|
this.materialCache.has(t.id) || this.materialCache.set(t.id, Promise.resolve(t));
|
|
3596
3596
|
}
|
|
3597
3597
|
/**
|
|
@@ -3709,7 +3709,7 @@ class di {
|
|
|
3709
3709
|
case "mkv":
|
|
3710
3710
|
return "video/x-matroska";
|
|
3711
3711
|
default:
|
|
3712
|
-
throw new
|
|
3712
|
+
throw new z("Unexpected mimetype: " + e);
|
|
3713
3713
|
}
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
@@ -3799,7 +3799,7 @@ class K {
|
|
|
3799
3799
|
N.setMap($a, t);
|
|
3800
3800
|
}
|
|
3801
3801
|
}
|
|
3802
|
-
const
|
|
3802
|
+
const L = new di();
|
|
3803
3803
|
class Ai {
|
|
3804
3804
|
constructor() {
|
|
3805
3805
|
this.cache = {}, this.disabled = !1;
|
|
@@ -3887,16 +3887,16 @@ const Jt = new Ai(), vn = v`
|
|
|
3887
3887
|
});
|
|
3888
3888
|
return t.data.options.forEach((e) => {
|
|
3889
3889
|
var a, n;
|
|
3890
|
-
(a = e.defaultVariant) != null && a.asset &&
|
|
3891
|
-
i.asset &&
|
|
3890
|
+
(a = e.defaultVariant) != null && a.asset && L.cacheAsset(e.defaultVariant.asset), e.colorProfile && L.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
|
|
3891
|
+
i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
|
|
3892
3892
|
});
|
|
3893
3893
|
}), t.data.options;
|
|
3894
|
-
},
|
|
3894
|
+
}, gi = async (r, t) => (await t).find((a) => a.id === r), mi = async (r) => {
|
|
3895
3895
|
const t = r.map((s) => Jt.get({ id: s })), e = r.filter((s, o) => t[o] === void 0);
|
|
3896
3896
|
if (e.length === 0)
|
|
3897
3897
|
return Promise.all(t);
|
|
3898
3898
|
const a = hi(e), n = e.map(
|
|
3899
|
-
(s) => Jt.set({ id: s },
|
|
3899
|
+
(s) => Jt.set({ id: s }, gi(s, a))
|
|
3900
3900
|
), i = t.filter((s) => s !== void 0);
|
|
3901
3901
|
return await Promise.all(i.concat(n));
|
|
3902
3902
|
};
|
|
@@ -3914,7 +3914,7 @@ class pi {
|
|
|
3914
3914
|
*/
|
|
3915
3915
|
async getOption(t) {
|
|
3916
3916
|
return (async () => {
|
|
3917
|
-
const n = (await
|
|
3917
|
+
const n = (await mi([t]))[0];
|
|
3918
3918
|
if (n)
|
|
3919
3919
|
return n;
|
|
3920
3920
|
})();
|
|
@@ -5134,7 +5134,7 @@ const Y = new pi(), En = v`
|
|
|
5134
5134
|
internalId
|
|
5135
5135
|
}
|
|
5136
5136
|
}
|
|
5137
|
-
`, Ot = [P.SilentIllustration, P.ProductOverlay],
|
|
5137
|
+
`, Ot = [P.SilentIllustration, P.ProductOverlay], Li = async (r) => {
|
|
5138
5138
|
const t = [];
|
|
5139
5139
|
r.introduction && t.push({
|
|
5140
5140
|
name: "Introduction",
|
|
@@ -5152,7 +5152,7 @@ const Y = new pi(), En = v`
|
|
|
5152
5152
|
silentSteps: []
|
|
5153
5153
|
});
|
|
5154
5154
|
for (const a of r.steps) {
|
|
5155
|
-
const n =
|
|
5155
|
+
const n = Ui(a.stepName, r.stepGroups);
|
|
5156
5156
|
if (!n)
|
|
5157
5157
|
t.push({
|
|
5158
5158
|
name: a.stepName,
|
|
@@ -5189,7 +5189,7 @@ const Y = new pi(), En = v`
|
|
|
5189
5189
|
],
|
|
5190
5190
|
silentSteps: []
|
|
5191
5191
|
}), t;
|
|
5192
|
-
},
|
|
5192
|
+
}, Ui = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
|
|
5193
5193
|
const a = t[e.targetStepName];
|
|
5194
5194
|
if (a && a.selectedVariants) {
|
|
5195
5195
|
const n = a.selectedVariants;
|
|
@@ -5206,7 +5206,7 @@ const Y = new pi(), En = v`
|
|
|
5206
5206
|
silentSteps: r.silentSteps.filter((a) => yt(a, t))
|
|
5207
5207
|
};
|
|
5208
5208
|
return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
|
|
5209
|
-
}, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null),
|
|
5209
|
+
}, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null), Gi = async (r, t, e = !1) => {
|
|
5210
5210
|
var s;
|
|
5211
5211
|
const a = Dt(r, t), n = [];
|
|
5212
5212
|
for (const o of a)
|
|
@@ -5301,7 +5301,7 @@ class xn {
|
|
|
5301
5301
|
const Q = () => {
|
|
5302
5302
|
const r = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
|
5303
5303
|
return r() + r() + "-" + r() + "-" + r() + "-" + r() + "-" + r() + r() + r();
|
|
5304
|
-
},
|
|
5304
|
+
}, zi = ({
|
|
5305
5305
|
backgroundColor: r,
|
|
5306
5306
|
outlineColor: t,
|
|
5307
5307
|
borderRadius: e,
|
|
@@ -5317,7 +5317,7 @@ const Q = () => {
|
|
|
5317
5317
|
width: u
|
|
5318
5318
|
}) => {
|
|
5319
5319
|
var E;
|
|
5320
|
-
const h = e || 0,
|
|
5320
|
+
const h = e || 0, g = 2 * ((l == null ? void 0 : l.scale) || 1), m = A || { x: 0, y: 0, width: u, height: i }, p = `${m.x} ${m.y} ${m.width} ${m.height}`, f = Q(), C = a.purpose === qt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: m.width, height: m.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
|
|
5321
5321
|
/* @ts-ignore */
|
|
5322
5322
|
/* @__PURE__ */ F("color-profile", { name: B.name, xlinkHref: B.key, children: " " }, I)
|
|
5323
5323
|
)), S = n.map((B) => ({
|
|
@@ -5350,8 +5350,8 @@ const Q = () => {
|
|
|
5350
5350
|
"rect",
|
|
5351
5351
|
{
|
|
5352
5352
|
id: "layout-background",
|
|
5353
|
-
width:
|
|
5354
|
-
height:
|
|
5353
|
+
width: m.width,
|
|
5354
|
+
height: m.height,
|
|
5355
5355
|
fill: r,
|
|
5356
5356
|
rx: h
|
|
5357
5357
|
}
|
|
@@ -5360,7 +5360,7 @@ const Q = () => {
|
|
|
5360
5360
|
"g",
|
|
5361
5361
|
{
|
|
5362
5362
|
id: "element-group",
|
|
5363
|
-
clipPath: a.purpose ===
|
|
5363
|
+
clipPath: a.purpose === qt.FreeDesign ? "url(#viewboxClip)" : void 0,
|
|
5364
5364
|
children: y.map((B) => Qn(B)).filter((B) => !!B)
|
|
5365
5365
|
}
|
|
5366
5366
|
),
|
|
@@ -5373,18 +5373,18 @@ const Q = () => {
|
|
|
5373
5373
|
height: l.height,
|
|
5374
5374
|
fill: "none",
|
|
5375
5375
|
stroke: l.hidden ? "none" : t || "#aaaaaa",
|
|
5376
|
-
strokeWidth:
|
|
5377
|
-
strokeDasharray: `${
|
|
5376
|
+
strokeWidth: g / 2,
|
|
5377
|
+
strokeDasharray: `${g * 2} ${g}`
|
|
5378
5378
|
}
|
|
5379
5379
|
),
|
|
5380
5380
|
l && /* @__PURE__ */ ct("mask", { id: `viewmask-${f}`, children: [
|
|
5381
5381
|
/* @__PURE__ */ F(
|
|
5382
5382
|
"rect",
|
|
5383
5383
|
{
|
|
5384
|
-
x:
|
|
5385
|
-
y:
|
|
5386
|
-
width:
|
|
5387
|
-
height:
|
|
5384
|
+
x: m.x,
|
|
5385
|
+
y: m.y,
|
|
5386
|
+
width: m.width,
|
|
5387
|
+
height: m.height,
|
|
5388
5388
|
fill: "black"
|
|
5389
5389
|
}
|
|
5390
5390
|
),
|
|
@@ -5403,7 +5403,7 @@ const Q = () => {
|
|
|
5403
5403
|
}
|
|
5404
5404
|
);
|
|
5405
5405
|
}, xc = (r, t, e, a, n) => {
|
|
5406
|
-
const i = pt(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s,
|
|
5406
|
+
const i = pt(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, g = -o, m = o, p = u * A - g * d, f = h * A - m * d, C = u * d + g * A, w = h * d + m * A, S = Math.max(Math.abs(p), Math.abs(f)), y = Math.max(Math.abs(C), Math.abs(w));
|
|
5407
5407
|
return {
|
|
5408
5408
|
minX: l - S,
|
|
5409
5409
|
maxX: l + S,
|
|
@@ -5433,22 +5433,22 @@ const Q = () => {
|
|
|
5433
5433
|
y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
|
|
5434
5434
|
}), Pt = (r) => {
|
|
5435
5435
|
switch (r) {
|
|
5436
|
-
case
|
|
5437
|
-
return
|
|
5438
|
-
case
|
|
5439
|
-
return
|
|
5440
|
-
case
|
|
5441
|
-
return
|
|
5442
|
-
case
|
|
5443
|
-
return
|
|
5444
|
-
case
|
|
5445
|
-
return
|
|
5446
|
-
case
|
|
5447
|
-
return
|
|
5448
|
-
case
|
|
5449
|
-
return
|
|
5450
|
-
case
|
|
5451
|
-
return
|
|
5436
|
+
case H.North:
|
|
5437
|
+
return H.East;
|
|
5438
|
+
case H.East:
|
|
5439
|
+
return H.South;
|
|
5440
|
+
case H.South:
|
|
5441
|
+
return H.West;
|
|
5442
|
+
case H.West:
|
|
5443
|
+
return H.North;
|
|
5444
|
+
case H.Northwest:
|
|
5445
|
+
return H.Northeast;
|
|
5446
|
+
case H.Northeast:
|
|
5447
|
+
return H.Southeast;
|
|
5448
|
+
case H.Southeast:
|
|
5449
|
+
return H.Southwest;
|
|
5450
|
+
case H.Southwest:
|
|
5451
|
+
return H.Northwest;
|
|
5452
5452
|
}
|
|
5453
5453
|
}, Oc = (r, t) => t > 45 && t <= 135 ? Pt(r) : t > 135 && t <= 225 ? Pt(Pt(r)) : t > 225 && t <= 315 ? Pt(Pt(Pt(r))) : r, $c = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
|
5454
5454
|
const a = pt(r.rotation), n = {
|
|
@@ -5480,7 +5480,7 @@ const Q = () => {
|
|
|
5480
5480
|
x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
|
|
5481
5481
|
y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
|
|
5482
5482
|
};
|
|
5483
|
-
},
|
|
5483
|
+
}, Lc = 0.352778, Uc = 0.035277, Fn = (r) => {
|
|
5484
5484
|
const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
|
|
5485
5485
|
return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
|
|
5486
5486
|
"g",
|
|
@@ -5505,7 +5505,7 @@ const Q = () => {
|
|
|
5505
5505
|
}, kn = (r) => {
|
|
5506
5506
|
var l;
|
|
5507
5507
|
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = pt(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
|
|
5508
|
-
return /* @__PURE__ */ ct(
|
|
5508
|
+
return /* @__PURE__ */ ct(zt, { children: [
|
|
5509
5509
|
/* @__PURE__ */ F("defs", { children: (() => /* @__PURE__ */ F("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ F("path", { d: r.clipPath }) : /* @__PURE__ */ F("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
|
|
5510
5510
|
/* @__PURE__ */ ct(
|
|
5511
5511
|
"g",
|
|
@@ -5545,8 +5545,8 @@ const Q = () => {
|
|
|
5545
5545
|
return r.pattern.src;
|
|
5546
5546
|
};
|
|
5547
5547
|
if (!a())
|
|
5548
|
-
return /* @__PURE__ */ F(
|
|
5549
|
-
const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(
|
|
5548
|
+
return /* @__PURE__ */ F(zt, {});
|
|
5549
|
+
const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(zt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
|
|
5550
5550
|
/* @__PURE__ */ F(
|
|
5551
5551
|
"feColorMatrix",
|
|
5552
5552
|
{
|
|
@@ -5567,15 +5567,15 @@ const Q = () => {
|
|
|
5567
5567
|
] })
|
|
5568
5568
|
] }) }) }), s = r.rotation || 0, o = pt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
|
|
5569
5569
|
var w, S, y, E, B, I, D, x, k, T;
|
|
5570
|
-
const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0,
|
|
5570
|
+
const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0, g = ((E = r.pattern) == null ? void 0 : E.height) || 0, m = ((B = r.pattern) == null ? void 0 : B.scaleX) || 1, p = ((I = r.pattern) == null ? void 0 : I.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
|
|
5571
5571
|
return [(x = r.pattern) != null && x.svg ? {
|
|
5572
5572
|
id: `${t}-contents`,
|
|
5573
5573
|
type: M.Illustration,
|
|
5574
5574
|
x: A,
|
|
5575
5575
|
y: u,
|
|
5576
5576
|
rotation: f,
|
|
5577
|
-
width: h *
|
|
5578
|
-
height:
|
|
5577
|
+
width: h * m,
|
|
5578
|
+
height: g * p,
|
|
5579
5579
|
src: a(),
|
|
5580
5580
|
svg: (k = r.pattern) == null ? void 0 : k.svg,
|
|
5581
5581
|
colors: (T = r.pattern) == null ? void 0 : T.colors
|
|
@@ -5585,12 +5585,12 @@ const Q = () => {
|
|
|
5585
5585
|
x: A,
|
|
5586
5586
|
y: u,
|
|
5587
5587
|
rotation: f,
|
|
5588
|
-
width: h *
|
|
5589
|
-
height:
|
|
5588
|
+
width: h * m,
|
|
5589
|
+
height: g * p,
|
|
5590
5590
|
src: a()
|
|
5591
5591
|
}];
|
|
5592
5592
|
};
|
|
5593
|
-
return /* @__PURE__ */ ct(
|
|
5593
|
+
return /* @__PURE__ */ ct(zt, { children: [
|
|
5594
5594
|
i(),
|
|
5595
5595
|
/* @__PURE__ */ F(
|
|
5596
5596
|
"g",
|
|
@@ -5677,14 +5677,14 @@ class ji {
|
|
|
5677
5677
|
}), a - n;
|
|
5678
5678
|
}
|
|
5679
5679
|
}
|
|
5680
|
-
const
|
|
5681
|
-
if (
|
|
5682
|
-
return
|
|
5680
|
+
const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @__PURE__ */ new Map(), Nt = async (r) => {
|
|
5681
|
+
if (Ue.has(r))
|
|
5682
|
+
return Ue.get(r);
|
|
5683
5683
|
const e = (async () => {
|
|
5684
5684
|
try {
|
|
5685
5685
|
return Et(r).getFont();
|
|
5686
5686
|
} catch {
|
|
5687
|
-
if (
|
|
5687
|
+
if (qi(r)) {
|
|
5688
5688
|
const a = hn(r), n = Xe(a);
|
|
5689
5689
|
return ra(r, n), n;
|
|
5690
5690
|
} else {
|
|
@@ -5693,8 +5693,8 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5693
5693
|
}
|
|
5694
5694
|
}
|
|
5695
5695
|
})();
|
|
5696
|
-
return
|
|
5697
|
-
},
|
|
5696
|
+
return Ue.set(r, e), e;
|
|
5697
|
+
}, Hi = (r) => {
|
|
5698
5698
|
const t = hn(r), e = Xe(t);
|
|
5699
5699
|
return ra(r, e), e;
|
|
5700
5700
|
}, Et = (r) => {
|
|
@@ -5710,18 +5710,18 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5710
5710
|
a.querySelectorAll("style").forEach((d) => {
|
|
5711
5711
|
var u;
|
|
5712
5712
|
(u = rn(d.innerHTML).stylesheet) == null || u.rules.forEach((h) => {
|
|
5713
|
-
var
|
|
5713
|
+
var g, m, p;
|
|
5714
5714
|
if (h.type === "font-face" && h.declarations) {
|
|
5715
|
-
const f = (
|
|
5715
|
+
const f = (g = h.declarations.find(
|
|
5716
5716
|
(S) => S.property === "font-family"
|
|
5717
|
-
)) == null ? void 0 :
|
|
5717
|
+
)) == null ? void 0 : g.value, C = (m = h.declarations.find((S) => S.property === "src")) == null ? void 0 : m.value, w = (p = C == null ? void 0 : C.match(/'(https.*?)'/)) == null ? void 0 : p[1];
|
|
5718
5718
|
f && w && n.set(f, w);
|
|
5719
5719
|
}
|
|
5720
5720
|
});
|
|
5721
5721
|
});
|
|
5722
5722
|
const s = e.querySelectorAll("tspan");
|
|
5723
5723
|
for (let d = 0; d < s.length; d++) {
|
|
5724
|
-
const A = s.item(d), u = A.closest("text"), h = A.closest("g"),
|
|
5724
|
+
const A = s.item(d), u = A.closest("text"), h = A.closest("g"), g = u.getAttribute("font-family"), m = await Nt(n.get(g)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), C = u.getAttribute("stroke-width"), w = m.getPath(
|
|
5725
5725
|
A.innerHTML,
|
|
5726
5726
|
0,
|
|
5727
5727
|
0,
|
|
@@ -5730,7 +5730,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5730
5730
|
let y = 0;
|
|
5731
5731
|
const E = A.getAttribute("text-anchor");
|
|
5732
5732
|
E === "middle" ? y = S / 2 : E === "end" && (y = S);
|
|
5733
|
-
const B =
|
|
5733
|
+
const B = m.getPath(
|
|
5734
5734
|
A.innerHTML,
|
|
5735
5735
|
parseFloat(A.getAttribute("x") ?? "0") - y,
|
|
5736
5736
|
parseFloat(A.getAttribute("y") ?? "0"),
|
|
@@ -5742,11 +5742,11 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5742
5742
|
}
|
|
5743
5743
|
return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
|
|
5744
5744
|
}, Ee = (r, t, e, a) => Math.max(_i(r.join(`
|
|
5745
|
-
`), e, a), t),
|
|
5745
|
+
`), e, a), t), La = (r, t, e, a, n, i) => {
|
|
5746
5746
|
const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
|
|
5747
5747
|
`);
|
|
5748
5748
|
try {
|
|
5749
|
-
const l = o.flatMap((d) =>
|
|
5749
|
+
const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
|
|
5750
5750
|
return {
|
|
5751
5751
|
lines: c,
|
|
5752
5752
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * s),
|
|
@@ -5762,14 +5762,14 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5762
5762
|
requiredWidth: Ee(c, r.width, a, n)
|
|
5763
5763
|
};
|
|
5764
5764
|
}
|
|
5765
|
-
},
|
|
5765
|
+
}, ge = (r, t, e, a) => {
|
|
5766
5766
|
const n = ht(r, e, a);
|
|
5767
5767
|
if (n <= t)
|
|
5768
5768
|
return { lines: [r], width: n };
|
|
5769
5769
|
if (!(r.indexOf(" ") > -1)) {
|
|
5770
5770
|
if (r.length <= 1)
|
|
5771
5771
|
throw new Error(`Character ${r} is wider than region`);
|
|
5772
|
-
const d = Math.floor(r.length / 2), A =
|
|
5772
|
+
const d = Math.floor(r.length / 2), A = ge(r.slice(0, d), t, e, a), u = ge(r.slice(d), t, e, a);
|
|
5773
5773
|
return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
|
|
5774
5774
|
}
|
|
5775
5775
|
const s = r.split(" "), o = [];
|
|
@@ -5777,15 +5777,15 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5777
5777
|
for (; c < s.length; ) {
|
|
5778
5778
|
const d = s[c];
|
|
5779
5779
|
if (ht(d, e, a) > t) {
|
|
5780
|
-
const A =
|
|
5780
|
+
const A = ge(d, t, e, a);
|
|
5781
5781
|
o.push(...A.lines), l = Math.max(l, A.width), c++;
|
|
5782
5782
|
} else {
|
|
5783
5783
|
const A = [d];
|
|
5784
5784
|
l = Math.max(l, ht(d, e, a));
|
|
5785
5785
|
let u = c + 1, h = !0;
|
|
5786
5786
|
for (; u < s.length && h; ) {
|
|
5787
|
-
const
|
|
5788
|
-
|
|
5787
|
+
const g = s[u], m = ht(`${A.join(" ")} ${g}`, e, a);
|
|
5788
|
+
m <= t ? (A.push(g), l = Math.max(l, m), u++) : h = !1;
|
|
5789
5789
|
}
|
|
5790
5790
|
o.push(A.join(" ")), c = u;
|
|
5791
5791
|
}
|
|
@@ -5800,7 +5800,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5800
5800
|
var c;
|
|
5801
5801
|
const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
|
5802
5802
|
if (!e)
|
|
5803
|
-
return
|
|
5803
|
+
return La(t, r, t.fontSize, s, n, a);
|
|
5804
5804
|
let o;
|
|
5805
5805
|
if (t.text ? o = t.text.split(`
|
|
5806
5806
|
`) : o = ((c = t.input) == null ? void 0 : c.split(`
|
|
@@ -5817,7 +5817,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5817
5817
|
requiredHeight: t.height,
|
|
5818
5818
|
requiredWidth: Ee(o, t.width, s, n),
|
|
5819
5819
|
fontSize: Yi(o, n, i, t.width, t.height, a)
|
|
5820
|
-
} :
|
|
5820
|
+
} : La(t, r, t.fontSize, s, n, a);
|
|
5821
5821
|
}, Ki = (r, t, e, a, n) => {
|
|
5822
5822
|
const s = Et(t.assetUrl).getFont();
|
|
5823
5823
|
let o = { ...r };
|
|
@@ -5846,12 +5846,12 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5846
5846
|
return r.forEach((n) => {
|
|
5847
5847
|
a = Math.max(a, ht(n, t, e));
|
|
5848
5848
|
}), a;
|
|
5849
|
-
},
|
|
5849
|
+
}, Ua = {
|
|
5850
5850
|
stripControlCharacters: !0,
|
|
5851
5851
|
vertical: !1,
|
|
5852
5852
|
uppercase: !1
|
|
5853
|
-
}, Be = (r, t =
|
|
5854
|
-
const e = { ...
|
|
5853
|
+
}, Be = (r, t = Ua) => {
|
|
5854
|
+
const e = { ...Ua, ...t };
|
|
5855
5855
|
let a = r || "";
|
|
5856
5856
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
|
5857
5857
|
`)), a;
|
|
@@ -5874,23 +5874,23 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
|
|
|
5874
5874
|
};
|
|
5875
5875
|
})()
|
|
5876
5876
|
} : r, ya = 1.1, ts = (r) => {
|
|
5877
|
-
var
|
|
5877
|
+
var g, m, p, f, C;
|
|
5878
5878
|
const e = (r.rotation || 0) * Math.PI / 180, a = Math.cos(e), n = -Math.sin(e), i = `text-path-${r.id}`, s = `text-fill-${r.id}`, o = r.x + (r.curved ? 0 : r.width / 2), l = r.y + (r.curved ? 0 : r.height / 2);
|
|
5879
5879
|
let c = "";
|
|
5880
5880
|
try {
|
|
5881
|
-
c =
|
|
5881
|
+
c = mr.compile(r.text || "")((g = r._renderingConfiguration) == null ? void 0 : g.templatingContext);
|
|
5882
5882
|
} catch {
|
|
5883
5883
|
c = r.text ?? "";
|
|
5884
5884
|
}
|
|
5885
5885
|
const d = c.split(`
|
|
5886
|
-
`), A = (
|
|
5886
|
+
`), A = (m = r.strokeColor) != null && m.browserValue && r.strokeThickness ? (p = r.strokeColor) == null ? void 0 : p.browserValue : void 0, u = (f = r.strokeColor) != null && f.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
|
|
5887
5887
|
if (r.curved && !r.paths || !r.fontData)
|
|
5888
5888
|
return null;
|
|
5889
5889
|
const h = () => {
|
|
5890
5890
|
var w;
|
|
5891
5891
|
return r.textFillImage ? `url("#${s}")` : (w = r._renderingConfiguration) != null && w.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${fn(r.fillSpotColorDefinition)}` : r.fill;
|
|
5892
5892
|
};
|
|
5893
|
-
return /* @__PURE__ */ ct(
|
|
5893
|
+
return /* @__PURE__ */ ct(zt, { children: [
|
|
5894
5894
|
/* @__PURE__ */ ct("defs", { children: [
|
|
5895
5895
|
r.textFillImage && /* @__PURE__ */ F(
|
|
5896
5896
|
"pattern",
|
|
@@ -6114,7 +6114,7 @@ class rs {
|
|
|
6114
6114
|
layouts: {}
|
|
6115
6115
|
};
|
|
6116
6116
|
t.forEach((n) => {
|
|
6117
|
-
a = new
|
|
6117
|
+
a = new Ln(n).apply(a);
|
|
6118
6118
|
}), this.runStateCallbacks(), this.state = {
|
|
6119
6119
|
transaction: a
|
|
6120
6120
|
};
|
|
@@ -6127,7 +6127,7 @@ class rs {
|
|
|
6127
6127
|
const Qn = (r) => r.type === M.Image ? /* @__PURE__ */ F(Fn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ F(Wi, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ F(ns, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ F(ts, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ F(kn, { ...r }, r.id) : null, Sa = (r, t, e) => {
|
|
6128
6128
|
const a = e.renderingConfiguration, n = a != null && a.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
|
|
6129
6129
|
return /* @__PURE__ */ F(
|
|
6130
|
-
|
|
6130
|
+
zi,
|
|
6131
6131
|
{
|
|
6132
6132
|
preserveAspectRatio: void 0,
|
|
6133
6133
|
elements: n,
|
|
@@ -6174,7 +6174,7 @@ const ae = (r) => {
|
|
|
6174
6174
|
if (r.defaultVariant !== void 0)
|
|
6175
6175
|
return t.find((e) => e.id === r.defaultVariant);
|
|
6176
6176
|
}
|
|
6177
|
-
}, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(),
|
|
6177
|
+
}, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Rn = async (r, t) => {
|
|
6178
6178
|
if (!t) {
|
|
6179
6179
|
if (!r)
|
|
6180
6180
|
throw new Error("No region or src supplied. Cannot construct frame!");
|
|
@@ -6198,8 +6198,8 @@ const ae = (r) => {
|
|
|
6198
6198
|
throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
|
|
6199
6199
|
return e;
|
|
6200
6200
|
}, Qe = async (r) => {
|
|
6201
|
-
if (
|
|
6202
|
-
return
|
|
6201
|
+
if (Ge.has(r))
|
|
6202
|
+
return Ge.get(r);
|
|
6203
6203
|
const e = (async () => {
|
|
6204
6204
|
if (Vt.has(r))
|
|
6205
6205
|
return Vt.get(r);
|
|
@@ -6235,7 +6235,7 @@ const ae = (r) => {
|
|
|
6235
6235
|
}
|
|
6236
6236
|
throw new Error("Malformed frame SVG");
|
|
6237
6237
|
})();
|
|
6238
|
-
return
|
|
6238
|
+
return Ge.set(r, e), e;
|
|
6239
6239
|
}, Ea = (r, t, e, a) => {
|
|
6240
6240
|
const n = t.width / t.height, i = r.width / r.height;
|
|
6241
6241
|
let s;
|
|
@@ -6297,9 +6297,9 @@ const ae = (r) => {
|
|
|
6297
6297
|
at(r).then((e) => {
|
|
6298
6298
|
t(e);
|
|
6299
6299
|
}).catch((e) => console.error(e));
|
|
6300
|
-
}),
|
|
6301
|
-
if (
|
|
6302
|
-
return
|
|
6300
|
+
}), ze = /* @__PURE__ */ new Map(), Kt = async (r) => {
|
|
6301
|
+
if (ze.has(r))
|
|
6302
|
+
return ze.get(r);
|
|
6303
6303
|
const t = async (n) => new Promise((i, s) => {
|
|
6304
6304
|
try {
|
|
6305
6305
|
if (!(!!URL && !!URL.createObjectURL))
|
|
@@ -6316,23 +6316,23 @@ const ae = (r) => {
|
|
|
6316
6316
|
const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
|
|
6317
6317
|
if (!s)
|
|
6318
6318
|
throw new Error("Failed to read SVG");
|
|
6319
|
-
const l = bt().serializeToString(s), c =
|
|
6319
|
+
const l = bt().serializeToString(s), c = mt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
|
|
6320
6320
|
anonymousCrossOrigin: !0,
|
|
6321
6321
|
ignoreDimensions: !1,
|
|
6322
|
-
createCanvas:
|
|
6322
|
+
createCanvas: mt,
|
|
6323
6323
|
createImage: Zt,
|
|
6324
|
-
DOMParser:
|
|
6324
|
+
DOMParser: ma(),
|
|
6325
6325
|
fetch: rt
|
|
6326
|
-
}), u = s.getAttribute("width"), h = s.getAttribute("height"),
|
|
6326
|
+
}), u = s.getAttribute("width"), h = s.getAttribute("height"), g = 2048;
|
|
6327
6327
|
if (h && u) {
|
|
6328
|
-
const
|
|
6329
|
-
f > 1 ? A.resize(
|
|
6328
|
+
const m = parseFloat(h), f = parseFloat(u) / m;
|
|
6329
|
+
f > 1 ? A.resize(g, g / f) : A.resize(g * f, g);
|
|
6330
6330
|
} else
|
|
6331
|
-
A.resize(
|
|
6331
|
+
A.resize(g, g);
|
|
6332
6332
|
return await A.render(), await t(c);
|
|
6333
6333
|
})();
|
|
6334
|
-
return
|
|
6335
|
-
},
|
|
6334
|
+
return ze.set(r, a), a;
|
|
6335
|
+
}, Lt = async (r, t, e, a) => {
|
|
6336
6336
|
const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
|
|
6337
6337
|
width: r.layoutState.layout.width,
|
|
6338
6338
|
height: r.layoutState.layout.height,
|
|
@@ -6350,7 +6350,7 @@ const ae = (r) => {
|
|
|
6350
6350
|
const l = await lt(await $n(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6351
6351
|
if (!u)
|
|
6352
6352
|
throw new Error("SVG missing viewBox.");
|
|
6353
|
-
const h = o.height,
|
|
6353
|
+
const h = o.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
|
|
6354
6354
|
o.height = o.width / f, o.top += (h - o.height) / 2;
|
|
6355
6355
|
}
|
|
6356
6356
|
if (e && t === M.Image) {
|
|
@@ -6364,9 +6364,9 @@ const ae = (r) => {
|
|
|
6364
6364
|
}
|
|
6365
6365
|
return o;
|
|
6366
6366
|
};
|
|
6367
|
-
class
|
|
6367
|
+
class Gc {
|
|
6368
6368
|
static async getFrame(t, e) {
|
|
6369
|
-
const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await
|
|
6369
|
+
const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Lt(t, M.Frame);
|
|
6370
6370
|
return {
|
|
6371
6371
|
id: Q(),
|
|
6372
6372
|
x: i.left,
|
|
@@ -6392,7 +6392,7 @@ class zc {
|
|
|
6392
6392
|
};
|
|
6393
6393
|
}
|
|
6394
6394
|
static async getImage(t, e) {
|
|
6395
|
-
const a = e.region || await
|
|
6395
|
+
const a = e.region || await Lt(t, M.Image, e.src);
|
|
6396
6396
|
return {
|
|
6397
6397
|
id: Q(),
|
|
6398
6398
|
src: e.src,
|
|
@@ -6409,14 +6409,14 @@ class zc {
|
|
|
6409
6409
|
};
|
|
6410
6410
|
}
|
|
6411
6411
|
static async getTextbox(t, e) {
|
|
6412
|
-
var
|
|
6412
|
+
var g;
|
|
6413
6413
|
const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Nt(n), o = {
|
|
6414
6414
|
assetUrl: n,
|
|
6415
6415
|
name: s.names.fullName.en
|
|
6416
6416
|
}, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
|
|
6417
6417
|
vertical: a.vertical,
|
|
6418
6418
|
uppercase: a.uppercase
|
|
6419
|
-
}), A = e.region || await
|
|
6419
|
+
}), A = e.region || await Lt(t, M.Textbox, n, {
|
|
6420
6420
|
text: d,
|
|
6421
6421
|
fontScale: a.size ? a.size / s.unitsPerEm : void 0
|
|
6422
6422
|
}), u = ee(
|
|
@@ -6447,7 +6447,7 @@ class zc {
|
|
|
6447
6447
|
{ ...A, height: u.height },
|
|
6448
6448
|
o,
|
|
6449
6449
|
u.fontSize,
|
|
6450
|
-
((
|
|
6450
|
+
((g = u == null ? void 0 : u.text) == null ? void 0 : g.split(`
|
|
6451
6451
|
`)) || [],
|
|
6452
6452
|
u.align
|
|
6453
6453
|
);
|
|
@@ -6482,7 +6482,7 @@ class zc {
|
|
|
6482
6482
|
</svg>
|
|
6483
6483
|
`, n = {};
|
|
6484
6484
|
n["spiff-fill-shape"] = { browserValue: e.color };
|
|
6485
|
-
const i = e.region || await
|
|
6485
|
+
const i = e.region || await Lt(t, M.Illustration), s = Q();
|
|
6486
6486
|
return {
|
|
6487
6487
|
stepRegion: e.region,
|
|
6488
6488
|
colors: n,
|
|
@@ -6500,7 +6500,7 @@ class zc {
|
|
|
6500
6500
|
};
|
|
6501
6501
|
}
|
|
6502
6502
|
static async getIllustration(t, e) {
|
|
6503
|
-
const a = e.region || await
|
|
6503
|
+
const a = e.region || await Lt(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
|
|
6504
6504
|
return {
|
|
6505
6505
|
cachedObjectURL: i,
|
|
6506
6506
|
stepRegion: e.region,
|
|
@@ -6525,7 +6525,7 @@ class V extends Error {
|
|
|
6525
6525
|
super("Element not found!"), Object.setPrototypeOf(this, V.prototype);
|
|
6526
6526
|
}
|
|
6527
6527
|
}
|
|
6528
|
-
const
|
|
6528
|
+
const U = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
|
|
6529
6529
|
const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
|
|
6530
6530
|
if (!e)
|
|
6531
6531
|
throw new V();
|
|
@@ -6537,7 +6537,7 @@ const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
|
|
|
6537
6537
|
elements: a,
|
|
6538
6538
|
modificationID: Q()
|
|
6539
6539
|
};
|
|
6540
|
-
},
|
|
6540
|
+
}, Ga = async (r) => {
|
|
6541
6541
|
var a;
|
|
6542
6542
|
const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
|
|
6543
6543
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -6599,7 +6599,7 @@ class O {
|
|
|
6599
6599
|
this.oldState = t;
|
|
6600
6600
|
}
|
|
6601
6601
|
}
|
|
6602
|
-
class
|
|
6602
|
+
class za extends O {
|
|
6603
6603
|
constructor(t) {
|
|
6604
6604
|
super(), this.serializableWorkflow = t;
|
|
6605
6605
|
}
|
|
@@ -6610,13 +6610,13 @@ class Ga extends O {
|
|
|
6610
6610
|
};
|
|
6611
6611
|
}
|
|
6612
6612
|
}
|
|
6613
|
-
class
|
|
6613
|
+
class zc extends O {
|
|
6614
6614
|
constructor(t, e, a) {
|
|
6615
6615
|
super(), this.id = t, this.x = e, this.y = a;
|
|
6616
6616
|
}
|
|
6617
6617
|
apply(t) {
|
|
6618
6618
|
this.oldState = t;
|
|
6619
|
-
const e =
|
|
6619
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6620
6620
|
if (!e.id)
|
|
6621
6621
|
throw new V();
|
|
6622
6622
|
const a = {
|
|
@@ -6639,7 +6639,7 @@ class Wc extends O {
|
|
|
6639
6639
|
}
|
|
6640
6640
|
apply(t) {
|
|
6641
6641
|
this.oldState = t;
|
|
6642
|
-
const e =
|
|
6642
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6643
6643
|
if (!e.id)
|
|
6644
6644
|
throw new V();
|
|
6645
6645
|
const a = {
|
|
@@ -6661,7 +6661,7 @@ class jc extends O {
|
|
|
6661
6661
|
}
|
|
6662
6662
|
apply(t) {
|
|
6663
6663
|
this.oldState = t;
|
|
6664
|
-
const e =
|
|
6664
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6665
6665
|
if (!e.id)
|
|
6666
6666
|
throw new V();
|
|
6667
6667
|
let a = {
|
|
@@ -6694,7 +6694,7 @@ class $ extends O {
|
|
|
6694
6694
|
return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
|
|
6695
6695
|
}
|
|
6696
6696
|
}
|
|
6697
|
-
class
|
|
6697
|
+
class Ln extends O {
|
|
6698
6698
|
constructor(t) {
|
|
6699
6699
|
super(), this.layout = t;
|
|
6700
6700
|
}
|
|
@@ -6800,7 +6800,7 @@ class ss extends O {
|
|
|
6800
6800
|
}
|
|
6801
6801
|
apply(t) {
|
|
6802
6802
|
this.oldState = t;
|
|
6803
|
-
const e =
|
|
6803
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6804
6804
|
if (!e.id)
|
|
6805
6805
|
throw new V();
|
|
6806
6806
|
const a = {
|
|
@@ -6824,7 +6824,7 @@ class We extends O {
|
|
|
6824
6824
|
}
|
|
6825
6825
|
apply(t) {
|
|
6826
6826
|
this.oldState = t;
|
|
6827
|
-
const e =
|
|
6827
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6828
6828
|
if (!e.id)
|
|
6829
6829
|
throw new V();
|
|
6830
6830
|
const a = {
|
|
@@ -6846,7 +6846,7 @@ class os extends O {
|
|
|
6846
6846
|
}
|
|
6847
6847
|
apply(t) {
|
|
6848
6848
|
this.oldState = t;
|
|
6849
|
-
const e =
|
|
6849
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6850
6850
|
if (!e.id)
|
|
6851
6851
|
throw new V();
|
|
6852
6852
|
const a = {
|
|
@@ -6868,7 +6868,7 @@ class Wa extends O {
|
|
|
6868
6868
|
}
|
|
6869
6869
|
apply(t) {
|
|
6870
6870
|
this.oldState = t;
|
|
6871
|
-
const e =
|
|
6871
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6872
6872
|
if (!e.id)
|
|
6873
6873
|
throw new V();
|
|
6874
6874
|
const a = {
|
|
@@ -6890,7 +6890,7 @@ class ls extends O {
|
|
|
6890
6890
|
}
|
|
6891
6891
|
apply(t) {
|
|
6892
6892
|
this.oldState = t;
|
|
6893
|
-
const e =
|
|
6893
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6894
6894
|
if (!e.id)
|
|
6895
6895
|
throw new V();
|
|
6896
6896
|
const a = {
|
|
@@ -6948,7 +6948,7 @@ class ds extends O {
|
|
|
6948
6948
|
}
|
|
6949
6949
|
apply(t) {
|
|
6950
6950
|
this.oldState = t;
|
|
6951
|
-
const e =
|
|
6951
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6952
6952
|
if (!e.id)
|
|
6953
6953
|
throw new V();
|
|
6954
6954
|
const a = {
|
|
@@ -6967,13 +6967,13 @@ class ds extends O {
|
|
|
6967
6967
|
};
|
|
6968
6968
|
}
|
|
6969
6969
|
}
|
|
6970
|
-
class
|
|
6970
|
+
class qc extends O {
|
|
6971
6971
|
constructor(t, e) {
|
|
6972
6972
|
super(), this.id = t, this.src = e;
|
|
6973
6973
|
}
|
|
6974
6974
|
apply(t) {
|
|
6975
6975
|
this.oldState = t;
|
|
6976
|
-
const e =
|
|
6976
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6977
6977
|
if (!e.id)
|
|
6978
6978
|
throw new V();
|
|
6979
6979
|
const a = {
|
|
@@ -6995,7 +6995,7 @@ class As extends O {
|
|
|
6995
6995
|
}
|
|
6996
6996
|
apply(t) {
|
|
6997
6997
|
this.oldState = t;
|
|
6998
|
-
const e =
|
|
6998
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
6999
6999
|
if (!e.id)
|
|
7000
7000
|
throw new V();
|
|
7001
7001
|
const a = X(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
|
|
@@ -7014,7 +7014,7 @@ class je extends O {
|
|
|
7014
7014
|
}
|
|
7015
7015
|
apply(t) {
|
|
7016
7016
|
this.oldState = t;
|
|
7017
|
-
const e =
|
|
7017
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7018
7018
|
if (!e.id)
|
|
7019
7019
|
throw new V();
|
|
7020
7020
|
const a = {
|
|
@@ -7037,7 +7037,7 @@ class oa extends O {
|
|
|
7037
7037
|
}
|
|
7038
7038
|
apply(t) {
|
|
7039
7039
|
this.oldState = t;
|
|
7040
|
-
const e =
|
|
7040
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7041
7041
|
if (!e.id)
|
|
7042
7042
|
throw new V();
|
|
7043
7043
|
const a = e.colors || {}, n = a[this.className];
|
|
@@ -7069,7 +7069,7 @@ class us extends O {
|
|
|
7069
7069
|
}
|
|
7070
7070
|
apply(t) {
|
|
7071
7071
|
this.oldState = t;
|
|
7072
|
-
const e =
|
|
7072
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7073
7073
|
if (!e.id)
|
|
7074
7074
|
throw new V();
|
|
7075
7075
|
const a = {
|
|
@@ -7086,7 +7086,7 @@ class us extends O {
|
|
|
7086
7086
|
};
|
|
7087
7087
|
}
|
|
7088
7088
|
}
|
|
7089
|
-
class
|
|
7089
|
+
class Hc extends O {
|
|
7090
7090
|
/**
|
|
7091
7091
|
* @param id The targeted element to bring to the front.
|
|
7092
7092
|
*/
|
|
@@ -7094,7 +7094,7 @@ class qc extends O {
|
|
|
7094
7094
|
super(), this.id = t;
|
|
7095
7095
|
}
|
|
7096
7096
|
apply(t) {
|
|
7097
|
-
if (this.oldState = t, !
|
|
7097
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
|
7098
7098
|
throw new V();
|
|
7099
7099
|
const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
|
|
7100
7100
|
if (!a)
|
|
@@ -7124,7 +7124,7 @@ class Yc extends O {
|
|
|
7124
7124
|
}
|
|
7125
7125
|
apply(t) {
|
|
7126
7126
|
this.oldState = t;
|
|
7127
|
-
const e =
|
|
7127
|
+
const e = U(this.id, Object.values(t.layouts));
|
|
7128
7128
|
if (!e.id)
|
|
7129
7129
|
throw new V();
|
|
7130
7130
|
const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
|
|
@@ -7154,7 +7154,7 @@ class Jc extends O {
|
|
|
7154
7154
|
super(), this.id = t;
|
|
7155
7155
|
}
|
|
7156
7156
|
apply(t) {
|
|
7157
|
-
if (this.oldState = t, !
|
|
7157
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
|
7158
7158
|
throw new V();
|
|
7159
7159
|
const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
|
|
7160
7160
|
if (!a)
|
|
@@ -7181,7 +7181,7 @@ class Kc extends O {
|
|
|
7181
7181
|
super(), this.id = t;
|
|
7182
7182
|
}
|
|
7183
7183
|
apply(t) {
|
|
7184
|
-
if (this.oldState = t, !
|
|
7184
|
+
if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
|
|
7185
7185
|
throw new V();
|
|
7186
7186
|
const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
|
|
7187
7187
|
if (!a)
|
|
@@ -7243,7 +7243,7 @@ class ja {
|
|
|
7243
7243
|
command: new W(h, i)
|
|
7244
7244
|
};
|
|
7245
7245
|
} else {
|
|
7246
|
-
const u = this.configuration.type === P.SilentIllustration ? (A = this.configuration.data.asset) == null ? void 0 : A.fileLink : s,
|
|
7246
|
+
const u = this.configuration.type === P.SilentIllustration ? (A = this.configuration.data.asset) == null ? void 0 : A.fileLink : s, g = await lt(await (async () => new Promise((p, f) => {
|
|
7247
7247
|
if (!u) {
|
|
7248
7248
|
f("Undefined vector silent step source");
|
|
7249
7249
|
return;
|
|
@@ -7251,13 +7251,13 @@ class ja {
|
|
|
7251
7251
|
at(u, !0).then((C) => {
|
|
7252
7252
|
p(C);
|
|
7253
7253
|
}).catch((C) => console.error(C));
|
|
7254
|
-
}))()),
|
|
7254
|
+
}))()), m = {
|
|
7255
7255
|
stepName: this.configuration.stepName,
|
|
7256
7256
|
id: Q(),
|
|
7257
|
-
cachedObjectURL: await Kt(
|
|
7257
|
+
cachedObjectURL: await Kt(g.svg),
|
|
7258
7258
|
src: u,
|
|
7259
|
-
svg:
|
|
7260
|
-
colors:
|
|
7259
|
+
svg: g.svg,
|
|
7260
|
+
colors: g.colors,
|
|
7261
7261
|
type: o,
|
|
7262
7262
|
y: n.top,
|
|
7263
7263
|
x: n.left,
|
|
@@ -7272,10 +7272,10 @@ class ja {
|
|
|
7272
7272
|
};
|
|
7273
7273
|
return {
|
|
7274
7274
|
regionElement: {
|
|
7275
|
-
id:
|
|
7275
|
+
id: m.id,
|
|
7276
7276
|
region: n
|
|
7277
7277
|
},
|
|
7278
|
-
command: new W(
|
|
7278
|
+
command: new W(m, i)
|
|
7279
7279
|
};
|
|
7280
7280
|
}
|
|
7281
7281
|
}, this.configuration = t, this.layouts = e, this.product = a || void 0;
|
|
@@ -7302,7 +7302,7 @@ class ja {
|
|
|
7302
7302
|
}
|
|
7303
7303
|
}
|
|
7304
7304
|
const hs = async (r) => {
|
|
7305
|
-
const t = `${
|
|
7305
|
+
const t = `${gt.getServicesApiUrl()}/shortener`;
|
|
7306
7306
|
try {
|
|
7307
7307
|
return (await (await rt(t, {
|
|
7308
7308
|
method: "POST",
|
|
@@ -7315,7 +7315,7 @@ const hs = async (r) => {
|
|
|
7315
7315
|
throw console.error(e), new xe("Failed to shorten URL, see console.");
|
|
7316
7316
|
}
|
|
7317
7317
|
};
|
|
7318
|
-
class
|
|
7318
|
+
class Un {
|
|
7319
7319
|
async poll() {
|
|
7320
7320
|
try {
|
|
7321
7321
|
if (await this.predicate()) {
|
|
@@ -7338,7 +7338,7 @@ class Ln {
|
|
|
7338
7338
|
this.onSuccess = e, this.onFailure = a, this.predicate = t, this.attempts = 0, this.pollingId = -1, this.interval = n, this.maxAttempts = i, this.poll();
|
|
7339
7339
|
}
|
|
7340
7340
|
}
|
|
7341
|
-
class
|
|
7341
|
+
class gs {
|
|
7342
7342
|
async init(t, e, a) {
|
|
7343
7343
|
return a && await this.reload(t, e, a), null;
|
|
7344
7344
|
}
|
|
@@ -7358,23 +7358,23 @@ class ms {
|
|
|
7358
7358
|
}
|
|
7359
7359
|
async regenerateQRCode(t, e, a, n) {
|
|
7360
7360
|
const i = async () => {
|
|
7361
|
-
var
|
|
7362
|
-
const h = (await ve([e]))[0],
|
|
7363
|
-
return { asset: h, link:
|
|
7364
|
-
}, s = await new Promise((h,
|
|
7365
|
-
new
|
|
7361
|
+
var m, p;
|
|
7362
|
+
const h = (await ve([e]))[0], g = (p = (m = h == null ? void 0 : h.versions) == null ? void 0 : m.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
|
|
7363
|
+
return { asset: h, link: g };
|
|
7364
|
+
}, s = await new Promise((h, g) => {
|
|
7365
|
+
new Un(
|
|
7366
7366
|
async () => !!(await i()).link,
|
|
7367
7367
|
async () => {
|
|
7368
|
-
const
|
|
7369
|
-
if (!
|
|
7370
|
-
throw new
|
|
7368
|
+
const m = await i();
|
|
7369
|
+
if (!m.link || !m.link)
|
|
7370
|
+
throw new Ht(m.asset);
|
|
7371
7371
|
h({
|
|
7372
7372
|
rel: "mpeg4",
|
|
7373
|
-
href:
|
|
7373
|
+
href: m.link
|
|
7374
7374
|
});
|
|
7375
7375
|
},
|
|
7376
7376
|
() => {
|
|
7377
|
-
|
|
7377
|
+
g("Poller timed out with 40 attempts @ 3 second interval");
|
|
7378
7378
|
},
|
|
7379
7379
|
3e3,
|
|
7380
7380
|
40
|
|
@@ -7430,7 +7430,7 @@ class ms {
|
|
|
7430
7430
|
} };
|
|
7431
7431
|
}
|
|
7432
7432
|
}
|
|
7433
|
-
const Vn = new
|
|
7433
|
+
const Vn = new gs();
|
|
7434
7434
|
class be {
|
|
7435
7435
|
constructor() {
|
|
7436
7436
|
this.frameSourceSvg = async (t, e) => {
|
|
@@ -7442,7 +7442,7 @@ class be {
|
|
|
7442
7442
|
const n = a.fileLink;
|
|
7443
7443
|
if (n)
|
|
7444
7444
|
return at(n, !0);
|
|
7445
|
-
throw new
|
|
7445
|
+
throw new Ht(a);
|
|
7446
7446
|
};
|
|
7447
7447
|
}
|
|
7448
7448
|
async init(t, e, a) {
|
|
@@ -7456,7 +7456,7 @@ class be {
|
|
|
7456
7456
|
const s = e.getWorkflowExperience().getBundle();
|
|
7457
7457
|
if (s && t.globalPropertyAspectConfigurations) {
|
|
7458
7458
|
const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
|
|
7459
|
-
c && c.originalAssetKey && (i = (await
|
|
7459
|
+
c && c.originalAssetKey && (i = (await L.getLocalOrFromServer(c.originalAssetKey)).fileLink);
|
|
7460
7460
|
}
|
|
7461
7461
|
if (t.option && t.option.variants && t.option.variants.length > 0) {
|
|
7462
7462
|
const o = t.option, l = Y.getDefaultVariant(o);
|
|
@@ -7492,8 +7492,8 @@ class be {
|
|
|
7492
7492
|
}
|
|
7493
7493
|
if (n) {
|
|
7494
7494
|
const d = async () => {
|
|
7495
|
-
var
|
|
7496
|
-
const A = (
|
|
7495
|
+
var g, m, p, f, C;
|
|
7496
|
+
const A = (g = n.storage) == null ? void 0 : g.colors, u = (m = n.storage) == null ? void 0 : m.framePatternSrc, h = (p = n.storage) == null ? void 0 : p.frameOffsetsList;
|
|
7497
7497
|
if (e.updateMetadata(t.stepName, {
|
|
7498
7498
|
frameOffsetsList: h,
|
|
7499
7499
|
framePatternSrc: u
|
|
@@ -7523,7 +7523,7 @@ class be {
|
|
|
7523
7523
|
l,
|
|
7524
7524
|
async () => {
|
|
7525
7525
|
const h = await Promise.all(
|
|
7526
|
-
t.data.regions.map((
|
|
7526
|
+
t.data.regions.map((g) => this.frameSourceSvg(u, g))
|
|
7527
7527
|
);
|
|
7528
7528
|
e.updateStorage(t.stepName, { currentFrameSources: h }), await d();
|
|
7529
7529
|
}
|
|
@@ -7552,14 +7552,14 @@ class be {
|
|
|
7552
7552
|
const o = e.fileLink || "";
|
|
7553
7553
|
return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((c) => {
|
|
7554
7554
|
a.addPoller(
|
|
7555
|
-
new
|
|
7555
|
+
new Un(
|
|
7556
7556
|
async () => {
|
|
7557
7557
|
var h;
|
|
7558
|
-
const A = (h = (await
|
|
7558
|
+
const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((g) => g.name === "svg");
|
|
7559
7559
|
return A ? (await rt(A.link)).status === 200 : !1;
|
|
7560
7560
|
},
|
|
7561
7561
|
() => {
|
|
7562
|
-
|
|
7562
|
+
L.getLocalOrFromServer(e.key || "").then((d) => {
|
|
7563
7563
|
this.loadPatternFromAsset(d, t, a, n).then(
|
|
7564
7564
|
c
|
|
7565
7565
|
);
|
|
@@ -7717,12 +7717,12 @@ class be {
|
|
|
7717
7717
|
if (!o)
|
|
7718
7718
|
throw new Error("Frame service unavailable, cannot load pattern!");
|
|
7719
7719
|
const l = await Promise.all(
|
|
7720
|
-
t.data.regions.map((
|
|
7720
|
+
t.data.regions.map((g) => this.frameSourceSvg(e, g))
|
|
7721
7721
|
);
|
|
7722
7722
|
i && i(!0);
|
|
7723
7723
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7724
|
-
t.data.regions.map(async (
|
|
7725
|
-
const p = await Qe(l[
|
|
7724
|
+
t.data.regions.map(async (g, m) => {
|
|
7725
|
+
const p = await Qe(l[m]), f = o.getImageData(), C = a.map((I) => new Bt(I.id)), w = f ? Ea(
|
|
7726
7726
|
f,
|
|
7727
7727
|
p,
|
|
7728
7728
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
@@ -7737,11 +7737,11 @@ class be {
|
|
|
7737
7737
|
scaleX: (w == null ? void 0 : w.zoom) || 1,
|
|
7738
7738
|
scaleY: (w == null ? void 0 : w.zoom) || 1,
|
|
7739
7739
|
rotation: 0
|
|
7740
|
-
} : void 0, y = Q(), B = n.getLayouts().find((I) => I.panelId ===
|
|
7740
|
+
} : void 0, y = Q(), B = n.getLayouts().find((I) => I.panelId === g.panelId);
|
|
7741
7741
|
if (!B)
|
|
7742
|
-
throw new J(
|
|
7742
|
+
throw new J(g);
|
|
7743
7743
|
return {
|
|
7744
|
-
command: this.getCreateElementCommand(y,
|
|
7744
|
+
command: this.getCreateElementCommand(y, g, B, {
|
|
7745
7745
|
frameData: p,
|
|
7746
7746
|
pattern: S,
|
|
7747
7747
|
disablePlaceholder: t.data.disablePlaceholder,
|
|
@@ -7749,26 +7749,26 @@ class be {
|
|
|
7749
7749
|
}),
|
|
7750
7750
|
regionEl: {
|
|
7751
7751
|
id: y,
|
|
7752
|
-
region:
|
|
7752
|
+
region: g
|
|
7753
7753
|
},
|
|
7754
7754
|
removeExistingCommands: C
|
|
7755
7755
|
};
|
|
7756
7756
|
})
|
|
7757
|
-
), A = d.map((
|
|
7757
|
+
), A = d.map((g) => g.command), u = d.map((g) => g.removeExistingCommands).flat();
|
|
7758
7758
|
return {
|
|
7759
7759
|
command: new $([...A, ...u]),
|
|
7760
7760
|
followup: async () => {
|
|
7761
7761
|
i && i(!1), await n.setSelectionsAndElements(
|
|
7762
7762
|
t.stepName,
|
|
7763
7763
|
e ? [e] : [],
|
|
7764
|
-
[...d.map((
|
|
7764
|
+
[...d.map((g) => g.regionEl)],
|
|
7765
7765
|
async () => {
|
|
7766
|
-
var
|
|
7766
|
+
var g;
|
|
7767
7767
|
if (n.updateStorage(t.stepName, { currentFrameSources: l }), s) {
|
|
7768
|
-
const
|
|
7769
|
-
if (!
|
|
7768
|
+
const m = (g = n.getWorkflowExperience().getStepById(t.stepName)) == null ? void 0 : g.frameService;
|
|
7769
|
+
if (!m)
|
|
7770
7770
|
throw new Error("Frame service unavailable, cannot load pattern!");
|
|
7771
|
-
await this.loadPatternFromString(s,
|
|
7771
|
+
await this.loadPatternFromString(s, m, !0);
|
|
7772
7772
|
}
|
|
7773
7773
|
}
|
|
7774
7774
|
);
|
|
@@ -7786,7 +7786,7 @@ class be {
|
|
|
7786
7786
|
const a = t.fileLink;
|
|
7787
7787
|
if (a)
|
|
7788
7788
|
return a;
|
|
7789
|
-
throw new
|
|
7789
|
+
throw new Ht(t);
|
|
7790
7790
|
}
|
|
7791
7791
|
async loadPatternFromAsset(t, e, a, n) {
|
|
7792
7792
|
var c, d;
|
|
@@ -7818,7 +7818,7 @@ class be {
|
|
|
7818
7818
|
}
|
|
7819
7819
|
}
|
|
7820
7820
|
const wt = new be();
|
|
7821
|
-
class
|
|
7821
|
+
class ms {
|
|
7822
7822
|
async getIllustrationBody(t) {
|
|
7823
7823
|
return new Promise((e) => {
|
|
7824
7824
|
at(t, !0).then((a) => {
|
|
@@ -7854,7 +7854,7 @@ class gs {
|
|
|
7854
7854
|
if (a.length === 0)
|
|
7855
7855
|
return [];
|
|
7856
7856
|
try {
|
|
7857
|
-
return
|
|
7857
|
+
return U(
|
|
7858
7858
|
a[0].id,
|
|
7859
7859
|
e.getAllLayoutData()
|
|
7860
7860
|
).colors;
|
|
@@ -7936,39 +7936,39 @@ class gs {
|
|
|
7936
7936
|
return new $(c);
|
|
7937
7937
|
}
|
|
7938
7938
|
async changeColors(t, e, a, n, i) {
|
|
7939
|
-
var h,
|
|
7939
|
+
var h, g;
|
|
7940
7940
|
if (e.length === 0)
|
|
7941
7941
|
return;
|
|
7942
|
-
const s =
|
|
7942
|
+
const s = U(
|
|
7943
7943
|
e[0].id,
|
|
7944
|
-
n().map((
|
|
7944
|
+
n().map((m) => m.layoutState)
|
|
7945
7945
|
), o = { ...s.colors }, l = {};
|
|
7946
|
-
Object.entries(o).forEach(([
|
|
7946
|
+
Object.entries(o).forEach(([m, p]) => {
|
|
7947
7947
|
const f = { browserValue: p.browserValue, pmsValue: p.pmsValue }, C = p.spotColor;
|
|
7948
|
-
C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[
|
|
7948
|
+
C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[m] = f;
|
|
7949
7949
|
});
|
|
7950
|
-
for (const [
|
|
7950
|
+
for (const [m, p] of i.entries()) {
|
|
7951
7951
|
const f = typeof p == "string" ? p : p.browserValue, C = typeof p == "string" ? void 0 : p.pmsValue;
|
|
7952
|
-
o[
|
|
7952
|
+
o[m] = { browserValue: f, spotColor: (h = o[m]) == null ? void 0 : h.spotColor, pmsValue: C }, l[m] = { browserValue: f };
|
|
7953
7953
|
}
|
|
7954
|
-
let c = Array.from(Object.values(o)).map((
|
|
7954
|
+
let c = Array.from(Object.values(o)).map((m) => m.browserValue);
|
|
7955
7955
|
const d = t.data.colorOption;
|
|
7956
|
-
d && ((
|
|
7956
|
+
d && ((g = d.variants) == null || g.forEach((m) => {
|
|
7957
7957
|
c = c.map((p) => {
|
|
7958
7958
|
var f;
|
|
7959
|
-
return p.toLowerCase() === ((f =
|
|
7959
|
+
return p.toLowerCase() === ((f = m.color) == null ? void 0 : f.toLowerCase()) ? m.name : p;
|
|
7960
7960
|
});
|
|
7961
7961
|
})), a.updateMetadata(t.stepName, { colors: c });
|
|
7962
7962
|
const A = /* @__PURE__ */ new Map();
|
|
7963
|
-
if (Object.entries(o).forEach(([
|
|
7964
|
-
A.set(
|
|
7963
|
+
if (Object.entries(o).forEach(([m, p]) => {
|
|
7964
|
+
A.set(m, p);
|
|
7965
7965
|
}), !s.svg)
|
|
7966
7966
|
throw new Error("Colors changed before SVG loaded. This should never happen!");
|
|
7967
7967
|
const u = await this.changeColorsCommand(
|
|
7968
7968
|
s.svg,
|
|
7969
7969
|
s.width,
|
|
7970
7970
|
s.height,
|
|
7971
|
-
e.map((
|
|
7971
|
+
e.map((m) => m.id),
|
|
7972
7972
|
A
|
|
7973
7973
|
);
|
|
7974
7974
|
a.updateStorage(t.stepName, {
|
|
@@ -7991,7 +7991,7 @@ class gs {
|
|
|
7991
7991
|
throw new vt(e);
|
|
7992
7992
|
const l = o.fileLink;
|
|
7993
7993
|
if (!l)
|
|
7994
|
-
throw new
|
|
7994
|
+
throw new Ht(o);
|
|
7995
7995
|
const c = await lt(await this.getIllustrationBody(l)), d = await Kt(c.svg), A = (C) => {
|
|
7996
7996
|
const w = i.getLayouts().find((y) => y.panelId === C.panelId);
|
|
7997
7997
|
if (!w)
|
|
@@ -8006,16 +8006,16 @@ class gs {
|
|
|
8006
8006
|
svg: c
|
|
8007
8007
|
})
|
|
8008
8008
|
};
|
|
8009
|
-
}, u = t.data.regions.map(A),
|
|
8010
|
-
let
|
|
8009
|
+
}, u = t.data.regions.map(A), g = [...u.map((C) => C.command), ...s];
|
|
8010
|
+
let m = Array.from(Object.values(c.colors)).map((C) => C.browserValue);
|
|
8011
8011
|
const p = t.data.colorOption;
|
|
8012
8012
|
return p && ((f = p.variants) == null || f.forEach((C) => {
|
|
8013
|
-
|
|
8013
|
+
m = m.map((w) => {
|
|
8014
8014
|
var S;
|
|
8015
8015
|
return w.toLowerCase() === ((S = C.color) == null ? void 0 : S.toLowerCase()) ? C.name : w;
|
|
8016
8016
|
});
|
|
8017
|
-
})), i.updateMetadata(t.stepName, { colors:
|
|
8018
|
-
command: new $(
|
|
8017
|
+
})), i.updateMetadata(t.stepName, { colors: m }), {
|
|
8018
|
+
command: new $(g),
|
|
8019
8019
|
followup: async () => {
|
|
8020
8020
|
var w, S;
|
|
8021
8021
|
await i.setSelectionsAndElements(
|
|
@@ -8065,7 +8065,7 @@ class gs {
|
|
|
8065
8065
|
};
|
|
8066
8066
|
}
|
|
8067
8067
|
}
|
|
8068
|
-
const
|
|
8068
|
+
const me = new ms();
|
|
8069
8069
|
class ps {
|
|
8070
8070
|
async init(t, e, a) {
|
|
8071
8071
|
const n = t.option;
|
|
@@ -8094,20 +8094,20 @@ class ps {
|
|
|
8094
8094
|
if (d) {
|
|
8095
8095
|
const A = (c = l.variants) == null ? void 0 : c.find((u) => u.id === d);
|
|
8096
8096
|
if (A) {
|
|
8097
|
-
const u = A.material, h = o.map((
|
|
8097
|
+
const u = A.material, h = o.map((g) => ({ id: g.id, region: g.stepRegion }));
|
|
8098
8098
|
await e.setSelectionsAndElements(
|
|
8099
8099
|
t.stepName,
|
|
8100
8100
|
[A],
|
|
8101
8101
|
h,
|
|
8102
8102
|
async () => {
|
|
8103
|
-
const
|
|
8104
|
-
if (
|
|
8105
|
-
const
|
|
8103
|
+
const g = e.getModelContainer();
|
|
8104
|
+
if (g) {
|
|
8105
|
+
const m = t.data.targetMaterials.map((p) => g.applyMaterialVariant(
|
|
8106
8106
|
p,
|
|
8107
8107
|
l.id || "",
|
|
8108
8108
|
u || {}
|
|
8109
8109
|
));
|
|
8110
|
-
Promise.all(
|
|
8110
|
+
Promise.all(m).then(
|
|
8111
8111
|
() => e.setMandatoryFulfilled(t.stepName, !0)
|
|
8112
8112
|
);
|
|
8113
8113
|
}
|
|
@@ -8143,7 +8143,7 @@ class ps {
|
|
|
8143
8143
|
};
|
|
8144
8144
|
}
|
|
8145
8145
|
}
|
|
8146
|
-
const
|
|
8146
|
+
const Gn = new ps();
|
|
8147
8147
|
class fs {
|
|
8148
8148
|
async init(t, e, a) {
|
|
8149
8149
|
const n = t.option;
|
|
@@ -8176,16 +8176,16 @@ class fs {
|
|
|
8176
8176
|
[A],
|
|
8177
8177
|
u,
|
|
8178
8178
|
async () => {
|
|
8179
|
-
var
|
|
8179
|
+
var g;
|
|
8180
8180
|
const h = e.getModelContainer();
|
|
8181
8181
|
if (h && t.option) {
|
|
8182
|
-
const
|
|
8183
|
-
if (!
|
|
8182
|
+
const m = (g = A.asset) == null ? void 0 : g.fileLink;
|
|
8183
|
+
if (!m)
|
|
8184
8184
|
throw new vt(A);
|
|
8185
8185
|
await h.applyModelVariant(
|
|
8186
8186
|
t.stepName || "",
|
|
8187
8187
|
{
|
|
8188
|
-
model:
|
|
8188
|
+
model: m,
|
|
8189
8189
|
contextService: e.getLayoutPreviewService()
|
|
8190
8190
|
},
|
|
8191
8191
|
t.data.replaceProductModel || !1
|
|
@@ -8229,7 +8229,7 @@ class fs {
|
|
|
8229
8229
|
};
|
|
8230
8230
|
}
|
|
8231
8231
|
}
|
|
8232
|
-
const
|
|
8232
|
+
const zn = new fs();
|
|
8233
8233
|
class Cs {
|
|
8234
8234
|
async init(t, e, a) {
|
|
8235
8235
|
if (a)
|
|
@@ -8265,17 +8265,17 @@ class Cs {
|
|
|
8265
8265
|
return console.error("Missing configuration."), null;
|
|
8266
8266
|
a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
|
|
8267
8267
|
const c = (A, u, h) => {
|
|
8268
|
-
const
|
|
8268
|
+
const g = h || Q(), p = a.getLayouts().find((C) => C.panelId === u.panelId);
|
|
8269
8269
|
if (!p)
|
|
8270
8270
|
return console.error(`Can not find layout for region: ${u.panelId}`), null;
|
|
8271
8271
|
const f = [];
|
|
8272
|
-
return h && f.push(new Bt(
|
|
8272
|
+
return h && f.push(new Bt(g)), f.push(
|
|
8273
8273
|
new W(
|
|
8274
8274
|
{
|
|
8275
8275
|
stepRegion: u,
|
|
8276
8276
|
stepName: t.stepName,
|
|
8277
8277
|
colors: {},
|
|
8278
|
-
id:
|
|
8278
|
+
id: g,
|
|
8279
8279
|
svg: A,
|
|
8280
8280
|
type: M.Illustration,
|
|
8281
8281
|
y: u.top,
|
|
@@ -8290,7 +8290,7 @@ class Cs {
|
|
|
8290
8290
|
p
|
|
8291
8291
|
)
|
|
8292
8292
|
), {
|
|
8293
|
-
id:
|
|
8293
|
+
id: g,
|
|
8294
8294
|
region: u,
|
|
8295
8295
|
command: new $(f)
|
|
8296
8296
|
};
|
|
@@ -8299,8 +8299,8 @@ class Cs {
|
|
|
8299
8299
|
const u = i.map((h) => {
|
|
8300
8300
|
if (!h.region)
|
|
8301
8301
|
return null;
|
|
8302
|
-
const
|
|
8303
|
-
return c(
|
|
8302
|
+
const g = s.svgPrint(e, h.region);
|
|
8303
|
+
return c(g, h.region, h.id);
|
|
8304
8304
|
}).filter((h) => !!h).filter((h) => !!h).map((h) => h && h.command);
|
|
8305
8305
|
return {
|
|
8306
8306
|
command: new $(u),
|
|
@@ -8314,7 +8314,7 @@ class Cs {
|
|
|
8314
8314
|
return {
|
|
8315
8315
|
command: new $(u),
|
|
8316
8316
|
followup: async () => {
|
|
8317
|
-
const h = A.filter((
|
|
8317
|
+
const h = A.filter((g) => g).map((g) => g && { id: g.id, region: g.region });
|
|
8318
8318
|
await a.setSelectionsAndElements(
|
|
8319
8319
|
t.stepName,
|
|
8320
8320
|
[],
|
|
@@ -8392,17 +8392,17 @@ class ws {
|
|
|
8392
8392
|
return console.error("No URL for picture!"), null;
|
|
8393
8393
|
n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
|
|
8394
8394
|
const l = a.getRegionElements(t.stepName).map((A) => new Bt(A.id)), c = (A) => {
|
|
8395
|
-
const h = a.getLayouts().find((
|
|
8395
|
+
const h = a.getLayouts().find((m) => m.panelId === A.panelId);
|
|
8396
8396
|
if (!h)
|
|
8397
8397
|
throw new J(A);
|
|
8398
|
-
const
|
|
8398
|
+
const g = Q();
|
|
8399
8399
|
return {
|
|
8400
|
-
regionElement: { id:
|
|
8400
|
+
regionElement: { id: g, region: A },
|
|
8401
8401
|
command: new W(
|
|
8402
8402
|
{
|
|
8403
8403
|
stepName: t.stepName,
|
|
8404
8404
|
stepRegion: A,
|
|
8405
|
-
id:
|
|
8405
|
+
id: g,
|
|
8406
8406
|
src: s,
|
|
8407
8407
|
type: M.Image,
|
|
8408
8408
|
y: A.top,
|
|
@@ -8472,31 +8472,31 @@ class ys {
|
|
|
8472
8472
|
}
|
|
8473
8473
|
}
|
|
8474
8474
|
async selectVariant(t, e, a) {
|
|
8475
|
-
await a.getInitializationPromise();
|
|
8475
|
+
console.log("LOG: q select variant"), await a.getInitializationPromise();
|
|
8476
8476
|
const n = await this.selectVariantLambda(t, e, a);
|
|
8477
|
-
n && (n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
|
|
8477
|
+
n && (console.log("LOG: q select variant result"), n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
|
|
8478
8478
|
}
|
|
8479
8479
|
async selectVariantLambda(t, e, a) {
|
|
8480
8480
|
const n = t.option;
|
|
8481
8481
|
if (!n)
|
|
8482
|
-
return null;
|
|
8482
|
+
return console.log("LOG: q select variant no option"), null;
|
|
8483
8483
|
const i = n.variants;
|
|
8484
8484
|
if (!i)
|
|
8485
|
-
return null;
|
|
8485
|
+
return console.log("LOG: q select variant no variants"), null;
|
|
8486
8486
|
const s = i.length > 1 ? i.find((o) => o.id === e) : i[0];
|
|
8487
8487
|
if (!s)
|
|
8488
|
-
throw new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
|
|
8488
|
+
throw console.log("LOG: q select variant no variant"), new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
|
|
8489
8489
|
return {
|
|
8490
8490
|
command: void 0,
|
|
8491
8491
|
followup: async () => {
|
|
8492
|
-
await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
|
|
8492
|
+
console.log("LOG: q select variant follow up"), await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
|
|
8493
8493
|
a.setMandatoryFulfilled(t.stepName, !0);
|
|
8494
8494
|
});
|
|
8495
8495
|
}
|
|
8496
8496
|
};
|
|
8497
8497
|
}
|
|
8498
8498
|
}
|
|
8499
|
-
const
|
|
8499
|
+
const qn = new ys();
|
|
8500
8500
|
class Ss {
|
|
8501
8501
|
constructor() {
|
|
8502
8502
|
this.shapeFillId = "spiff-fill-shape";
|
|
@@ -8585,10 +8585,10 @@ class Ss {
|
|
|
8585
8585
|
if (a.length > 0) {
|
|
8586
8586
|
const c = (A) => {
|
|
8587
8587
|
const u = A.region;
|
|
8588
|
-
if (!i.find((
|
|
8588
|
+
if (!i.find((m) => m.panelId === (u == null ? void 0 : u.panelId)))
|
|
8589
8589
|
throw new J(u);
|
|
8590
|
-
const
|
|
8591
|
-
return new oa(A.id, this.shapeFillId,
|
|
8590
|
+
const g = o();
|
|
8591
|
+
return new oa(A.id, this.shapeFillId, g);
|
|
8592
8592
|
}, d = a.map(c).filter((A) => !!A);
|
|
8593
8593
|
return {
|
|
8594
8594
|
command: new $(d),
|
|
@@ -8602,10 +8602,10 @@ class Ss {
|
|
|
8602
8602
|
};
|
|
8603
8603
|
} else {
|
|
8604
8604
|
const c = (h) => {
|
|
8605
|
-
const
|
|
8606
|
-
if (!
|
|
8605
|
+
const g = i.find((w) => w.panelId === h.panelId);
|
|
8606
|
+
if (!g)
|
|
8607
8607
|
throw new J(h);
|
|
8608
|
-
const
|
|
8608
|
+
const m = o(), p = `
|
|
8609
8609
|
<svg
|
|
8610
8610
|
xmlns="http://www.w3.org/2000/svg"
|
|
8611
8611
|
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
@@ -8622,11 +8622,11 @@ class Ss {
|
|
|
8622
8622
|
width="1"
|
|
8623
8623
|
height="1"
|
|
8624
8624
|
class="${this.shapeFillId}"
|
|
8625
|
-
fill="${
|
|
8625
|
+
fill="${m}"
|
|
8626
8626
|
/>
|
|
8627
8627
|
</svg>
|
|
8628
8628
|
`, f = {};
|
|
8629
|
-
f[this.shapeFillId] = { browserValue:
|
|
8629
|
+
f[this.shapeFillId] = { browserValue: m };
|
|
8630
8630
|
const C = Q();
|
|
8631
8631
|
return {
|
|
8632
8632
|
id: C,
|
|
@@ -8649,7 +8649,7 @@ class Ss {
|
|
|
8649
8649
|
immutable: h.immutable,
|
|
8650
8650
|
excludeFromExport: t.data.excludeFromPrint
|
|
8651
8651
|
},
|
|
8652
|
-
|
|
8652
|
+
g
|
|
8653
8653
|
)
|
|
8654
8654
|
};
|
|
8655
8655
|
}, d = t.data.regions.map(c), A = d.filter((h) => !!h).map((h) => h == null ? void 0 : h.command), u = d.filter((h) => !!h).map((h) => ({ id: h.id, region: h.region }));
|
|
@@ -8669,7 +8669,7 @@ class Ss {
|
|
|
8669
8669
|
}
|
|
8670
8670
|
}
|
|
8671
8671
|
}
|
|
8672
|
-
const
|
|
8672
|
+
const Gt = new Ss();
|
|
8673
8673
|
class vs {
|
|
8674
8674
|
constructor() {
|
|
8675
8675
|
this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
|
|
@@ -8695,7 +8695,7 @@ class vs {
|
|
|
8695
8695
|
);
|
|
8696
8696
|
}
|
|
8697
8697
|
}
|
|
8698
|
-
const Es = new vs(),
|
|
8698
|
+
const Es = new vs(), qe = (r, t, e, a, n) => {
|
|
8699
8699
|
if (t.some((d) => d == null))
|
|
8700
8700
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
|
8701
8701
|
let i = t.map((d) => d.split(`
|
|
@@ -8709,17 +8709,17 @@ const Es = new vs(), He = (r, t, e, a, n) => {
|
|
|
8709
8709
|
if (A <= r.width)
|
|
8710
8710
|
return [i, A];
|
|
8711
8711
|
const u = o.reduce((p, f, C, w) => f > w[p] ? C : p, 0), h = i[u];
|
|
8712
|
-
let
|
|
8713
|
-
for (; !
|
|
8714
|
-
|
|
8715
|
-
const p = [h.slice(0,
|
|
8712
|
+
let g = !1, m = h.length;
|
|
8713
|
+
for (; !g && m > -1; ) {
|
|
8714
|
+
m = h.lastIndexOf(" ", m - 1);
|
|
8715
|
+
const p = [h.slice(0, m), h.slice(m + 1)], f = p.map((w) => ht(w, a, n));
|
|
8716
8716
|
f[0] <= r.width && (i = [...i.slice(0, u), ...p, ...i.slice(u + 1)], o = [
|
|
8717
8717
|
...o.slice(0, u),
|
|
8718
8718
|
...f,
|
|
8719
8719
|
...o.slice(u + 1)
|
|
8720
|
-
], s += 1,
|
|
8720
|
+
], s += 1, g = !0);
|
|
8721
8721
|
}
|
|
8722
|
-
|
|
8722
|
+
g || (c = !1);
|
|
8723
8723
|
}
|
|
8724
8724
|
return [null, null];
|
|
8725
8725
|
}, pe = (r, t, e, a, n) => {
|
|
@@ -8727,19 +8727,19 @@ const Es = new vs(), He = (r, t, e, a, n) => {
|
|
|
8727
8727
|
const o = Et(t.assetUrl), l = o.getFont();
|
|
8728
8728
|
if (n.size) {
|
|
8729
8729
|
const u = r / l.unitsPerEm;
|
|
8730
|
-
return [i, s] =
|
|
8730
|
+
return [i, s] = qe(e, a, r, u, o), [n.size, i, s];
|
|
8731
8731
|
}
|
|
8732
8732
|
const c = 6;
|
|
8733
8733
|
let d = c - Ve;
|
|
8734
8734
|
if (a.length > 0) {
|
|
8735
8735
|
let u = a, h = 0;
|
|
8736
8736
|
for (; (!n.maxSize || d <= n.maxSize) && u; )
|
|
8737
|
-
d += Ve, h = d / l.unitsPerEm, [u, s] =
|
|
8737
|
+
d += Ve, h = d / l.unitsPerEm, [u, s] = qe(e, a, d, h, o);
|
|
8738
8738
|
}
|
|
8739
8739
|
d > c && (d -= Ve), n.minSize && d < n.minSize && (d = n.minSize);
|
|
8740
8740
|
const A = d / l.unitsPerEm;
|
|
8741
|
-
return [i, s] =
|
|
8742
|
-
},
|
|
8741
|
+
return [i, s] = qe(e, a, d, A, o), [d, i, s];
|
|
8742
|
+
}, He = 30;
|
|
8743
8743
|
class Ie extends Error {
|
|
8744
8744
|
constructor(t) {
|
|
8745
8745
|
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ie.name;
|
|
@@ -8786,51 +8786,53 @@ class bs {
|
|
|
8786
8786
|
}
|
|
8787
8787
|
async init(t, e, a) {
|
|
8788
8788
|
var i, s, o, l;
|
|
8789
|
+
console.log("LOG: t init");
|
|
8789
8790
|
const n = t.option;
|
|
8790
8791
|
if (!n)
|
|
8791
|
-
return null;
|
|
8792
|
+
return console.log("LOG: t no option"), null;
|
|
8792
8793
|
if (a)
|
|
8793
|
-
await this.reload(t, e, a);
|
|
8794
|
+
console.log("LOG: t reload"), await this.reload(t, e, a);
|
|
8794
8795
|
else {
|
|
8796
|
+
console.log("LOG: t no reload");
|
|
8795
8797
|
const c = this.getDefaultImageFillVariant(t.data), d = (i = c == null ? void 0 : c.asset) == null ? void 0 : i.fileLink, A = d ? await sa(d) : void 0, u = A ? {
|
|
8796
8798
|
src: A.src,
|
|
8797
8799
|
height: A.height,
|
|
8798
8800
|
width: A.width,
|
|
8799
8801
|
scale: t.data.imageFillScale || 1
|
|
8800
|
-
} : void 0, h = this.getDefaultStrokeColorVariant(t.data),
|
|
8802
|
+
} : void 0, h = this.getDefaultStrokeColorVariant(t.data), g = t.data.strokeEnabled && (h != null && h.color) ? {
|
|
8801
8803
|
browserValue: h.color,
|
|
8802
8804
|
pmsValue: h.name
|
|
8803
8805
|
} : void 0;
|
|
8804
|
-
let
|
|
8806
|
+
let m = t.data.defaultText || "";
|
|
8805
8807
|
const p = e.getWorkflowExperience().getBundle();
|
|
8806
8808
|
if (p && t.globalPropertyAspectConfigurations) {
|
|
8807
8809
|
const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
|
|
8808
8810
|
var y;
|
|
8809
|
-
return S.type ===
|
|
8811
|
+
return S.type === G.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
|
|
8810
8812
|
});
|
|
8811
8813
|
if (w) {
|
|
8812
8814
|
const y = p.getGlobalPropertyStateManager().getAspect(w.name);
|
|
8813
|
-
y && (
|
|
8815
|
+
y && (m = y);
|
|
8814
8816
|
}
|
|
8815
8817
|
}
|
|
8816
8818
|
e.updateStorage(t.stepName, {
|
|
8817
|
-
text:
|
|
8819
|
+
text: m,
|
|
8818
8820
|
inputText: t.data.defaultText || "",
|
|
8819
8821
|
color: ((o = this.getDefaultColorVariant(t.data)) == null ? void 0 : o.color) || this.getDefaultColor(t.data),
|
|
8820
8822
|
fillImage: u,
|
|
8821
|
-
strokeColor:
|
|
8823
|
+
strokeColor: g
|
|
8822
8824
|
}), e.updateMetadata(t.stepName, {
|
|
8823
|
-
text:
|
|
8825
|
+
text: m,
|
|
8824
8826
|
color: ((l = this.getDefaultColorVariant(t.data)) == null ? void 0 : l.name) || this.getDefaultColor(t.data),
|
|
8825
8827
|
fillImage: c == null ? void 0 : c.name,
|
|
8826
8828
|
strokeColor: t.data.strokeEnabled ? h == null ? void 0 : h.color : void 0
|
|
8827
8829
|
});
|
|
8828
8830
|
const f = Y.getDefaultVariant(n);
|
|
8829
8831
|
if (f)
|
|
8830
|
-
return this.selectVariantCommand(
|
|
8832
|
+
return console.log("LOG: t variant"), this.selectVariantCommand(
|
|
8831
8833
|
t,
|
|
8832
8834
|
f,
|
|
8833
|
-
{ text:
|
|
8835
|
+
{ text: m },
|
|
8834
8836
|
[],
|
|
8835
8837
|
e,
|
|
8836
8838
|
() => {
|
|
@@ -8838,13 +8840,13 @@ class bs {
|
|
|
8838
8840
|
() => {
|
|
8839
8841
|
},
|
|
8840
8842
|
u,
|
|
8841
|
-
|
|
8843
|
+
g
|
|
8842
8844
|
);
|
|
8843
8845
|
}
|
|
8844
|
-
return null;
|
|
8846
|
+
return console.log("LOG: t end"), null;
|
|
8845
8847
|
}
|
|
8846
8848
|
findLayoutElements(t, e) {
|
|
8847
|
-
return t.getRegionElements(e.stepName).map((i) =>
|
|
8849
|
+
return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
|
|
8848
8850
|
}
|
|
8849
8851
|
/**
|
|
8850
8852
|
* Get the colors that can be used for a given text step.
|
|
@@ -8992,7 +8994,7 @@ class bs {
|
|
|
8992
8994
|
const l = [], c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
8993
8995
|
for (const A of e) {
|
|
8994
8996
|
if (!A.fontData)
|
|
8995
|
-
throw new
|
|
8997
|
+
throw new z("Failed to resolve font data for text.");
|
|
8996
8998
|
const [u, h] = pe(
|
|
8997
8999
|
A.fontSize,
|
|
8998
9000
|
A.fontData,
|
|
@@ -9001,9 +9003,9 @@ class bs {
|
|
|
9001
9003
|
{ size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
|
|
9002
9004
|
);
|
|
9003
9005
|
c.set(A.id, u), d.set(A.id, h);
|
|
9004
|
-
const
|
|
9006
|
+
const g = a.data.curved ? s : (h || []).join(`
|
|
9005
9007
|
`);
|
|
9006
|
-
l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id,
|
|
9008
|
+
l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id, g));
|
|
9007
9009
|
}
|
|
9008
9010
|
return !a.data.curved && e.length > 0 && !Array.from(d.values()).every((u) => u) ? (o.errorData || (o.errorData = {}), o.errorData.doesNotFit = !0, o) : (n.updateStorage(a.stepName, { text: t }), n.updateMetadata(a.stepName, {
|
|
9009
9011
|
text: s
|
|
@@ -9038,19 +9040,19 @@ class bs {
|
|
|
9038
9040
|
const n = e.getSerializedStep(
|
|
9039
9041
|
t.stepName,
|
|
9040
9042
|
a.serializableWorkflow.steps
|
|
9041
|
-
), o = Object.values(a.layouts).map((
|
|
9043
|
+
), o = Object.values(a.layouts).map((g) => g.elements).flat().filter((g) => g.stepName === t.stepName), l = t.option;
|
|
9042
9044
|
if (n != null && n.selectedVariants) {
|
|
9043
|
-
const
|
|
9044
|
-
if (l &&
|
|
9045
|
-
const
|
|
9046
|
-
if (
|
|
9047
|
-
const p = await this.fontDataFromVariant(
|
|
9045
|
+
const g = n.selectedVariants[0].id;
|
|
9046
|
+
if (l && g) {
|
|
9047
|
+
const m = (c = l.variants) == null ? void 0 : c.find((p) => p.id === g);
|
|
9048
|
+
if (m) {
|
|
9049
|
+
const p = await this.fontDataFromVariant(m), f = o.map((y) => ({ id: y.id, region: y.stepRegion })), C = (d = n.storage) == null ? void 0 : d.color;
|
|
9048
9050
|
let w = (A = n.storage) == null ? void 0 : A.text;
|
|
9049
9051
|
const S = e.getWorkflowExperience().getBundle();
|
|
9050
9052
|
if (S && t.globalPropertyAspectConfigurations) {
|
|
9051
9053
|
const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, E = y == null ? void 0 : y.find((B) => {
|
|
9052
9054
|
var I;
|
|
9053
|
-
return B.type ===
|
|
9055
|
+
return B.type === G.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
|
|
9054
9056
|
});
|
|
9055
9057
|
if (E) {
|
|
9056
9058
|
const I = S.getGlobalPropertyStateManager().getAspect(E.name);
|
|
@@ -9059,7 +9061,7 @@ class bs {
|
|
|
9059
9061
|
}
|
|
9060
9062
|
if (await e.setSelectionsAndElements(
|
|
9061
9063
|
t.stepName,
|
|
9062
|
-
[
|
|
9064
|
+
[m],
|
|
9063
9065
|
f,
|
|
9064
9066
|
async () => {
|
|
9065
9067
|
e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
|
|
@@ -9094,14 +9096,14 @@ class bs {
|
|
|
9094
9096
|
}
|
|
9095
9097
|
}
|
|
9096
9098
|
} else {
|
|
9097
|
-
const
|
|
9098
|
-
if (
|
|
9099
|
-
const
|
|
9099
|
+
const g = e.getWorkflowExperience().getBundle();
|
|
9100
|
+
if (g && t.globalPropertyAspectConfigurations) {
|
|
9101
|
+
const m = (h = g.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = m == null ? void 0 : m.find((f) => {
|
|
9100
9102
|
var C;
|
|
9101
|
-
return f.type ===
|
|
9103
|
+
return f.type === G.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
|
|
9102
9104
|
});
|
|
9103
9105
|
if (p) {
|
|
9104
|
-
const C =
|
|
9106
|
+
const C = g.getGlobalPropertyStateManager().getAspect(p.name);
|
|
9105
9107
|
if (C)
|
|
9106
9108
|
if (o.length === 0 && l) {
|
|
9107
9109
|
const w = Y.getDefaultVariant(l);
|
|
@@ -9160,7 +9162,7 @@ class bs {
|
|
|
9160
9162
|
throw new vt(t);
|
|
9161
9163
|
const a = e.fileLink;
|
|
9162
9164
|
if (!a)
|
|
9163
|
-
throw new
|
|
9165
|
+
throw new Ht(e);
|
|
9164
9166
|
const n = await Nt(a);
|
|
9165
9167
|
return {
|
|
9166
9168
|
assetUrl: a,
|
|
@@ -9182,9 +9184,9 @@ class bs {
|
|
|
9182
9184
|
);
|
|
9183
9185
|
h.push(...p);
|
|
9184
9186
|
}
|
|
9185
|
-
const
|
|
9187
|
+
const g = await this.changeInputTextWithRegion(
|
|
9186
9188
|
t,
|
|
9187
|
-
t.data.size ||
|
|
9189
|
+
t.data.size || He,
|
|
9188
9190
|
A,
|
|
9189
9191
|
a.text || "",
|
|
9190
9192
|
a,
|
|
@@ -9193,7 +9195,7 @@ class bs {
|
|
|
9193
9195
|
s,
|
|
9194
9196
|
o
|
|
9195
9197
|
);
|
|
9196
|
-
return
|
|
9198
|
+
return g && h.push(g), {
|
|
9197
9199
|
command: new $(h),
|
|
9198
9200
|
followup: async () => {
|
|
9199
9201
|
i.markUpdateCompleted(d), await i.setSelectionsAndElements(t.stepName, [e], n);
|
|
@@ -9207,9 +9209,9 @@ class bs {
|
|
|
9207
9209
|
A,
|
|
9208
9210
|
a,
|
|
9209
9211
|
i
|
|
9210
|
-
),
|
|
9212
|
+
), g = await this.changeInputTextWithRegion(
|
|
9211
9213
|
t,
|
|
9212
|
-
t.data.size ||
|
|
9214
|
+
t.data.size || He,
|
|
9213
9215
|
A,
|
|
9214
9216
|
((u = h[0]) == null ? void 0 : u.newElement.input) || a.text || t.data.defaultText || "",
|
|
9215
9217
|
a,
|
|
@@ -9217,21 +9219,21 @@ class bs {
|
|
|
9217
9219
|
(a == null ? void 0 : a.customiseAllText) ?? !1,
|
|
9218
9220
|
s,
|
|
9219
9221
|
o
|
|
9220
|
-
),
|
|
9222
|
+
), m = h.flatMap((f) => f.commands);
|
|
9221
9223
|
if (l) {
|
|
9222
9224
|
const f = h.map(
|
|
9223
9225
|
(C) => new We(C.regionElement.id, l)
|
|
9224
9226
|
);
|
|
9225
|
-
|
|
9227
|
+
m.push(...f);
|
|
9226
9228
|
}
|
|
9227
9229
|
if (c) {
|
|
9228
9230
|
const f = n.map(
|
|
9229
9231
|
(C) => new je(C.id, c, t.data.strokeThickness)
|
|
9230
9232
|
);
|
|
9231
|
-
|
|
9233
|
+
m.push(...f);
|
|
9232
9234
|
}
|
|
9233
|
-
return
|
|
9234
|
-
command: new $(
|
|
9235
|
+
return g && m.push(g), {
|
|
9236
|
+
command: new $(m),
|
|
9235
9237
|
followup: async () => {
|
|
9236
9238
|
i.markUpdateCompleted(d);
|
|
9237
9239
|
}
|
|
@@ -9250,8 +9252,8 @@ class bs {
|
|
|
9250
9252
|
if (!a || !a.regions)
|
|
9251
9253
|
throw new Error("Step data not supplied");
|
|
9252
9254
|
const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = async (A) => {
|
|
9253
|
-
var
|
|
9254
|
-
const h = s.getLayouts().find((p) => p.panelId === A.panelId),
|
|
9255
|
+
var m;
|
|
9256
|
+
const h = s.getLayouts().find((p) => p.panelId === A.panelId), g = Q();
|
|
9255
9257
|
try {
|
|
9256
9258
|
if (!h)
|
|
9257
9259
|
throw new Pe("Failed to find layout for region: " + A.panelId);
|
|
@@ -9263,7 +9265,7 @@ class bs {
|
|
|
9263
9265
|
return nt.id === ((R = p.defaultVariant) == null ? void 0 : R.id);
|
|
9264
9266
|
}) || p.variants[0];
|
|
9265
9267
|
f = this.createTextFillSpotColor(p, T), s.updateStorage(t, {
|
|
9266
|
-
colorProfileAssetKey: (
|
|
9268
|
+
colorProfileAssetKey: (m = p.colorProfile) == null ? void 0 : m.key
|
|
9267
9269
|
});
|
|
9268
9270
|
}
|
|
9269
9271
|
const C = await this.getDefaultColor(a), w = C || "#000000", S = {
|
|
@@ -9271,9 +9273,9 @@ class bs {
|
|
|
9271
9273
|
stepName: t,
|
|
9272
9274
|
align: this.textAlign(a),
|
|
9273
9275
|
fill: i.color ? i.color : w,
|
|
9274
|
-
fontSize: a.size ||
|
|
9276
|
+
fontSize: a.size || He,
|
|
9275
9277
|
fontData: n,
|
|
9276
|
-
id:
|
|
9278
|
+
id: g,
|
|
9277
9279
|
layer: A.layer,
|
|
9278
9280
|
layerIndex: A.layerIndex,
|
|
9279
9281
|
rotation: A.rotation,
|
|
@@ -9292,7 +9294,7 @@ class bs {
|
|
|
9292
9294
|
fillSpotColorDefinition: f
|
|
9293
9295
|
}, y = [], E = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
|
|
9294
9296
|
if (!S.fontData)
|
|
9295
|
-
throw new
|
|
9297
|
+
throw new z("Failed to resolve font data for text.");
|
|
9296
9298
|
const [I, D] = pe(
|
|
9297
9299
|
S.fontSize,
|
|
9298
9300
|
S.fontData,
|
|
@@ -9315,7 +9317,7 @@ class bs {
|
|
|
9315
9317
|
);
|
|
9316
9318
|
const k = new W(S, h);
|
|
9317
9319
|
return {
|
|
9318
|
-
regionElement: { id:
|
|
9320
|
+
regionElement: { id: g, region: A },
|
|
9319
9321
|
commands: [k, ...y],
|
|
9320
9322
|
newElement: S,
|
|
9321
9323
|
fontData: n
|
|
@@ -9351,7 +9353,7 @@ class bs {
|
|
|
9351
9353
|
* @deprecated
|
|
9352
9354
|
*/
|
|
9353
9355
|
async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, d) {
|
|
9354
|
-
const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName),
|
|
9356
|
+
const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName), g = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
9355
9357
|
for (const S of h)
|
|
9356
9358
|
if (S.region) {
|
|
9357
9359
|
const [y, E] = pe(
|
|
@@ -9361,7 +9363,7 @@ class bs {
|
|
|
9361
9363
|
[u],
|
|
9362
9364
|
{ size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
|
|
9363
9365
|
);
|
|
9364
|
-
|
|
9366
|
+
g.set(S.id, y), m.set(S.id, E);
|
|
9365
9367
|
}
|
|
9366
9368
|
const f = (() => {
|
|
9367
9369
|
if (t.data && t.data.maxLength && u.length > t.data.maxLength)
|
|
@@ -9374,7 +9376,7 @@ class bs {
|
|
|
9374
9376
|
return l(!0), { error: "Blocked profanity." };
|
|
9375
9377
|
}
|
|
9376
9378
|
return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
|
|
9377
|
-
`) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(
|
|
9379
|
+
`) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(m.values()).every((B) => B) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - u.length).toString() });
|
|
9378
9380
|
})();
|
|
9379
9381
|
if (f.error) {
|
|
9380
9382
|
c(f.error);
|
|
@@ -9387,11 +9389,11 @@ class bs {
|
|
|
9387
9389
|
}), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
|
|
9388
9390
|
const C = [];
|
|
9389
9391
|
for (const S of h) {
|
|
9390
|
-
const y = t.data.curved ? u : (
|
|
9392
|
+
const y = t.data.curved ? u : (m.get(S.id) || []).join(`
|
|
9391
9393
|
`);
|
|
9392
9394
|
C.push(
|
|
9393
9395
|
this.generateTextChangeCommandsForRegion(
|
|
9394
|
-
|
|
9396
|
+
g.get(S.id) || 1,
|
|
9395
9397
|
t.data,
|
|
9396
9398
|
S.id,
|
|
9397
9399
|
y
|
|
@@ -9436,7 +9438,7 @@ function Ms(r, t, e, a) {
|
|
|
9436
9438
|
const n = e / r, i = a / t;
|
|
9437
9439
|
return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
|
|
9438
9440
|
}
|
|
9439
|
-
const
|
|
9441
|
+
const qa = {
|
|
9440
9442
|
m: ["x", "y"],
|
|
9441
9443
|
z: [],
|
|
9442
9444
|
l: ["x", "y"],
|
|
@@ -9466,7 +9468,7 @@ class Ts {
|
|
|
9466
9468
|
const n = (i) => {
|
|
9467
9469
|
const s = [], o = i.relative ? i.type : i.type.toUpperCase();
|
|
9468
9470
|
let l = e !== o;
|
|
9469
|
-
const c =
|
|
9471
|
+
const c = qa[i.type];
|
|
9470
9472
|
l && (s.push(o), e = o);
|
|
9471
9473
|
for (const d of c) {
|
|
9472
9474
|
const A = i[d];
|
|
@@ -9491,7 +9493,7 @@ class Ts {
|
|
|
9491
9493
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
|
|
9492
9494
|
let i;
|
|
9493
9495
|
for (e.lastIndex = 0; i = e.exec(t); ) {
|
|
9494
|
-
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c =
|
|
9496
|
+
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = qa[s];
|
|
9495
9497
|
if (o.length < c.length)
|
|
9496
9498
|
throw new xt(
|
|
9497
9499
|
`Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
|
|
@@ -9557,7 +9559,7 @@ class Ns extends Is {
|
|
|
9557
9559
|
return this.svgElement(t, e);
|
|
9558
9560
|
}
|
|
9559
9561
|
svgElement(t, e) {
|
|
9560
|
-
const a =
|
|
9562
|
+
const a = Hi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
|
|
9561
9563
|
const w = et("g");
|
|
9562
9564
|
w.classList.add("module-text-group");
|
|
9563
9565
|
const S = et("defs");
|
|
@@ -9576,22 +9578,22 @@ class Ns extends Is {
|
|
|
9576
9578
|
u.classList.add("module-root");
|
|
9577
9579
|
const h = et("defs");
|
|
9578
9580
|
u.appendChild(h);
|
|
9579
|
-
const
|
|
9580
|
-
|
|
9581
|
-
const
|
|
9582
|
-
|
|
9581
|
+
const g = et("g");
|
|
9582
|
+
g.classList.add("module-bounds"), u.appendChild(g);
|
|
9583
|
+
const m = Ds(e.height, e.width);
|
|
9584
|
+
m.setAttribute("opacity", "0"), g.appendChild(m);
|
|
9583
9585
|
const p = et("g");
|
|
9584
9586
|
p.classList.add("module-text-enclosure"), u.appendChild(p);
|
|
9585
9587
|
const f = A();
|
|
9586
9588
|
p.appendChild(f);
|
|
9587
|
-
const C =
|
|
9589
|
+
const C = gr(d);
|
|
9588
9590
|
return ks(p, C, e.height, e.width, 0.35, 0.65), Fs(u.outerHTML);
|
|
9589
9591
|
}
|
|
9590
9592
|
}
|
|
9591
|
-
async function
|
|
9593
|
+
async function Hn(r) {
|
|
9592
9594
|
if (r === "Vegemite")
|
|
9593
9595
|
return new Ns();
|
|
9594
|
-
throw new
|
|
9596
|
+
throw new z(`Failed to resolve Module, Module ${r} not found`);
|
|
9595
9597
|
}
|
|
9596
9598
|
const ne = v`
|
|
9597
9599
|
fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
|
|
@@ -9765,7 +9767,7 @@ const ne = v`
|
|
|
9765
9767
|
}
|
|
9766
9768
|
}
|
|
9767
9769
|
}
|
|
9768
|
-
`,
|
|
9770
|
+
`, Ls = (r) => v`
|
|
9769
9771
|
${ne}
|
|
9770
9772
|
${re(r)}
|
|
9771
9773
|
query GetBundle($id: String!) {
|
|
@@ -9809,7 +9811,7 @@ const ne = v`
|
|
|
9809
9811
|
quoteId
|
|
9810
9812
|
}
|
|
9811
9813
|
}
|
|
9812
|
-
`,
|
|
9814
|
+
`, Ha = v`
|
|
9813
9815
|
query GetBundleStakeholders($id: String!) {
|
|
9814
9816
|
bundles(ids: [$id]) {
|
|
9815
9817
|
id
|
|
@@ -9854,7 +9856,7 @@ const ne = v`
|
|
|
9854
9856
|
}
|
|
9855
9857
|
}
|
|
9856
9858
|
}
|
|
9857
|
-
`,
|
|
9859
|
+
`, Us = v`
|
|
9858
9860
|
query GetBundlesForCustomer($id: String!) {
|
|
9859
9861
|
customers(ids: [$id]) {
|
|
9860
9862
|
bundleStakeholders {
|
|
@@ -9893,7 +9895,7 @@ const ne = v`
|
|
|
9893
9895
|
}
|
|
9894
9896
|
}
|
|
9895
9897
|
}
|
|
9896
|
-
`,
|
|
9898
|
+
`, Gs = v`
|
|
9897
9899
|
query GetProductCollectionForFilteredProducts(
|
|
9898
9900
|
$id: String!
|
|
9899
9901
|
$filters: ProductCollectionProductFilterInput
|
|
@@ -9916,7 +9918,7 @@ const ne = v`
|
|
|
9916
9918
|
}
|
|
9917
9919
|
}
|
|
9918
9920
|
}
|
|
9919
|
-
`,
|
|
9921
|
+
`, zs = v`
|
|
9920
9922
|
${ba}
|
|
9921
9923
|
query GetProductCollectionForProductsFeed(
|
|
9922
9924
|
$id: String!
|
|
@@ -10015,7 +10017,7 @@ const ne = v`
|
|
|
10015
10017
|
}
|
|
10016
10018
|
}
|
|
10017
10019
|
}
|
|
10018
|
-
`,
|
|
10020
|
+
`, qs = v`
|
|
10019
10021
|
mutation UpdateBundle(
|
|
10020
10022
|
$id: String!
|
|
10021
10023
|
$name: String
|
|
@@ -10035,7 +10037,7 @@ const ne = v`
|
|
|
10035
10037
|
id
|
|
10036
10038
|
}
|
|
10037
10039
|
}
|
|
10038
|
-
`,
|
|
10040
|
+
`, Hs = v`
|
|
10039
10041
|
mutation BundleAddTransaction($id: String!, $transactionId: String!) {
|
|
10040
10042
|
bundleAddTransaction(id: $id, transactionId: $transactionId) {
|
|
10041
10043
|
id
|
|
@@ -10278,18 +10280,18 @@ class Ya extends Dn {
|
|
|
10278
10280
|
});
|
|
10279
10281
|
}
|
|
10280
10282
|
}
|
|
10281
|
-
class
|
|
10282
|
-
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h,
|
|
10283
|
+
class go {
|
|
10284
|
+
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, g = !1, m, p = !1, f = !1, C = !1) {
|
|
10283
10285
|
var w;
|
|
10284
10286
|
this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
|
10285
10287
|
var E;
|
|
10286
10288
|
if (!this.previewService)
|
|
10287
10289
|
return;
|
|
10288
10290
|
const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
|
|
10289
|
-
if (y)
|
|
10291
|
+
if (console.log(`LOG: render layouts: ${y == null ? void 0 : y.size} handles`), !!y)
|
|
10290
10292
|
for (const [, B] of y)
|
|
10291
10293
|
B.render(S);
|
|
10292
|
-
}, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly =
|
|
10294
|
+
}, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = g, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = m, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, (w = this.renderableContextService) == null || w.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((S) => {
|
|
10293
10295
|
this.stepTags[S.stepName] = S.tags ?? [];
|
|
10294
10296
|
}), C && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
|
|
10295
10297
|
this.initialized = !0;
|
|
@@ -10305,7 +10307,7 @@ class mo {
|
|
|
10305
10307
|
return { recipient: this.transaction.recipient };
|
|
10306
10308
|
}
|
|
10307
10309
|
async updateRecipient(t, e, a, n, i, s, o, l, c, d) {
|
|
10308
|
-
var A, u, h,
|
|
10310
|
+
var A, u, h, g, m;
|
|
10309
10311
|
if ((A = this.transaction.recipient) != null && A.id)
|
|
10310
10312
|
this.transaction.recipient = {
|
|
10311
10313
|
id: this.transaction.recipient.id,
|
|
@@ -10373,7 +10375,7 @@ class mo {
|
|
|
10373
10375
|
fetchPolicy: "no-cache",
|
|
10374
10376
|
variables: {
|
|
10375
10377
|
id: this.transaction.id,
|
|
10376
|
-
recipientId: (
|
|
10378
|
+
recipientId: (m = (g = p.data) == null ? void 0 : g.recipientCreate) == null ? void 0 : m.id
|
|
10377
10379
|
},
|
|
10378
10380
|
context: {
|
|
10379
10381
|
transactionOwnerId: this.transaction.transactionOwnerId
|
|
@@ -10393,7 +10395,7 @@ class mo {
|
|
|
10393
10395
|
};
|
|
10394
10396
|
this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
|
|
10395
10397
|
this.storage[o.stepName] = o.storage || {};
|
|
10396
|
-
}), this.allScenes = await
|
|
10398
|
+
}), this.allScenes = await Li(t);
|
|
10397
10399
|
const n = Dt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
|
|
10398
10400
|
this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
|
|
10399
10401
|
}
|
|
@@ -10612,7 +10614,7 @@ class mo {
|
|
|
10612
10614
|
const l = o[0];
|
|
10613
10615
|
if (s.type === P.Model) {
|
|
10614
10616
|
if (!this.modelContainer)
|
|
10615
|
-
throw new
|
|
10617
|
+
throw new z(
|
|
10616
10618
|
"We should always have a model container when injecting a preview!"
|
|
10617
10619
|
);
|
|
10618
10620
|
const u = (A = l.asset) == null ? void 0 : A.fileLink;
|
|
@@ -10635,12 +10637,12 @@ class mo {
|
|
|
10635
10637
|
console.error(`Failed to read material from variant: ${l.id} for step: ${s.stepName}`);
|
|
10636
10638
|
return;
|
|
10637
10639
|
}
|
|
10638
|
-
s.data.targetMaterials.forEach((
|
|
10640
|
+
s.data.targetMaterials.forEach((g) => {
|
|
10639
10641
|
if (!this.modelContainer)
|
|
10640
|
-
throw new
|
|
10642
|
+
throw new z(
|
|
10641
10643
|
"We should always have a model container when injecting a preview!"
|
|
10642
10644
|
);
|
|
10643
|
-
this.modelContainer.applyMaterialVariant(
|
|
10645
|
+
this.modelContainer.applyMaterialVariant(g, s.option.id, u);
|
|
10644
10646
|
});
|
|
10645
10647
|
}
|
|
10646
10648
|
}), await a.getInitializationPromise(), this.renderLayouts();
|
|
@@ -10660,7 +10662,7 @@ class mo {
|
|
|
10660
10662
|
};
|
|
10661
10663
|
if (!on(a, this.storage)) {
|
|
10662
10664
|
this.storage = a;
|
|
10663
|
-
const n = new
|
|
10665
|
+
const n = new za(this.constructSerializableWorkflow());
|
|
10664
10666
|
this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
|
10665
10667
|
}
|
|
10666
10668
|
}
|
|
@@ -10711,7 +10713,7 @@ class mo {
|
|
|
10711
10713
|
serialize() {
|
|
10712
10714
|
const t = this.getCommandContext().getState();
|
|
10713
10715
|
if (!t)
|
|
10714
|
-
throw new
|
|
10716
|
+
throw new z("Attempted to serialize state before it was initialized.");
|
|
10715
10717
|
const e = St(t.transaction), a = this.dehydrateState(e);
|
|
10716
10718
|
return JSON.stringify(a);
|
|
10717
10719
|
}
|
|
@@ -10864,18 +10866,18 @@ class mo {
|
|
|
10864
10866
|
c.forEach((E) => {
|
|
10865
10867
|
yt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
|
|
10866
10868
|
});
|
|
10867
|
-
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands:
|
|
10869
|
+
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: g } = await this.stepElementsForIntroducedSilentSteps(A, !1);
|
|
10868
10870
|
this.stepElements = {
|
|
10869
10871
|
...this.stepElements,
|
|
10870
10872
|
...h,
|
|
10871
10873
|
[t]: a
|
|
10872
10874
|
}, this.removeElements(u);
|
|
10873
|
-
const
|
|
10874
|
-
if ((
|
|
10875
|
-
const E = (y = this.getWorkflowExperience().getStepById(
|
|
10875
|
+
const m = this.workflow.steps.find((E) => E.stepName === t);
|
|
10876
|
+
if ((m == null ? void 0 : m.type) === P.Frame) {
|
|
10877
|
+
const E = (y = this.getWorkflowExperience().getStepById(m.stepName)) == null ? void 0 : y.frameService;
|
|
10876
10878
|
E == null || E.setTargetElements(a.map((B) => B.id));
|
|
10877
10879
|
}
|
|
10878
|
-
const p = u.map((E) => new Bt(E.id)), f = new
|
|
10880
|
+
const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...g, ...p, f];
|
|
10879
10881
|
C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
10880
10882
|
const w = this.getInvalidModelVariants(), S = this.modelContainer;
|
|
10881
10883
|
if (S) {
|
|
@@ -10894,8 +10896,9 @@ class mo {
|
|
|
10894
10896
|
}
|
|
10895
10897
|
async ensureStepsAreLoaded() {
|
|
10896
10898
|
const e = Dt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
|
|
10899
|
+
console.log(`LOG: ensure ${n.length} steps loaded`);
|
|
10897
10900
|
for (const l of n)
|
|
10898
|
-
if (!this.stepInitialised[l.stepName])
|
|
10901
|
+
if (console.log(`LOG: is ${l.stepTitle} (${l.stepName}) inited? ${this.stepInitialised[l.stepName]}`), !this.stepInitialised[l.stepName])
|
|
10899
10902
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
|
10900
10903
|
case P.DigitalContent:
|
|
10901
10904
|
a.push(
|
|
@@ -10911,20 +10914,20 @@ class mo {
|
|
|
10911
10914
|
break;
|
|
10912
10915
|
case P.Illustration:
|
|
10913
10916
|
a.push(
|
|
10914
|
-
|
|
10917
|
+
me.init(l, this, this.reloadedState)
|
|
10915
10918
|
);
|
|
10916
10919
|
break;
|
|
10917
10920
|
case P.Material:
|
|
10918
10921
|
a.push(
|
|
10919
|
-
|
|
10922
|
+
Gn.init(l, this, this.reloadedState)
|
|
10920
10923
|
);
|
|
10921
10924
|
break;
|
|
10922
10925
|
case P.Model:
|
|
10923
|
-
a.push(
|
|
10926
|
+
a.push(zn.init(l, this, this.reloadedState));
|
|
10924
10927
|
break;
|
|
10925
10928
|
case P.Module:
|
|
10926
10929
|
this.stepSpecificServices[l.stepName] = {
|
|
10927
|
-
module: await
|
|
10930
|
+
module: await Hn(l.data.module)
|
|
10928
10931
|
}, a.push(
|
|
10929
10932
|
Wn.init(l, this, this.reloadedState)
|
|
10930
10933
|
);
|
|
@@ -10936,14 +10939,14 @@ class mo {
|
|
|
10936
10939
|
break;
|
|
10937
10940
|
case P.Question:
|
|
10938
10941
|
a.push(
|
|
10939
|
-
|
|
10942
|
+
qn.init(l, this, this.reloadedState)
|
|
10940
10943
|
);
|
|
10941
10944
|
break;
|
|
10942
10945
|
case P.Shape:
|
|
10943
|
-
a.push(
|
|
10946
|
+
a.push(Gt.init(l, this, this.reloadedState));
|
|
10944
10947
|
break;
|
|
10945
10948
|
case P.Text:
|
|
10946
|
-
a.push(j.init(l, this, this.reloadedState));
|
|
10949
|
+
console.log("LOG: ensure text loaded"), a.push(j.init(l, this, this.reloadedState));
|
|
10947
10950
|
break;
|
|
10948
10951
|
}
|
|
10949
10952
|
const i = (await Promise.allSettled(a)).map((l) => {
|
|
@@ -11003,7 +11006,7 @@ class mo {
|
|
|
11003
11006
|
this.validationCallbacks.forEach((t) => t(this.validationErrors));
|
|
11004
11007
|
}
|
|
11005
11008
|
traversableScenes() {
|
|
11006
|
-
return
|
|
11009
|
+
return Gi(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
|
|
11007
11010
|
}
|
|
11008
11011
|
}
|
|
11009
11012
|
class st {
|
|
@@ -11222,7 +11225,7 @@ const Yn = class la {
|
|
|
11222
11225
|
};
|
|
11223
11226
|
Yn.updateState = /* @__PURE__ */ new Map();
|
|
11224
11227
|
let it = Yn;
|
|
11225
|
-
class
|
|
11228
|
+
class mo extends it {
|
|
11226
11229
|
constructor(t, e, a) {
|
|
11227
11230
|
super(t, e, a);
|
|
11228
11231
|
}
|
|
@@ -11233,7 +11236,7 @@ class go extends it {
|
|
|
11233
11236
|
*/
|
|
11234
11237
|
async selectVariant(t) {
|
|
11235
11238
|
if (!this.getUpdateState() && this.getCurrentVariant() !== t)
|
|
11236
|
-
return
|
|
11239
|
+
return me.selectVariant(
|
|
11237
11240
|
this.step,
|
|
11238
11241
|
t.getResource(),
|
|
11239
11242
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -11250,7 +11253,7 @@ class go extends it {
|
|
|
11250
11253
|
const t = this.manager.getRegionElements(this.step.stepName) || [];
|
|
11251
11254
|
if (t.length === 0)
|
|
11252
11255
|
return;
|
|
11253
|
-
const a =
|
|
11256
|
+
const a = U(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
|
|
11254
11257
|
if (s.length !== 0) {
|
|
11255
11258
|
const l = {};
|
|
11256
11259
|
return s.forEach((c) => {
|
|
@@ -11279,7 +11282,7 @@ class go extends it {
|
|
|
11279
11282
|
const d = c.id.replace(/\W/g, "");
|
|
11280
11283
|
a ? n.set(d, { browserValue: e, pmsValue: a }) : n.set(d, e);
|
|
11281
11284
|
}
|
|
11282
|
-
}) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e),
|
|
11285
|
+
}) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e), me.changeColors(
|
|
11283
11286
|
this.step,
|
|
11284
11287
|
this.manager.getRegionElements(this.step.stepName),
|
|
11285
11288
|
this.manager,
|
|
@@ -11291,7 +11294,7 @@ class go extends it {
|
|
|
11291
11294
|
return this.step.data.colorOption;
|
|
11292
11295
|
}
|
|
11293
11296
|
getAvailableColors() {
|
|
11294
|
-
return this.step.data.colorPickerEnabled ?
|
|
11297
|
+
return this.step.data.colorPickerEnabled ? me.availableColors(this.step, this.manager) : Promise.resolve([]);
|
|
11295
11298
|
}
|
|
11296
11299
|
isColorPickerEnabled() {
|
|
11297
11300
|
return this.step.data.colorPickerEnabled ?? !1;
|
|
@@ -11305,7 +11308,7 @@ class po extends it {
|
|
|
11305
11308
|
super(t, e, a);
|
|
11306
11309
|
}
|
|
11307
11310
|
selectVariant(t) {
|
|
11308
|
-
return
|
|
11311
|
+
return Gn.selectVariant(
|
|
11309
11312
|
this.step,
|
|
11310
11313
|
t.getResource(),
|
|
11311
11314
|
this.manager,
|
|
@@ -11318,7 +11321,7 @@ class fo extends it {
|
|
|
11318
11321
|
super(t, e, a);
|
|
11319
11322
|
}
|
|
11320
11323
|
selectVariant(t) {
|
|
11321
|
-
return
|
|
11324
|
+
return zn.selectVariant(
|
|
11322
11325
|
this.step,
|
|
11323
11326
|
t.getResource(),
|
|
11324
11327
|
this.manager,
|
|
@@ -11351,7 +11354,7 @@ class wo extends it {
|
|
|
11351
11354
|
async selectVariant(t) {
|
|
11352
11355
|
if (!t.getId())
|
|
11353
11356
|
throw new Error("Unable to select variant with a null ID");
|
|
11354
|
-
await
|
|
11357
|
+
await qn.selectVariant(this.step, t.getId(), this.manager);
|
|
11355
11358
|
}
|
|
11356
11359
|
/**
|
|
11357
11360
|
* The way that this step expects to be rendered.
|
|
@@ -11367,7 +11370,7 @@ class yo extends it {
|
|
|
11367
11370
|
}
|
|
11368
11371
|
selectVariant(t) {
|
|
11369
11372
|
const e = t.getResource();
|
|
11370
|
-
return
|
|
11373
|
+
return Gt.selectVariant(
|
|
11371
11374
|
this.step,
|
|
11372
11375
|
{
|
|
11373
11376
|
fill: e.color,
|
|
@@ -11385,7 +11388,7 @@ class yo extends it {
|
|
|
11385
11388
|
* @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
|
|
11386
11389
|
*/
|
|
11387
11390
|
setColor(t) {
|
|
11388
|
-
return
|
|
11391
|
+
return Gt.selectVariant(
|
|
11389
11392
|
this.step,
|
|
11390
11393
|
t,
|
|
11391
11394
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -11397,7 +11400,7 @@ class yo extends it {
|
|
|
11397
11400
|
* @returns A list of color definitions that are currently applied to the illustration.
|
|
11398
11401
|
*/
|
|
11399
11402
|
getColors() {
|
|
11400
|
-
return
|
|
11403
|
+
return Gt.availableColours(this.step);
|
|
11401
11404
|
}
|
|
11402
11405
|
/**
|
|
11403
11406
|
* Allows for setting a custom color when the custom variant is selected. Will
|
|
@@ -11405,7 +11408,7 @@ class yo extends it {
|
|
|
11405
11408
|
*/
|
|
11406
11409
|
setCustomColor(t) {
|
|
11407
11410
|
var e, a;
|
|
11408
|
-
return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`),
|
|
11411
|
+
return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), Gt.setCustomColor(t, this.step, this.manager);
|
|
11409
11412
|
}
|
|
11410
11413
|
getCustomColor() {
|
|
11411
11414
|
var e, a, n;
|
|
@@ -11513,7 +11516,9 @@ class So extends it {
|
|
|
11513
11516
|
helperData: {}
|
|
11514
11517
|
}, a = j.findLayoutElements(this.manager, this.step), n = j.filterUnsupportedCharacters(t, (d = a[0]) == null ? void 0 : d.fontData), i = !!this.step.data && !!this.step.data.maxLength && n.length > this.step.data.maxLength;
|
|
11515
11518
|
i || (e.input = n);
|
|
11516
|
-
const s = a.length <= 0
|
|
11519
|
+
const s = a.length <= 0;
|
|
11520
|
+
console.log(`LOG: setting text ${t} to ${a.length} regions`);
|
|
11521
|
+
const o = s ? { inputText: n, text: n } : { inputText: n };
|
|
11517
11522
|
this.manager.updateStorage(this.step.stepName, o);
|
|
11518
11523
|
const l = this.manager.getStepStorage(this.step.stepName), c = j.getProcessedInput(
|
|
11519
11524
|
n,
|
|
@@ -11717,7 +11722,7 @@ class ce {
|
|
|
11717
11722
|
case P.Text:
|
|
11718
11723
|
return new So(t, e, t.getStepTags(e.stepName));
|
|
11719
11724
|
case P.Illustration:
|
|
11720
|
-
return new
|
|
11725
|
+
return new mo(t, e, t.getStepTags(e.stepName));
|
|
11721
11726
|
case P.Picture:
|
|
11722
11727
|
return new Co(t, e, t.getStepTags(e.stepName));
|
|
11723
11728
|
case P.Shape:
|
|
@@ -11731,7 +11736,7 @@ class ce {
|
|
|
11731
11736
|
case P.Module:
|
|
11732
11737
|
return new Bo(t, e, t.getStepTags(e.stepName));
|
|
11733
11738
|
default:
|
|
11734
|
-
throw new
|
|
11739
|
+
throw new z(`Step type ${e.type} not yet supported in Core SDK`);
|
|
11735
11740
|
}
|
|
11736
11741
|
}
|
|
11737
11742
|
}
|
|
@@ -11932,10 +11937,10 @@ const Po = async (r, t) => {
|
|
|
11932
11937
|
}
|
|
11933
11938
|
return n;
|
|
11934
11939
|
}, Kn = (r, t, e, a, n, i, s, o) => {
|
|
11935
|
-
var
|
|
11940
|
+
var g, m;
|
|
11936
11941
|
const l = t.basePrice || 0, c = r.priceModifierTotal || 0, d = xo(a, e, void 0, i), u = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(r.id), h = {
|
|
11937
|
-
additionalExternalProductId: (
|
|
11938
|
-
additionalExternalVariantId: (
|
|
11942
|
+
additionalExternalProductId: (g = r.integrationProduct) == null ? void 0 : g.additionalExternalProductId,
|
|
11943
|
+
additionalExternalVariantId: (m = r.integrationProduct) == null ? void 0 : m.additionalExternalVariantId,
|
|
11939
11944
|
baseCost: l,
|
|
11940
11945
|
designExternalVariants: r.designExternalVariants,
|
|
11941
11946
|
designProductId: r.externalDesignProductId,
|
|
@@ -11975,29 +11980,29 @@ const Po = async (r, t) => {
|
|
|
11975
11980
|
T.errors && console.log("Server Error:", tt.message);
|
|
11976
11981
|
}), null) : nt ?? null;
|
|
11977
11982
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
|
11978
|
-
const u = r.getPreviewService(), h = (I = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : I.lookAtAnimation,
|
|
11983
|
+
const u = r.getPreviewService(), h = (I = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : I.lookAtAnimation, g = u && t.showModelOnFinishStep && !!h, m = l && ca(l, t, !0), p = l && ca(l, t, !1), f = async (D) => {
|
|
11979
11984
|
const x = {};
|
|
11980
11985
|
let k = 0;
|
|
11981
11986
|
if (Object.keys(i).length > 0)
|
|
11982
11987
|
for (const T of Object.keys(i)) {
|
|
11983
11988
|
const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
|
|
11984
11989
|
for (let tt = 0; tt < nt.selections.length; ++tt) {
|
|
11985
|
-
const
|
|
11990
|
+
const q = nt.selections[tt];
|
|
11986
11991
|
if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
|
|
11987
11992
|
const ft = R.stepTitle;
|
|
11988
11993
|
x[ft] ? x[ft].push({
|
|
11989
|
-
id:
|
|
11990
|
-
name:
|
|
11991
|
-
priceModifier:
|
|
11994
|
+
id: q.id || "",
|
|
11995
|
+
name: q.name,
|
|
11996
|
+
priceModifier: q.priceModifier
|
|
11992
11997
|
}) : x[ft] = [
|
|
11993
11998
|
{
|
|
11994
|
-
id:
|
|
11995
|
-
name:
|
|
11996
|
-
priceModifier:
|
|
11999
|
+
id: q.id || "",
|
|
12000
|
+
name: q.name,
|
|
12001
|
+
priceModifier: q.priceModifier
|
|
11997
12002
|
}
|
|
11998
12003
|
];
|
|
11999
12004
|
}
|
|
12000
|
-
k +=
|
|
12005
|
+
k += q.priceModifier;
|
|
12001
12006
|
}
|
|
12002
12007
|
}
|
|
12003
12008
|
return [x, k];
|
|
@@ -12009,10 +12014,10 @@ const Po = async (r, t) => {
|
|
|
12009
12014
|
S[D].map((x) => x.id)
|
|
12010
12015
|
])
|
|
12011
12016
|
);
|
|
12012
|
-
let E = await o(
|
|
12017
|
+
let E = await o(g, n.id);
|
|
12013
12018
|
if (E) {
|
|
12014
12019
|
const D = await (await rt(E)).blob();
|
|
12015
|
-
E = (await
|
|
12020
|
+
E = (await L.uploadAsset(
|
|
12016
12021
|
{ name: `${n.id}-preview-image.png`, blob: D },
|
|
12017
12022
|
Ce.Image,
|
|
12018
12023
|
!0,
|
|
@@ -12029,7 +12034,7 @@ const Po = async (r, t) => {
|
|
|
12029
12034
|
})),
|
|
12030
12035
|
workflowId: t.id,
|
|
12031
12036
|
transactionId: n.id,
|
|
12032
|
-
useThreeDimPreview: !!
|
|
12037
|
+
useThreeDimPreview: !!g,
|
|
12033
12038
|
previewImage: E
|
|
12034
12039
|
};
|
|
12035
12040
|
if (p) {
|
|
@@ -12047,7 +12052,7 @@ const Po = async (r, t) => {
|
|
|
12047
12052
|
return D;
|
|
12048
12053
|
})(),
|
|
12049
12054
|
cartSelectionsWithPrices: C,
|
|
12050
|
-
cartMetadata:
|
|
12055
|
+
cartMetadata: m
|
|
12051
12056
|
};
|
|
12052
12057
|
}, Fo = async (r, t, e, a, n, i, s, o, l, c, d) => {
|
|
12053
12058
|
var f, C;
|
|
@@ -12064,20 +12069,20 @@ const Po = async (r, t) => {
|
|
|
12064
12069
|
d
|
|
12065
12070
|
);
|
|
12066
12071
|
l("workflow.steps.finish.finalize.creatingDesign");
|
|
12067
|
-
const
|
|
12068
|
-
if (!(
|
|
12072
|
+
const g = await Po(A), m = (f = g == null ? void 0 : g.transaction) == null ? void 0 : f.previewImageLink;
|
|
12073
|
+
if (!(g != null && g.transaction))
|
|
12069
12074
|
throw new Error("Failed to create design");
|
|
12070
12075
|
l("workflow.steps.finish.finalize.updatingTransaction");
|
|
12071
|
-
const p =
|
|
12076
|
+
const p = g.transaction;
|
|
12072
12077
|
return Kn(
|
|
12073
12078
|
p,
|
|
12074
12079
|
n,
|
|
12075
12080
|
t,
|
|
12076
12081
|
u,
|
|
12077
|
-
|
|
12082
|
+
g == null ? void 0 : g.sku,
|
|
12078
12083
|
h,
|
|
12079
|
-
|
|
12080
|
-
(C =
|
|
12084
|
+
m,
|
|
12085
|
+
(C = g == null ? void 0 : g.processExecution) == null ? void 0 : C.id
|
|
12081
12086
|
);
|
|
12082
12087
|
}, ko = async (r, t, e) => {
|
|
12083
12088
|
t("workflow.steps.finish.finalize.buildingLayouts"), await Promise.all(
|
|
@@ -12153,7 +12158,7 @@ class Mo {
|
|
|
12153
12158
|
const t = N.get(this.localPersistenceKey);
|
|
12154
12159
|
return t ? JSON.parse(t) : [];
|
|
12155
12160
|
}
|
|
12156
|
-
throw new
|
|
12161
|
+
throw new z("Unexpected storage method requested");
|
|
12157
12162
|
}
|
|
12158
12163
|
/**
|
|
12159
12164
|
* Search for a transaction that has been saved.
|
|
@@ -12193,7 +12198,7 @@ class Mo {
|
|
|
12193
12198
|
N.set(this.localPersistenceKey, JSON.stringify(t));
|
|
12194
12199
|
return;
|
|
12195
12200
|
}
|
|
12196
|
-
throw new
|
|
12201
|
+
throw new z("Unexpected storage method requested");
|
|
12197
12202
|
}
|
|
12198
12203
|
}
|
|
12199
12204
|
const Ye = new Mo(), To = v`
|
|
@@ -12262,7 +12267,7 @@ class Oo {
|
|
|
12262
12267
|
throw new Error("No Workflow ID provided.");
|
|
12263
12268
|
this.client = t;
|
|
12264
12269
|
const a = e.layouts;
|
|
12265
|
-
this.commandContext = new rs(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new
|
|
12270
|
+
this.commandContext = new rs(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new go(
|
|
12266
12271
|
this,
|
|
12267
12272
|
t,
|
|
12268
12273
|
e.workflow,
|
|
@@ -12352,7 +12357,7 @@ class Oo {
|
|
|
12352
12357
|
}
|
|
12353
12358
|
let i = 2048;
|
|
12354
12359
|
e && e <= 2048 && (i = e);
|
|
12355
|
-
const s =
|
|
12360
|
+
const s = mt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((S) => {
|
|
12356
12361
|
var y;
|
|
12357
12362
|
return ((y = S.layoutState) == null ? void 0 : y.layout.panelId) === (c == null ? void 0 : c.name);
|
|
12358
12363
|
}) || o[0], A = d.layoutState.layout.previewRegion ? {
|
|
@@ -12368,19 +12373,19 @@ class Oo {
|
|
|
12368
12373
|
}, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
|
|
12369
12374
|
if (!h)
|
|
12370
12375
|
throw new xe("Failed to obtain 2D context for preview image creation");
|
|
12371
|
-
const
|
|
12376
|
+
const g = Sa(u.layoutState.layout, u.layoutState.elements, {
|
|
12372
12377
|
renderingConfiguration: {
|
|
12373
|
-
purpose:
|
|
12378
|
+
purpose: qt.Print,
|
|
12374
12379
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
12375
12380
|
templatingContext: this.workflowManager.getTemplatingContext()
|
|
12376
12381
|
}
|
|
12377
|
-
}),
|
|
12378
|
-
await (await Aa.from(h,
|
|
12382
|
+
}), m = un(g);
|
|
12383
|
+
await (await Aa.from(h, m, {
|
|
12379
12384
|
anonymousCrossOrigin: !0,
|
|
12380
12385
|
ignoreDimensions: !1,
|
|
12381
|
-
createCanvas:
|
|
12386
|
+
createCanvas: mt,
|
|
12382
12387
|
createImage: Zt,
|
|
12383
|
-
DOMParser:
|
|
12388
|
+
DOMParser: ma(),
|
|
12384
12389
|
fetch
|
|
12385
12390
|
})).render();
|
|
12386
12391
|
const f = await this.getCanvasObjectURLAsync(s);
|
|
@@ -12479,16 +12484,16 @@ class Oo {
|
|
|
12479
12484
|
const d = /* @__PURE__ */ new Set(), A = c.getRaw().globalPropertyAspectConfigurations;
|
|
12480
12485
|
A !== void 0 && (A.forEach((u) => d.add(JSON.stringify(u))), o.forEach((u) => {
|
|
12481
12486
|
const h = u.getRaw().globalPropertyAspectConfigurations;
|
|
12482
|
-
h !== void 0 && h.forEach((
|
|
12483
|
-
const
|
|
12484
|
-
if (p && (
|
|
12487
|
+
h !== void 0 && h.forEach((g) => {
|
|
12488
|
+
const m = l(g), p = d.has(JSON.stringify(g));
|
|
12489
|
+
if (p && (m == null ? void 0 : m.getType()) === "Option") {
|
|
12485
12490
|
const f = u.getCurrentVariant();
|
|
12486
12491
|
if (!f)
|
|
12487
12492
|
return;
|
|
12488
|
-
c.selectVariant(f), d.delete(JSON.stringify(
|
|
12489
|
-
} else if (p && (
|
|
12493
|
+
c.selectVariant(f), d.delete(JSON.stringify(g));
|
|
12494
|
+
} else if (p && (m == null ? void 0 : m.getType()) === "Text") {
|
|
12490
12495
|
const f = u.getText();
|
|
12491
|
-
c.setText(f), d.delete(JSON.stringify(
|
|
12496
|
+
c.setText(f), d.delete(JSON.stringify(g));
|
|
12492
12497
|
}
|
|
12493
12498
|
});
|
|
12494
12499
|
}));
|
|
@@ -12543,7 +12548,7 @@ class Oo {
|
|
|
12543
12548
|
}
|
|
12544
12549
|
async save(t) {
|
|
12545
12550
|
if (!this.getCommandContext().getState())
|
|
12546
|
-
throw new
|
|
12551
|
+
throw new z("State undefined!");
|
|
12547
12552
|
const n = {
|
|
12548
12553
|
title: await (async () => {
|
|
12549
12554
|
var l;
|
|
@@ -12566,10 +12571,10 @@ class Oo {
|
|
|
12566
12571
|
var s;
|
|
12567
12572
|
const t = St(this.getCommandContext().getState());
|
|
12568
12573
|
if (!t)
|
|
12569
|
-
throw new
|
|
12574
|
+
throw new z("Internal state is undefined! Cannot copy experience!");
|
|
12570
12575
|
const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
|
|
12571
12576
|
if (!n)
|
|
12572
|
-
throw new
|
|
12577
|
+
throw new z("Integration product id is undefined!");
|
|
12573
12578
|
return await this.getClient().getWorkflowExperience({
|
|
12574
12579
|
type: "integration",
|
|
12575
12580
|
integrationProductId: n,
|
|
@@ -12680,17 +12685,17 @@ const $o = [
|
|
|
12680
12685
|
"textPath",
|
|
12681
12686
|
"tref",
|
|
12682
12687
|
"tspan"
|
|
12683
|
-
],
|
|
12688
|
+
], Lo = async (r, t, e) => {
|
|
12684
12689
|
const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
|
|
12685
12690
|
o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
|
12686
12691
|
const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
|
|
12687
|
-
const
|
|
12688
|
-
if (!
|
|
12692
|
+
const g = r.find((p) => p.panelId === h.panelId);
|
|
12693
|
+
if (!g)
|
|
12689
12694
|
throw new J(h);
|
|
12690
|
-
const
|
|
12695
|
+
const m = Q();
|
|
12691
12696
|
return new W(
|
|
12692
12697
|
{
|
|
12693
|
-
id:
|
|
12698
|
+
id: m,
|
|
12694
12699
|
src: d,
|
|
12695
12700
|
type: M.Image,
|
|
12696
12701
|
y: h.top,
|
|
@@ -12699,7 +12704,7 @@ const $o = [
|
|
|
12699
12704
|
height: h.height,
|
|
12700
12705
|
rotation: 0
|
|
12701
12706
|
},
|
|
12702
|
-
|
|
12707
|
+
g
|
|
12703
12708
|
);
|
|
12704
12709
|
}, u = e.data.regions;
|
|
12705
12710
|
try {
|
|
@@ -12707,17 +12712,17 @@ const $o = [
|
|
|
12707
12712
|
} catch (h) {
|
|
12708
12713
|
return console.error(h), [];
|
|
12709
12714
|
}
|
|
12710
|
-
},
|
|
12715
|
+
}, Uo = async (r, t, e, a) => {
|
|
12711
12716
|
const n = e.data, i = n.assetUrl, s = await sa(i);
|
|
12712
12717
|
try {
|
|
12713
12718
|
const o = is(n, a.option);
|
|
12714
12719
|
o && (t[a.stepName] = { selectedVariants: [o] });
|
|
12715
12720
|
const l = async (c) => {
|
|
12716
|
-
var
|
|
12717
|
-
const d = await Rn(c, (
|
|
12721
|
+
var m;
|
|
12722
|
+
const d = await Rn(c, (m = o == null ? void 0 : o.asset) == null ? void 0 : m.fileLink), A = await Qe(d), u = Q(), h = r.find((p) => p.panelId === c.panelId);
|
|
12718
12723
|
if (!h)
|
|
12719
12724
|
throw new J(c);
|
|
12720
|
-
const
|
|
12725
|
+
const g = Ea(
|
|
12721
12726
|
s,
|
|
12722
12727
|
A,
|
|
12723
12728
|
{
|
|
@@ -12746,13 +12751,13 @@ const $o = [
|
|
|
12746
12751
|
pattern: {
|
|
12747
12752
|
id: `${u}-pattern`,
|
|
12748
12753
|
src: s.src,
|
|
12749
|
-
x:
|
|
12750
|
-
y:
|
|
12754
|
+
x: g.x,
|
|
12755
|
+
y: g.y,
|
|
12751
12756
|
width: s.width,
|
|
12752
12757
|
height: s.height,
|
|
12753
12758
|
rotation: 0,
|
|
12754
|
-
scaleX:
|
|
12755
|
-
scaleY:
|
|
12759
|
+
scaleX: g.zoom,
|
|
12760
|
+
scaleY: g.zoom,
|
|
12756
12761
|
svg: s.svg,
|
|
12757
12762
|
colors: s.colors
|
|
12758
12763
|
}
|
|
@@ -12779,30 +12784,30 @@ const $o = [
|
|
|
12779
12784
|
const o = (E = s.asset) == null ? void 0 : E.fileLink;
|
|
12780
12785
|
if (!o)
|
|
12781
12786
|
return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
|
|
12782
|
-
const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "",
|
|
12783
|
-
if (!
|
|
12787
|
+
const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "", g = dt().parseFromString(A, "image/svg+xml").firstElementChild;
|
|
12788
|
+
if (!g)
|
|
12784
12789
|
return console.error("Failed to read SVG."), [];
|
|
12785
|
-
pa(
|
|
12786
|
-
const
|
|
12787
|
-
kt(
|
|
12790
|
+
pa(g);
|
|
12791
|
+
const m = {};
|
|
12792
|
+
kt(g, (B) => {
|
|
12788
12793
|
$o.includes(B.tagName) && !B.attributes.getNamedItem("fill") && B.setAttribute("fill", "#000000");
|
|
12789
12794
|
const I = B.attributes.getNamedItem("fill");
|
|
12790
12795
|
if (I && I.value !== "none") {
|
|
12791
12796
|
const x = I.value, T = `spiff-fill-${x.replace(/\W/g, "")}`;
|
|
12792
|
-
B.classList.add(T),
|
|
12797
|
+
B.classList.add(T), m[T] = { browserValue: x };
|
|
12793
12798
|
}
|
|
12794
12799
|
const D = B.attributes.getNamedItem("stroke");
|
|
12795
12800
|
if (D && D.value !== "none") {
|
|
12796
12801
|
const x = D.value, T = `spiff-stroke-${x.replace(/\W/g, "")}`;
|
|
12797
|
-
B.classList.add(T),
|
|
12802
|
+
B.classList.add(T), m[T] = { browserValue: x };
|
|
12798
12803
|
}
|
|
12799
12804
|
});
|
|
12800
|
-
const f = bt().serializeToString(
|
|
12805
|
+
const f = bt().serializeToString(g), C = n.colors;
|
|
12801
12806
|
if (C) {
|
|
12802
|
-
for (const [B, I] of Object.entries(
|
|
12807
|
+
for (const [B, I] of Object.entries(m))
|
|
12803
12808
|
for (const D of Object.keys(C))
|
|
12804
12809
|
if (I.browserValue === D) {
|
|
12805
|
-
|
|
12810
|
+
m[B] = { browserValue: C[D] };
|
|
12806
12811
|
break;
|
|
12807
12812
|
}
|
|
12808
12813
|
}
|
|
@@ -12813,7 +12818,7 @@ const $o = [
|
|
|
12813
12818
|
const D = Q();
|
|
12814
12819
|
return new W(
|
|
12815
12820
|
{
|
|
12816
|
-
colors:
|
|
12821
|
+
colors: m,
|
|
12817
12822
|
id: D,
|
|
12818
12823
|
svg: f,
|
|
12819
12824
|
type: M.Illustration,
|
|
@@ -12834,8 +12839,8 @@ const $o = [
|
|
|
12834
12839
|
} catch (B) {
|
|
12835
12840
|
return console.error(B), [];
|
|
12836
12841
|
}
|
|
12837
|
-
},
|
|
12838
|
-
const a = await
|
|
12842
|
+
}, Go = async (r, t, e) => {
|
|
12843
|
+
const a = await Hn(e.data.module), n = t.data, i = (o, l) => {
|
|
12839
12844
|
const c = r.find((A) => A.panelId === l.panelId);
|
|
12840
12845
|
if (!c)
|
|
12841
12846
|
throw new J(l);
|
|
@@ -12864,7 +12869,7 @@ const $o = [
|
|
|
12864
12869
|
} catch (o) {
|
|
12865
12870
|
return console.error(o), [];
|
|
12866
12871
|
}
|
|
12867
|
-
},
|
|
12872
|
+
}, zo = async (r, t, e, a) => {
|
|
12868
12873
|
var d, A;
|
|
12869
12874
|
const n = e.data, i = a.option;
|
|
12870
12875
|
if (!i)
|
|
@@ -12879,13 +12884,13 @@ const $o = [
|
|
|
12879
12884
|
if (!o)
|
|
12880
12885
|
return console.error(`No asset link for variant with ID: ${n.pictureVariantId}`), [];
|
|
12881
12886
|
const l = (u) => {
|
|
12882
|
-
const h = r.find((
|
|
12887
|
+
const h = r.find((m) => m.panelId === u.panelId);
|
|
12883
12888
|
if (!h)
|
|
12884
12889
|
throw new J(u);
|
|
12885
|
-
const
|
|
12890
|
+
const g = Q();
|
|
12886
12891
|
return new W(
|
|
12887
12892
|
{
|
|
12888
|
-
id:
|
|
12893
|
+
id: g,
|
|
12889
12894
|
src: o,
|
|
12890
12895
|
type: M.Image,
|
|
12891
12896
|
y: u.top,
|
|
@@ -12939,11 +12944,11 @@ const $o = [
|
|
|
12939
12944
|
fill="${s == null ? void 0 : s.color}"
|
|
12940
12945
|
/>
|
|
12941
12946
|
</svg>
|
|
12942
|
-
`,
|
|
12947
|
+
`, g = { "spiff-fill-shape": { browserValue: s.color || "#000000" } }, m = Q();
|
|
12943
12948
|
return new W(
|
|
12944
12949
|
{
|
|
12945
|
-
colors:
|
|
12946
|
-
id:
|
|
12950
|
+
colors: g,
|
|
12951
|
+
id: m,
|
|
12947
12952
|
svg: u,
|
|
12948
12953
|
type: M.Illustration,
|
|
12949
12954
|
y: d.top,
|
|
@@ -12998,13 +13003,13 @@ const $o = [
|
|
|
12998
13003
|
}
|
|
12999
13004
|
else {
|
|
13000
13005
|
const c = await at(i, !0), d = (A) => {
|
|
13001
|
-
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [],
|
|
13006
|
+
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], g = (h == null ? void 0 : h.length) > 0 ? h[0] : "", f = dt().parseFromString(g, "image/svg+xml").firstElementChild;
|
|
13002
13007
|
if (!f)
|
|
13003
13008
|
throw new xt("Failed to read SVG.");
|
|
13004
13009
|
return pa(f), bt().serializeToString(f);
|
|
13005
13010
|
};
|
|
13006
13011
|
l.forEach((A) => {
|
|
13007
|
-
const u = r.find((
|
|
13012
|
+
const u = r.find((g) => g.panelId === A.panelId);
|
|
13008
13013
|
if (!u)
|
|
13009
13014
|
throw new J(A);
|
|
13010
13015
|
const h = {
|
|
@@ -13030,7 +13035,7 @@ const $o = [
|
|
|
13030
13035
|
});
|
|
13031
13036
|
}
|
|
13032
13037
|
return a;
|
|
13033
|
-
},
|
|
13038
|
+
}, qo = async (r, t, e, a) => {
|
|
13034
13039
|
const n = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
|
|
13035
13040
|
var w;
|
|
13036
13041
|
const p = a.option;
|
|
@@ -13061,8 +13066,8 @@ const $o = [
|
|
|
13061
13066
|
return;
|
|
13062
13067
|
const C = Y.getDefaultVariant(f);
|
|
13063
13068
|
return C == null ? void 0 : C.color;
|
|
13064
|
-
},
|
|
13065
|
-
for (const p of
|
|
13069
|
+
}, g = i.color || await h(a.data), m = a.data.regions;
|
|
13070
|
+
for (const p of m) {
|
|
13066
13071
|
const f = r.find((w) => w.panelId === p.panelId);
|
|
13067
13072
|
if (!f)
|
|
13068
13073
|
continue;
|
|
@@ -13071,7 +13076,7 @@ const $o = [
|
|
|
13071
13076
|
id: Q(),
|
|
13072
13077
|
align: o(a.data),
|
|
13073
13078
|
curved: a.data.curved,
|
|
13074
|
-
fill: i.color ||
|
|
13079
|
+
fill: i.color || g || "#000000",
|
|
13075
13080
|
fontData: d,
|
|
13076
13081
|
fontSize: a.data.size || s,
|
|
13077
13082
|
height: p.height,
|
|
@@ -13119,7 +13124,7 @@ const $o = [
|
|
|
13119
13124
|
n.push(new W(C, f));
|
|
13120
13125
|
}
|
|
13121
13126
|
return n;
|
|
13122
|
-
},
|
|
13127
|
+
}, Ho = (r, t) => r.conditions ? r.conditions.every((e) => {
|
|
13123
13128
|
const a = t[e.targetStepName];
|
|
13124
13129
|
if (a && a.selectedVariants) {
|
|
13125
13130
|
const n = a.selectedVariants;
|
|
@@ -13136,13 +13141,13 @@ const $o = [
|
|
|
13136
13141
|
switch (o.type) {
|
|
13137
13142
|
case P.DigitalContent:
|
|
13138
13143
|
n.push(
|
|
13139
|
-
...await
|
|
13144
|
+
...await Lo(e, s, o)
|
|
13140
13145
|
);
|
|
13141
13146
|
break;
|
|
13142
13147
|
case P.Frame:
|
|
13143
13148
|
case P.Photo:
|
|
13144
13149
|
n.push(
|
|
13145
|
-
...await
|
|
13150
|
+
...await Uo(e, i, s, o)
|
|
13146
13151
|
);
|
|
13147
13152
|
break;
|
|
13148
13153
|
case P.Illustration:
|
|
@@ -13156,11 +13161,11 @@ const $o = [
|
|
|
13156
13161
|
);
|
|
13157
13162
|
break;
|
|
13158
13163
|
case P.Module:
|
|
13159
|
-
n.push(...await
|
|
13164
|
+
n.push(...await Go(e, s, o));
|
|
13160
13165
|
break;
|
|
13161
13166
|
case P.Picture:
|
|
13162
13167
|
n.push(
|
|
13163
|
-
...await
|
|
13168
|
+
...await zo(e, i, s, o)
|
|
13164
13169
|
);
|
|
13165
13170
|
break;
|
|
13166
13171
|
case P.Shape:
|
|
@@ -13170,13 +13175,13 @@ const $o = [
|
|
|
13170
13175
|
break;
|
|
13171
13176
|
case P.Text:
|
|
13172
13177
|
n.push(
|
|
13173
|
-
...await
|
|
13178
|
+
...await qo(e, i, s, o)
|
|
13174
13179
|
);
|
|
13175
13180
|
break;
|
|
13176
13181
|
}
|
|
13177
13182
|
}
|
|
13178
13183
|
for (const s of t.steps)
|
|
13179
|
-
s.type !== P.SilentIllustration && s.type !== P.ProductOverlay ||
|
|
13184
|
+
s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || Ho(s, i) && n.push(
|
|
13180
13185
|
...await jo(e, s, a)
|
|
13181
13186
|
);
|
|
13182
13187
|
return n;
|
|
@@ -13216,7 +13221,7 @@ class Jo {
|
|
|
13216
13221
|
}
|
|
13217
13222
|
const Ko = () => new Promise((r, t) => {
|
|
13218
13223
|
try {
|
|
13219
|
-
const a =
|
|
13224
|
+
const a = mt().getContext("webgl2");
|
|
13220
13225
|
r(!!a);
|
|
13221
13226
|
} catch {
|
|
13222
13227
|
r(!1);
|
|
@@ -13329,23 +13334,23 @@ class Zo extends Dn {
|
|
|
13329
13334
|
* a loose target but should be kept in mind when making changes.
|
|
13330
13335
|
*/
|
|
13331
13336
|
async execute() {
|
|
13332
|
-
var h,
|
|
13333
|
-
const t = this.layouts.find((
|
|
13337
|
+
var h, g;
|
|
13338
|
+
const t = this.layouts.find((m) => m.layoutState.layout.id === this.layoutId);
|
|
13334
13339
|
if (!t)
|
|
13335
13340
|
return;
|
|
13336
13341
|
const e = t.layoutState.elements || [], a = t.layoutState.layout.width, n = t.layoutState.layout.height, i = a === 1 || n === 1 ? { width: 1, height: 1 } : this.getDynamicTextureResolution(), s = i.width, o = i.height;
|
|
13337
13342
|
let l, c;
|
|
13338
13343
|
if (this.nonPOTSupport) {
|
|
13339
|
-
const
|
|
13340
|
-
a / n <
|
|
13344
|
+
const m = s / o;
|
|
13345
|
+
a / n < m ? (l = s, c = n * (s / a)) : (l = a * (o / n), c = o);
|
|
13341
13346
|
const f = this.resizeFit({ width: l, height: c });
|
|
13342
13347
|
l = f.width, c = f.height;
|
|
13343
13348
|
} else
|
|
13344
13349
|
l = i.width, c = i.height;
|
|
13345
13350
|
const d = Sa(t.layoutState.layout, e, {
|
|
13346
13351
|
renderingConfiguration: {
|
|
13347
|
-
purpose:
|
|
13348
|
-
templatingContext: (
|
|
13352
|
+
purpose: qt.ThreeD,
|
|
13353
|
+
templatingContext: (g = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : g.getTemplatingContext()
|
|
13349
13354
|
}
|
|
13350
13355
|
}), A = un(d), u = await Aa.from(this.ctx, A, {
|
|
13351
13356
|
anonymousCrossOrigin: !0,
|
|
@@ -13354,9 +13359,9 @@ class Zo extends Dn {
|
|
|
13354
13359
|
ignoreClear: !0,
|
|
13355
13360
|
ignoreMouse: !0,
|
|
13356
13361
|
enableRedraw: !1,
|
|
13357
|
-
createCanvas:
|
|
13362
|
+
createCanvas: mt,
|
|
13358
13363
|
createImage: Zt,
|
|
13359
|
-
DOMParser:
|
|
13364
|
+
DOMParser: ma(),
|
|
13360
13365
|
fetch
|
|
13361
13366
|
});
|
|
13362
13367
|
u.resize(l, c), await u.render(), this.onRender();
|
|
@@ -13378,7 +13383,7 @@ const Xc = (r, t) => {
|
|
|
13378
13383
|
serializableWorkflow: { steps: [] },
|
|
13379
13384
|
layouts: {}
|
|
13380
13385
|
};
|
|
13381
|
-
n = new $(e.map((l) => new
|
|
13386
|
+
n = new $(e.map((l) => new Ln(l))).apply(n);
|
|
13382
13387
|
const s = await Yo(r, t, e, a);
|
|
13383
13388
|
return new $(s).apply(n);
|
|
13384
13389
|
};
|
|
@@ -13426,19 +13431,19 @@ class tl {
|
|
|
13426
13431
|
}
|
|
13427
13432
|
async createHandle(t) {
|
|
13428
13433
|
switch (t.type) {
|
|
13429
|
-
case
|
|
13434
|
+
case G.FileUpload:
|
|
13430
13435
|
return new el(this.bundle, t).initialize();
|
|
13431
|
-
case
|
|
13436
|
+
case G.ColorOption:
|
|
13432
13437
|
return new Ja(
|
|
13433
13438
|
this.bundle,
|
|
13434
13439
|
t,
|
|
13435
13440
|
t.entityId ? await Y.getOption(t.entityId) : void 0
|
|
13436
13441
|
);
|
|
13437
|
-
case
|
|
13442
|
+
case G.Option: {
|
|
13438
13443
|
const e = t.entityId ? await Y.getOption(t.entityId) : void 0;
|
|
13439
13444
|
return (e == null ? void 0 : e.type) === "Color" ? new Ja(this.bundle, t, e) : new Xn(this.bundle, t, e);
|
|
13440
13445
|
}
|
|
13441
|
-
case
|
|
13446
|
+
case G.Text:
|
|
13442
13447
|
return new al(this.bundle, t);
|
|
13443
13448
|
default:
|
|
13444
13449
|
throw new Error("Unhandled Global Property Aspect Type");
|
|
@@ -13483,18 +13488,20 @@ class Ia {
|
|
|
13483
13488
|
* Returns all steps that share this property.
|
|
13484
13489
|
* @param targetExperiences Optionally filter the steps to only those in the given experiences.
|
|
13485
13490
|
*/
|
|
13486
|
-
getSharedSteps(t) {
|
|
13487
|
-
|
|
13488
|
-
|
|
13489
|
-
|
|
13490
|
-
|
|
13491
|
-
|
|
13492
|
-
|
|
13493
|
-
|
|
13491
|
+
getSharedSteps(t, e) {
|
|
13492
|
+
const a = t ?? this.bundle.getWorkflowExperiences();
|
|
13493
|
+
return console.log(`LOG: getting shared steps from ${a.length} experiences`), a.flatMap((i) => {
|
|
13494
|
+
const s = e ? i.getSteps() : i.getStepsConditionallyActive();
|
|
13495
|
+
return console.log(`LOG: getting shared steps from ${s.length} active steps`), s.filter((o) => {
|
|
13496
|
+
var l;
|
|
13497
|
+
return o.getOverrideGlobalPropertyConfiguration(this.property.type) ? (console.log("LOG: getting shared steps? no"), !1) : (console.log("LOG: getting shared steps? maybe!"), (l = o.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : l.some(
|
|
13498
|
+
(c) => {
|
|
13499
|
+
var d, A;
|
|
13500
|
+
return c.globalPropertyConfigurationId === ((A = (d = this.bundle.getProductCollection()) == null ? void 0 : d.getResource().globalPropertyConfiguration) == null ? void 0 : A.id) && c.aspectName === this.property.name;
|
|
13494
13501
|
}
|
|
13495
|
-
);
|
|
13496
|
-
})
|
|
13497
|
-
);
|
|
13502
|
+
));
|
|
13503
|
+
});
|
|
13504
|
+
});
|
|
13498
13505
|
}
|
|
13499
13506
|
getStateValue() {
|
|
13500
13507
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
@@ -13566,7 +13573,7 @@ class el extends Ia {
|
|
|
13566
13573
|
const e = await this.getOriginalImage();
|
|
13567
13574
|
if (!e)
|
|
13568
13575
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
|
13569
|
-
const a = this.bundle.getGlobalPropertyStateManager(), n = await
|
|
13576
|
+
const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
|
|
13570
13577
|
...a.getAspectStorage(this.property.name),
|
|
13571
13578
|
backgroundRemovedAssetKey: n.key,
|
|
13572
13579
|
useOriginalAsset: !t
|
|
@@ -13586,7 +13593,7 @@ class el extends Ia {
|
|
|
13586
13593
|
async getImage() {
|
|
13587
13594
|
const t = this.getStateValue();
|
|
13588
13595
|
if (t)
|
|
13589
|
-
return
|
|
13596
|
+
return L.getLocalOrFromServer(t);
|
|
13590
13597
|
}
|
|
13591
13598
|
async getImageWithColors() {
|
|
13592
13599
|
var t, e;
|
|
@@ -13599,7 +13606,7 @@ class el extends Ia {
|
|
|
13599
13606
|
async getOriginalImage() {
|
|
13600
13607
|
const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13601
13608
|
if (t != null && t.originalAssetKey)
|
|
13602
|
-
return
|
|
13609
|
+
return L.getLocalOrFromServer(t.originalAssetKey);
|
|
13603
13610
|
}
|
|
13604
13611
|
/**
|
|
13605
13612
|
* Retrieves the version of the image selection that has the background removed, if one exists.
|
|
@@ -13608,7 +13615,7 @@ class el extends Ia {
|
|
|
13608
13615
|
async getBackgroundRemovedImage() {
|
|
13609
13616
|
const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13610
13617
|
if (t != null && t.backgroundRemovedAssetKey)
|
|
13611
|
-
return
|
|
13618
|
+
return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
|
|
13612
13619
|
}
|
|
13613
13620
|
getUseOriginalImage() {
|
|
13614
13621
|
var t;
|
|
@@ -13640,26 +13647,26 @@ class el extends Ia {
|
|
|
13640
13647
|
}
|
|
13641
13648
|
o.push(this.loadImageData()), await Promise.all(o), this.updateSharedStepStorage(i);
|
|
13642
13649
|
}
|
|
13643
|
-
async applyGlobalState(t) {
|
|
13644
|
-
const
|
|
13645
|
-
if (!e)
|
|
13646
|
-
return;
|
|
13647
|
-
const a = await U.getLocalOrFromServer(e);
|
|
13650
|
+
async applyGlobalState(t, e) {
|
|
13651
|
+
const a = this.getStateValue();
|
|
13648
13652
|
if (!a)
|
|
13649
13653
|
return;
|
|
13650
|
-
await
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13654
|
+
const n = await L.getLocalOrFromServer(a);
|
|
13655
|
+
if (!n)
|
|
13656
|
+
return;
|
|
13657
|
+
await this.applyImageSelection(n, t, !1, !0);
|
|
13658
|
+
const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13659
|
+
if (i) {
|
|
13660
|
+
if (this.updateSharedStepStorage({ ...i }), i.colors) {
|
|
13661
|
+
const s = new Map(
|
|
13662
|
+
i.colors.map((o) => [o.key, { browserValue: o.browserValue, pmsValue: o.pmsValue }]) ?? []
|
|
13656
13663
|
);
|
|
13657
|
-
this.getSharedSteps(t).forEach((
|
|
13658
|
-
|
|
13664
|
+
this.getSharedSteps(t, e).forEach((o) => {
|
|
13665
|
+
o.changeColors(s);
|
|
13659
13666
|
});
|
|
13660
13667
|
}
|
|
13661
13668
|
} else
|
|
13662
|
-
this.updateSharedStepStorage({ originalAssetKey:
|
|
13669
|
+
this.updateSharedStepStorage({ originalAssetKey: a }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: a });
|
|
13663
13670
|
}
|
|
13664
13671
|
getAvailableColors() {
|
|
13665
13672
|
var t, e, a, n;
|
|
@@ -13686,22 +13693,22 @@ class el extends Ia {
|
|
|
13686
13693
|
var e;
|
|
13687
13694
|
return (e = this.imageData) != null && e.svg ? (await lt(this.imageData.svg)).colors : void 0;
|
|
13688
13695
|
}
|
|
13689
|
-
async changeColors(t) {
|
|
13690
|
-
var
|
|
13691
|
-
if (!((
|
|
13696
|
+
async changeColors(t, e) {
|
|
13697
|
+
var s;
|
|
13698
|
+
if (!((s = this.imageData) != null && s.svg))
|
|
13692
13699
|
return;
|
|
13693
|
-
const
|
|
13694
|
-
|
|
13695
|
-
|
|
13700
|
+
const a = this.getSharedSteps(void 0, e), n = new Map(Object.entries(t));
|
|
13701
|
+
a.forEach((o) => {
|
|
13702
|
+
o.changeColors(n);
|
|
13696
13703
|
});
|
|
13697
|
-
const
|
|
13704
|
+
const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13698
13705
|
await Promise.all([
|
|
13699
13706
|
this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, {
|
|
13700
|
-
...
|
|
13701
|
-
colors: Object.entries(t).map(([
|
|
13702
|
-
key:
|
|
13703
|
-
browserValue:
|
|
13704
|
-
pmsValue:
|
|
13707
|
+
...i,
|
|
13708
|
+
colors: Object.entries(t).map(([o, l]) => ({
|
|
13709
|
+
key: o,
|
|
13710
|
+
browserValue: l.browserValue,
|
|
13711
|
+
pmsValue: l.pmsValue
|
|
13705
13712
|
}))
|
|
13706
13713
|
}),
|
|
13707
13714
|
await this.loadImageData()
|
|
@@ -13751,10 +13758,10 @@ class al extends Ia {
|
|
|
13751
13758
|
/**
|
|
13752
13759
|
* Set the text.
|
|
13753
13760
|
*/
|
|
13754
|
-
async setText(t) {
|
|
13761
|
+
async setText(t, e) {
|
|
13755
13762
|
await Promise.all([
|
|
13756
13763
|
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
|
|
13757
|
-
this.applyTextSelection(t)
|
|
13764
|
+
this.applyTextSelection(t, void 0, e)
|
|
13758
13765
|
]);
|
|
13759
13766
|
}
|
|
13760
13767
|
async applyGlobalState(t) {
|
|
@@ -13763,11 +13770,13 @@ class al extends Ia {
|
|
|
13763
13770
|
return Promise.resolve();
|
|
13764
13771
|
await this.applyTextSelection(e, t);
|
|
13765
13772
|
}
|
|
13766
|
-
async applyTextSelection(t, e) {
|
|
13767
|
-
const n = this.getSharedSteps(e)
|
|
13768
|
-
|
|
13773
|
+
async applyTextSelection(t, e, a) {
|
|
13774
|
+
const n = this.getSharedSteps(e, a);
|
|
13775
|
+
console.log(`LOG: ${n.length} shared steps`);
|
|
13776
|
+
const i = n.map((s) => {
|
|
13777
|
+
s.setText(t);
|
|
13769
13778
|
});
|
|
13770
|
-
await Promise.all(
|
|
13779
|
+
await Promise.all(i);
|
|
13771
13780
|
}
|
|
13772
13781
|
}
|
|
13773
13782
|
class Xn extends Ia {
|
|
@@ -13826,10 +13835,10 @@ class Xn extends Ia {
|
|
|
13826
13835
|
* Select a given variant on the option for all shared steps.
|
|
13827
13836
|
* @param variant The variant to select.
|
|
13828
13837
|
*/
|
|
13829
|
-
async selectVariant(t, e) {
|
|
13838
|
+
async selectVariant(t, e, a) {
|
|
13830
13839
|
await Promise.all([
|
|
13831
13840
|
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
|
|
13832
|
-
this.applyVariantSelection(t)
|
|
13841
|
+
this.applyVariantSelection(t, void 0, a)
|
|
13833
13842
|
]);
|
|
13834
13843
|
}
|
|
13835
13844
|
async applyGlobalState(t) {
|
|
@@ -13840,9 +13849,9 @@ class Xn extends Ia {
|
|
|
13840
13849
|
const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
|
|
13841
13850
|
return a ? this.applyVariantSelection(new st(a), t) : Promise.resolve();
|
|
13842
13851
|
}
|
|
13843
|
-
async applyVariantSelection(t, e) {
|
|
13844
|
-
const
|
|
13845
|
-
await Promise.all(
|
|
13852
|
+
async applyVariantSelection(t, e, a) {
|
|
13853
|
+
const i = this.getSharedSteps(e, a).map((s) => s.selectVariant(t));
|
|
13854
|
+
await Promise.all(i);
|
|
13846
13855
|
}
|
|
13847
13856
|
}
|
|
13848
13857
|
class Ja extends Xn {
|
|
@@ -13891,8 +13900,8 @@ class Ja extends Xn {
|
|
|
13891
13900
|
/**
|
|
13892
13901
|
* Sets a custom color on the global state.
|
|
13893
13902
|
*/
|
|
13894
|
-
setCustomColor(t) {
|
|
13895
|
-
this.getSharedSteps().forEach((
|
|
13903
|
+
setCustomColor(t, e) {
|
|
13904
|
+
this.getSharedSteps(void 0, e).forEach((n) => n.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
|
|
13896
13905
|
}
|
|
13897
13906
|
/**
|
|
13898
13907
|
* Gets the custom color used by the global state.
|
|
@@ -14038,15 +14047,15 @@ class il {
|
|
|
14038
14047
|
let i = n.type && n.storage ? {} : void 0;
|
|
14039
14048
|
if (i)
|
|
14040
14049
|
switch (n.type) {
|
|
14041
|
-
case
|
|
14050
|
+
case G.FileUpload: {
|
|
14042
14051
|
i.fileUpload = n.storage;
|
|
14043
14052
|
break;
|
|
14044
14053
|
}
|
|
14045
|
-
case
|
|
14054
|
+
case G.Option: {
|
|
14046
14055
|
i.option = n.storage;
|
|
14047
14056
|
break;
|
|
14048
14057
|
}
|
|
14049
|
-
case
|
|
14058
|
+
case G.ColorOption: {
|
|
14050
14059
|
i = n.storage;
|
|
14051
14060
|
break;
|
|
14052
14061
|
}
|
|
@@ -14318,7 +14327,7 @@ class Zn {
|
|
|
14318
14327
|
async filterProducts(t, e, a, n) {
|
|
14319
14328
|
var l, c;
|
|
14320
14329
|
const i = await b.getShadowGraphqlClient().query({
|
|
14321
|
-
query:
|
|
14330
|
+
query: Gs,
|
|
14322
14331
|
errorPolicy: "all",
|
|
14323
14332
|
variables: {
|
|
14324
14333
|
id: this.getId(),
|
|
@@ -14358,7 +14367,7 @@ class Zn {
|
|
|
14358
14367
|
};
|
|
14359
14368
|
}
|
|
14360
14369
|
const o = new AbortController(), { signal: l } = o, c = b.getShadowGraphqlClient().watchQuery({
|
|
14361
|
-
query:
|
|
14370
|
+
query: zs,
|
|
14362
14371
|
variables: {
|
|
14363
14372
|
id: this.getId(),
|
|
14364
14373
|
limit: e,
|
|
@@ -14387,13 +14396,13 @@ class Zn {
|
|
|
14387
14396
|
let A = !1;
|
|
14388
14397
|
const u = c.subscribe({
|
|
14389
14398
|
next(h) {
|
|
14390
|
-
var
|
|
14391
|
-
if (A || h.partial && (!h.data.productCollections || h.data.productCollections.length === 0 || !((
|
|
14399
|
+
var m, p, f, C, w, S;
|
|
14400
|
+
if (A || h.partial && (!h.data.productCollections || h.data.productCollections.length === 0 || !((m = h.data.productCollections[0].productCollectionProductsFeed) != null && m.items) || ((p = h.data.productCollections[0].productCollectionProductsFeed) == null ? void 0 : p.items.length) === 0))
|
|
14392
14401
|
return;
|
|
14393
14402
|
o.abort(), A = !0, u.unsubscribe();
|
|
14394
|
-
const
|
|
14403
|
+
const g = ((C = (f = h.data.productCollections) == null ? void 0 : f[0].productCollectionProductsFeed) == null ? void 0 : C.items.filter((y) => !!y.product).map((y) => new de(St(y)))) || [];
|
|
14395
14404
|
d({
|
|
14396
|
-
items:
|
|
14405
|
+
items: g,
|
|
14397
14406
|
// Clone items because it could be cached data (immutable)
|
|
14398
14407
|
total: ((S = (w = h.data.productCollections) == null ? void 0 : w[0].productCollectionProductsFeed) == null ? void 0 : S.total) ?? 0
|
|
14399
14408
|
});
|
|
@@ -14642,7 +14651,7 @@ const hl = v`
|
|
|
14642
14651
|
}
|
|
14643
14652
|
})).data) == null ? void 0 : e.productCollections) == null ? void 0 : a.map((n) => new Zn(n));
|
|
14644
14653
|
};
|
|
14645
|
-
class
|
|
14654
|
+
class gl {
|
|
14646
14655
|
constructor() {
|
|
14647
14656
|
this.listeners = {};
|
|
14648
14657
|
}
|
|
@@ -14669,7 +14678,7 @@ class ml {
|
|
|
14669
14678
|
delete this.listeners[e];
|
|
14670
14679
|
}
|
|
14671
14680
|
}
|
|
14672
|
-
const
|
|
14681
|
+
const ml = v`
|
|
14673
14682
|
mutation AddAddressToBundle(
|
|
14674
14683
|
$bundleId: String!
|
|
14675
14684
|
$streetAddress: String
|
|
@@ -14708,7 +14717,7 @@ const gl = v`
|
|
|
14708
14717
|
class Je {
|
|
14709
14718
|
constructor(t, e, a, n, i, s) {
|
|
14710
14719
|
var c, d, A;
|
|
14711
|
-
this.workflowExperiences = [], this.eventEmitter = new
|
|
14720
|
+
this.workflowExperiences = [], this.eventEmitter = new gl(), this.client = t, this.id = e.id, this.name = e.name || "", this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(((c = e.metadata) == null ? void 0 : c.map((u) => [u.key, u.value])) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new sl(e.bundleStateData);
|
|
14712
14721
|
const o = (d = this.productCollection) == null ? void 0 : d.globalPropertyConfiguration;
|
|
14713
14722
|
this.globalConfigurationPropertyId = o == null ? void 0 : o.id, this.globalPropertyStateManager = new il(
|
|
14714
14723
|
this.id,
|
|
@@ -14722,16 +14731,16 @@ class Je {
|
|
|
14722
14731
|
u([]);
|
|
14723
14732
|
return;
|
|
14724
14733
|
}
|
|
14725
|
-
console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((
|
|
14726
|
-
const
|
|
14727
|
-
if (p.getType() ===
|
|
14734
|
+
console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((g) => {
|
|
14735
|
+
const m = g.map((p) => {
|
|
14736
|
+
if (p.getType() === G.ColorOption || p.getType() === G.Option) {
|
|
14728
14737
|
const f = p;
|
|
14729
14738
|
if (this.globalPropertyStateManager.getGlobalPropertyState())
|
|
14730
14739
|
return f.initDefaultVariant();
|
|
14731
14740
|
console.log("Attempted to set global default variant before state was initialized.");
|
|
14732
14741
|
}
|
|
14733
14742
|
});
|
|
14734
|
-
Promise.all(
|
|
14743
|
+
Promise.all(m).then(u).catch(h);
|
|
14735
14744
|
});
|
|
14736
14745
|
});
|
|
14737
14746
|
this.initializationPromise = Promise.all([
|
|
@@ -14762,7 +14771,7 @@ class Je {
|
|
|
14762
14771
|
}
|
|
14763
14772
|
async attachAddress(t, e, a, n, i, s) {
|
|
14764
14773
|
await b.getShadowGraphqlClient().mutate({
|
|
14765
|
-
mutation:
|
|
14774
|
+
mutation: ml,
|
|
14766
14775
|
variables: {
|
|
14767
14776
|
bundleId: this.id,
|
|
14768
14777
|
streetAddress: t || void 0,
|
|
@@ -14859,7 +14868,7 @@ class Je {
|
|
|
14859
14868
|
const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
|
|
14860
14869
|
if (console.log(`LOG: handle for ${i}? ${s}`), s)
|
|
14861
14870
|
switch (n.type) {
|
|
14862
|
-
case
|
|
14871
|
+
case G.FileUpload: {
|
|
14863
14872
|
const o = s, l = await ve([n.value]);
|
|
14864
14873
|
l.length > 0 && await o.selectImage(l[0]);
|
|
14865
14874
|
const c = (a = n.storage) == null ? void 0 : a.colors;
|
|
@@ -14867,26 +14876,26 @@ class Je {
|
|
|
14867
14876
|
const d = Object.fromEntries(
|
|
14868
14877
|
c.map((A) => [A.key, { browserValue: A.browserValue, pmsValue: A.pmsValue }]) ?? []
|
|
14869
14878
|
);
|
|
14870
|
-
await o.changeColors(d);
|
|
14879
|
+
await o.changeColors(d, !0);
|
|
14871
14880
|
}
|
|
14872
14881
|
break;
|
|
14873
14882
|
}
|
|
14874
|
-
case
|
|
14883
|
+
case G.ColorOption: {
|
|
14875
14884
|
const o = s;
|
|
14876
|
-
if (n.type ===
|
|
14885
|
+
if (n.type === G.ColorOption) {
|
|
14877
14886
|
const c = o.getAllVariants().find((d) => d.getId() === n.value);
|
|
14878
14887
|
c && await o.selectVariant(c);
|
|
14879
14888
|
} else
|
|
14880
|
-
o.setCustomColor(n.value);
|
|
14889
|
+
o.setCustomColor(n.value, !0);
|
|
14881
14890
|
break;
|
|
14882
14891
|
}
|
|
14883
|
-
case
|
|
14892
|
+
case G.Option: {
|
|
14884
14893
|
const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
|
|
14885
|
-
c && await o.selectVariant(c);
|
|
14894
|
+
console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c, void 0, !0);
|
|
14886
14895
|
break;
|
|
14887
14896
|
}
|
|
14888
|
-
case
|
|
14889
|
-
await s.setText(n.value);
|
|
14897
|
+
case G.Text: {
|
|
14898
|
+
console.log(`LOG: text ${n.value}`), await s.setText(n.value, !0);
|
|
14890
14899
|
break;
|
|
14891
14900
|
}
|
|
14892
14901
|
}
|
|
@@ -14896,7 +14905,7 @@ class Je {
|
|
|
14896
14905
|
return this.globalPropertyStateManager;
|
|
14897
14906
|
}
|
|
14898
14907
|
async getGlobalPropertyTotalSubunits() {
|
|
14899
|
-
return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() ===
|
|
14908
|
+
return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === G.Option).map((a) => {
|
|
14900
14909
|
var n;
|
|
14901
14910
|
return ((n = a.getCurrentVariant()) == null ? void 0 : n.getPrice()) || 0;
|
|
14902
14911
|
}).reduce((a, n) => a + n, 0);
|
|
@@ -14915,14 +14924,14 @@ class Je {
|
|
|
14915
14924
|
const c = (e = this.getGlobalPropertyConfiguration()) == null ? void 0 : e.aspects.find(
|
|
14916
14925
|
(d) => d.name === l
|
|
14917
14926
|
);
|
|
14918
|
-
if (c && c.type ===
|
|
14927
|
+
if (c && c.type === G.ColorOption) {
|
|
14919
14928
|
const d = (a = s.getCurrentVariant()) == null ? void 0 : a.getAssetResource(), A = ((n = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : n.channelNumbers) || [], u = ((i = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : i.defaultColorVariants) || [], h = rl(
|
|
14920
14929
|
this.getWorkflowExperiences(),
|
|
14921
14930
|
this.globalConfigurationPropertyId || "",
|
|
14922
14931
|
l
|
|
14923
|
-
),
|
|
14924
|
-
if (
|
|
14925
|
-
for (const p of
|
|
14932
|
+
), g = [...new Set(A.map((p) => p.number))];
|
|
14933
|
+
if (g.length > h)
|
|
14934
|
+
for (const p of g) {
|
|
14926
14935
|
const f = this.getGlobalPropertyStateManager(), C = u.find((w) => w.channelNumber === p);
|
|
14927
14936
|
C && await f.setAspect(l, C.variant.id || "", void 0, C.channelNumber);
|
|
14928
14937
|
}
|
|
@@ -14983,7 +14992,7 @@ class Je {
|
|
|
14983
14992
|
throw new Error("Unable to add transaction to bundle - Already Exists!");
|
|
14984
14993
|
const s = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
|
|
14985
14994
|
await b.getShadowGraphqlClient().mutate({
|
|
14986
|
-
mutation:
|
|
14995
|
+
mutation: Hs,
|
|
14987
14996
|
variables: {
|
|
14988
14997
|
id: this.id,
|
|
14989
14998
|
transactionId: a
|
|
@@ -15166,7 +15175,7 @@ class Je {
|
|
|
15166
15175
|
}
|
|
15167
15176
|
async getAllStakeholders() {
|
|
15168
15177
|
const t = await b.getShadowGraphqlClient().query({
|
|
15169
|
-
query:
|
|
15178
|
+
query: Ha,
|
|
15170
15179
|
errorPolicy: "all",
|
|
15171
15180
|
fetchPolicy: "no-cache",
|
|
15172
15181
|
variables: {
|
|
@@ -15183,7 +15192,7 @@ class Je {
|
|
|
15183
15192
|
}
|
|
15184
15193
|
async getCurrentStakeholder() {
|
|
15185
15194
|
const t = await b.getShadowGraphqlClient().query({
|
|
15186
|
-
query:
|
|
15195
|
+
query: Ha,
|
|
15187
15196
|
errorPolicy: "all",
|
|
15188
15197
|
fetchPolicy: "no-cache",
|
|
15189
15198
|
variables: {
|
|
@@ -15338,7 +15347,7 @@ class Je {
|
|
|
15338
15347
|
async updateBundle() {
|
|
15339
15348
|
var e;
|
|
15340
15349
|
if (!((e = (await b.getShadowGraphqlClient().mutate({
|
|
15341
|
-
mutation:
|
|
15350
|
+
mutation: qs,
|
|
15342
15351
|
variables: {
|
|
15343
15352
|
id: this.id,
|
|
15344
15353
|
name: this.name,
|
|
@@ -15447,14 +15456,14 @@ class wl {
|
|
|
15447
15456
|
mutation: Cl,
|
|
15448
15457
|
variables: {
|
|
15449
15458
|
processFlowId: t,
|
|
15450
|
-
inputs: [...e.map((
|
|
15459
|
+
inputs: [...e.map((g) => g.getValueForTransmission())]
|
|
15451
15460
|
}
|
|
15452
15461
|
})).data) == null ? void 0 : A.processExecutionCreate) == null ? void 0 : u.id;
|
|
15453
15462
|
if (!i)
|
|
15454
15463
|
throw new Error("Failed to create process execution.");
|
|
15455
|
-
function s(
|
|
15456
|
-
return new Promise((
|
|
15457
|
-
setTimeout(
|
|
15464
|
+
function s(g) {
|
|
15465
|
+
return new Promise((m) => {
|
|
15466
|
+
setTimeout(m, g);
|
|
15458
15467
|
});
|
|
15459
15468
|
}
|
|
15460
15469
|
let o = !1, l = 0, c, d;
|
|
@@ -15478,20 +15487,20 @@ class wl {
|
|
|
15478
15487
|
ids: [i]
|
|
15479
15488
|
}
|
|
15480
15489
|
});
|
|
15481
|
-
const
|
|
15482
|
-
if (!c || !
|
|
15490
|
+
const g = (h = c.data) == null ? void 0 : h.processExecutions[0];
|
|
15491
|
+
if (!c || !g)
|
|
15483
15492
|
throw new Error("Failed to retrieve server response for execution.");
|
|
15484
|
-
if (
|
|
15493
|
+
if (g.failedAt)
|
|
15485
15494
|
throw new Error(
|
|
15486
15495
|
"Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub."
|
|
15487
15496
|
);
|
|
15488
|
-
if (
|
|
15489
|
-
o = !0, d = new yl(
|
|
15497
|
+
if (g.completedAt) {
|
|
15498
|
+
o = !0, d = new yl(g);
|
|
15490
15499
|
break;
|
|
15491
15500
|
}
|
|
15492
15501
|
l += 1;
|
|
15493
|
-
const
|
|
15494
|
-
if (l >=
|
|
15502
|
+
const m = a != null && a.repeats ? a == null ? void 0 : a.repeats : 5;
|
|
15503
|
+
if (l >= m)
|
|
15495
15504
|
throw new Error("Maximum wait time exceeded for execution result.");
|
|
15496
15505
|
await s(a != null && a.sleepTime ? Math.max(a.sleepTime, 500) : 2e3);
|
|
15497
15506
|
}
|
|
@@ -15838,7 +15847,7 @@ class Il {
|
|
|
15838
15847
|
));
|
|
15839
15848
|
}
|
|
15840
15849
|
}
|
|
15841
|
-
const
|
|
15850
|
+
const Ut = new Il(), Pl = async (r, t) => {
|
|
15842
15851
|
var n;
|
|
15843
15852
|
const e = await b.getShadowGraphqlClient().query({
|
|
15844
15853
|
query: ki(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
|
|
@@ -15857,8 +15866,8 @@ const Lt = new Il(), Pl = async (r, t) => {
|
|
|
15857
15866
|
return a.forEach((i) => {
|
|
15858
15867
|
i.steps.forEach((s) => {
|
|
15859
15868
|
var o, l, c;
|
|
15860
|
-
delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset &&
|
|
15861
|
-
d.asset &&
|
|
15869
|
+
delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && L.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && L.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
|
|
15870
|
+
d.asset && L.cacheAsset(d.asset), d.thumbnail && L.cacheAsset(d.thumbnail), d.material && L.cacheMaterial(d.material);
|
|
15862
15871
|
}), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
|
|
15863
15872
|
}), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
|
|
15864
15873
|
}), a;
|
|
@@ -15904,17 +15913,17 @@ class rd {
|
|
|
15904
15913
|
} catch (a) {
|
|
15905
15914
|
throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
|
|
15906
15915
|
}
|
|
15907
|
-
}, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.
|
|
15916
|
+
}, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.0c29bcb7-7d39-5ab9-a8a6-1904f4c28585"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
15908
15917
|
}
|
|
15909
15918
|
configure(t) {
|
|
15910
|
-
|
|
15919
|
+
gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
15911
15920
|
}
|
|
15912
15921
|
/**
|
|
15913
15922
|
* @returns The asset manager allows for common operations related to assets
|
|
15914
15923
|
* and the Spiff Commerce platform.
|
|
15915
15924
|
*/
|
|
15916
15925
|
getAssetManager() {
|
|
15917
|
-
return
|
|
15926
|
+
return L;
|
|
15918
15927
|
}
|
|
15919
15928
|
getCurrencyCode() {
|
|
15920
15929
|
if (this.currencyCode === void 0)
|
|
@@ -15982,7 +15991,7 @@ class rd {
|
|
|
15982
15991
|
* @throws An error if the transaction is not found.
|
|
15983
15992
|
*/
|
|
15984
15993
|
async authenticateTransactionFromLocalStorage(t) {
|
|
15985
|
-
var d, A, u, h,
|
|
15994
|
+
var d, A, u, h, g, m;
|
|
15986
15995
|
const e = b.getShadowGraphqlClient(), a = await e.query({
|
|
15987
15996
|
query: Mi,
|
|
15988
15997
|
errorPolicy: "all",
|
|
@@ -16008,7 +16017,7 @@ class rd {
|
|
|
16008
16017
|
var S, y;
|
|
16009
16018
|
return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((E) => E.id === t);
|
|
16010
16019
|
}
|
|
16011
|
-
)) || ((
|
|
16020
|
+
)) || ((m = (g = this.customer) == null ? void 0 : g.stakeholders) == null ? void 0 : m.find(
|
|
16012
16021
|
(w) => {
|
|
16013
16022
|
var S;
|
|
16014
16023
|
return ((S = w.transaction) == null ? void 0 : S.id) === t;
|
|
@@ -16114,7 +16123,7 @@ class rd {
|
|
|
16114
16123
|
return !1;
|
|
16115
16124
|
const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
|
|
16116
16125
|
if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
|
|
16117
|
-
const l = await
|
|
16126
|
+
const l = await Ut.refreshTokens();
|
|
16118
16127
|
if (l != null && l.AuthenticationResult)
|
|
16119
16128
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
|
|
16120
16129
|
else
|
|
@@ -16139,14 +16148,14 @@ class rd {
|
|
|
16139
16148
|
variables: {
|
|
16140
16149
|
emailAddress: t
|
|
16141
16150
|
}
|
|
16142
|
-
}), await
|
|
16151
|
+
}), await Ut.generateCode(t);
|
|
16143
16152
|
}
|
|
16144
16153
|
/**
|
|
16145
16154
|
* Verify an email code to log in as a Spiff user.
|
|
16146
16155
|
* Always returns true if it doesn't throw.
|
|
16147
16156
|
*/
|
|
16148
16157
|
async verifyCode(t, e) {
|
|
16149
|
-
const a = (await this.getIntegration()).partner.id || "", n = await
|
|
16158
|
+
const a = (await this.getIntegration()).partner.id || "", n = await Ut.verifyCode(t, e, a);
|
|
16150
16159
|
if (n != null && n.AuthenticationResult) {
|
|
16151
16160
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
|
16152
16161
|
const s = (await b.getShadowGraphqlClient().query({
|
|
@@ -16176,7 +16185,7 @@ class rd {
|
|
|
16176
16185
|
throw new Error("No token data in storage.");
|
|
16177
16186
|
const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
|
|
16178
16187
|
if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
|
|
16179
|
-
const s = await
|
|
16188
|
+
const s = await Ut.refreshTokens();
|
|
16180
16189
|
if (s != null && s.AuthenticationResult)
|
|
16181
16190
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
|
|
16182
16191
|
else
|
|
@@ -16207,7 +16216,7 @@ class rd {
|
|
|
16207
16216
|
mutation: Ws(((d = (c = a == null ? void 0 : a.graphql) == null ? void 0 : c.productCollection) == null ? void 0 : d.eagerFetchProducts) || !1),
|
|
16208
16217
|
variables: {
|
|
16209
16218
|
collectionId: t,
|
|
16210
|
-
initialMetadata: e ? Object.entries(e).map((
|
|
16219
|
+
initialMetadata: e ? Object.entries(e).map((g, m) => ({ key: g[0], value: g[1] })) : void 0,
|
|
16211
16220
|
marketplaceThemeInstallId: this.marketplaceThemeInstallId,
|
|
16212
16221
|
marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
|
|
16213
16222
|
},
|
|
@@ -16233,7 +16242,7 @@ class rd {
|
|
|
16233
16242
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16234
16243
|
*/
|
|
16235
16244
|
async getExistingBundle(t, e, a, n) {
|
|
16236
|
-
var h,
|
|
16245
|
+
var h, g, m, p, f, C, w, S, y, E, B;
|
|
16237
16246
|
const i = N.getMap("bundleOwnerIds"), s = i == null ? void 0 : i.get(t), o = {};
|
|
16238
16247
|
try {
|
|
16239
16248
|
const I = await this.loggedInBearerToken();
|
|
@@ -16245,9 +16254,9 @@ class rd {
|
|
|
16245
16254
|
const l = {
|
|
16246
16255
|
bundleOwnerId: s,
|
|
16247
16256
|
...o,
|
|
16248
|
-
...(
|
|
16257
|
+
...(g = n == null ? void 0 : n.graphql) == null ? void 0 : g.additionalHeaders
|
|
16249
16258
|
}, c = await b.getShadowGraphqlClient().query({
|
|
16250
|
-
query:
|
|
16259
|
+
query: Ls(((p = (m = n == null ? void 0 : n.graphql) == null ? void 0 : m.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
|
|
16251
16260
|
variables: {
|
|
16252
16261
|
id: t
|
|
16253
16262
|
},
|
|
@@ -16275,19 +16284,19 @@ class rd {
|
|
|
16275
16284
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16276
16285
|
*/
|
|
16277
16286
|
async duplicateBundle(t, e, a, n) {
|
|
16278
|
-
var h,
|
|
16287
|
+
var h, g, m, p, f, C, w, S;
|
|
16279
16288
|
const i = (h = N.getMap("bundleOwnerIds")) == null ? void 0 : h.get(t), s = {};
|
|
16280
16289
|
try {
|
|
16281
16290
|
const y = await this.loggedInBearerToken();
|
|
16282
16291
|
s.Authorization = `Bearer ${y}`;
|
|
16283
16292
|
} catch {
|
|
16284
|
-
const B = ((
|
|
16293
|
+
const B = ((g = Object.entries(localStorage).find(([D, x]) => D.startsWith("CognitoIdentityServiceProvider") && D.endsWith("idToken"))) == null ? void 0 : g[0]) || "", I = localStorage.getItem(B);
|
|
16285
16294
|
I && !Wt(I) && (s.Authorization = `Bearer ${I}`);
|
|
16286
16295
|
}
|
|
16287
16296
|
const o = {
|
|
16288
16297
|
bundleOwnerId: i,
|
|
16289
16298
|
...s,
|
|
16290
|
-
...(
|
|
16299
|
+
...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
|
|
16291
16300
|
}, c = (C = (await b.getShadowGraphqlClient().mutate({
|
|
16292
16301
|
mutation: js(((f = (p = n == null ? void 0 : n.graphql) == null ? void 0 : p.productCollection) == null ? void 0 : f.eagerFetchProducts) || !1),
|
|
16293
16302
|
variables: {
|
|
@@ -16346,7 +16355,7 @@ class rd {
|
|
|
16346
16355
|
if (!this.customer)
|
|
16347
16356
|
throw new Error("Customer not authenticated.");
|
|
16348
16357
|
const t = await b.getShadowGraphqlClient().query({
|
|
16349
|
-
query:
|
|
16358
|
+
query: Us,
|
|
16350
16359
|
variables: {
|
|
16351
16360
|
id: this.customer.id
|
|
16352
16361
|
},
|
|
@@ -16443,11 +16452,11 @@ class rd {
|
|
|
16443
16452
|
), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
|
|
16444
16453
|
...c.map(n),
|
|
16445
16454
|
...d.map(i)
|
|
16446
|
-
])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await er(u, e),
|
|
16455
|
+
])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await er(u, e), g = new Map(h.map((y) => [y.id, y])), m = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
|
|
16447
16456
|
var tt;
|
|
16448
|
-
const { transaction: E, workflowId: B, readOnly: I, index: D } = y, x =
|
|
16449
|
-
!
|
|
16450
|
-
const T =
|
|
16457
|
+
const { transaction: E, workflowId: B, readOnly: I, index: D } = y, x = g.get(B), k = t[D];
|
|
16458
|
+
!m.get(E.id) && E.transactionOwnerId && m.set(E.id, E.transactionOwnerId);
|
|
16459
|
+
const T = m.get(E.id) || void 0, nt = new bl({
|
|
16451
16460
|
onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
|
|
16452
16461
|
onQuery: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } })
|
|
16453
16462
|
}), R = {
|
|
@@ -16456,9 +16465,9 @@ class rd {
|
|
|
16456
16465
|
layouts: [],
|
|
16457
16466
|
singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
|
|
16458
16467
|
stateMutationFunc: I ? async () => {
|
|
16459
|
-
throw new
|
|
16460
|
-
} : async (
|
|
16461
|
-
...
|
|
16468
|
+
throw new z("State mutation is forbidden in read only mode!");
|
|
16469
|
+
} : async (q) => this.updateTransactionState({
|
|
16470
|
+
...q,
|
|
16462
16471
|
context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
|
|
16463
16472
|
}),
|
|
16464
16473
|
graphQlClient: () => nt,
|
|
@@ -16467,11 +16476,11 @@ class rd {
|
|
|
16467
16476
|
isReloadedTransaction: k.type === "transaction"
|
|
16468
16477
|
};
|
|
16469
16478
|
if (k.type === "transaction" && E.workflowState) {
|
|
16470
|
-
const
|
|
16471
|
-
R.layouts = Object.values(
|
|
16479
|
+
const q = JSON.parse(E.workflowState);
|
|
16480
|
+
R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
|
|
16472
16481
|
} else if (!I && k.workflowState) {
|
|
16473
|
-
const
|
|
16474
|
-
R.layouts = Object.values(
|
|
16482
|
+
const q = JSON.parse(k.workflowState);
|
|
16483
|
+
R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
|
|
16475
16484
|
} else
|
|
16476
16485
|
R.layouts = Fl(
|
|
16477
16486
|
R.transaction,
|
|
@@ -16481,7 +16490,7 @@ class rd {
|
|
|
16481
16490
|
R.layouts
|
|
16482
16491
|
), R.delayWorkflowStateSync = !0, { experienceOptions: R, index: D, options: k };
|
|
16483
16492
|
}), f = await Promise.all(p);
|
|
16484
|
-
N.setMap("transactionOwnerIds",
|
|
16493
|
+
N.setMap("transactionOwnerIds", m);
|
|
16485
16494
|
const w = f.sort((y, E) => y.index - E.index).map(async (y) => {
|
|
16486
16495
|
const { experienceOptions: E, options: B } = y, I = new Oo(this, E);
|
|
16487
16496
|
return await I.getWorkflowManager().getInitializationPromise(), B.type !== "transaction" && this.customer && await I.attachCustomerDetails({ email: this.customer.emailAddress }), I;
|
|
@@ -16758,7 +16767,7 @@ class Tl {
|
|
|
16758
16767
|
if (!n || !this.frameData)
|
|
16759
16768
|
return;
|
|
16760
16769
|
if (this.frameData.length !== t.length)
|
|
16761
|
-
throw new
|
|
16770
|
+
throw new z(
|
|
16762
16771
|
"Frame data and offsets are not the same length. This is a bug. Please report it."
|
|
16763
16772
|
);
|
|
16764
16773
|
if (!this.offsets.some((s, o) => !(t[o].x === s.x && t[o].y === s.y && t[o].zoom === s.zoom)) && !a) {
|
|
@@ -16802,9 +16811,9 @@ class Tl {
|
|
|
16802
16811
|
*/
|
|
16803
16812
|
updateFrameOffsets(t, e, a, n, i) {
|
|
16804
16813
|
if (!a || a.length === 0 || a.some((o) => !o))
|
|
16805
|
-
throw new
|
|
16814
|
+
throw new z("Frame data not set. This is a bug");
|
|
16806
16815
|
if (!this.workflowManager)
|
|
16807
|
-
throw new
|
|
16816
|
+
throw new z("No workflow manager set, cannot update offsets.");
|
|
16808
16817
|
const s = this.workflowManager.getCommandDispatcher();
|
|
16809
16818
|
this.targetElements.forEach((o, l) => {
|
|
16810
16819
|
s(
|
|
@@ -17076,7 +17085,7 @@ class Ql extends it {
|
|
|
17076
17085
|
const e = await this.getOriginalImageSelection();
|
|
17077
17086
|
if (!e)
|
|
17078
17087
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
|
17079
|
-
const a = await
|
|
17088
|
+
const a = await L.removeBackgroundFromAsset(e);
|
|
17080
17089
|
t && await wt.selectImage(this.step, a, this.manager, !1);
|
|
17081
17090
|
const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
|
|
17082
17091
|
return this.manager.updateStorage(this.step.stepName, {
|
|
@@ -17135,13 +17144,13 @@ class Ql extends it {
|
|
|
17135
17144
|
var e, a;
|
|
17136
17145
|
const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
|
|
17137
17146
|
if (t)
|
|
17138
|
-
return
|
|
17147
|
+
return L.getLocalOrFromServer(t);
|
|
17139
17148
|
}
|
|
17140
17149
|
async getBackgroundRemovedImageSelection() {
|
|
17141
17150
|
var e, a;
|
|
17142
17151
|
const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
|
|
17143
17152
|
if (t)
|
|
17144
|
-
return
|
|
17153
|
+
return L.getLocalOrFromServer(t);
|
|
17145
17154
|
}
|
|
17146
17155
|
hasOriginalImageSelection() {
|
|
17147
17156
|
var t, e;
|
|
@@ -17238,7 +17247,7 @@ const Rl = v`
|
|
|
17238
17247
|
workflowViewerLink
|
|
17239
17248
|
}
|
|
17240
17249
|
}
|
|
17241
|
-
`,
|
|
17250
|
+
`, Ll = v`
|
|
17242
17251
|
query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
|
|
17243
17252
|
customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
|
|
17244
17253
|
items {
|
|
@@ -17253,7 +17262,7 @@ const Rl = v`
|
|
|
17253
17262
|
total
|
|
17254
17263
|
}
|
|
17255
17264
|
}
|
|
17256
|
-
`,
|
|
17265
|
+
`, Ul = v`
|
|
17257
17266
|
query GetTransactionsForBundle($id: String!) {
|
|
17258
17267
|
bundles(ids: [$id]) {
|
|
17259
17268
|
id
|
|
@@ -17281,14 +17290,14 @@ const Rl = v`
|
|
|
17281
17290
|
name
|
|
17282
17291
|
}
|
|
17283
17292
|
}
|
|
17284
|
-
`,
|
|
17293
|
+
`, Gl = v`
|
|
17285
17294
|
mutation DuplicateBundle($id: String!, $template: Boolean!) {
|
|
17286
17295
|
bundleDuplicate(id: $id, template: $template) {
|
|
17287
17296
|
id
|
|
17288
17297
|
workflowViewerLink
|
|
17289
17298
|
}
|
|
17290
17299
|
}
|
|
17291
|
-
`,
|
|
17300
|
+
`, zl = v`
|
|
17292
17301
|
query GetBundleTemplates($id: String!, $limit: Int!, $offset: Int!) {
|
|
17293
17302
|
customerBundlesFeed(id: $id, limit: $limit, offset: $offset, template: true) {
|
|
17294
17303
|
items {
|
|
@@ -17317,7 +17326,7 @@ const Rl = v`
|
|
|
17317
17326
|
name: t
|
|
17318
17327
|
}
|
|
17319
17328
|
}), ud = async (r, t) => await b.getShadowGraphqlClient().mutate({
|
|
17320
|
-
mutation:
|
|
17329
|
+
mutation: Gl,
|
|
17321
17330
|
errorPolicy: "all",
|
|
17322
17331
|
variables: {
|
|
17323
17332
|
id: r,
|
|
@@ -17330,14 +17339,14 @@ const Rl = v`
|
|
|
17330
17339
|
id: r,
|
|
17331
17340
|
template: t
|
|
17332
17341
|
}
|
|
17333
|
-
}),
|
|
17342
|
+
}), gd = async (r) => (await b.getShadowGraphqlClient().query({
|
|
17334
17343
|
query: Rl,
|
|
17335
17344
|
errorPolicy: "all",
|
|
17336
17345
|
variables: {
|
|
17337
17346
|
email: r
|
|
17338
17347
|
}
|
|
17339
|
-
})).data.customer,
|
|
17340
|
-
query:
|
|
17348
|
+
})).data.customer, md = async (r, t, e) => await b.getShadowGraphqlClient().query({
|
|
17349
|
+
query: Ll,
|
|
17341
17350
|
errorPolicy: "all",
|
|
17342
17351
|
fetchPolicy: "no-cache",
|
|
17343
17352
|
variables: {
|
|
@@ -17346,7 +17355,7 @@ const Rl = v`
|
|
|
17346
17355
|
limit: t
|
|
17347
17356
|
}
|
|
17348
17357
|
}), pd = async (r, t) => await b.getShadowGraphqlClient().query({
|
|
17349
|
-
query:
|
|
17358
|
+
query: Ul,
|
|
17350
17359
|
errorPolicy: "all",
|
|
17351
17360
|
fetchPolicy: "no-cache",
|
|
17352
17361
|
variables: {
|
|
@@ -17424,7 +17433,7 @@ const Rl = v`
|
|
|
17424
17433
|
}, yd = async (r, t, e) => {
|
|
17425
17434
|
var n;
|
|
17426
17435
|
const a = await b.getShadowGraphqlClient().query({
|
|
17427
|
-
query:
|
|
17436
|
+
query: zl,
|
|
17428
17437
|
errorPolicy: "all",
|
|
17429
17438
|
fetchPolicy: "no-cache",
|
|
17430
17439
|
variables: {
|
|
@@ -17458,7 +17467,7 @@ _ = { __e: function(r, t, e, a) {
|
|
|
17458
17467
|
throw r;
|
|
17459
17468
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
|
17460
17469
|
var ot, Ke, _a, ar = [], _e = [], Xa = _.__b, Za = _.__r, tn = _.diffed, en = _.__c, an = _.unmount;
|
|
17461
|
-
function
|
|
17470
|
+
function ql() {
|
|
17462
17471
|
for (var r; r = ar.shift(); )
|
|
17463
17472
|
if (r.__P && r.__H)
|
|
17464
17473
|
try {
|
|
@@ -17478,7 +17487,7 @@ _.__b = function(r) {
|
|
|
17478
17487
|
}, _.diffed = function(r) {
|
|
17479
17488
|
tn && tn(r);
|
|
17480
17489
|
var t = r.__c;
|
|
17481
|
-
t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) ||
|
|
17490
|
+
t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || Hl)(ql)), t.__H.__.forEach(function(e) {
|
|
17482
17491
|
e.i && (e.__H = e.i), e.__V !== _e && (e.__ = e.__V), e.i = void 0, e.__V = _e;
|
|
17483
17492
|
})), Ke = ot = null;
|
|
17484
17493
|
}, _.__c = function(r, t) {
|
|
@@ -17505,7 +17514,7 @@ _.__b = function(r) {
|
|
|
17505
17514
|
}), e.__H = void 0, t && _.__e(t, e.__v));
|
|
17506
17515
|
};
|
|
17507
17516
|
var nn = typeof requestAnimationFrame == "function";
|
|
17508
|
-
function
|
|
17517
|
+
function Hl(r) {
|
|
17509
17518
|
var t, e = function() {
|
|
17510
17519
|
clearTimeout(a), nn && cancelAnimationFrame(t), setTimeout(r);
|
|
17511
17520
|
}, a = setTimeout(e, 100);
|
|
@@ -17648,12 +17657,12 @@ export {
|
|
|
17648
17657
|
Zl as AddressValidationJobStatus,
|
|
17649
17658
|
Xl as AddressValidationResultConfirmationLevel,
|
|
17650
17659
|
ad as ArrayInput,
|
|
17651
|
-
|
|
17660
|
+
G as AspectType,
|
|
17652
17661
|
vt as AssetNotFoundError,
|
|
17653
17662
|
Ce as AssetType,
|
|
17654
17663
|
Jc as BringForwardCommand,
|
|
17655
17664
|
Yc as BringToBackCommand,
|
|
17656
|
-
|
|
17665
|
+
Hc as BringToFrontCommand,
|
|
17657
17666
|
yr as BundleDesignCreationCartAddMode,
|
|
17658
17667
|
O as CanvasCommand,
|
|
17659
17668
|
de as CollectionProduct,
|
|
@@ -17662,7 +17671,7 @@ export {
|
|
|
17662
17671
|
jl as ConversionDataType,
|
|
17663
17672
|
Wl as ConversionLocation,
|
|
17664
17673
|
W as CreateElementCommand,
|
|
17665
|
-
|
|
17674
|
+
Ln as CreateLayoutCommand,
|
|
17666
17675
|
Bt as DeleteElementCommand,
|
|
17667
17676
|
Eo as DigitalContentStepHandle,
|
|
17668
17677
|
el as FileUploadGlobalPropertyHandle,
|
|
@@ -17678,21 +17687,21 @@ export {
|
|
|
17678
17687
|
Ql as FrameStepHandle,
|
|
17679
17688
|
Ia as GlobalPropertyHandle,
|
|
17680
17689
|
$ as GroupCommand,
|
|
17681
|
-
|
|
17690
|
+
mo as IllustrationStepHandle,
|
|
17682
17691
|
Re as InformationMessageType,
|
|
17683
17692
|
vo as InformationStepHandle,
|
|
17684
17693
|
Ka as IntegrationProduct,
|
|
17685
17694
|
vr as IntegrationType,
|
|
17686
|
-
|
|
17695
|
+
Gc as LayoutElementFactory,
|
|
17687
17696
|
M as LayoutElementType,
|
|
17688
17697
|
J as LayoutNotFoundError,
|
|
17689
|
-
|
|
17698
|
+
qt as LayoutRenderingPurpose,
|
|
17690
17699
|
po as MaterialStepHandle,
|
|
17691
17700
|
Se as MisconfigurationError,
|
|
17692
17701
|
cd as MockWorkflowManager,
|
|
17693
17702
|
fo as ModelStepHandle,
|
|
17694
17703
|
Bo as ModuleStepHandle,
|
|
17695
|
-
|
|
17704
|
+
zc as MoveCommand,
|
|
17696
17705
|
tr as ObjectInput,
|
|
17697
17706
|
Sl as ObjectInputType,
|
|
17698
17707
|
Xn as OptionGlobalPropertyHandle,
|
|
@@ -17708,9 +17717,9 @@ export {
|
|
|
17708
17717
|
wo as QuestionStepHandle,
|
|
17709
17718
|
Dn as QueueablePromise,
|
|
17710
17719
|
jc as ResizeCommand,
|
|
17711
|
-
|
|
17720
|
+
Ht as ResourceNotFoundError,
|
|
17712
17721
|
Wc as RotateCommand,
|
|
17713
|
-
|
|
17722
|
+
H as ScaleAxis,
|
|
17714
17723
|
Kc as SendBackwardsCommand,
|
|
17715
17724
|
yo as ShapeStepHandle,
|
|
17716
17725
|
Sr as ShareActionType,
|
|
@@ -17726,15 +17735,15 @@ export {
|
|
|
17726
17735
|
So as TextStepHandle,
|
|
17727
17736
|
ul as Transform,
|
|
17728
17737
|
Al as TransformCollection,
|
|
17729
|
-
|
|
17738
|
+
z as UnhandledBehaviorError,
|
|
17730
17739
|
Br as UnitOfMeasurement,
|
|
17731
|
-
|
|
17740
|
+
qc as UpdateImageSourceCommand,
|
|
17732
17741
|
st as Variant,
|
|
17733
17742
|
Ro as WorkflowExperienceEventType,
|
|
17734
17743
|
Oo as WorkflowExperienceImpl,
|
|
17735
|
-
|
|
17744
|
+
L as assetService,
|
|
17736
17745
|
Kr as browserColorToHex,
|
|
17737
|
-
|
|
17746
|
+
Uc as cmPerPixel,
|
|
17738
17747
|
Fo as createDesign,
|
|
17739
17748
|
Oc as currentDirection,
|
|
17740
17749
|
bc as dataUrlFromExternalUrl,
|
|
@@ -17746,7 +17755,7 @@ export {
|
|
|
17746
17755
|
hd as duplicateTransaction,
|
|
17747
17756
|
at as fetchAsString,
|
|
17748
17757
|
Fc as findAngle,
|
|
17749
|
-
|
|
17758
|
+
U as findElement,
|
|
17750
17759
|
Dc as findPmsColors,
|
|
17751
17760
|
Vt as frameDataCache,
|
|
17752
17761
|
wt as frameStepService,
|
|
@@ -17759,8 +17768,8 @@ export {
|
|
|
17759
17768
|
xc as getAxisAlignedBoundingBox,
|
|
17760
17769
|
Ml as getBoundedOffsets,
|
|
17761
17770
|
od as getBundleThemeConfiguration,
|
|
17762
|
-
|
|
17763
|
-
|
|
17771
|
+
gd as getCustomer,
|
|
17772
|
+
md as getCustomerBundles,
|
|
17764
17773
|
$c as getElementVertices,
|
|
17765
17774
|
Qe as getFrameData,
|
|
17766
17775
|
_c as getGlobalPropertyStateForBundle,
|
|
@@ -17784,14 +17793,14 @@ export {
|
|
|
17784
17793
|
nd as getWorkflow,
|
|
17785
17794
|
er as getWorkflows,
|
|
17786
17795
|
b as graphQlManager,
|
|
17787
|
-
|
|
17796
|
+
me as illustrationStepService,
|
|
17788
17797
|
kc as isCloseToValue,
|
|
17789
17798
|
Nt as loadFont,
|
|
17790
17799
|
Pc as matchHexToPms,
|
|
17791
|
-
|
|
17800
|
+
Gn as materialStepService,
|
|
17792
17801
|
cl as metafieldManager,
|
|
17793
|
-
|
|
17794
|
-
|
|
17802
|
+
Lc as mmPerPixel,
|
|
17803
|
+
zn as modelStepService,
|
|
17795
17804
|
Ca as modifySVGColors,
|
|
17796
17805
|
Wn as moduleStepService,
|
|
17797
17806
|
dd as nameBundle,
|
|
@@ -17802,18 +17811,18 @@ export {
|
|
|
17802
17811
|
N as persistenceService,
|
|
17803
17812
|
jn as pictureStepService,
|
|
17804
17813
|
Ic as pmsToRgb,
|
|
17805
|
-
|
|
17814
|
+
qn as questionStepService,
|
|
17806
17815
|
Bc as registerFetchImplementation,
|
|
17807
17816
|
Ec as registerWindowImplementation,
|
|
17808
|
-
|
|
17809
|
-
|
|
17817
|
+
Ga as rehydrateSerializedLayout,
|
|
17818
|
+
Hr as rgbToPms,
|
|
17810
17819
|
le as rotateAroundPoint,
|
|
17811
17820
|
pa as sanitizeSvgTree,
|
|
17812
17821
|
$r as setBearerAuthenticationToken,
|
|
17813
|
-
|
|
17814
|
-
|
|
17822
|
+
mn as setCanvasModule,
|
|
17823
|
+
Gt as shapeStepService,
|
|
17815
17824
|
hs as shortenUrl,
|
|
17816
|
-
|
|
17825
|
+
gt as spiffCoreConfiguration,
|
|
17817
17826
|
Xc as stepAspectValuesToDesignInputSteps,
|
|
17818
17827
|
Oa as svgColorValueToDefinition,
|
|
17819
17828
|
On as svgStringDimensions,
|